-
Notifications
You must be signed in to change notification settings - Fork 11
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
Implementation of Go to Definition in the clangd LSP editor #175
Comments
Hi @ghentschke Absolutely, you're correct. The functionality works well when the implementation classes reside within the project. However, I'm referring to the navigation of system header implementations and external file includes source code, both of which are already included in the compile_commands.json file
For instance, in the given source code, the printf() function is defined in the stdio.h header, which is not included in the project's source code and same goes for esp_cpu_reset() which is an external file include. If we aim to view the source code for printf() and esp_cpu_reset() which is navigating only to the header files but the not the source definition files. |
Hi @ghentschke Any pointers to troubleshoot this issue? clangd logs, CDT classes, etc? Thanks for the help |
I am not sure if this already worked in the old editor? I assume that the function definition has been done in a system library (.a or .so). So there is no implementation file to jump into? The linker will fetch the code from there. I am not sure how to handle the case when the implementation resides in a project in the same workspace. I'll check that on monday. |
The Go-to-Definition (textDocument/implementation) seems to work only if the file which contains the implementation is in the same project or it is already opened in the new LSP based C/C++ editor. It seems to be rather a |
Thanks you @ghentschke That helps. Agree with you. Feel free to close this issue. P.S: However, I wonder how CLion and VSCode does this with clangd. I will check further on this. |
Currently, the "Open Declaration" feature(By pressing F3 key) is functional in navigating to header files, but it lacks the ability to navigate to the corresponding source definitions (Open Implementations) of those header files.
Is there a way which we could achieve this for LSP/clangd editors?
Context:
For Make projects - we are able to achieve this using Include Paths configuration
For CMake projects in the core build system - Probably creating a virtual/symbolic link files with in the project for the library sources worked based on the compile_commands.json
Now for Clangd C/C++ based editor - how could we achieve this with the information what we have from compile_commands.json file?
The text was updated successfully, but these errors were encountered: