mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-08 05:24:46 +08:00
Show tsserver hints/suggestions in Ale.
This commit is contained in:
committed by
Dalius Dobravolskas
parent
d0b5909fd8
commit
2ab46d4b8e
@@ -85,12 +85,18 @@ function! s:HandleTSServerDiagnostics(response, error_type) abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
let l:info.syntax_loclist = l:thislist
|
let l:info.syntax_loclist = l:thislist
|
||||||
else
|
elseif a:error_type is# 'semantic'
|
||||||
if len(l:thislist) is 0 && len(get(l:info, 'semantic_loclist', [])) is 0
|
if len(l:thislist) is 0 && len(get(l:info, 'semantic_loclist', [])) is 0
|
||||||
let l:no_changes = 1
|
let l:no_changes = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let l:info.semantic_loclist = l:thislist
|
let l:info.semantic_loclist = l:thislist
|
||||||
|
else
|
||||||
|
if len(l:thislist) is 0 && len(get(l:info, 'suggestion_loclist', [])) is 0
|
||||||
|
let l:no_changes = 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:info.suggestion_loclist = l:thislist
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if l:no_changes
|
if l:no_changes
|
||||||
@@ -98,6 +104,7 @@ function! s:HandleTSServerDiagnostics(response, error_type) abort
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
let l:loclist = get(l:info, 'semantic_loclist', [])
|
let l:loclist = get(l:info, 'semantic_loclist', [])
|
||||||
|
\ + get(l:info, 'suggestion_loclist', [])
|
||||||
\ + get(l:info, 'syntax_loclist', [])
|
\ + get(l:info, 'syntax_loclist', [])
|
||||||
|
|
||||||
call ale#engine#HandleLoclist(l:linter_name, l:buffer, l:loclist, 0)
|
call ale#engine#HandleLoclist(l:linter_name, l:buffer, l:loclist, 0)
|
||||||
@@ -150,6 +157,9 @@ function! ale#lsp_linter#HandleLSPResponse(conn_id, response) abort
|
|||||||
elseif get(a:response, 'type', '') is# 'event'
|
elseif get(a:response, 'type', '') is# 'event'
|
||||||
\&& get(a:response, 'event', '') is# 'syntaxDiag'
|
\&& get(a:response, 'event', '') is# 'syntaxDiag'
|
||||||
call s:HandleTSServerDiagnostics(a:response, 'syntax')
|
call s:HandleTSServerDiagnostics(a:response, 'syntax')
|
||||||
|
elseif get(a:response, 'type', '') is# 'event'
|
||||||
|
\&& get(a:response, 'event', '') is# 'suggestionDiag'
|
||||||
|
call s:HandleTSServerDiagnostics(a:response, 'suggestion')
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user