Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go to definition does not work from header to implementation in c++ #757

Open
lijh8 opened this issue Dec 14, 2024 · 0 comments
Open

go to definition does not work from header to implementation in c++ #757

lijh8 opened this issue Dec 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@lijh8
Copy link

lijh8 commented Dec 14, 2024

  1. firstly, do not navigate from definition foo in foo.cpp to declaration foo in foo.h, this kinda hides the issue;
  2. close all opened tabs and reopen the editor;
  3. from function call site foo() in main.cpp, can only go to declaration in foo.h;
  4. from function declaration foo in header foo.h, can not go to definition in foo.cpp;

Tested with: VSCode 1.96.0.

By the way, both nvim-lsp and vim-lsp have the same issue, is this related to LSP server clangd?

// main.cpp
foo();
// foo.cpp
void foo(){}
// foo.h
#ifndef foo_h
#define foo_h

void foo();

#endif

Logs
Please attach the clangd log from the "Output" window if you can.
If possible, run with --log=verbose - note that the logs will include the contents of open files!

System information
Clangd version (from the log, or clangd --version): Apple clangd version 14.0.0 (clang-1400.0.29.202) ;
clangd extension version: llvm-vs-code-extensions.vscode-clangd 0.1.33 ;
Operating system: macOS 12.7.6 (21H1320) ;
VSCode 1.96.0 ;

@lijh8 lijh8 added the bug Something isn't working label Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant