mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 10:20:05 +08:00
fix(lsp): add spacevim.diagnostic function
close https://github.com/SpaceVim/SpaceVim/issues/4556
This commit is contained in:
parent
9f5e635250
commit
b0b738e4fa
@ -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()')
|
||||
|
18
lua/spacevim/diagnostic.lua
Normal file
18
lua/spacevim/diagnostic.lua
Normal 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
|
Loading…
Reference in New Issue
Block a user