Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lua/telescope/builtin/__lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ end
local function list_or_jump(action, title, funname, params, opts)
opts.reuse_win = vim.F.if_nil(opts.reuse_win, false)
opts.curr_filepath = vim.api.nvim_buf_get_name(opts.bufnr)
opts.filter_items = opts.filter_items or function(items)
return items
end

vim.lsp.buf_request_all(opts.bufnr, action, params, function(results_per_client)
local items = {}
Expand Down Expand Up @@ -234,6 +237,7 @@ local function list_or_jump(action, title, funname, params, opts)

items = apply_action_handler(action, items, opts)
items = filter_file_ignore_patters(items, opts)
items = opts.filter_items(items)

if vim.tbl_isempty(items) then
utils.notify(funname, {
Expand Down
6 changes: 6 additions & 0 deletions lua/telescope/builtin/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ builtin.jumplist = require_on_exported_call("telescope.builtin.__internal").jump
---@field trim_text boolean: trim results text (default: false)
---@field reuse_win boolean: jump to existing window if buffer is already opened (default: false)
---@field file_encoding string: file encoding for the previewer
---@field filter_items FilterItemsCallback: callback to filter out quickfix entries that should be ignored
builtin.lsp_references = require_on_exported_call("telescope.builtin.__lsp").references

--- Lists LSP incoming calls for word under the cursor, jumps to reference on `<cr>`
Expand All @@ -451,6 +452,7 @@ builtin.lsp_outgoing_calls = require_on_exported_call("telescope.builtin.__lsp")
---@field trim_text boolean: trim results text (default: false)
---@field reuse_win boolean: jump to existing window if buffer is already opened (default: false)
---@field file_encoding string: file encoding for the previewer
---@field filter_items FilterItemsCallback: callback to filter out quickfix entries that should be ignored
builtin.lsp_definitions = require_on_exported_call("telescope.builtin.__lsp").definitions

--- Goto the definition of the type of the word under the cursor, if there's only one,
Expand All @@ -461,6 +463,7 @@ builtin.lsp_definitions = require_on_exported_call("telescope.builtin.__lsp").de
---@field trim_text boolean: trim results text (default: false)
---@field reuse_win boolean: jump to existing window if buffer is already opened (default: false)
---@field file_encoding string: file encoding for the previewer
---@field filter_items FilterItemsCallback: callback to filter out quickfix entries that should be ignored
builtin.lsp_type_definitions = require_on_exported_call("telescope.builtin.__lsp").type_definitions

--- Goto the implementation of the word under the cursor if there's only one, otherwise show all options in Telescope
Expand All @@ -470,6 +473,7 @@ builtin.lsp_type_definitions = require_on_exported_call("telescope.builtin.__lsp
---@field trim_text boolean: trim results text (default: false)
---@field reuse_win boolean: jump to existing window if buffer is already opened (default: false)
---@field file_encoding string: file encoding for the previewer
---@field filter_items FilterItemsCallback: callback to filter out quickfix entries that should be ignored
builtin.lsp_implementations = require_on_exported_call("telescope.builtin.__lsp").implementations

--- Lists LSP document symbols in the current buffer
Expand Down Expand Up @@ -513,6 +517,8 @@ builtin.lsp_workspace_symbols = require_on_exported_call("telescope.builtin.__ls
---@field file_encoding string: file encoding for the previewer
builtin.lsp_dynamic_workspace_symbols = require_on_exported_call("telescope.builtin.__lsp").dynamic_workspace_symbols

---@alias FilterItemsCallback fun(items: vim.quickfix.entry[]): vim.quickfix.entry[]

--
--
-- Diagnostics Pickers
Expand Down