Skip to content
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

Add configuration options for picking and choosing which servers are used for LSP features #4392

Open
w0rp opened this issue Dec 20, 2022 · 1 comment
Assignees
Labels
enhancement LSP Any issue relating to LSP or tsserver
Milestone

Comments

@w0rp
Copy link
Member

w0rp commented Dec 20, 2022

ALE currently searches through all language servers configured with ale_linters and discovers which of them offer capabilities for specific features, such as code completion, "go to definition", hover information, and so on. ALE will then try to either combine the results of multiple tools together for a feature, or stop on the first one it can find where it doesn't make sense to combine the results together.

We should add support to configure which linters are used for which features, so you can explicitly prefer one tool over another one, in an order that is user-configured. At the moment the only similar option we have is ale_linters_ignore, which is for disabling specific linters, and overrides the selection from ale_linters. We will keep this option.

A new option could take the following forms.

" Globally configured
let g:ale_linter_features = {
\   'completion': ['pylsp', 'pyright', 'tsserver', 'gopls'],
\   'hover': ['pyright', 'pyslp', 'tsserver', 'gopls'],
\}
" Configured per-buffer
let b:ale_linter_features = {
\   'completion': ['pylsp', 'pyright'],
\   'hover': ['pylsp', 'pyright'],
\}

Because the setting will not cause ALE to go and enable a linter, which is already configured with ale_linters, we do not need to write the filetypes into the Dictionary, which will simplify the design and use of the setting. You could list out all of your preferences across all languages in a straight List for each feature globally, and list only options specific to one language in an ftplugin file or shared config. As always, I recommend writing b: configuration variables wherever possible instead of g: variables. (Except maybe in shared third party plugins that make it harder for you to set your own configuration specific to your system.)

NOTE: If anyone can think of a better name than ale_linter_features, give it to me. I might think of a better one along the way.

@w0rp w0rp added enhancement LSP Any issue relating to LSP or tsserver labels Dec 20, 2022
@w0rp w0rp self-assigned this Dec 20, 2022
@w0rp w0rp pinned this issue Jan 29, 2023
@w0rp w0rp added this to the Version 4.0.0 milestone Feb 3, 2023
@w0rp
Copy link
Member Author

w0rp commented Sep 6, 2023

I now think ale_features is a better name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement LSP Any issue relating to LSP or tsserver
Projects
None yet
Development

No branches or pull requests

1 participant