Skip to content

Fix missing URI conversion in code action execution.#1074

Merged
pfitzseb merged 2 commits intomasterfrom
fe/fix-executecommand
May 5, 2022
Merged

Fix missing URI conversion in code action execution.#1074
pfitzseb merged 2 commits intomasterfrom
fe/fix-executecommand

Conversation

@fredrikekre
Copy link
Copy Markdown
Member

I am confused how CI passed without this, this path should be tested by

LanguageServer.workspace_executeCommand_request(LanguageServer.ExecuteCommandParams(missing, c.command, c.arguments), server, server.jr_endpoint)
etc.

@fredrikekre
Copy link
Copy Markdown
Member Author

Hmm, okay, maybe it is specific to neovim somehow then?

@fredrikekre
Copy link
Copy Markdown
Member Author

No probably doesn't work anywhere, I think the problem is that in the tests the client directly call the server without JSON serialization/deserialization.

@davidanthoff
Copy link
Copy Markdown
Member

There is probably no harm in adding

URI(uri::URI) = uri

to fix the current test failure, right?

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.

@pfitzseb pfitzseb merged commit 0700041 into master May 5, 2022
@davidanthoff davidanthoff deleted the fe/fix-executecommand branch May 5, 2022 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants