Skip to content
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

Pipe output from one picker into a new configuration #1590

Closed
Conni2461 opened this issue Dec 11, 2021 · 3 comments
Closed

Pipe output from one picker into a new configuration #1590

Conni2461 opened this issue Dec 11, 2021 · 3 comments
Labels
enhancement Enhancement to performance, inner workings or existent features
Milestone

Comments

@Conni2461
Copy link
Member

Example would be live_grep -> fuzzy, or lsp_dynamic_workspace_symbols

The interface i had in my was something like this

attach_mappings = function(map) 
  map("i", "<c-f>", function(prompt_bufnr)
    local line = action_state.get_current_line()
    require("telescope.actions.generate").pipe(prompt_bufnr, {
      prompt_title = "Find Word (" .. line .. ")" 
      sorter = conf.generic_sorter(opts),
    })
  end)
  return true
end

It should allow us to take all items that were already gather from live_grep (for example) and put them back into a new_table with a fuzzy sorter. We should probably only refresh the picker rather than closing and reopening it. If we pass in a sorter we need to make sure that its correctly setup. This includes calling the init function of the sorter. Otherwise fzf sorter wouldnt work.

CC @kylo252 If you would be interested in doing this, I would assign you otherwise i flag it with good first issue

@danielo515
Copy link

Ins't this similar to #793 , which is attempt to be done in #1115 ?

@Conni2461
Copy link
Member Author

forgot that #793 existed. I looked at #1115 a long time ago and it looks promising.

Some time ago we had a not so great proposal and then i wrote down what i was expecting from something like that (interface wise). The task shouldn't be that difficult and if i find the time i'll write the implementation (probably based on #1115) prior to 0.1 (#1938)

@Conni2461 Conni2461 added this to the 0.1 Release milestone May 29, 2022
@Conni2461
Copy link
Member Author

A somewhat basic interface is provided (we can add additional config options on demand) and we provide implementations refine implementation for live_grep and lsp_dynamic_workspace_symbols to go from live to fuzzy with the default key being <c-space> and it can be configured to custom keys, see #2034

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to performance, inner workings or existent features
Projects
None yet
Development

No branches or pull requests

2 participants