-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
The source file parent path in compile_commands.json isn't added to the browse.path if it's a relative path #11631
Comments
I'm not reproing the issue. Can you run C/C++: Reset IntelliSense Database to make sure database isn't corrupted? Then can you run C/C++: Log Diagnostics and provide the output or review it to see if there is anything that seems incorrect, i.e. are the folders with the source and headers in the browse path? Also when you open module1.c/h does the Outline view populate with symbols? Also, are you able to project a sample compile_commands.json that repros the issue? If Find All References and Go to Definition don't work, that usually means there's a problem with tag parsing the files or the symbol database. |
1.Can you run C/C++: Reset IntelliSense Database to make sure database isn't corrupted? 2.Then can you run C/C++: Log Diagnostics and provide the output or review it to see if there is anything that seems incorrect 3., i.e. are the folders with the source and headers in the browse path?
4.Also when you open module1.c/h does the Outline view populate with symbols? 5.Also, are you able to project a sample compile_commands.json that repros the issue? If Find All References and Go to Definition don't work, that usually means there's a problem with tag parsing the files or the symbol database. -- Yes please see below comments |
please see
So it may be a bug of cpptools, if my project configuration isn't incorrect. |
@sean-mcmanus reproducing steps:
|
@Shaka0723 Thanks, I repro the issue with that project and compile_commands.json -- it looks like the folder with the source path is not getting added to the browse.path for some reason. |
@Shaka0723 This is a "duplicate" of #11036, but that is closed so we can keep this issue open and/or fix it. |
@Shaka0723 I think we can fix it by just adding the source file directories -- my prior concern was about using that directory instead of the "directory". Also, I previously was thinking that the "directory" would always contain the source file directory, but in your example that uses a lot of ".." it does not. |
Thanks and you are right, I replace ../../.... with absolute path then cpptools works fine now. |
Fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/v1.19.0 (pre-release) |
Environment
Bug Summary and Steps to Reproduce
Bug Summary:
1#. can't switch between src and header
2#. goto definition failed from header/function declaration
3#. find all references failed from header/function declaration
Steps to reproduce:
repro condition:
using compile_commands.json to config intellisense
a project with deep directory depth, like >5
Expected behavior:
"goto definition"/"find all references"/"switch source/header" ... should work fine via compile_commands.json
Configuration and Logs
Other Extensions
No response
Additional context
more infos
The text was updated successfully, but these errors were encountered: