vscode-workspace-config-plus icon indicating copy to clipboard operation
vscode-workspace-config-plus copied to clipboard

Track changes from `settings.json`

Open witcher112 opened this issue 2 years ago • 2 comments

I wonder if we can introduce tracking of direct changes from settings.json and give the user an option to apply them to one of extension supported configuration files. It could serve as an improvement of the current behavior of merging with settings.json (we can for example block updating settings.json if we detect that it's out of sync).

I'm thinking of the scenario:

  • settings.json is produced as a result of merging settings.shared.json with settings.local.json and marked as synced
  • settings.json is modified (thus becoming non-synced)
  • extension detects it and sends the notification
  • user is presented with the option to "Sync" (either triggered manually or required before merging settings.shared.json and settings.local.json)
  • user can select the target configuration file where the diff would be applied (we'd need to perform some checks*)

Please let me know if that makes sense, I can take a look and start researching the possibilities (I guess some diff libraries would be the first thing to look for).

*we'd need to check that after applying the diff to one of our configuration files, produced settings.json would be the same as it was, otherwise we should block applying to certain config files (for example if the user would like to apply to settings.shared.json but in the same time his settings.local.json overrides the field - in such scenario only applying to settings.local.json should be possible).

witcher112 avatar Feb 22 '23 06:02 witcher112

Appreciate the thought, but I'm not sure I understand the use case and I'm not entirely convinced it's something we should do regardless.

Fundamentally, this extension is a bolt-on/band-aid type approach around a gap in VS Code which I hope will be resolved and available natively at some point (perhaps being far to overly optimistic though).

As such I'd like to try to minimize complexity, both in terms of the code and in terms of the mental model for users when leveraging the extension. I believe it's a fairly simple mental model at the moment, the real gap is the lack of the ability to use the UI. I'm not convinced that adding monitoring of native files and incorporating those into the fold is worth the hit on the mental model just to be able to use the UI (especially given that we've wired up autocomplete/intellisense on all the supported local/shared files)

calebcartwright avatar Mar 10 '23 23:03 calebcartwright

The one big reason I'd want to see this is that some things modify .vscode/settings.json for you, and it's easy not to notice. For instance, pinning a GitHub actions workflow to the status bar writes that setting to the workspace settings. Then those changes get overwritten by Workspace Config+, which is confusing.

It would be nice for changes like that to be noticed, and sent somewhere they can safely live.

Peeja avatar Feb 12 '25 20:02 Peeja