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
90 changes: 49 additions & 41 deletions doc/telescope.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1605,20 +1605,22 @@ builtin.lsp_references({opts}) *telescope.builtin.lsp_references()*
{opts} (table) options to pass to the picker

Options: ~
{include_declaration} (boolean) include symbol declaration in the
lsp references (default: true)
{include_current_line} (boolean) include current line (default:
false)
{jump_type} (string) how to goto reference if there is
only one and the definition file is
different from the current file,
values: "tab", "tab drop", "split",
"vsplit", "never"
{show_line} (boolean) show results text (default: true)
{trim_text} (boolean) trim results text (default: false)
{reuse_win} (boolean) jump to existing window if buffer is
already opened (default: false)
{file_encoding} (string) file encoding for the previewer
{include_declaration} (boolean) include symbol declaration in the
lsp references (default: true)
{include_current_line} (boolean) include current line (default:
false)
{jump_type} (string|function) how to goto reference if there is
only one and the definition file is
different from the current file,
values: "tab", "tab drop", "split",
"vsplit", "never" or a function,
which will be executed before the
jump
{show_line} (boolean) show results text (default: true)
{trim_text} (boolean) trim results text (default: false)
{reuse_win} (boolean) jump to existing window if buffer is
already opened (default: false)
{file_encoding} (string) file encoding for the previewer


builtin.lsp_incoming_calls({opts}) *telescope.builtin.lsp_incoming_calls()*
Expand Down Expand Up @@ -1658,15 +1660,17 @@ builtin.lsp_definitions({opts}) *telescope.builtin.lsp_definitions()*
{opts} (table) options to pass to the picker

Options: ~
{jump_type} (string) how to goto definition if there is only one
and the definition file is different from
the current file, values: "tab", "tab
drop", "split", "vsplit", "never"
{show_line} (boolean) show results text (default: true)
{trim_text} (boolean) trim results text (default: false)
{reuse_win} (boolean) jump to existing window if buffer is
already opened (default: false)
{file_encoding} (string) file encoding for the previewer
{jump_type} (string|function) how to goto definition if there is only one
and the definition file is different from
the current file, values: "tab", "tab
drop", "split", "vsplit", "never" or a function,
which will be executed before the
jump
{show_line} (boolean) show results text (default: true)
{trim_text} (boolean) trim results text (default: false)
{reuse_win} (boolean) jump to existing window if buffer is
already opened (default: false)
{file_encoding} (string) file encoding for the previewer


builtin.lsp_type_definitions({opts}) *telescope.builtin.lsp_type_definitions()*
Expand All @@ -1678,15 +1682,17 @@ builtin.lsp_type_definitions({opts}) *telescope.builtin.lsp_type_definitions()*
{opts} (table) options to pass to the picker

Options: ~
{jump_type} (string) how to goto definition if there is only one
and the definition file is different from
the current file, values: "tab", "tab
drop", "split", "vsplit", "never"
{show_line} (boolean) show results text (default: true)
{trim_text} (boolean) trim results text (default: false)
{reuse_win} (boolean) jump to existing window if buffer is
already opened (default: false)
{file_encoding} (string) file encoding for the previewer
{jump_type} (string|function) how to goto definition if there is only one
and the definition file is different from
the current file, values: "tab", "tab
drop", "split", "vsplit", "never" or a function,
which will be executed before the
jump
{show_line} (boolean) show results text (default: true)
{trim_text} (boolean) trim results text (default: false)
{reuse_win} (boolean) jump to existing window if buffer is
already opened (default: false)
{file_encoding} (string) file encoding for the previewer


builtin.lsp_implementations({opts}) *telescope.builtin.lsp_implementations()*
Expand All @@ -1698,15 +1704,17 @@ builtin.lsp_implementations({opts}) *telescope.builtin.lsp_implementations()*
{opts} (table) options to pass to the picker

