diff --git a/autoload/ale/lsp/response.vim b/autoload/ale/lsp/response.vim index 7984369d..4b895ac7 100644 --- a/autoload/ale/lsp/response.vim +++ b/autoload/ale/lsp/response.vim @@ -58,11 +58,11 @@ function! ale#lsp#response#ReadDiagnostics(response) abort 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)) . + \ ale#path#FromURI(val.location.uri) . \ ':' . val.location.range.start.line . ':' . val.location.range.start.character . - \ ': ' . val.message + \ ":\n\t" . val.message \ }) - let l:loclist_item.detail = join(l:related, "\n") . "\n" + let l:loclist_item.detail = l:diagnostic.message . "\n" . join(l:related, "\n") . "\n" endif call add(l:loclist, l:loclist_item) diff --git a/test/lsp/test_read_lsp_diagnostics.vader b/test/lsp/test_read_lsp_diagnostics.vader index c1df55f0..6708ad2f 100644 --- a/test/lsp/test_read_lsp_diagnostics.vader +++ b/test/lsp/test_read_lsp_diagnostics.vader @@ -165,7 +165,7 @@ Execute(ale#lsp#response#ReadDiagnostics() should use relatedInformation for det \ { \ 'range': Range(0, 2, 0, 2), \ 'message': 'Something went wrong!', - \ 'detail': 'file:///tmp/someotherfile.txt:42:79: might be this' + \ 'detail': "Something went wrong!\n/tmp/someotherfile.txt:42:79:\n\tmight be this" \ } \ ]}})