diff options
author | w0rp <w0rp@users.noreply.github.com> | 2018-08-20 16:59:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-20 16:59:21 +0100 |
commit | a366d325a7c69fa20a3ab69ff8359bcd37d1487a (patch) | |
tree | dfca1aa7964cba0c2cf2555228546827d034279d /autoload | |
parent | 61a071683752b2824a222c484aa0243c05aa85b2 (diff) | |
parent | 4923d48d53a2ca64d2a125ff5ea4e4c9aa744f48 (diff) | |
download | ale-a366d325a7c69fa20a3ab69ff8359bcd37d1487a.zip |
Merge pull request #1815 from fredemmott/lsp-related-information
If present, use new-ish LSP 'relatedInformation' field for :ALEDetail
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/lsp/response.vim | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/autoload/ale/lsp/response.vim b/autoload/ale/lsp/response.vim index 561be62e..69e88d56 100644 --- a/autoload/ale/lsp/response.vim +++ b/autoload/ale/lsp/response.vim @@ -55,6 +55,17 @@ 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 + 1) . + \ ':' . (val.location.range.start.character + 1) . + \ ":\n\t" . val.message + \ }) + let l:loclist_item.detail = l:diagnostic.message . "\n" . join(l:related, "\n") + endif + call add(l:loclist, l:loclist_item) endfor |