Merge pull request #2042 from jparise/elixir-ls-config

Add configuration dictionary support to elixir-ls
This commit is contained in:
w0rp 2018-11-04 10:10:25 +00:00 committed by GitHub
commit 93180239b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 1 deletions

View File

@ -1,7 +1,8 @@
" Author: Jon Parise <jon@indelible.org>
" Description: elixir-ls integration (https://github.com/JakeBecker/elixir-ls)
" Description: ElixirLS integration (https://github.com/JakeBecker/elixir-ls)
call ale#Set('elixir_elixir_ls_release', 'elixir-ls')
call ale#Set('elixir_elixir_ls_config', {})
function! ale_linters#elixir#elixir_ls#GetExecutable(buffer) abort
let l:dir = ale#path#Simplify(ale#Var(a:buffer, 'elixir_elixir_ls_release'))
@ -16,4 +17,5 @@ call ale#linter#Define('elixir', {
\ 'executable_callback': 'ale_linters#elixir#elixir_ls#GetExecutable',
\ 'command_callback': 'ale_linters#elixir#elixir_ls#GetExecutable',
\ 'project_root_callback': 'ale#handlers#elixir#FindMixProjectRoot',
\ 'lsp_config_callback': ale#VarFunc('elixir_elixir_ls_config'),
\})

View File

@ -53,5 +53,20 @@ g:ale_elixir_elixir_ls_release *g:ale_elixir_elixir_ls_release*
Location of the elixir-ls release directory. This directory must contain
the language server scripts (language_server.sh and language_server.bat).
g:ale_elixir_elixir_ls_config *g:ale_elixir_elixir_ls_config*
*b:ale_elixir_elixir_ls_config*
Type: |Dictionary|
Default: `{}`
Dictionary containing configuration settings that will be passed to the
language server. For example, to disable Dialyzer: >
{
\ 'elixirLS': {
\ 'dialyzerEnabled': v:false,
\ },
\ }
<
Consult the ElixirLS documentation for more information about settings.
===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View File

@ -28,3 +28,8 @@ Execute(should set correct LSP values):
AssertLSPOptions {}
AssertLSPConfig {}
AssertLSPProject ale#path#Simplify(g:dir . '/mix_paths/wrapped_project')
Execute(should accept configuration settings):
AssertLSPConfig {}
let b:ale_elixir_elixir_ls_config = {'elixirLS': {'dialyzerEnabled': v:false}}
AssertLSPConfig {'elixirLS': {'dialyzerEnabled': v:false}}