-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow local configuration update in the extension API #43226
Comments
Hi, any thoughts or suggestions on this? |
@dece There is an internal support for storing in memory configuration. But this is not supported in the API. But your scenario is a good use case to expose this. |
Can you please elaborate more on that and what is the need behind this and how is it helpful to user? |
Sure! The current idea is to let users specify in their user settings a local setting file, e.g. localSettings.json, accepting the same options as the main setting. When triggered (on startup or on command), the extension would look for this file and load the settings in memory. This way, the user options can be shared between several devices like with the Sync Settings extension or Git and point to a file or symlink storing those local settings so they can vary from one computer to another without impacting the shared configuration. The settings precedence, file management, etc, would be done by the extension so it would require minimal changes from the editor code base as I think exposing this memory configuration option should be just enough. I use VS Code on several devices and I love the ability to sync my settings, and I think setting a different window zoom level or theme locally would be a great addition. I don't have much thought on what other use cases for this API support would be, unrelated to my extension, I can just think of configuration preview, but I'm sure extension developers will find something useful to do with this :) |
You are not the only one. The point is: |
Possible forms:Dynamic wayProvides an API to injecting settings(from anywhere) at vscode runtime. with the highest priority. Static wayA new
This means it can be override by folder settings. How is it helpful to user:
Why not use the
|
One problems, if make it, how to resolve conflicts from multi |
@sandy081 Hi, it's been a year since this issue was opened, any chance of seeing it happening any time soon? |
@dece Sorry no plans yet. |
No problem I'll look into other ways of reaching my goal. Cheers! |
There are some open questions to answer before tackling this - How does the user expect to see these in memory settings? So we need to have an UI story first before going into implementation. |
Initially, I suggest the following (open to suggestions/updates as I go through the implementation):
Extra things that can be done later (thoughts on priority?):
This will enable two scenarios. Extensions editing settings temporarily without touching files. And users who might want to change some setting temporarily, without having to |
Before going further, can you please elaborate your use case that required this? It would be needed to bring it up with the team. |
|
I do not fully understand why |
This is #40233 |
@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:
|
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. |
The airline feature in VSCode Vim is border line unusable without the ability for the extension to modify vscode configuration without changing |
macOS + Nix (nix-darwin) users may need this feature. When we manage If I write a extension, switch current theme on vscode launch, the issues above will gone. |
Same for NixOS and https://github.com/nix-community/home-manager on any operating system. |
We closed this issue because we don't plan to address it in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider. If you wonder what we are up to, please see our roadmap and issue reporting guidelines. Thanks for your understanding, and happy coding! |
Hello, 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:
WorkspaceConfiguration.update
and an option, or a different kind ofConfigurationTarget
, to not write this new configuration setting.A quick search in the issues tells me that it would be an appreciated feature:
settings.local.json
) #37519Thank you!
The text was updated successfully, but these errors were encountered: