Allow local configuration update in the extension API
See original GitHub issueHello, I would like to see in VS Code the ability to set configuration options without them automatically being written in the target configuration file, whether it’s the global settings.json
or workspace settings.
Right now it’s not possible to share your global/workspace settings between several machines and adding machine-specific configuration options (e.g. window.zoomLevel, due to different screen DPI) without issues. I’m currently writing an extension that will allow users to save some settings in a specific file and load it on top on the user settings ; adding several local files and workspace/folder support can come later once this basic feature is working. If I try to write a locally available configuration option in whatever configuration target with WorkspaceConfiguration.update
, the result is automatically written in the associated settings file, making common settings file sharing problematic: the settings file will always store the merged configuration (global & local) from the last machine used.
Proposal:
- Update current settings with
WorkspaceConfiguration.update
and an option, or a different kind ofConfigurationTarget
, to not write this new configuration setting. - Apply the changes only in memory and not on disk : the configuration will be reset next time VS Code is restarted, or when the window reloads.
A quick search in the issues tells me that it would be an appreciated feature:
- https://github.com/Microsoft/vscode/issues/17634
- https://github.com/Microsoft/vscode/issues/37519
- https://github.com/Microsoft/vscode/issues/40233
Thank you!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:73
- Comments:22 (7 by maintainers)
Top GitHub Comments
This is what I came here to request this feature for. I’d love to use this feature of VSCodeVim, but it is just too heavy on performance. If extensions could do in-memory overrides of specific configuration properties, that would solve this problem.
@bpasero your proposition is interesting but works only for the use case presented by @OmarTawfik. In particular, in-memory settings as described in this issue are not always related to a particular workspace but rather to a VS code user installation.
I’m not familiar with your workflow but my guess is that having some settings set in memory only should be visible and maybe editable in the UI somehow? What about a new tab named “Temporary”, “Session” or “Transient” in the settings window?
Even though my use case described in the OP still holds, another that comes to mind if I’m not mistaken is the Vim VS Code plugin that struggles with rapidly editing some settings that have no purpose being written on files. To quote them:
Source: https://github.com/VSCodeVim/Vim#vim-airline