Skip to content

Commit 0700041

Browse files
authored
Merge pull request #1074 from julia-vscode/fe/fix-executecommand
Fix missing URI conversion in code action execution.
2 parents 0955a4d + c7cf191 commit 0700041

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/URIs2/URIs2.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ function URI(value::AbstractString)
3030
)
3131
end
3232

33+
URI(uri::URI) = uri
34+
3335
function URI(;
3436
scheme::Union{AbstractString,Nothing}=nothing,
3537
authority::Union{AbstractString,Nothing}=nothing,

src/requests/actions.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ function textDocument_codeAction_request(params::CodeActionParams, server::Langu
7575
end
7676

7777
function workspace_executeCommand_request(params::ExecuteCommandParams, server::LanguageServerInstance, conn)
78-
uri = params.arguments[1]
79-
offset = params.arguments[2]
80-
doc = getdocument(server, uri)
81-
x = get_expr(getcst(doc), offset)
8278
if haskey(LSActions, params.command)
79+
uri = URI(params.arguments[1])
80+
offset = params.arguments[2]
81+
doc = getdocument(server, uri)
82+
x = get_expr(getcst(doc), offset)
8383
LSActions[params.command].handler(x, server, conn)
8484
end
8585
end

0 commit comments

Comments
 (0)