Skip to content

Commit

Permalink
Append diagnostic code to the message
Browse files Browse the repository at this point in the history
  • Loading branch information
natebosch committed Aug 11, 2017
1 parent 3b17e39 commit 8f11863
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
7 changes: 5 additions & 2 deletions autoload/lsc/diagnostics.vim
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ function! s:Convert(diagnostic) abort
let range = [line, character, length]
let group = <SID>SeverityGroup(a:diagnostic.severity)
let type = <SID>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
Expand Down

0 comments on commit 8f11863

Please sign in to comment.