Skip to content

Update System include path/defines resolution strategies #10847

Open
@sean-mcmanus

Description

@sean-mcmanus
          @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 #10842 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature: Compile CommandsFeature: ConfigurationAn issue related to configuring the extension or IntelliSenseLanguage ServicedocsIssue related to documentation about the extensionhelp wantedCan be fixed in the public (open source) repo.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions