Fix tests for LSP suggestions

This commit is contained in:
w0rp 2021-02-06 18:55:21 +00:00
parent 99eb68e6ca
commit 8beb67b4d1
No known key found for this signature in database
GPG Key ID: 0FC1ECAA8C81CD83
1 changed files with 10 additions and 0 deletions

View File

@ -1,8 +1,10 @@
Before:
Save g:ale_buffer_info
Save g:ale_disable_lsp
Save g:ale_lsp_suggestions
let g:ale_disable_lsp = 0
let g:ale_lsp_suggestions = 1
unlet! b:ale_disable_lsp
function! CreateError(type, message) abort
@ -146,6 +148,14 @@ Execute(Subsequent empty lists should be ignored - suggestion):
Assert !g:ale_handle_loclist_called
Execute(You should be able to disable suggestions):
let g:ale_lsp_suggestions = 0
let g:ale_buffer_info[bufnr('')].suggestion_loclist = []
call ale#lsp_linter#HandleLSPResponse(1, CreateError('suggestionDiag', 'x'))
Assert !g:ale_handle_loclist_called
Execute(Empty then non-empty suggestion messages should be handled):
let g:ale_buffer_info[bufnr('')].suggestion_loclist = []