Options: ~
{jump_type} (string) how to goto implementation if there is only
one and the definition file is different
from the current file, values: "tab", "tab
drop", "split", "vsplit", "never"
{show_line} (boolean) show results text (default: true)
{trim_text} (boolean) trim results text (default: false)
{reuse_win} (boolean) jump to existing window if buffer is
already opened (default: false)
{file_encoding} (string) file encoding for the previewer
{jump_type} (string|function) how to goto implementation if there is only
one and the definition file is different
from the current file, values: "tab", "tab
drop", "split", "vsplit", "never" or a function,
which will be executed before the
jump
{show_line} (boolean) show results text (default: true)
{trim_text} (boolean) trim results text (default: false)
{reuse_win} (boolean) jump to existing window if buffer is
already opened (default: false)
{file_encoding} (string) file encoding for the previewer


builtin.lsp_document_symbols({opts}) *telescope.builtin.lsp_document_symbols()*
Expand Down
2 changes: 2 additions & 0 deletions lua/telescope/builtin/__lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ local function list_or_jump(action, title, funname, params, opts)
cmd = "vnew"
elseif opts.jump_type == "tab drop" then
cmd = "tab drop"
elseif type(opts.jump_type) == "function" then
opts.jump_type()
end

if cmd then
Expand Down
8 changes: 4 additions & 4 deletions lua/telescope/builtin/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ builtin.jumplist = require_on_exported_call("telescope.builtin.__internal").jump
---@param opts table: options to pass to the picker
---@field include_declaration boolean: include symbol declaration in the lsp references (default: true)
---@field include_current_line boolean: include current line (default: false)
---@field jump_type string: how to goto reference if there is only one and the definition file is different from the current file, values: "tab", "tab drop", "split", "vsplit", "never"
---@field jump_type string|function: how to goto reference if there is only one and the definition file is different from the current file, values: "tab", "tab drop", "split", "vsplit", "never" or a function, which will be executed before the jump
---@field show_line boolean: show results text (default: true)
---@field trim_text boolean: trim results text (default: false)
---@field reuse_win boolean: jump to existing window if buffer is already opened (default: false)
Expand All @@ -446,7 +446,7 @@ builtin.lsp_outgoing_calls = require_on_exported_call("telescope.builtin.__lsp")

--- Goto the definition of the word under the cursor, if there's only one, otherwise show all options in Telescope
---@param opts table: options to pass to the picker
---@field jump_type string: how to goto definition if there is only one and the definition file is different from the current file, values: "tab", "tab drop", "split", "vsplit", "never"
---@field jump_type string|function: how to goto definition if there is only one and the definition file is different from the current file, values: "tab", "tab drop", "split", "vsplit", "never" or a function, which will be executed before the jump
---@field show_line boolean: show results text (default: true)
---@field trim_text boolean: trim results text (default: false)
---@field reuse_win boolean: jump to existing window if buffer is already opened (default: false)
Expand All @@ -456,7 +456,7 @@ builtin.lsp_definitions = require_on_exported_call("telescope.builtin.__lsp").de
--- Goto the definition of the type of the word under the cursor, if there's only one,
--- otherwise show all options in Telescope
---@param opts table: options to pass to the picker
---@field jump_type string: how to goto definition if there is only one and the definition file is different from the current file, values: "tab", "tab drop", "split", "vsplit", "never"
---@field jump_type string|function: how to goto definition if there is only one and the definition file is different from the current file, values: "tab", "tab drop", "split", "vsplit", "never" or a function, which will be executed before the jump
---@field show_line boolean: show results text (default: true)
---@field trim_text boolean: trim results text (default: false)
---@field reuse_win boolean: jump to existing window if buffer is already opened (default: false)
Expand All @@ -465,7 +465,7 @@ builtin.lsp_type_definitions = require_on_exported_call("telescope.builtin.__lsp

--- Goto the implementation of the word under the cursor if there's only one, otherwise show all options in Telescope
---@param opts table: options to pass to the picker
---@field jump_type string: how to goto implementation if there is only one and the definition file is different from the current file, values: "tab", "tab drop", "split", "vsplit", "never"
---@field jump_type string|function: how to goto implementation if there is only one and the definition file is different from the current file, values: "tab", "tab drop", "split", "vsplit", "never" or a function, which will be executed before the jump
---@field show_line boolean: show results text (default: true)
---@field trim_text boolean: trim results text (default: false)
---@field reuse_win boolean: jump to existing window if buffer is already opened (default: false)
Expand Down