diff options
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/telescope/builtin/init.lua | 6 | ||||
| -rw-r--r-- | lua/telescope/builtin/lsp.lua | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/lua/telescope/builtin/init.lua b/lua/telescope/builtin/init.lua index e790700..0f55467 100644 --- a/lua/telescope/builtin/init.lua +++ b/lua/telescope/builtin/init.lua @@ -355,6 +355,12 @@ builtin.lsp_references = require_on_exported_call("telescope.builtin.lsp").refer ---@field jump_type string: how to goto definition if there is only one, values: "tab", "split", "vsplit", "never" 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, +--- 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, values: "tab", "split", "vsplit", "never" +builtin.lsp_type_definitions = require("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 ---@param opts table: options to pass to the picker ---@field jump_type string: how to goto implementation if there is only one, values: "tab", "split", "vsplit", "never" diff --git a/lua/telescope/builtin/lsp.lua b/lua/telescope/builtin/lsp.lua index 056221e..e5b183e 100644 --- a/lua/telescope/builtin/lsp.lua +++ b/lua/telescope/builtin/lsp.lua @@ -95,6 +95,10 @@ lsp.definitions = function(opts) return list_or_jump("textDocument/definition", "LSP Definitions", opts) end +lsp.type_definitions = function(opts) + return list_or_jump("textDocument/typeDefinition", "LSP Type Definitions", opts) +end + lsp.implementations = function(opts) return list_or_jump("textDocument/implementation", "LSP Implementations", opts) end @@ -403,6 +407,7 @@ local feature_map = { ["document_symbols"] = "document_symbol", ["references"] = "find_references", ["definitions"] = "goto_definition", + ["type_definitions"] = "type_definition", ["implementations"] = "implementation", ["workspace_symbols"] = "workspace_symbol", } |
