VS Code 1.18.1
C/C++ extension 0.14.2
Is there a way to add my own include paths to the default json file that generated, so that I don't have to copy-paste them manually into the file every time? My C++ library locations don't change, but the default json file that's generated does not include their locations, and I'd like to not have to manually edit the json file every time I create a new program.
AFAIK, the template for c_cpp_properties.json is located at C:\Users\
Maybe you can manually edit that file for workaround. I'm not sure whether it is overwritten when extension is updated or not.
Unfortunately, this will be overwritten during updates. When we migrate settings from c_cpp_properties.json to the VS Code settings.json file, you should be able to accomplish this reliably.
Thanks, so basically it's a planned addition? I might modify the js file anyway. Redoing it after an update is still easier than the json file every time I make a new program.
Hi @bobbrow , is there any ETA for this migration ? I'm really interested in this, that would allow to set compileCommands using the the standard vscode API, and that would be really nice for a few extensions (CMake Tools for one, and the one I'm currently working on :p)
@dcourtois Possibly mid-January or February (if so, we'll add it to the appropriate milestone...right now we just have a December milestone).
I have just posted a plan to issue #1338 that may address this issue. I encourage those on this thread to take a look and provide feedback.
A preview of this is available in the insiders build if you would like to try it out and provide feedback.
The change from #1338 is in the released VSIX now. You can add your default include path to the C_Cpp.default.includePath setting and the extension will pick that up when you open new folders. More information can be found here.
Thanks for the update and the addition.
Is there a way to append includePath in workspace c_cpp_properties.json to the default one defined in the user's global settings.json but not to overwrite it?
Use the ${default} variable to insert the values from C_Cpp.default.includePath into your c_cpp_properties.json:
"includePath": [
"${default}",
"/some/other/path",
...
]
(https://code.visualstudio.com/docs/cpp/customize-default-settings-cpp#_updated-ccpppropertiesjson-syntax)
Use the ${default} variable to insert the values from C_Cpp.default.includePath into your c_cpp_properties.json:
"includePath": [
"${default}",
"/some/other/path",
...
]
(https://code.visualstudio.com/docs/cpp/customize-default-settings-cpp#_updated-ccpppropertiesjson-syntax)
Cool. Thanks very much Bob.
Most helpful comment
Unfortunately, this will be overwritten during updates. When we migrate settings from c_cpp_properties.json to the VS Code settings.json file, you should be able to accomplish this reliably.