Skip to content

Commit 8f11863

Browse files
committed
Append diagnostic code to the message
1 parent 3b17e39 commit 8f11863

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# 0.2.5-dev
1+
# 0.2.5
22

33
- Add autocmds `LSCAutocomplete` before firing completion, and `LSCShowPreview`
44
after opening the preview window.
55
- Change Info and Hint diagnostic default highlight to `SpellCap`.
6+
- Append diagnostic code to the message.
67

78
# 0.2.4
89

autoload/lsc/diagnostics.vim

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ function! s:Convert(diagnostic) abort
2222
let range = [line, character, length]
2323
let group = <SID>SeverityGroup(a:diagnostic.severity)
2424
let type = <SID>SeverityType(a:diagnostic.severity)
25-
return {'group': group, 'range': range,
26-
\ 'message': a:diagnostic.message, 'type': type}
25+
let message = a:diagnostic.message
26+
if has_key(a:diagnostic, 'code')
27+
let message = message.' ['.a:diagnostic.code.']'
28+
endif
29+
return {'group': group, 'range': range, 'message': message, 'type': type}
2730
endfunction
2831

2932
function! lsc#diagnostics#clean(filetype) abort

0 commit comments

Comments
 (0)