microsoft / microsoft/vscode-cpptools
Update System include path/defines resolution strategies
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
@sean-mcmanus - thanks for the clarification! However, the [Customizing default settings](https://code.visualstudio.com/docs/cpp/customize-default-settings-cpp) article doesn't seem to indicate this order of evaluation.
In the Updated c_cpp_properties.json syntax section, it states the following:
If a property is missing from
c_cpp_properties.json, the extension will use the value in the VS Code setting.
And then in the System include path/defines resolution strategies section for when the open file is found in the compileCommands database, the following order of operations is listed:
- If
systemIncludePathhas a value, use it (continue to the next step to search for system defines).- If
compilerPathis valid, query it.- Interpret the first argument in the command as the compiler and attempt to query it.
- If
compilerPathis "", use an empty array for system include path and defines.- If
compilerPathis undefined, look for a compiler on the system and query it.
Based on these details, it's not clear from the documentation that the VS Code setting is evaluated differently from the value provided in the c_cpp_properties.json file. If the compilerPath from the VS Code setting does have lower presence than the command from the compile commands database, then it would be helpful if the System include path/defines resolution strategies section could be updated to reflect this.
Originally posted by @tcm0116 in https://github.com/microsoft/vscode-cpptools/issues/10842#issuecomment-1517100747
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the “Updated c_cpp_properties.json syntax” and “System include path/defines resolution strategies” sections in the linked Customizing default settings article. Compare their descriptions of VS Code settings, c_cpp_properties.json, and compileCommands, then confirm the intended precedence with the issue context. Done means the documentation clearly describes the actual evaluation order.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- vscode
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100