You can override the default values for properties set in c_cpp_properties.json
.
Visual Studio Code settings
In other words, you can use a C11 compliant compiler with Dev-C, it's just not as easy as point and click out of the box. I agree that a newer IDE should be used, but some people like Dev-C too much to dump it.
The following C_Cpp.default.*
settings map to each of the properties in a configuration block of c_cpp_properties.json
. Namely:
These settings have all of the benefits of VS Code settings, meaning that they can have default, 'User', 'Workspace', and 'Folder' values. So you can set a global value for C_Cpp.default.cppStandard
in your 'User' settings and have it apply to all of the folders you open. If any one folder needs a different value, you can override the value by adding a 'Folder' or 'Workspace' value.
This property of VS Code settings allows you to configure each of your workspaces independently - making the c_cpp_properties.json
file optional.
Updated c_cpp_properties.json
syntax
A special variable has been added to the accepted syntax of c_cpp_properties.json
that will instruct the extension to insert the value from the VS Code settings mentioned above. If you set the value of any setting in c_cpp_properties.json
to '${default}' it will instruct the extension to read the VS Code default setting for that property and insert it. For example:
Dev C Default Settings In Firefox
Dev C++ Default Settings Firefox
Take note that for the properties that accept string[], the syntax proposed above allows you to augment the VS Code setting with additional values, thus allowing you to have common paths listed in the VS Code settings and configuration-specific settings in c_cpp_properties.json
.
If a property is missing from c_cpp_properties.json
, the extension will use the value in the VS Code setting. If a developer assigns values to all of the settings that apply for a given folder, then c_cpp_properties.json
could be removed from the .vscode folder as it will no longer be needed.
System includes
A new setting will be added that allows you specify the system include path separate from the folder's include path. If this setting has a value, then the system include path the extension gets from the compiler specified in the compilerPath
setting will not be added to the path array that the extension uses for IntelliSense. We may want to provide a VS Code command to populate this value from the compiler's default for users who are interested in using it in case they want to make some modifications to the defaults.
System include path/defines resolution strategies
The extension determines the system includePath and defines to send to the IntelliSense engine in the following manner:
Dev C++ Download
Default Settings For Yahoo
If
compileCommands
has a valid value and the file open in the editor is in the database, use the compile command in the database entry to determine the include path and defines.- The system include path and defines are determined using the following logic (in order):
- If
systemIncludePath
has a value, use it (continue to the next step to search for system defines). - If
compilerPath
is valid, query it. - Interpret the first argument in the command as the compiler and attempt to query it.
- If
compilerPath
is ', use an empty array for system include path and defines. - If
compilerPath
is undefined, look for a compiler on the system and query it.
- If
- The system include path and defines are determined using the following logic (in order):
If
compileCommands
is invalid or the current file is not listed in the database, use theincludePath
anddefines
properties in the configuration for IntelliSense.- The system include path and defines are determined using the following logic (in order):
- If
systemIncludePath
has a value, use it (continue to the next step to search for system defines). - If
compilerPath
is valid, query it. - If
compilerPath
is ', use an empty array for system include path and defines (they are assumed to be in theincludePath
anddefines
for the current config already). - If
compilerPath
is undefined, look for a compiler on the system and query it.
- If
- The system include path and defines are determined using the following logic (in order):
Change Yahoo Default Settings
System includes should not be added to the includePath
or browse.path
variables. If the extension detects any system include paths in the includePath
property it will silently remove them so that it can ensure system include paths are added last and in the correct order (this is especially important for GCC/Clang).