Each time I commit the changes in my VS Code project, VS Code automatically adds many standard C++ libraries to the files.associations list inside of workspace.code-workspace.
Example:

I think I can't simply add the whole file to .gitignore, because I want to allow anyone from the company to just clone the repository and open the workspace from this file. Is there a way to prevent the file.associations to change every time without losing any functionality?
According to this issue: https://github.com/microsoft/vscode-cpptools/issues/722 :
You can add to your workspace.code-workspace file the setting: "C_Cpp.autoAddFileAssociations": false inside "settings".
You can also add this as a user setting only if you'll search for autoAddFileAssociations in the settings GUI.
It does mean that VSCode won't treat those files as C++ but as plain text. A proper fix still seems to be in progress in https://github.com/microsoft/vscode-cpptools/issues/4077 .
I've added something like this and it helped me:
"files.associations": {
"*.h": "c",
"*.c": "c"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With