vscode-clangd icon indicating copy to clipboard operation
vscode-clangd copied to clipboard

Go to symbol only shows current file

Open infn-ke opened this issue 3 years ago • 3 comments

The function go to symbol only shows symbols in the current file. Is there no way to search through all symbols in the project?

Using clangd 11.0.1-2.

infn-ke avatar Sep 23 '22 16:09 infn-ke

VSCode has a "Go to symbol in editor" command and a "Go to symbol in workspace" command. The latter should offer symbols from the whole project, assuming the project is indexed.

HighCommander4 avatar Sep 23 '22 20:09 HighCommander4

Thanks! But realized this issue was caused by clangd not picking up the right compilation database. Seems it defaults to reading it from the source directory. Is that configurable?

infn-ke avatar Sep 24 '22 04:09 infn-ke

Yes, using the --compile-commands-dir command line argument to clangd (discussed e.g. here).

HighCommander4 avatar Sep 24 '22 19:09 HighCommander4