mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-13 18:25:42 +08:00
feat(lsp): make SPC e c support to clear diagnostics
If lsp is enabled for current buffer. SPC e c should be able to clear diagnostics.
This commit is contained in:
parent
aa3deb1f25
commit
35bdf0da3e
@ -391,5 +391,12 @@ endif
|
||||
|
||||
" TODO clear errors
|
||||
function! s:clear_errors() abort
|
||||
sign unplace *
|
||||
if SpaceVim#lsp#buf_server_ready()
|
||||
call SpaceVim#lsp#diagnostic_clear()
|
||||
if get(getloclist(0, {'title': 0}), 'title', '') ==# 'Language Server'
|
||||
call setloclist(0, [], 'r')
|
||||
endif
|
||||
else
|
||||
sign unplace *
|
||||
endif
|
||||
endfunction
|
||||
|
@ -71,6 +71,9 @@ if (has('nvim-0.5.0') && s:NVIM_VERSION.is_release_version()) || has('nvim-0.6.0
|
||||
function! SpaceVim#lsp#diagnostic_goto_prev() abort
|
||||
lua vim.lsp.diagnostic.goto_prev()
|
||||
endfunction
|
||||
function! SpaceVim#lsp#diagnostic_clear() abort
|
||||
lua vim.lsp.diagnostic.clear(0)
|
||||
endfunction
|
||||
elseif SpaceVim#layers#isLoaded('autocomplete') && get(g:, 'spacevim_autocomplete_method') ==# 'coc'
|
||||
" use coc.nvim
|
||||
let s:coc_language_servers = {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user