techee / geany-lsp

LSP plugin for the Geany editor
GNU General Public License v2.0
19 stars 1 forks source link

Configuring the LSP plugin #31

Closed techee closed 3 months ago

techee commented 1 year ago

I suggest having a look at the 3 points at the beginning of the settings file regarding settings loading. Basically:

[filetype] user config > [all] user config > [filetype] global config > [all] global config
[filetype] project config > [all] project config > [filetype] global config > [all] global config

where > means "overrides settings from".

Nearly all options can be specified either in the [all] section, or in the [filetype] section where they override the corresponding option from [all] or the global config file. The only exceptions are cmd, use, rpc_log, and initialization_options_file which are per-filetype settings only.

On the topic, the paragraph setting is helpful, the per line one tended to cut stuff off if it happened to be a bit long. But for pylsp the paragraph setting would be best as 1 and clangd 2 AFAICT, so maybe later it can be per server.

Can be done already, these config options can be specified in any section.

Also you said that per project LSP settings were possible, but didn't say how to set that up.

Go to Project->Properties->LSP Client, select "Use project configuration" from the combo and point it to the conf file you want to use for the project in the edit box below. You can e.g. make a copy of the currently used user config file from ~/.config/geany/plugins/lsp/lsp.conf somewhere where you want to store the project config. After this, "User configuration" in the LSP Client menu will be grayed out and the project configuration file will be used instead.

techee commented 1 year ago

Also, the config file is a bit mess now. What I'd like to do is to list all the available config options in the [all] section with some sane defaults together with a good docstring for each of them and also some general info because nobody is going to read the documentation :-).

Then, it would be nice to have some config for the LSP servers we know, just with the commented-out cmd command so they don't start (or fail to start) out of the box. Users will be advised to comment-out those they are interested in and possibly contribute settings for servers they use and which aren't listed in the config file yet.