c_cpp_properties.json reference

See also: Customizing Default Settings

Example

{
    "env" : {
        "myDefaultIncludePath": [
            "${workspaceFolder}",
            "${workspaceFolder}/include"
        ],
        "myCompilerPath": "/usr/local/bin/gcc-7"
    },
    "configurations": [
        {
            "name": "Mac",
            "intelliSenseMode": "clang-x64",
            "includePath": [ "${myDefaultIncludePath}", "/another/path" ],
            "macFrameworkPath": [ "/System/Library/Frameworks" ],
            "defines": [ "FOO", "BAR=100" ],
            "forcedInclude": [ "${workspaceFolder}/include/config.h" ],
            "compilerPath": "/usr/bin/clang",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "compileCommands": "/path/to/compile_commands.json",
            "browse": {
                "path": [ "${workspaceFolder}" ],
                "limitSymbolsToIncludedHeaders": true,
                "databaseFilename": ""
            }
        }
    ],
    "version": 4
}

Top-level properties

Configuration properties

Putting "compilerPath": "" (empty string) will skip querying a compiler. This is useful if a specified compiler doesn't support the arguments that are used for the query, as the extension will default back to any compiler it can find (like Visual C). Leaving out the compilerPath property does not skip the query.

Platform defaults: - Windows: msvc-x64 - Linux: gcc-x64 - macOS: clang-x64

For more information about the file format, see the Clang documentation. Some build systems, such as CMake, simplify generating this file.

Browse properties