textDocument/definition not working
See original GitHub issueHi nice work,
I have some problems using the goto definition feature.
My setup include nvim
+ LanguageClient
(or even builtin LSP) and jedi-language-server
.
The problem in my case is that when calling LanguageClient#textDocument_definition()
the cursor do not move, nvim
complains as:
[LC] data did not match any variant of untagged enum GotoDefinitionResponse
and the client log is as follows:
17:04:44 DEBUG reader-Some("python") src/rpcclient.rs:207 <= Some("python") {"id": 1, "jsonrpc": "2.0", "result": [{"uri": null, "range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 7}}}]}
17:04:44 ERROR unnamed src/rpchandler.rs:27 Error handling message: data did not match any variant of untagged enum GotoDefinitionResponse
Message: {"jsonrpc":"2.0","method":"textDocument/definition","params":{"bufnr":1,"character":0,"filename":"/home/mauro/t.py","gotoCmd":null,"handle":true,"languageId":"python","line":4,"text":["def foo():"," print('FOO')","","","foo()",""]},"id":1}
Error: data did not match any variant of untagged enum GotoDefinitionResponse
In particular note that it seams that the server do not send back the URI to the file, instead there is a null
entry, and that with the method textDocument/publishDiagnostics
, the server send back the right URI to the file position.
I found the same problem with anakin https://github.com/muffinmad/anakin-language-server/issues/17 but not with other servers such as python-language-server
.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
textDocument/definition not working #2654 - GitHub
build tool: stack CI Continuous integration type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Read more >nvim-lspconfig error 'method textDocument/codeAction is not ...
I config vimls in nvim-lspconfig, but get an error with my cursor move. Error detected while processing CursorHold Autocommands for "*": method…
Read more >VS Code - Request textDocument/definition failed
I want to code and debug my own code, not manage my ecosystem of tools and debug their problems. At least they should...
Read more >Lsp - Neovim docs
Q: Why isn't completion working? ... To override the handler for the "textDocument/definition" method: vim.lsp.handlers["textDocument/definition"] = ...
Read more >Language Server Protocol Specification - 3.17
This mechanism can be used to report any kind of progress including work done ... the server most likely should not reorder textDocument/definition...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
On second thought, since this tool targets the latest version of Jedi, I’ll just wait for the next version of Jedi and use the path objects directly (pinning the latest Jedi version in that release).
from_fs_path
is unnecessary when working withpathlib.Path
objects; it provides its own as_uri method.Anyway, thanks for raising this and I look forward to Jedi’s next version’s stabilization!
resolved in the latest published release (0.22.0)!