diff --git a/CHANGELOG.md b/CHANGELOG.md index c962b26d..e635834d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,9 @@ -# 0.2.5-dev +# 0.2.5 - Add autocmds `LSCAutocomplete` before firing completion, and `LSCShowPreview` after opening the preview window. - Change Info and Hint diagnostic default highlight to `SpellCap`. +- Append diagnostic code to the message. # 0.2.4 diff --git a/autoload/lsc/diagnostics.vim b/autoload/lsc/diagnostics.vim index b01aedad..21977d3c 100644 --- a/autoload/lsc/diagnostics.vim +++ b/autoload/lsc/diagnostics.vim @@ -22,8 +22,11 @@ function! s:Convert(diagnostic) abort let range = [line, character, length] let group = SeverityGroup(a:diagnostic.severity) let type = SeverityType(a:diagnostic.severity) - return {'group': group, 'range': range, - \ 'message': a:diagnostic.message, 'type': type} + let message = a:diagnostic.message + if has_key(a:diagnostic, 'code') + let message = message.' ['.a:diagnostic.code.']' + endif + return {'group': group, 'range': range, 'message': message, 'type': type} endfunction function! lsc#diagnostics#clean(filetype) abort