LSP
LSP copied to clipboard
not all settings are honored in *.sublime-project
- OS and language server: macOS, every language servers
- How you installed LSP (Package Control or from git?) Package Control
- Minimal reproduction steps
1 run Project: Edit Project, put
{
"settings":
{
"LSP":
{
"diagnostics_highlight_style": "box"
}
}
}
- Observer that the setting is not honored.
It doesn't limit to diagnostics_highlight_style. In particular, I would love to have a project-wise toggle of log_debug. I only want to enable the setting when I am working on the R language server and keep it disabled when I am working with other projects.
Perhaps this should be documented (though it's not promised to be anything but global preferences).
Unless there are some strong arguments for specific settings I would like to wontfix this. To do this is a nasty amount of code change as all code referring to these settings would need to be tied to a window/project.
I second @randy3k's wish. LSP should handle settings more sublime-like. Though I can see how it would require major refactors. Let's keep this in the backlog :)
Perhaps after cleaning up the settings in #722, we can come up with some candidates that definitely should be project-specific?
For example configuring completion_hint_type is very likely a server specific choice.
It's specifically log_debug that gets used without any reference to a window/project, so it cannot reliably be turned on/off at different levels.
My current workaround is to use AutomaticPackageReloader to reload LSP as needed. It works for most of the parts.
{
"caption": "LSP: Reload",
"command": "package_reloader_reload",
"args": {"package": "LSP"}
}
Sublime Packages usually lets u modify settings based on current view or atleast current-syntax etc, so I really expected that to be the same case for LSP :( I tried to modify the package itself but they are so many redirections and everything, thats its really hard to make a change without a guide. Hence, I did the non-optimal solution and read a custom diagnostic highlight style setting from view before implementing it (in the diagnostics.py), I have no clue how frequently that settings.get() function call is made given the complex structure of the whole plugin but at-least its working as I want.
This is the first time I failed to correctly modify a package to accept my custom setting :/
Since this also affects per-project settings for individual language servers and most language servers have settings that they recommend be changed on a per-project basis rather than being set globally it would be nice if this could get fixed eventually, otherwise depending on which project(s) I'm working on I may need to go to each server's global configuration and change it several times per day in order to be able to work efficiently across all of them.