I was in trouble because I didn't have a proper explanation in Japanese, so I translated c_cpp_properties.json
Reference Guide. To do.
{
"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
}
env
It is an array of user-defined variables, and you can replace standard environment variables with the syntax $ {<var>}
or $ {env: <var>}
. You can put a string and an array of strings.
configurations
An array of objects that specify project and configuration information for the IntelliSense engine. By default, this extension will generate settings based on your OS. You can add additional settings.
version
Do not edit this field. This keeps track of the current version of the c_cpp_properties.json
file so that the extension knows which properties and settings exist and how to upgrade to the latest version.
name
A descriptive name for this setting. "Linux", "Mac", "Win32" are special names that tell the extension to load the default values for each OS, unless you have additional settings. The VS Code status bar shows which settings are active. You can change the active setting by clicking the label on the status bar.
intelliSenseMode
Specifies the operating mode of the IntelliSense engine when " C_Cpp.intelliSenseEngine "
is set to "Default". " msvc-x64 "
corresponds to Visual Studio with 64-bit pointer size. " clang-x64 "
corresponds to 64-bit pointer-sized Clang. " gcc-x64 "
corresponds to GCC with 64-bit pointer size. Windows uses " msvc-x64 "
by default, macOS uses " clang-x64 "
, and Linux uses " gcc-x64 "
.
includePath
Specifies a list of paths for IntelliSense to search for header files included from the source when " C_Cpp.intelliSenseEngine "
is set to "Default". This is basically the same as the list of paths you pass to the compiler on the -I
switch. When the path ends with / **
, the IntelliSense engine recursively searches that directory. If you have Windows with Visual Studio installed, or if the compilerPath
setting specifies a compiler, you do not need to include the system include path in this list.
macFrameworkPath
If " C_Cpp.intelliSenseEngine "
is set to "Default", specify the list of paths IntelliSense will use to look up the framework headers. This is basically the same as the list of paths you pass to the compiler with the -F
switch. IntelliSense does not recursively search these paths.
defines
If " C_Cpp.intelliSenseEngine "
is set to "Default", it specifies a list of preprocessor symbols that IntelliSense will use at compile time. This is basically the same as the list of symbols you pass to the compiler with the -D
switch. If you have Windows with Visual Studio installed, or if the compilerPath
setting specifies a compiler, this list does not need to include the symbols defined by default.
forcedInclude
(optional)Specifies a list of files to include before the source files are processed. The files are included in the order listed.
compilerPath
(optional)Specifies the absolute path of the compiler used to build your project. The extension queries the compiler to determine the system include path and default symbol definition to use with IntelliSense.
You can add arguments to change the inclusions and definitions of -nostdinc ++
, -m32
, -fno-ms-extensions
, etc. However, paths with spaces must be enclosed in double quotes "
.
If you want to disable the automatic query of system include paths and definitions, set this value to the empty string " "
. This is generally not recommended, but in some cases it may not be desirable to query automatically.
cStandard
Specifies the C standard revision used by IntelliSense in your project.
cppStandard
Specifies the C ++ standard revision used by IntelliSense in your project.
compileCommands
(optional)If " C_Cpp.intelliSenseEngine "
is set to "Default", the includes and definitions found in this file will be used instead of the values set in ʻincludePath and
definitions. If this compile command database does not contain a translation unit entry for the file you are opening in the editor, a warning message will be displayed and the extension will use the ʻincludePath
and defines
settings instead. ..
See Clang documentation for more information on this file format. Some build systems (eg CMake) will generate this file (https://cmake.org/cmake/help/v3.5/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html).
browse
Specifies a set of properties to use when " C_Cpp.intelliSenseEngine "
is set to " Tag Parser "
(also known as "fuzzy" IntelliSense or "browse" engine). These properties are used when the "Go To Definition / Declaration" feature or the "Default" IntelliSense engine cannot resolve the #include in the source file.
path
Specifies a list of paths that Tag Parser will use to look up headers included in the source file. If omitted, ʻincludePath is used as
path. Unless the paths end in
/ *or
\ *, Tag Parser will automatically search for subfolders in those paths. For example, if you specify
/ usr / include, Tag Parser will search the ʻinclude
folder and its subfolders, while if you specify/ usr / include / *
, Tag Parser will search / usr / include
Does not search any of the subfolders of.
limitSymbolsToIncludedHeaders
If true, Tag Parser will only parse files that are directly or indirectly included from the source files in $ {workspaceFolder}
. If false, Tag Parser parses all files found in the path specified in the path
list.
databaseFilename
When set, the extension specifies a location to store the Tag Parser symbol database outside of the workspace's default storage location. When a relative path is specified, it will be relative to the default storage location of the workspace, not the workspace folder. You can use the $ {workspaceFolder}
variable to specify a relative path from the workspace folder (for example, $ {workspaceFolder} /. vscode/browse.vc.db
).
Recommended Posts