We'd have to switch json parsers to one that supported comments.
I'd love to see this use the exact same parser as the rest of VS Code, as opposed to trying to 'fill in the gaps' in one-off cases.
Going a step further, I really think the options in this file should be rolled into the normal vscode settings so we can benefit from global defaults, workspace specific settings, and we don't end up with an extra json file that is effectively 'other settings oh and also they work a little differently'.
@akbyrd, if you only use one configuration, you can use the C_Cpp.default settings that we expose instead of c_cpp_properties.json.
We have "C_Cpp.default." settings in the normal settings.json that can set the c_cpp_properties.json settings at a user/workspace scope: see https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/LanguageServer/Customizing%20Default%20Settings.md. We did consider removing c_cpp_properties.json at one point, but we had reasons to keep it (maybe it was too much work).
Haha -- my browser didn't refresh, so I didn't see Bob's post :)
It's great that the default settings exists, but I'd like to point out that that solidly falls into the 'one-off solution' category. It focuses on one aspect of the user issues that exist from having a separate settings file. I don't know what common patterns exist for other language support extensions, but with my narrow focus the separate settings file with necessarily separate behavior is a nuisance that will always feel like an awkward bolt-on. We already have a facility for per-language settings and cpp is a separate snowflake with different solutions to the same problems.
I'm sorry, what separate settings file are you referring to? c_cpp_properties.json? The C_Cpp.default.* are not that. They are real VS Code-style settings and when you use them, c_cpp_properties.json is no longer needed for configuration.
If you have suggestions for a better configuration system, we are always open to suggestions.
I didn't realize the json file was no longer necessary when using C_Cpp.default.*. That's actually exactly what I was hoping for. The 'default' name threw me off, I guess.
Honestly, with that I don't see a strong reason to keep the json at all. I'd just as soon see C_Cpp.default.* become the standard way of configuring the extension. Though maybe something like cpp.config.* would be more intuitive.
Compatibility is the main reason we keep it. I'm confident we would get a lot of complaints if we removed it.
Another reason is that the json file allows you to create multiple configs if you need to switch back and forth between, say, "release" and "debug" or something like that.
Closed this for the wrong reason. The original issue is not addressed yet.
Where is C_Cpp.default located?
@clankill3r It's part of the normal VS Code settings (i.e. settings.json) or Ctrl+,
Ability to add comments would be great!
Hi everyone, is there any news about comments in c_cpp_properties.json?
@fabiuz7
There are no updates on the priority of this feature request. It is open for others to help implement it.
Thank you for your answer! Actually I haven't yet the skills needed to help on this topic...
This got fixed with https://github.com/microsoft/vscode-cpptools/issues/5885 and improved upon with https://github.com/microsoft/vscode-cpptools/pull/5954 .