Merge pull request #3362 from daliusd/tsserver_hints

Show tsserver hints/suggestions in Ale.
This commit is contained in:
Horacio Sanson
2021-01-20 20:40:44 +09:00
committed by GitHub
3 changed files with 50 additions and 2 deletions

View File

@@ -111,7 +111,7 @@ Execute(An initial list of semantic errors should be handled):
Assert g:ale_handle_loclist_called
Execute(Subsequent empty lists should be ignored):
Execute(Subsequent empty lists should be ignored - semantic):
let g:ale_buffer_info[bufnr('')].semantic_loclist = []
call ale#lsp_linter#HandleLSPResponse(1, CreateError('semanticDiag', ''))
@@ -138,3 +138,31 @@ Execute(Non-empty then non-empty semantic errors should be handled):
call ale#lsp_linter#HandleLSPResponse(1, CreateError('semanticDiag', 'x'))
Assert g:ale_handle_loclist_called
Execute(Subsequent empty lists should be ignored - suggestion):
let g:ale_buffer_info[bufnr('')].suggestion_loclist = []
call ale#lsp_linter#HandleLSPResponse(1, CreateError('suggestionDiag', ''))
Assert !g:ale_handle_loclist_called
Execute(Empty then non-empty suggestion messages should be handled):
let g:ale_buffer_info[bufnr('')].suggestion_loclist = []
call ale#lsp_linter#HandleLSPResponse(1, CreateError('suggestionDiag', 'x'))
Assert g:ale_handle_loclist_called
Execute(Non-empty then empt suggestion messages should be handled):
let g:ale_buffer_info[bufnr('')].suggestion_loclist = CreateLoclist('x')
call ale#lsp_linter#HandleLSPResponse(1, CreateError('suggestionDiag', ''))
Assert g:ale_handle_loclist_called
Execute(Non-empty then non-empty suggestion messages should be handled):
let g:ale_buffer_info[bufnr('')].suggestion_loclist = CreateLoclist('x')
call ale#lsp_linter#HandleLSPResponse(1, CreateError('suggestionDiag', 'x'))
Assert g:ale_handle_loclist_called