Open tisble opened 1 month ago
It looks like the client sides a textDocument/references
request if the response to textDocument/definition
was the same location as the input.
This is a behaviour of the vscode-languageclient component that lives upstream at https://github.com/Microsoft/vscode-languageserver-node/, could you file an issue there please?
Hi, I have submitted the issue and the link is: https://github.com/microsoft/vscode-languageserver-node/issues/1486
This is a behaviour of the vscode-languageclient component
It turns out I was mistaken about this: this is actually a behaviour of vscode itself.
Moreover, it is configurable as follows:
editor.gotoLocation.alternativeDefinitionCommand
. Note the setting's description: "Alternative command id that is being executed when the result of 'Go to Definition' is the current location.", and default value, editor.action.goToReferences
.Now, go-to-def on s
on line 6 will leave the cursor at the same location.
Hi, I found a bug about the go to definition and go to declaration. Please see the code example below:
I performed Go-to-def/decl on the variable
s
in declaration statement at line 6, but it jumps to the variables
at line 7. Actually, I think this is Go to Use or Find References, rather than Go-to-def or decl (should be unchanged at line 6). So, this is a bug.System information
Clangd version: Apple clangd version 15.0.0 (clang-1500.3.9.4) Features: mac+xpc Platform: x86_64-apple-darwin23.5.0; target=arm64-apple-darwin23.5.0
clangd extension version: Version 0.1.28: March 20, 2024
Operating system: MacOS