company-lsp
company-lsp copied to clipboard
jump to candidate definition
This is something about the interaction between company-lsp and lsp-mode. lsp-mode does jump-to-defnition very well through xref-find-definitions, but I can't quite make it work with company-lsp. The best I can get is to jump to the top of the file that contains the candidate. Any advice?
I'm not sure if I fully understand your question. Are you trying to jump to the definition of a candidate without adding it to the file content? If that's the case I don't think it's possible. The LSP protocol only provides API for getting the location of the definition at a given point in a file (see the request for textDocument/definition
in the spec).
You can work around it by completing the candidate and use lsp-mode to jump to the definition.
Okay, thanks. I will try that, I think I can get that to work.
I spent some time trying to get this to work and was not successful. I think we can get it to work, and it requires some changes in this plugin. I'd like to request this as a feature?