-
-
Notifications
You must be signed in to change notification settings - Fork 489
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
WIP Tab completion for CLI #727
Conversation
@patriksvensson @phil-scott-78 Do you feel am I taking this in the right direction? Today's start, to me, felt promising. Let me know your thoughts, and feel free to add (failing) tests to provide more specific direction. |
I forgot to catch the actual parser error, so... I was accidentally muting an index out of bounds exception.. fixed now. |
I'm going to pul this down tonight and play with it. So far it looks really cool. One scenario that I was thinking about was being able to add a service to commands to specify valid values when they are resolved. E.g. when I type |
@phil-scott-78 I'm not entirely sure yet how to add what you mentioned above. Could you provide a pseudo code draft? I added option parameter support and some more tests. |
* Adding a dark mode * Adding reference for types to summary pages * Adding API Reference * Adding modifiers to methods/fields/etc * Minimizing files input * Caching a lot of the output pages * Cache only for each execution * Adding API references to existing docs
So my thought was given this settings public class FooCommandSettings : CommandSettings
{
[CommandArgument(0, "[QUX]")]
[Description("The qux value.")]
public string Qux { get; set; }
} Let's assume Qux might be a list of *.qux files in the current folder or sub-folder. Someone types in To implement perhaps would work like the `ParameterValidationAttribute public sealed class FileCompletionAttribute : ParameterValidationAttribute
{
public override string[] Complete(CommandParameterContext context, string partialElement)
{
return GetQuxCompletions(partialElement);
}
}
public class FooCommandSettings : CommandSettings
{
[CommandArgument(0, "[QUX]")]
[Description("The qux value.")]
[FileCompletionAttribute]
public string Qux { get; set; }
} |
It's absolutely the next step and would be super cool to have. I'll have a look at where this would fit, thanks for the input, appreciate it! |
Hello @Jawz84, I'm just checking in to see if you made any further progress with this PR? |
Hi Frank, thank you for checking in. I'm afraid life happened and I have since not continued the PR.
I don't think I will continue it either. It's been so long and lots of other things are happening.
Sorry to disappoint.
Met vriendelijke groet,
Jos Koelewijn
…________________________________
From: Frank Ray ***@***.***>
Sent: Saturday, May 13, 2023 9:21:41 PM
To: spectreconsole/spectre.console ***@***.***>
Cc: Jos Koelewijn ***@***.***>; Mention ***@***.***>
Subject: Re: [spectreconsole/spectre.console] WIP Fixes #267 completer (PR #727)
Hello @Jawz84<https://github.com/Jawz84>, I'm just checking in to see if you made any further progress with this PR?
—
Reply to this email directly, view it on GitHub<#727 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGJ5E5J5UQRAEYAI5ZNCIH3XF7NMLANCNFSM5NU77RXA>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Thanks for replying @Jawz84 , it's no disappointment and all contributions, even unmerged WIP PRs are appreciated. I was just doing some housekeeping across the open issues and PRs to check on any progress. Regarding tab completion, and whilst I don't know anything about MacOS and Linux, it seems more involved than it first appears: https://learn.microsoft.com/en-us/dotnet/core/tools/enable-tab-autocomplete ie. each shell seems to need custom configuration manually added before tab completion actually works Anyhow, I'm going to close this PR given your comment above and you can always come back to it later if you so desire. Or not. Take care |
Thank you Frank!
…________________________________
From: Frank Ray ***@***.***>
Sent: Monday, May 15, 2023 11:57:12 AM
To: spectreconsole/spectre.console ***@***.***>
Cc: Jos Koelewijn ***@***.***>; Mention ***@***.***>
Subject: Re: [spectreconsole/spectre.console] WIP Tab completion for CLI (PR #727)
Thanks for replying @Jawz84<https://github.com/Jawz84> , it's no disappointment and all contributions, even unmerged WIP PRs are appreciated. I was just doing some housekeeping across the open issues and PRs to check on any progress.
Regarding tab completion, and whilst I don't know anything about MacOS and Linux, it seems more involved than it first appears: https://learn.microsoft.com/en-us/dotnet/core/tools/enable-tab-autocomplete ie. each shell seems to need custom configuration manually added before tab completion actually works
Anyhow, I'm going to close this PR given your comment above and you can always come back to it later if you so desire. Or not. Take care
—
Reply to this email directly, view it on GitHub<#727 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGJ5E5JDZIR53TAFQE7DXQ3XGH4XRANCNFSM5NU77RXA>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
The goal of this pull request is to add out-of-the-box completer functionality to Spectre.Console, as suggested in #267.
The approach will be to mimic what a tool like
dotnet complete
does. As a result, the completion scripts that people can use, will be analogous to those fordotnet complete
.