feat: migrate to Telescope diagnostics using vim.diagnostic (#1553)
This commit is contained in:
@@ -436,31 +436,43 @@ builtin.lsp_workspace_symbols = require_on_exported_call("telescope.builtin.lsp"
|
||||
---@field symbol_highlights table: string -> string. Matches symbol with hl_group
|
||||
builtin.lsp_dynamic_workspace_symbols = require_on_exported_call("telescope.builtin.lsp").dynamic_workspace_symbols
|
||||
|
||||
--- Lists LSP diagnostics for the current buffer
|
||||
--- - Fields:
|
||||
--- - `All severity flags can be passed as `string` or `number` as per `:vim.lsp.protocol.DiagnosticSeverity:`
|
||||
--- - Default keymaps:
|
||||
--- - `<C-l>`: show autocompletion menu to prefilter your query with the diagnostic you want to see (i.e. `:warning:`)
|
||||
---@param opts table: options to pass to the picker
|
||||
---@field severity string|number: filter diagnostics by severity name (string) or id (number)
|
||||
---@field severity_limit string|number: keep diagnostics equal or more severe wrt severity name (string) or id (number)
|
||||
---@field severity_bound string|number: keep diagnostics equal or less severe wrt severity name (string) or id (number)
|
||||
---@field no_sign boolean: hide LspDiagnosticSigns from Results (default: false)
|
||||
---@field line_width number: set length of diagnostic entry text in Results
|
||||
builtin.lsp_document_diagnostics = require_on_exported_call("telescope.builtin.lsp").diagnostics
|
||||
builtin.lsp_document_diagnostics = function(...)
|
||||
vim.api.nvim_err_write(
|
||||
"`lsp_document_diagnostics` is deprecated and will be removed. Please use `Telescope diagnostics bufnr=0`.\n"
|
||||
.. "For more information see `:help telescope.changelog-1553`\n"
|
||||
)
|
||||
local new = ...
|
||||
new.bufnr = 0
|
||||
require("telescope.builtin.diagnostics").get(new)
|
||||
end
|
||||
builtin.lsp_workspace_diagnostics = function(...)
|
||||
vim.api.nvim_err_write(
|
||||
"`lsp_workspace_diagnostics` is deprecated and will be removed. Please use `Telescope diagnostics`.\n"
|
||||
.. "For more information see `:help telescope.changelog-1553`\n"
|
||||
)
|
||||
require("telescope.builtin.diagnostics").get(...)
|
||||
end
|
||||
|
||||
--- Lists LSP diagnostics for the current workspace if supported, otherwise searches in all open buffers
|
||||
--
|
||||
--
|
||||
-- Diagnostics Pickers
|
||||
--
|
||||
--
|
||||
|
||||
--- Lists diagnostics for current or all open buffers
|
||||
--- - Fields:
|
||||
--- - `All severity flags can be passed as `string` or `number` as per `:vim.lsp.protocol.DiagnosticSeverity:`
|
||||
--- - `All severity flags can be passed as `string` or `number` as per `:vim.diagnostic.severity:`
|
||||
--- - Default keymaps:
|
||||
--- - `<C-l>`: show autocompletion menu to prefilter your query with the diagnostic you want to see (i.e. `:warning:`)
|
||||
---@param opts table: options to pass to the picker
|
||||
---@field bufnr string|number: if nil get diagnostics for all open buffers. Use 0 for current buffer
|
||||
---@field severity string|number: filter diagnostics by severity name (string) or id (number)
|
||||
---@field severity_limit string|number: keep diagnostics equal or more severe wrt severity name (string) or id (number)
|
||||
---@field severity_bound string|number: keep diagnostics equal or less severe wrt severity name (string) or id (number)
|
||||
---@field no_sign boolean: hide LspDiagnosticSigns from Results (default: false)
|
||||
---@field no_sign boolean: hide DiagnosticSigns from Results (default: false)
|
||||
---@field line_width number: set length of diagnostic entry text in Results
|
||||
builtin.lsp_workspace_diagnostics = require_on_exported_call("telescope.builtin.lsp").workspace_diagnostics
|
||||
---@field namespace number: limit your diagnostics to a specific namespace
|
||||
builtin.diagnostics = require_on_exported_call("telescope.builtin.diagnostics").get
|
||||
|
||||
local apply_config = function(mod)
|
||||
local pickers_conf = require("telescope.config").pickers
|
||||
|
||||
Reference in New Issue
Block a user