Closed rihardsk closed 2 months ago
could this be removed and replaced by lsp-ivy-workspace-symbol
I haven't used ivy, but it seems that lsp-ivy-workspace-symbol
is the equivalent of helm-lsp-workspace-symbol
which lets you search through workspace symbols. spacemacs//lsp-avy-document-symbol
does a different thing – it lets you jump to a position in the current document.
I have made a first commit to fix our function, it will not longer break however we still need to obtain all ranges, for now we only get the first one. If someone can help with this it would be very much appreciated. If not I will have a look later.
I don't think that we have the resources to maintain specific functions like these. Instead it must be moved into a specific emacs package and integrated in one of the existing layers. Therefore I have removed the mostly broken spacemacs specific implementation today.
Description :octocat:
There's a bug in
spacemacs//lsp-avy-document-symbol
which makes it fail for some language servers. As a result, thelsp-avy-goto-word
andlsp-avy-goto-symbol
functions don't work for those language servers.Here's the code of the function
The issue is with this expression (line 20):
As per the spec https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_documentSymbol, a response to the
textDocument/documentSymbol
request can contain either aSymbolInformation[]
or aDocumentSymbol[]
. Of these two onlySymbolInformation
contains alocation
field so the above code fails if aDocumentSymbol[]
is returned instead. Moreover, the docs state that using the later response type is preferred, makingspacemacs//lsp-avy-document-symbol
fail for the most common case.I've tested that
rust-analyzer
andjdtls
(the Eclipse JDT Language Server) both returnDocumentSymbol[]
making them not supported by this function. When I try to invoke it, I get an error:Reproduction guide :beetle:
lsp-avy-goto-word
(,gk
)Observed behaviour: :eyes: :broken_heart: This message appears
Expected behaviour: :heart: :smile: I get to navigate to some symbols or something
System Info :computer:
Backtrace :paw_prints: