Better formatting

This commit is contained in:
Fred Emmott 2018-08-15 14:31:30 -07:00
parent 484a70f0c0
commit c467db3ed9
No known key found for this signature in database
GPG Key ID: 06C22A9D789FCA28
2 changed files with 4 additions and 4 deletions

View File

@ -58,11 +58,11 @@ function! ale#lsp#response#ReadDiagnostics(response) abort
if has_key(l:diagnostic, 'relatedInformation') if has_key(l:diagnostic, 'relatedInformation')
let l:related = deepcopy(l:diagnostic.relatedInformation) let l:related = deepcopy(l:diagnostic.relatedInformation)
call map(l:related, {key, val -> 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.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 endif
call add(l:loclist, l:loclist_item) call add(l:loclist, l:loclist_item)

View File

@ -165,7 +165,7 @@ Execute(ale#lsp#response#ReadDiagnostics() should use relatedInformation for det
\ { \ {
\ 'range': Range(0, 2, 0, 2), \ 'range': Range(0, 2, 0, 2),
\ 'message': 'Something went wrong!', \ '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"
\ } \ }
\ ]}}) \ ]}})