-
Notifications
You must be signed in to change notification settings - Fork 511
Adding snippet for class based argument completion #1212
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
Conversation
One completer with and one w/o example Also adding placeholders for the one without example
I've thought about this for a bit. I'm not sure how many folks create argument completions. If not a lot of folks do it, I'm hesitant to add this to the snippets that ship with the PowerShell extension. Feel free to change my mind! That said, perhaps what we should have is a doc in this repo that consists of a bunch of user develop snippets for misc scenarios? In that doc we could also have instructions on how to make your own snippets so that it's easier to get started with snippets. Thoughts? (@SeeminglyScience, @rkeithhill, and @rjmholt) |
How about we make this an example? We could do more with our examples. There is a some stuff in there for dealing with paths but hey, the more examples the better IMO. |
I have no strong feelings about it at all. I just write completers for most of the scripts/modules I write, since I believe that is one of the greatest usability boost you can get. I have a PR for the C# version of this in the engine, so it may be better to wait for that. This is more of a stop gap, or for Windows PowerShell |
@powercode do you mind if we make your snippets the first snippets to go in the "community snippets"? I've got a PR out about this: I'll make sure to give you credit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that this is part of community snippets, we should probably close this.
I agree with @rjmholt |
@powercode Any progress on the PowerShell repo issue you submitted on simplifying tab-completion? Just spent a weekend on a tab-completer for a moderately complex native app. Kind of a PITA. I really wanted to use |
@rkeithhill It got put on hold to "get more input". Bot closed it a week ago, but I'll be back. I've run into exactly the same issue with nct, and the work I've done so far is really only useful for cmdlet completions. I'm still trying to figure out a good way of doing this for native commands. I have started modeling what rust is doing with https://clap.rs/. A fluent API for describing command lines, but it is too much of a WIP to share yet. |
Interesting, I remember @lzybkr also talking about Rust's CLI experience in comparison to PowerShell. I feel like |
Yes, I most likely mentioned Another cli framework worth looking at is knack - used for the |
|
Adding a snippet with a class based Argument Completer and simple usage examples.
Is has helper functions for the most common use cases I have encountered when writing completers.
I am a bit hesitating about the examples - Do they belong here? Maybe we should have one snippet without them?