summaryrefslogtreecommitdiff
path: root/lua/telescope/builtin/init.lua
diff options
context:
space:
mode:
authorSimon Hauser <Simon-Hauser@outlook.de>2021-12-10 17:49:06 +0100
committerGitHub <noreply@github.com>2021-12-10 17:49:06 +0100
commit56325fefb21a8a9331a25e294c074887dfb2a60c (patch)
tree1b0c08e44dc437ed96824eae941a991a6a204ac1 /lua/telescope/builtin/init.lua
parent61240ac75a93b3cdafb4325ab4e9d407f83965f4 (diff)
feat: migrate to Telescope diagnostics using vim.diagnostic (#1553)
Diffstat (limited to 'lua/telescope/builtin/init.lua')
-rw-r--r--lua/telescope/builtin/init.lua44
1 files changed, 28 insertions, 16 deletions
diff --git a/lua/telescope/builtin/init.lua b/lua/telescope/builtin/init.lua
index 66f3eda..c7bceba 100644
--- a/lua/telescope/builtin/init.lua
+++ b/lua/telescope/builtin/init.lua
@@ -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
+
+--
+--
+-- Diagnostics Pickers
+--
+--
---- Lists LSP diagnostics for the current workspace if supported, otherwise searches in all open buffers
+--- 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