mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-30 08:04:31 +08:00
Use new-ish LSP 'relatedInformation' field for :ALEDetail
This commit is contained in:
@@ -55,6 +55,16 @@ function! ale#lsp#response#ReadDiagnostics(response) abort
|
||||
endif
|
||||
endif
|
||||
|
||||
if has_key(l:diagnostic, 'relatedInformation')
|
||||
let l:related = deepcopy(l:diagnostic.relatedInformation)
|
||||
call map(l:related, {key, val ->
|
||||
\ ale#path#FromURI(val.location.uri)) .
|
||||
\ ':' . val.location.range.start.line . ':' . val.location.range.start.character .
|
||||
\ ': ' . val.message
|
||||
\ })
|
||||
let l:loclist_item.detail = join(l:related, "\n") . "\n"
|
||||
endif
|
||||
|
||||
call add(l:loclist, l:loclist_item)
|
||||
endfor
|
||||
|
||||
|
||||
Reference in New Issue
Block a user