psi-header icon indicating copy to clipboard operation
psi-header copied to clipboard

Plugin modifies VSCode's settings.json

Open robross0606 opened this issue 6 months ago • 1 comments

The plugin is modifying settings.json files even if that file isn't part of the currently opened projects. This includes the file(s) saved in my user home directory which should be 100% off-limits to the plugin. I was even able to get it to corrupt the file which then caused VSCode to immediately crash. Since I could not open VSCode to fix it, I had to modify the settings file outside VSCode to recover. The plugin should not be modifying VSCode's settings files to include headers.

robross0606 avatar Jul 04 '25 12:07 robross0606

The settings.json file, is mentioned in the documentation around enforcing headers as:

If you are using this setting, I would recommend that you also add "**/settings.json" to psi-header.changes-tracking.excludeGlob to ensure that headers do not get added to VSCode's settings file. I also suggest you add ["jsonc","json"] to the psi-header.changes-tracking.exclude setting to ensure headers are not added to json files (jsonc is VSCode's language id for json files that are enabled for comments).

The issue with modifying files that are outside the currently open project is not to do with the extension. VSCode just reports to the extension that a file has been saved with edits from within VSCode, regardless of what or where the file is. VSCode does not stop you messing with files anywhere on your system. This is a "feature" for many VSCode users who work across multiple projects and workspaces at the same time.

HTH D

davidquinn avatar Jul 04 '25 18:07 davidquinn