dense-analysis / ale

Check syntax in Vim/Neovim asynchronously and fix files, with Language Server Protocol (LSP) support
BSD 2-Clause "Simplified" License
13.4k stars 1.42k forks source link

Common configuration for Language Servers #1754

Open actionless opened 5 years ago

actionless commented 5 years ago

I found in docs what ale currently have several options for configuring specific linters.

However Language Servers also support some common configuration options. Is there an option in ale to bypass some config to Language Server?

ex. how it's implemented in vim-lsp: https://github.com/prabirshrestha/vim-lsp/wiki/Servers-Python#workspace-configuration

(i've came to this question while trying to find a way to loose down mccabe warnings in ale: https://github.com/palantir/python-language-server/blob/develop/vscode-client/package.json#L73)

w0rp commented 5 years ago

I think this is a good idea. Here is a plan for this.

  1. Require snake_case names for linters, so all linter names are valid in variable names. Make this a linting rule in the ALE codebase, but permit other linter names outside of the codebase. Use aliases for existing names.
  2. Set up a default for the initialization_options_callback which gets get(g:, 'ale_' . a:registered_filetype . '_' . a:linter_name, {}) (and also the buffer variable version).
  3. Add documentation to describe how it works.
actionless commented 5 years ago

thanks a lot for the prompt reaction!

so far it seems what ale could replace quite successfully my current combination of YCM+Syntastic+vim-codefmt, i am very happy with using the benefits of new async vim

yogeshdhamija commented 5 years ago

I am trying to send some config to pyls in my vimrc. Is that possible as of right now? I see this pull request (https://github.com/w0rp/ale/pull/1852), and it looks like it might be, but I'm not sure how to do it. I apologize, but could someone please point me in the right direction?

I am commenting here because, as actionless mentioned, what I'm trying to do is implemented in vim-lsp like this: https://github.com/prabirshrestha/vim-lsp/wiki/Servers-Python#workspace-configuration

w0rp commented 5 years ago

Not yet.