diff --git a/autoload/SpaceVim/lsp.vim b/autoload/SpaceVim/lsp.vim index 48f7acb20..9da013dc6 100644 --- a/autoload/SpaceVim/lsp.vim +++ b/autoload/SpaceVim/lsp.vim @@ -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()') diff --git a/lua/spacevim/diagnostic.lua b/lua/spacevim/diagnostic.lua new file mode 100644 index 000000000..15168967d --- /dev/null +++ b/lua/spacevim/diagnostic.lua @@ -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