Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ale_linters/elixir/expert.vim
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ call ale#linter#Define('elixir', {
\ 'name': 'expert',
\ 'lsp': 'stdio',
\ 'executable': {b -> ale#Var(b, 'elixir_expert_executable')},
\ 'command': '%e',
\ 'command': '%e --stdio',
\ 'project_root': function('ale#handlers#elixir#FindMixUmbrellaRoot'),
\})
2 changes: 2 additions & 0 deletions autoload/ale/lsp_linter.vim
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ function! ale#lsp_linter#HandleLSPResponse(conn_id, response) abort
\ : a:response.result.items

call ale#lsp_linter#HandleLSPDiagnostics(a:conn_id, l:uri, l:diagnostics)
elseif l:method is# 'client/registerCapability'
call ale#lsp#SendResponse(a:conn_id, a:response.id, v:null)
elseif l:method is# 'workspace/configuration'
let l:items = get(get(a:response, 'params', {}), 'items', [])
let l:config = ale#lsp#GetConnectionConfig(a:conn_id)
Expand Down
4 changes: 2 additions & 2 deletions test/linter/test_elixir_expert.vader
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ After:
call ale#assert#TearDownLinterTest()

Execute(should set correct defaults):
AssertLinter 'expert', ale#Escape('expert')
AssertLinter 'expert', ale#Escape('expert') . ' --stdio'

Execute(The executable should be configurable):
let b:ale_elixir_expert_executable = 'foobar'

AssertLinter 'foobar', ale#Escape('foobar')
AssertLinter 'foobar', ale#Escape('foobar') . ' --stdio'

Execute(should set correct LSP values):
call ale#test#SetFilename('../test-files/elixir/umbrella_project/apps/app1/lib/app.ex')
Expand Down
24 changes: 24 additions & 0 deletions test/lsp/test_engine_lsp_response_handling.vader
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,30 @@ Execute(workspace/configuration requests should be answered with the connection
unlet! g:sent_responses
runtime autoload/ale/lsp.vim

Execute(client/registerCapability requests should be acknowledged):
let g:sent_responses = []

function! ale#lsp#SendResponse(conn_id, id, result) abort
call add(g:sent_responses, [a:conn_id, a:id, a:result])
endfunction

call ale#lsp_linter#SetLSPLinterMap({'1': {'name': 'expert', 'aliases': [], 'lsp': 'stdio'}})
call ale#lsp_linter#HandleLSPResponse(1, {
\ 'jsonrpc': '2.0',
\ 'id': 12,
\ 'method': 'client/registerCapability',
\ 'params': {
\ 'registrations': [{'id': 'abc', 'method': 'textDocument/didSave'}],
\ },
\})

AssertEqual
\ [[1, 12, v:null]],
\ g:sent_responses

unlet! g:sent_responses
runtime autoload/ale/lsp.vim

Execute(LSP errors should be logged in the history):
call ale#lsp_linter#SetLSPLinterMap({'347': {'name': 'foobar', 'aliases': [], 'lsp': 'stdio'}})
call ale#lsp_linter#HandleLSPResponse(347, {
Expand Down
Loading