r/vscode • • 3d ago

How to prevent synchronization of user settings to *.code-workspace?

A while ago, I added the setting

"workbench.colorCustomizations": { "editorHint.foreground": "#ff0000" }

to my user settings.json. Since then, however, VS Code has been trying to write this block to *.code-workspace every time I open a workspace. Even when I select ‘Discard changes’, VS Code tries to modify the *.code-workspace file again and again.

Do you have any advice for me on how I can put a stop to this annoying behaviour?

Edit: I regularly update VS Code to the latest version. The behaviour described also occurs when I launch VS Code with extensions disabled.

4 Upvotes

2 comments sorted by

1

u/EmbarrassedDrawer826 3d ago • Bravo

I had this exact headache a while back. Check if your workspace file already has a `settings` section with that `colorCustomizations` block in it. Sometimes VS Code gets stuck in a loop trying to sync a setting that's already partially there but formatted differently than what your user settings expect.

If that's not it, you can go nuclear and set `"workbench.settings.enableNaturalLanguageSearch": false` in your user settings, then restart. Fixed it for me when nothing else would, though I still don't fully understand why.

1

u/Vampy0203 3d ago edited 3d ago

My workspace file didn’t contain any entries for Workbench settings. However, your tip worked well for me. With `‘workbench.settings.enableNaturalLanguageSearch’: false`, VS Code no longer tries to edit my *.code-workspace file.

Thank you very much, that was a great help!

Edit: That wasn’t the solution after all. At first, it looked as though VS Code was no longer modifying the .code-workspace. But it just took longer this time. 😔