-
Notifications
You must be signed in to change notification settings - Fork 182
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
Language server configuration management #119
Conversation
There is a way to do so, I think. You could try loading the settings by the following two lines: clients = settings.get("default_clients")
clients.update(settings.get("user_clients"))
By modifying the configuration structure as array, these would be the only two lines needed to read in the client configuration - except you'd like to do some value checks. |
@deathaxe I looked into this today, this should work if we |
The user benefit of merging up from defaults instead of copying defaults is that if LSP improves the defaults (eg. extra syntaxes or scopes) the user will immediately get those updates. supported_client_configs use the settings in global_client_configs inherit the settings from In order to enable eg. "clients": {
"pyls": {
"enabled": true
}
} project_client_configs inherit the settings from In order to enable "settings": {
"LSP": {
"clients": {
"pyls": {
"enabled": true
}
}
}
} |
If a user overrides a setting, he must ensure his changes work. You could probably do some format/type checks against the user configuration before merging. If a key is present, it must match the desired type. On the other hand, if things are merged and something goes wrong, because of invalid settings, you can be quite sure its the user settings issue and output a descriptive error. I find the idea of merging things together better than ask the user to copy the whole structure. Can be compared with patching a color scheme vs. a theme. Later one is much easier to adjust as you just need to create a file with few lines to patch the original one. |
8ce9230
to
9e8f330
Compare
Read "settings" key for all client configs Move settings to global scope Simplify setup popup
092f1c1
to
7daeb02
Compare
Onboarding flow
Notification when a supported syntax is detected:
Documentation shown when running "Setup Language Server":
Clicking one of the Enable options in the bottom will copy the default config to
clients
in your user settings and set theenabled
flags at the user/project level if needed. LSP starts up immediately.Copying global config vs. merging from default
The "clients" setting in the User LSP.sublime-settings fully replaced the defaults, causing #76 and #117.
Moving the default clients to their own setting key fixes #76 (as there are no default-enabled clients, you don't lose any by defining "clients" in user settings)
As we copy the entire config of a client into user settings, #117 will still not be solved: There will be no way to "use the default config, and only override the
command
field"Is this feature worth dedicating even more lines of config-wrangling code to?
TO DO
default_clients
is worthwhile (User settings are all-or-nothing #117)settings
and parsedconfigs
project_data
handlingUpdate documentation structure so we can open/link to individual language setups