feat(lsp): add 'reuse_win' for reuse window options (#2454)
This commit is contained in:
@@ -1516,6 +1516,8 @@ builtin.lsp_definitions({opts}) *telescope.builtin.lsp_definitions()*
|
|||||||
(default: 30)
|
(default: 30)
|
||||||
{show_line} (boolean) show results text (default: true)
|
{show_line} (boolean) show results text (default: true)
|
||||||
{trim_text} (boolean) trim results text (default: false)
|
{trim_text} (boolean) trim results text (default: false)
|
||||||
|
{reuse_win} (boolean) jump to existing window if buffer is already
|
||||||
|
opened (default: false)
|
||||||
|
|
||||||
|
|
||||||
builtin.lsp_type_definitions({opts}) *telescope.builtin.lsp_type_definitions()*
|
builtin.lsp_type_definitions({opts}) *telescope.builtin.lsp_type_definitions()*
|
||||||
@@ -1535,6 +1537,8 @@ builtin.lsp_type_definitions({opts}) *telescope.builtin.lsp_type_definitions()*
|
|||||||
(default: 30)
|
(default: 30)
|
||||||
{show_line} (boolean) show results text (default: true)
|
{show_line} (boolean) show results text (default: true)
|
||||||
{trim_text} (boolean) trim results text (default: false)
|
{trim_text} (boolean) trim results text (default: false)
|
||||||
|
{reuse_win} (boolean) jump to existing window if buffer is already
|
||||||
|
opened (default: false)
|
||||||
|
|
||||||
|
|
||||||
builtin.lsp_implementations({opts}) *telescope.builtin.lsp_implementations()*
|
builtin.lsp_implementations({opts}) *telescope.builtin.lsp_implementations()*
|
||||||
@@ -1554,6 +1558,8 @@ builtin.lsp_implementations({opts}) *telescope.builtin.lsp_implementations()*
|
|||||||
(default: 30)
|
(default: 30)
|
||||||
{show_line} (boolean) show results text (default: true)
|
{show_line} (boolean) show results text (default: true)
|
||||||
{trim_text} (boolean) trim results text (default: false)
|
{trim_text} (boolean) trim results text (default: false)
|
||||||
|
{reuse_win} (boolean) jump to existing window if buffer is already
|
||||||
|
opened (default: false)
|
||||||
|
|
||||||
|
|
||||||
builtin.lsp_document_symbols({opts}) *telescope.builtin.lsp_document_symbols()*
|
builtin.lsp_document_symbols({opts}) *telescope.builtin.lsp_document_symbols()*
|
||||||
|
|||||||
@@ -196,7 +196,8 @@ local function list_or_jump(action, title, opts)
|
|||||||
vim.cmd "vnew"
|
vim.cmd "vnew"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
vim.lsp.util.jump_to_location(flattened_results[1], offset_encoding)
|
|
||||||
|
vim.lsp.util.jump_to_location(flattened_results[1], offset_encoding, opts.reuse_win)
|
||||||
else
|
else
|
||||||
local locations = vim.lsp.util.locations_to_items(flattened_results, offset_encoding)
|
local locations = vim.lsp.util.locations_to_items(flattened_results, offset_encoding)
|
||||||
pickers
|
pickers
|
||||||
|
|||||||
@@ -407,6 +407,7 @@ builtin.lsp_outgoing_calls = require_on_exported_call("telescope.builtin.__lsp")
|
|||||||
---@field fname_width number: defines the width of the filename section (default: 30)
|
---@field fname_width number: defines the width of the filename section (default: 30)
|
||||||
---@field show_line boolean: show results text (default: true)
|
---@field show_line boolean: show results text (default: true)
|
||||||
---@field trim_text boolean: trim results text (default: false)
|
---@field trim_text boolean: trim results text (default: false)
|
||||||
|
---@field reuse_win boolean: jump to existing window if buffer is already opened (default: false)
|
||||||
builtin.lsp_definitions = require_on_exported_call("telescope.builtin.__lsp").definitions
|
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,
|
--- Goto the definition of the type of the word under the cursor, if there's only one,
|
||||||
@@ -416,6 +417,7 @@ builtin.lsp_definitions = require_on_exported_call("telescope.builtin.__lsp").de
|
|||||||
---@field fname_width number: defines the width of the filename section (default: 30)
|
---@field fname_width number: defines the width of the filename section (default: 30)
|
||||||
---@field show_line boolean: show results text (default: true)
|
---@field show_line boolean: show results text (default: true)
|
||||||
---@field trim_text boolean: trim results text (default: false)
|
---@field trim_text boolean: trim results text (default: false)
|
||||||
|
---@field reuse_win boolean: jump to existing window if buffer is already opened (default: false)
|
||||||
builtin.lsp_type_definitions = require("telescope.builtin.__lsp").type_definitions
|
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
|
--- Goto the implementation of the word under the cursor if there's only one, otherwise show all options in Telescope
|
||||||
@@ -424,6 +426,7 @@ builtin.lsp_type_definitions = require("telescope.builtin.__lsp").type_definitio
|
|||||||
---@field fname_width number: defines the width of the filename section (default: 30)
|
---@field fname_width number: defines the width of the filename section (default: 30)
|
||||||
---@field show_line boolean: show results text (default: true)
|
---@field show_line boolean: show results text (default: true)
|
||||||
---@field trim_text boolean: trim results text (default: false)
|
---@field trim_text boolean: trim results text (default: false)
|
||||||
|
---@field reuse_win boolean: jump to existing window if buffer is already opened (default: false)
|
||||||
builtin.lsp_implementations = require_on_exported_call("telescope.builtin.__lsp").implementations
|
builtin.lsp_implementations = require_on_exported_call("telescope.builtin.__lsp").implementations
|
||||||
|
|
||||||
--- Lists LSP document symbols in the current buffer
|
--- Lists LSP document symbols in the current buffer
|
||||||
|
|||||||
Reference in New Issue
Block a user