You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently I started using mini.pick in my config. Thank you for this great plugin!
Regarding the lsp picker, I miss the ability to jump directly to a single result, bypassing the picker.
This is standard behavior in telescope, and can be configured in fzf-lua by supplying jump_to_single_result is true.
I frequently use goto definition. For now, fzf-lua provides the following lsp pickers in my config: "definition", "reference", "implementation", "type_definition".
Would it be possible to add this behavior to mini.pick?
The text was updated successfully, but these errors were encountered:
This is, of course, possible. However, I don't think this is a good idea. My reasoning is that starting a picker should always result into showing a picker (as stated in #809 with a bit more thoughts in this comment).
I've stumbled upon the same problem and implemented this function that does just that =) Hope it helps
-- Open LSP picker for the given scope---@paramscope"declaration" | "definition" | "document_symbol" | "implementation" | "references" | "type_definition" | "workspace_symbol"---@paramautojumpboolean? If there is only one result it will jump to it.functionM.picker(scope, autojump)
---@returnstringlocalfunctionget_symbol_query()
returnvim.fn.input("Symbol: ")
endifnotautojumpthenlocalopts= { scope=scope }
ifscope=="workspace_symbol" thenopts.symbol_query=get_symbol_query()
endrequire("mini.extra").pickers.lsp(opts)
returnend---@paramoptsvim.lsp.LocationOpts.OnListlocalfunctionon_list(opts)
vim.fn.setqflist({}, "", opts)
if#opts.items==1thenvim.cmd.cfirst()
elserequire("mini.extra").pickers.list({ scope="quickfix" }, { source= { name=opts.title } })
endendifscope=="references" thenvim.lsp.buf.references(nil, { on_list=on_list })
returnendifscope=="workspace_symbol" thenvim.lsp.buf.workspace_symbol(get_symbol_query(), { on_list=on_list })
returnendvim.lsp.buf[scope]({ on_list=on_list })
end
Contributing guidelines
Module(s)
mini.pick, mini.extra
Description
Recently I started using mini.pick in my config. Thank you for this great plugin!
Regarding the
lsp
picker, I miss the ability to jump directly to a single result, bypassing the picker.This is standard behavior in
telescope
, and can be configured infzf-lua
by supplyingjump_to_single_result
is true.I frequently use
goto definition
. For now,fzf-lua
provides the followinglsp
pickers in my config: "definition", "reference", "implementation", "type_definition".Would it be possible to add this behavior to mini.pick?
The text was updated successfully, but these errors were encountered: