-
-
Notifications
You must be signed in to change notification settings - Fork 496
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
AutoCompletion Support #2 #1260
base: main
Are you sure you want to change the base?
Conversation
@microsoft-github-policy-service agree |
I am going to mention the people from the other pr and #267, they might be interested, otherwise: Sorry 😅 |
Commit JKamsker@a39517f implements static completions, attribute based Objections? anyone? |
@nils-a I apologize for the delay. I fell ill over the weekend and am still recovering. I'll address this pull request once I'm in better shape. |
557a233
to
80d5b91
Compare
80d5b91
to
20ea81b
Compare
…istered successfully.
The primary functionality of this PR isn't exclusive to PowerShell. It's a universal tab completion engine, with the PowerShell module serving as an example of how it can be utilized. In principle, any shell could leverage it with the appropriate wrapper code. The command line interface for this is
The goal here is to introduce a universal tab completion engine that any shell can utilize. The PowerShell module is merely the first implementation, with more to follow in the future. Implementing such a completion feature isn't overly complex and it doesn't rely on any spectre.console internals, unlike the core command
Theoretically, the completion code provided should work with the shims you've mentioned, although I haven't personally tested these.
Cool, i really appreciate some extra eyes on this. I'm happy to answer any questions you might have. |
It would be so cool to have a pre-populated command settings in |
@alex-fomin Thanks for the suggestion! I'm a bit tied up at the moment and won't be able to get to it right away, but it's definitely on my radar to tackle as soon as I can. In the meantime, if you're up for it, you're totally welcome to take a stab at it by forking my PR and adding the changes yourself. Cheers! |
@alex-fomin I have added the functionality to public static void Main(string[] args)
{
var app = new CommandApp();
app.Configure
(
config =>
{
config
.AddAutoCompletion(x => x.AddPowershell())
.AddCommand<LionCommand>("lion");
}
) ;
} Will port it to this pr when i got time. |
Heyo @JKamsker, great job so far. Subscribed to the discussion and eager to try it out as soon as I get the chance. |
Now published as separate repo. |
Is there a reason why
|
Nushell can use value + description for auto-completion - listing not only the options but also describing them. It would be nice if command descriptions could be used too (they can already be described with attributes for the help text), and maybe even any suggestions (static and dynamic suggestions). I guess not necessarily in this PR changeset so it is not blocked further. |
Base stolen from #727 . fixed & extended
I know there is alot going on there and i wasn't always sure if i was doing it in the right way. Comments&Changes welcome!
Status:
Non-Goal:
Edit:
The powershell integration seems to have turned out a bit wonky. Maybe we want to extract it into a pre-release library until its stable enough
Please upvote 👍 this pull request if you are interested in it.