Add language server source in ALEDetail (2)
This commit is contained in:
parent
0c4606651f
commit
0da4c6e4ad
@ -29,7 +29,6 @@ function! ale#lsp#response#ReadDiagnostics(response) abort
|
|||||||
let l:severity = get(l:diagnostic, 'severity', 0)
|
let l:severity = get(l:diagnostic, 'severity', 0)
|
||||||
let l:loclist_item = {
|
let l:loclist_item = {
|
||||||
\ 'text': l:diagnostic.message,
|
\ 'text': l:diagnostic.message,
|
||||||
\ 'detail': printf("[%s] %s", l:diagnostic.source, l:diagnostic.message),
|
|
||||||
\ 'type': 'E',
|
\ 'type': 'E',
|
||||||
\ 'lnum': l:diagnostic.range.start.line + 1,
|
\ 'lnum': l:diagnostic.range.start.line + 1,
|
||||||
\ 'col': l:diagnostic.range.start.character + 1,
|
\ 'col': l:diagnostic.range.start.character + 1,
|
||||||
@ -51,6 +50,10 @@ function! ale#lsp#response#ReadDiagnostics(response) abort
|
|||||||
let l:loclist_item.nr = l:diagnostic.code
|
let l:loclist_item.nr = l:diagnostic.code
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if has_key(l:diagnostic, 'source')
|
||||||
|
let l:loclist_item.detail = printf("[%s] %s", l:diagnostic.source, l:diagnostic.message)
|
||||||
|
endif
|
||||||
|
|
||||||
call add(l:loclist, l:loclist_item)
|
call add(l:loclist, l:loclist_item)
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user