-
Notifications
You must be signed in to change notification settings - Fork 385
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
Support metadata based CLI: was Demo/test case: TaskRunner parsing #461
Comments
This should be pretty straightforward. Depending on how many tasks there are and whether the scan will be costly, you might consider doing this reflection only once and caching it, e.g. creating this index at build time or writing a file to disk after the first scan. |
Thank you, Jon. Would you accept such a demo as a PR?
Basically, the direction I want to go with this is to replace MSBuild
entirely with dotnet.exe.
…On Sat, Mar 16, 2019 at 12:37 PM Jon Sequeira ***@***.***> wrote:
This should be pretty straightforward. Argument.AddSuggestionSource can
be used to provide dynamic suggestions via a delegate or via your own
implementation of ISuggestionSource.
Depending on how many tasks there are and whether the scan will be costly,
you might consider doing this reflection only once and caching it, e.g.
creating this index at build time or writing a file to disk after the first
scan.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#461 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAbT_TtEnRxfMqd4oeh7VlwcVaXLqwN5ks5vXR25gaJpZM4b3ehn>
.
|
I would be happy to look at the code and help work through the use case. This sounds like it falls under the general category of app models that sit on top of the core functionality and we want to enable scenarios like this but building the app models themselves isn't the general goal of this project so a separate repo would be best. |
Thank you, Jon! I somewhat agree, but the problem with splitting these things out into separate repos is you lose the benefits of ReSharper refactoring things and so the downstream maintainers get stuck with double (or more) of the work. I also think a "plugin of plugin" model is a fairly realistic scenario, in that every job I've ever worked on has needed some command-line tool to orchestrate tasks. It would just be unique in the sense that it's turtles all the way down: You plug in your TaskRunner plugin into dotnet.exe tools, and you plug-in Task plug-ins into TaskRunner. (MSBuild just happens to be a special case where the Tasks are build related rather than problem domain related.) In effect, what this demo is really demonstrating is how to build a W-grammar/attribute grammar using |
Imagine an exe called TaskRunner.dll that has a bunch of
TaskDefinition<T>
sub-classes.I would like to provide dotnet-suggest support for each one. To do this, I would need to load, using reflection, an instance of each
TaskDefinition
and be able to explain toSystem.CommandLine
how to use this metadata to provide command line auto-completion suggestions.The text was updated successfully, but these errors were encountered: