1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 13:00:04 +08:00

fix(lsp): add spacevim.diagnostic function

close https://github.com/SpaceVim/SpaceVim/issues/4556
This commit is contained in:
wsdjeg 2022-01-12 22:36:02 +08:00
parent 9f5e635250
commit b0b738e4fa
2 changed files with 19 additions and 1 deletions

View File

@ -49,7 +49,7 @@ if (has('nvim-0.5.0') && s:NVIM_VERSION.is_release_version()) || has('nvim-0.6.0
lua vim.lsp.buf.implementation()
endfunction
function! SpaceVim#lsp#show_line_diagnostics() abort
lua vim.lsp.diagnostic.show_line_diagnostics()
lua require('spacevim.diagnostic').open_float()
endfunction
function! SpaceVim#lsp#list_workspace_folder() abort
let workspace = luaeval('vim.lsp.buf.list_workspace_folders()')

View File

@ -0,0 +1,18 @@
local M = {}
-- The following have been replaced by |vim.diagnostic.open_float()|.
--
-- *vim.lsp.diagnostic.show_line_diagnostics()*
-- *vim.lsp.diagnostic.show_position_diagnostics()*
function M.open_float()
if vim.diagnostic ~= nil then
vim.diagnostic.open_float()
else
vim.lsp.diagnostic.show_line_diagnostics()
end
end
return M