diff options
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r-- | runtime/lua/vim/diagnostic.lua | 8 | ||||
-rw-r--r-- | runtime/lua/vim/lsp/diagnostic.lua | 28 |
2 files changed, 5 insertions, 31 deletions
diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua index 33fa07ef4c..688f9b5811 100644 --- a/runtime/lua/vim/diagnostic.lua +++ b/runtime/lua/vim/diagnostic.lua @@ -523,7 +523,7 @@ end --- Get current diagnostics. --- ----@param bufnr number|nil Buffer number to get diagnistics from. Use 0 for +---@param bufnr number|nil Buffer number to get diagnostics from. Use 0 for --- current buffer or nil for all buffers. ---@param opts table|nil A table with the following keys: --- - namespace: (number) Limit diagnostics to the given namespace. @@ -631,7 +631,7 @@ local function diagnostic_move_pos(opts, pos) local win_id = opts.win_id or vim.api.nvim_get_current_win() if not pos then - vim.api.nvim_echo({"No more valid diagnostics to move to", "WarningMsg"}) + vim.api.nvim_echo({{"No more valid diagnostics to move to", "WarningMsg"}}, true, {}) return end @@ -1001,7 +1001,7 @@ end --- Open a floating window with the diagnostics at the given position. --- ---@param opts table|nil Configuration table with the same keys as ---- |vim.lsp.util.open_floatin_preview()| in addition to the following: +--- |vim.lsp.util.open_floating_preview()| in addition to the following: --- - namespace: (number) Limit diagnostics to the given namespace --- - severity: See |diagnostic-severity|. --- - show_header: (boolean, default true) Show "Diagnostics:" header @@ -1049,7 +1049,7 @@ function M.show_line_diagnostics(opts, bufnr, lnum) opts = opts or {} opts.focus_id = "line_diagnostics" - opts.lnum = lnum + opts.lnum = lnum or (vim.api.nvim_win_get_cursor(0)[1] - 1) local line_diagnostics = M.get(bufnr, opts) return show_diagnostics(opts, line_diagnostics) end diff --git a/runtime/lua/vim/lsp/diagnostic.lua b/runtime/lua/vim/lsp/diagnostic.lua index 01c675ba77..eef840bee5 100644 --- a/runtime/lua/vim/lsp/diagnostic.lua +++ b/runtime/lua/vim/lsp/diagnostic.lua @@ -265,7 +265,7 @@ function M.get(bufnr, client_id, predicate) table.insert(all_diagnostics, diagnostic) end end) - return diagnostic_vim_to_lsp(all_diagnostics) + return all_diagnostics end local namespace = M.get_namespace(client_id) @@ -446,14 +446,6 @@ end --- ---@deprecated Prefer |vim.diagnostic._set_signs()| --- ---- Sign characters can be customized with the following commands: ---- ---- <pre> ---- sign define LspDiagnosticsSignError text=E texthl=LspDiagnosticsSignError linehl= numhl= ---- sign define LspDiagnosticsSignWarning text=W texthl=LspDiagnosticsSignWarning linehl= numhl= ---- sign define LspDiagnosticsSignInformation text=I texthl=LspDiagnosticsSignInformation linehl= numhl= ---- sign define LspDiagnosticsSignHint text=H texthl=LspDiagnosticsSignHint linehl= numhl= ---- </pre> ---@param diagnostics Diagnostic[] ---@param bufnr number The buffer number ---@param client_id number the client id @@ -478,15 +470,6 @@ end --- ---@deprecated Prefer |vim.diagnostic._set_underline()| --- ---- Underline highlights can be customized by changing the following |:highlight| groups. ---- ---- <pre> ---- LspDiagnosticsUnderlineError ---- LspDiagnosticsUnderlineWarning ---- LspDiagnosticsUnderlineInformation ---- LspDiagnosticsUnderlineHint ---- </pre> ---- ---@param diagnostics Diagnostic[] ---@param bufnr number: The buffer number ---@param client_id number: The client id @@ -506,15 +489,6 @@ end --- ---@deprecated Prefer |vim.diagnostic._set_virtual_text()| --- ---- Virtual text highlights can be customized by changing the following |:highlight| groups. ---- ---- <pre> ---- LspDiagnosticsVirtualTextError ---- LspDiagnosticsVirtualTextWarning ---- LspDiagnosticsVirtualTextInformation ---- LspDiagnosticsVirtualTextHint ---- </pre> ---- ---@param diagnostics Diagnostic[] ---@param bufnr number ---@param client_id number |