mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-08 21:44:47 +08:00
Merge pull request #1734 from sridhars/master
Add language server source in ALEDetail
This commit is contained in:
@@ -66,6 +66,10 @@ function! ale#lsp#response#ReadDiagnostics(response) abort
|
|||||||
let l:loclist_item.detail = l:diagnostic.message . "\n" . join(l:related, "\n")
|
let l:loclist_item.detail = l:diagnostic.message . "\n" . join(l:related, "\n")
|
||||||
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
|
||||||
|
|
||||||
|
|||||||
@@ -89,6 +89,26 @@ Execute(ale#lsp#response#ReadDiagnostics() should handle messages without codes)
|
|||||||
\ },
|
\ },
|
||||||
\ ]}})
|
\ ]}})
|
||||||
|
|
||||||
|
Execute(ale#lsp#response#ReadDiagnostics() should include sources in detail):
|
||||||
|
AssertEqual [
|
||||||
|
\ {
|
||||||
|
\ 'type': 'E',
|
||||||
|
\ 'text': 'Something went wrong!',
|
||||||
|
\ 'detail': '[tslint] Something went wrong!',
|
||||||
|
\ 'lnum': 10,
|
||||||
|
\ 'col': 15,
|
||||||
|
\ 'end_lnum': 12,
|
||||||
|
\ 'end_col': 23,
|
||||||
|
\ }
|
||||||
|
\ ],
|
||||||
|
\ ale#lsp#response#ReadDiagnostics({'params': {'uri': 'filename.ts', 'diagnostics': [
|
||||||
|
\ {
|
||||||
|
\ 'range': Range(9, 14, 11, 22),
|
||||||
|
\ 'message': 'Something went wrong!',
|
||||||
|
\ 'source': 'tslint',
|
||||||
|
\ }
|
||||||
|
\ ]}})
|
||||||
|
|
||||||
Execute(ale#lsp#response#ReadDiagnostics() should consider -1 to be a meaningless code):
|
Execute(ale#lsp#response#ReadDiagnostics() should consider -1 to be a meaningless code):
|
||||||
AssertEqual [
|
AssertEqual [
|
||||||
\ {
|
\ {
|
||||||
@@ -108,7 +128,6 @@ Execute(ale#lsp#response#ReadDiagnostics() should consider -1 to be a meaningles
|
|||||||
\ },
|
\ },
|
||||||
\ ]}})
|
\ ]}})
|
||||||
|
|
||||||
|
|
||||||
Execute(ale#lsp#response#ReadDiagnostics() should handle multiple messages):
|
Execute(ale#lsp#response#ReadDiagnostics() should handle multiple messages):
|
||||||
AssertEqual [
|
AssertEqual [
|
||||||
\ {
|
\ {
|
||||||
|
|||||||
Reference in New Issue
Block a user