b5a7593577
This is the callback-based variant of the existing `lsp_config` linter option. It serves the same purpose but can be used when more complicated processing is needed. `lsp_config` and `lsp_config_callback` are mutually exclusive options; if both an given, a linter preprocessing error will be raised. The runtime logic has been wrapped in `ale#lsp_linter#GetConfig` for convenience, similar to `ale#lsp_linter#GetOptions`. This also adds documentation and an `AssertLSPConfig` test function for completeness.
30 lines
896 B
Text
30 lines
896 B
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')
|