From 0da4c6e4ad009a37b482d301a19b6d024aa0ae0a Mon Sep 17 00:00:00 2001 From: Sridhar Srinivasan Date: Wed, 18 Jul 2018 22:12:56 -0500 Subject: [PATCH] Add language server source in ALEDetail (2) --- autoload/ale/lsp/response.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/autoload/ale/lsp/response.vim b/autoload/ale/lsp/response.vim index ab3c503d..939a8997 100644 --- a/autoload/ale/lsp/response.vim +++ b/autoload/ale/lsp/response.vim @@ -29,7 +29,6 @@ function! ale#lsp#response#ReadDiagnostics(response) abort let l:severity = get(l:diagnostic, 'severity', 0) let l:loclist_item = { \ 'text': l:diagnostic.message, - \ 'detail': printf("[%s] %s", l:diagnostic.source, l:diagnostic.message), \ 'type': 'E', \ 'lnum': l:diagnostic.range.start.line + 1, \ 'col': l:diagnostic.range.start.character + 1, @@ -51,6 +50,10 @@ function! ale#lsp#response#ReadDiagnostics(response) abort let l:loclist_item.nr = l:diagnostic.code 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) endfor