-
-
Notifications
You must be signed in to change notification settings - Fork 836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Combining sources/pickers #213
Comments
currently working on this on cjquines@2a5f69b693d6d0ce63237c152b476660a74e86c3 . exactly how are pickers supposed to be combined? there seems to be a clear way to combine finders by just running both finder commands (see the commit i'm working on), but how will e.g. actions be combined? i guess one way could be to take each individual item, wrap them with the picker they came from, then make actions to that item call that picker's action or something. but iirc telescope supports actions on multiple items at once, so that doesn't seem to make sense to me. the option that would be simplest would be to just, when combining two or more pickers, just use the first picker for everything, and only combine the finders. idk if this is good enough though |
I haven't had a look at your branch, but some thoughts off of the top of my head:
I would assume the practical conclusion is to enable some sort of finders of finder interface (similar to how filtering probably is will end up being combining multiple sorters) and combining finders will in most cases be more of a user-specific case. I could envision some refactoring to cleanly carve out providers (ie the picker-specific finders) to facilitate customization in user land. It's what appears to be the most maintainable solution while enabling maximum customization. Nevertheless, it's somewhat opinionated. I hope that makes sense, let me know in case you have more questions. Other maintainers are very happy to chime in :) |
I would really like to see this feature (just combining multiple results from |
No updates. Planed for after 0.1 release |
after bringing up this topic on reddit. |
+1 for this, combining specific and quick pickers with more general and slow pickers is extremely useful. For example my dream buffer switcher is Emacs package consult shows open buffers and recent files together. I hope something exists in Neovim world too. |
I have written a small "cycle" picker that can cycle through some pickers and keep the query intact because I was missing this picker combinator described here (and also because it is a feature I know from ctrl-space.vim). It is not so much a picker combinator (it does not produce a new picker with the combined items) but rather a wrapper to switch between some pickers and take the current query with you. With some config like this: local my_cycle_picker = cycle(picker_A, picker_B, picker_C)
require 'telescope'.setup {
defaults = { mappings = { i = { ["<C-Space>"] = function() my_cycle_picker.next() end } } }
}
vim.keymap.set({"n", "i"}, "<C-Space>", function() my_cycle_picker() end, opts) on the first press of real world usage: If you are interested I could polish this into a PR. |
I think that right now the biggest use case for that would be combining information from multiple language servers. Imagine a project where you have at least two languages. Both language servers implement lsp_dynamic_workspace_symbols. Without that feature there is no way to present information from both clients. |
Per discussion on Gitter, it would be cool if
telescope
supported an easy way to combine sources/pickers and merge the results in a common display for filtering.e.g. doing something like
my_combo_picker = my_first_picker + my_second_picker
, thenmy_combo_picker()
displays everything from bothmy_first_picker
andmy_second_picker
.The text was updated successfully, but these errors were encountered: