From 8f11863542b3fa0493abe9a659b88494aa5aff76 Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Fri, 11 Aug 2017 08:47:15 -0700 Subject: [PATCH] Append diagnostic code to the message --- CHANGELOG.md | 3 ++- autoload/lsc/diagnostics.vim | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) 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