Skip to content

Commit 20bf205

Browse files
HicaroDConni2461
andauthored
fix: nil problem when jump to location when tab drop is set as jump_type (#2760)
* feat(lsp_definitions): adding `tab drop` as `jump_type` * feat(lsp-jump-types): `tab drop` for LSP features Now, you're able to use `tab drop` as `jump_type` for these LSP features: references, type definitions, definitions an implementations. * fix(docs): reordering `tab drop` option * feat: generate docs * fix: nil problem with `vim.uri_to_fname` * fix: removing warning about `file_uri` variable not being used --------- Co-authored-by: Simon Hauser <[email protected]>
1 parent 4522d7e commit 20bf205

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lua/telescope/builtin/__lsp.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,11 @@ local function list_or_jump(action, title, opts)
200200
elseif opts.jump_type == "vsplit" then
201201
vim.cmd "vnew"
202202
elseif opts.jump_type == "tab drop" then
203-
local file_path = vim.uri_to_fname(flattened_results[1].uri)
203+
local file_uri = flattened_results[1].uri
204+
if file_uri == nil then
205+
file_uri = flattened_results[1].targetUri
206+
end
207+
local file_path = vim.uri_to_fname(file_uri)
204208
vim.cmd("tab drop " .. file_path)
205209
end
206210
end

0 commit comments

Comments
 (0)