LSP icon indicating copy to clipboard operation
LSP copied to clipboard

not all settings are honored in *.sublime-project

Open randy3k opened this issue 6 years ago • 6 comments
trafficstars

  • 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"
		}
	}
}
  1. 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.

randy3k avatar Nov 06 '19 21:11 randy3k

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.

tomv564 avatar Nov 10 '19 12:11 tomv564

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 :)

rwols avatar Nov 26 '19 22:11 rwols

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.

tomv564 avatar Nov 29 '19 19:11 tomv564

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"}
    }

randy3k avatar Dec 12 '19 19:12 randy3k

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 :/

Penguin98kStudio avatar Oct 29 '20 00:10 Penguin98kStudio

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.

RevanProdigalKnight avatar Sep 18 '21 22:09 RevanProdigalKnight