Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSP server responds to Goto Definition request with LocationLink[] even if the client doesn't support it #592

Closed
groszdaniel opened this issue Oct 4, 2020 · 0 comments
Labels
bug Something isn't working Fixed Fixed in master branch. Pending production release.

Comments

@groszdaniel
Copy link

groszdaniel commented Oct 4, 2020

Describe the bug
svelte-language-server responds to a Goto Definition request with LocationLink[] even if the client does not report the textDocument.definition.linkSupport capability.

I quote the comment of a developer of a client (Kate):

As for it not working (and the Url turning empty), that is actually a server-side problem. As specified (https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_definition) the reply to a 'textDocument/definition') can be one of Location, or Location[] or LocationLink[]. However, the latter depends on the client specifying it is so capable (which allows extending the protocol without surprising existing client). As it stands, the client does not support that reply nor does it claim to in reported capabilities, so the server should not resort to sending that type of reply.

It's not difficult to extend parsing to handle that reply as well (and will likely do so in the coming days), but such is the background of the situation.

To Reproduce
The language server is run with
node /usr/local/lib/node_modules/svelte-language-server/bin/server.js --stdio
I attach the server's standard streams (stdin, stdout, stderr) and the source files involved (import.html, export.js).

I used "Go to Definition" on the word 'constant' in import.html, while using the Svelte language server. The issue also happens with Svelte files.

System (please complete the following information):

  • OS: Linux, openSUSE Tumbleweed
  • IDE: Kate 20.8.1
  • Plugin/Package: svelte-language-server, LSP Client plugin
@groszdaniel groszdaniel added the bug Something isn't working label Oct 4, 2020
dummdidumm pushed a commit to dummdidumm/language-tools that referenced this issue Oct 13, 2020
If LocationLink is not supported
sveltejs#592
dummdidumm added a commit that referenced this issue Oct 13, 2020
@dummdidumm dummdidumm added the Fixed Fixed in master branch. Pending production release. label Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Fixed Fixed in master branch. Pending production release.
Projects
None yet
Development

No branches or pull requests

2 participants