ycmd icon indicating copy to clipboard operation
ycmd copied to clipboard

Language service completer makes no distinction between GoToDeclaration and GoToDefinition

Open ioeric opened this issue 7 years ago • 5 comments

https://github.com/Valloric/ycmd/blob/master/ycmd/completers/language_server/language_server_completer.py#L52

LSP supports both textDocument/declaration and textDocument/definition requests: https://github.com/Microsoft/language-server-protocol/blob/gh-pages/specification.md#textDocument_declaration

ioeric avatar Feb 15 '19 13:02 ioeric

The textDocument/declaration is a very recent addition to the protocol. When we wrote the completer there was neither textDocument/declaration nor do jdt.ls and clangd 7 support them.

That said, yes, textDocument/declaration is useful and will most likely be implemented when clangd 8 comes out.

bstaletic avatar Feb 15 '19 14:02 bstaletic

Looks like textDocument/declaration has been implemented in clangd: https://github.com/llvm-mirror/clang-tools-extra/commit/820bac171c912a763b2df27786e8e6215c3e74e4#diff-0ac995152f29b025ebe32598acf06047

ioeric avatar Feb 15 '19 14:02 ioeric

Yes, two weeks ago. That commit is not in a stable release yet. That's why I said that we are waiting for clangd 8 to come out.

bstaletic avatar Feb 15 '19 15:02 bstaletic

Sorry, not trying to nag on this.

The language server release doesn't seem to be a blocker here. The completer should be able to detect whether to use textDocument/declaration based on the server capacities right?

ioeric avatar Feb 15 '19 15:02 ioeric

See https://github.com/Microsoft/language-server-protocol/issues/673.

micbou avatar Feb 15 '19 15:02 micbou