-
Notifications
You must be signed in to change notification settings - Fork 198
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
Add a way to set the CommandCollector
#612
Comments
These options were not actually options, and were added to |
Is it possible to create a |
Also - the |
I'm really not sure what you are trying to achieve here, could you share a snippet ? |
There is a regression in the lib, you are right that |
We'll fix that ASAP, but I'd like to understand your usage better first |
It's not really a regression because it never worked in Skim since I'll need some time to write a small example snippet, but my actual usecase is https://github.com/idanarye/nu_plugin_skim. Basically it's a plugin for using Skim in Nushell. Nushell is a rich shell that supports structured objects, and what my plugin does is run Skim with these objects instead of strings. This means that:
Here is example of interactive mode with my plugin: Peek.2024-11-24.18-27.mp4 |
From what I understand, this is for use in interactive mode. Is there any other use case you're missing that requires cmd_collector ? |
Not really - AFAIK the purpose of the command collector is to augment interactive mode. If interactive mode is not used and the |
This should be enough for us to work with, I think this means we need to bring the options moved to the context back where they were, then make the options module public. |
Not sure what you mean by "options moved to the context back where they were". Weren't the options passed directly to |
The missing options that were moved to a new |
This should not have any impact on you, other than making your use case work |
@LoricAndre Thanks - it seems to work. I still need two more things before I can migrate it back from two_percent though:
The former is easy and I can make a PR myself, but I'm not familiar enough with the codebase to do the latter. Is it something that should belong with #613 (since it's another non-CLI thing to add back to |
I'll try to add both to this PR and rename it later this week |
Thanks! |
I had some time and motivation, so I added them |
You should be able to set |
Thanks! Should I make this a separate ticket? |
No, but I think we should move this discussion to the PR, I'll take a look at |
Prior to 0.11,
SkimOptions
had acmd_collector
field which could be used to generateSkimItem
s based on the user-editable command query.(In practice, because
CommandCollector
was not exported, this was not possible. I had to make a PR to the two_percent fork to expose it before I could use it)In 0.11 I see that it's removed - I believe as part of making
SkimOptions
comform to Clap? - which means that it is no longer possible to register Rust functions that generateSkimItem
s from a user-editable command - at most one can register a shell command template. It also means that interactive mode can no longer work with customSkimItem
s - only with strings.Is it possible to restore this functionality? I don't suggest it should go back
SkimOptions
, but maybe some other way to inject it? Maybe the second argument ofskim_run
could be anenum
with witherSkimItemReceiver
or aCommandCollector
? (because these two are mutually exclusive. Or at least they should be)Other missing similar options are
selector
andengine_factory
. Thatenum
approach will not work for them though...The text was updated successfully, but these errors were encountered: