microsoft / microsoft/vscode-cpptools

Update System include path/defines resolution strategies

Open
#10,847 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

docs Feature: Compile Commands Feature: Configuration help wanted Language Service
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:

  1. If systemIncludePath has a value, use it (continue to the next step to search for system defines).
  2. If compilerPath is valid, query it.
  3. Interpret the first argument in the command as the compiler and attempt to query it.
  4. If compilerPath is "", use an empty array for system include path and defines.
  5. If compilerPath is 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.