4bee0f1743
This adds generic configuration dictionary support to the elixir-ls linter. This is useful for disabling its built-in Dialyzer support, for example, which can improve startup time. The configuration dictionary is a little verbose. I considered reducing the user configuration to only the nested settings dictionary (and having the linter implementation wrap it in the top-level `elixirLS` dictionary), but leaving it fully configurable simplifies the code and removes any assumptions about current or future ElixirLS behavior.
35 lines
1.1 KiB
Text
35 lines
1.1 KiB
Text
Before:
|
|
call ale#assert#SetUpLinterTest('elixir', 'elixir_ls')
|
|
|
|
let g:ale_has_override['win32'] = 0
|
|
|
|
After:
|
|
let g:ale_has_override = {}
|
|
|
|
call ale#assert#TearDownLinterTest()
|
|
|
|
Execute(should set correct defaults (unix)):
|
|
AssertLinter 'elixir-ls/language_server.sh', 'elixir-ls/language_server.sh'
|
|
|
|
Execute(should set correct defaults (win32)):
|
|
let g:ale_has_override['win32'] = 1
|
|
|
|
AssertLinter 'elixir-ls\language_server.bat', 'elixir-ls\language_server.bat'
|
|
|
|
Execute(should configure elixir-ls release location):
|
|
let b:ale_elixir_elixir_ls_release = 'boo'
|
|
|
|
AssertLinter 'boo/language_server.sh', 'boo/language_server.sh'
|
|
|
|
Execute(should set correct LSP values):
|
|
call ale#test#SetFilename('mix_paths/wrapped_project/lib/app.ex')
|
|
|
|
AssertLSPLanguage 'elixir'
|
|
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}}
|