Skip to content

Commit

Permalink
severity is optional in diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
prabirshrestha committed Dec 24, 2020
1 parent 1d41c06 commit fa5bfbc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion autoload/lsp/ui/vim/highlights.vim
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function! s:place_highlights(server_name, path, diagnostics) abort
let [l:line, l:start_col] = lsp#utils#position#lsp_to_vim(l:bufnr, l:item['range']['start'])
let [l:_, l:end_col] = lsp#utils#position#lsp_to_vim(l:bufnr, l:item['range']['end'])

let l:name = get(s:severity_sign_names_mapping, l:item['severity'], 'LspError')
let l:name = get(s:severity_sign_names_mapping, get(l:item, 'severity', 3), 'LspError')
let l:hl_name = l:name . 'Highlight'
call nvim_buf_add_highlight(l:bufnr, l:ns, l:hl_name, l:line - 1, l:start_col - 1, l:end_col - 1)
endfor
Expand Down
2 changes: 1 addition & 1 deletion autoload/lsp/ui/vim/virtual.vim
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function! s:place_virtual(server_name, path, diagnostics) abort
for l:item in a:diagnostics
let l:line = l:item['range']['start']['line']

let l:name = get(s:severity_sign_names_mapping, l:item['severity'], 'LspError')
let l:name = get(s:severity_sign_names_mapping, get(l:item, 'severity', 3), 'LspError')
let l:hl_name = l:name . 'Virtual'
call nvim_buf_set_virtual_text(l:bufnr, l:ns, l:line,
\ [[g:lsp_virtual_text_prefix . l:item['message'], l:hl_name]], {})
Expand Down

0 comments on commit fa5bfbc

Please sign in to comment.