Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/URIs2/URIs2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ function URI(value::AbstractString)
)
end

URI(uri::URI) = uri

function URI(;
scheme::Union{AbstractString,Nothing}=nothing,
authority::Union{AbstractString,Nothing}=nothing,
Expand Down
8 changes: 4 additions & 4 deletions src/requests/actions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ function textDocument_codeAction_request(params::CodeActionParams, server::Langu
end

function workspace_executeCommand_request(params::ExecuteCommandParams, server::LanguageServerInstance, conn)
uri = params.arguments[1]
offset = params.arguments[2]
doc = getdocument(server, uri)
x = get_expr(getcst(doc), offset)
if haskey(LSActions, params.command)
uri = URI(params.arguments[1])
offset = params.arguments[2]
doc = getdocument(server, uri)
x = get_expr(getcst(doc), offset)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've moved the uri/offset extraction into the if block because that "calling convention" is only valid for actions we define ourselves, and who knows what a client might send.

LSActions[params.command].handler(x, server, conn)
end
end
Expand Down