-
Notifications
You must be signed in to change notification settings - Fork 386
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
Powderhouse subsystems and directives #2351
Powderhouse subsystems and directives #2351
Conversation
This issue has files changed that I did not expect. I need to review this with Jean or Mikayla, regardless of content, and I know it makes it hard to review. So, unless you are in a patient mood, you can wait for a cleaner PR. I did not deliberately delete most of the code marked as deleted. |
The changes might be easier to understand if you updated the API compatibility test files too. |
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.
Paired with @KathleenDollard reviewing this. Left comments from review. Overall looks good, big remaining questions this review does not address are largely around:
StringExtensions
/ Tokenizer- haven't reviewed as it is outdated / in flux
- Handling of Directives as options
- conversations around this are currently in flight
src/System.CommandLine.Subsystems.Tests/DiagramSubsystemTests.cs
Outdated
Show resolved
Hide resolved
src/System.CommandLine.Subsystems.Tests/DiagramSubsystemTests.cs
Outdated
Show resolved
Hide resolved
src/System.CommandLine.Subsystems/Subsystems/InitializationContext.cs
Outdated
Show resolved
Hide resolved
public void MarkArgAsHandled(int argPos, string handledBy) | ||
{ | ||
|
||
} |
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.
Do we want this empty, and is it related to the (possibly removed) HandledInfo
?
TBH, we are still getting everything to work with the split approach and have not given much thought to the API yet. We will do that a bit later. I think the new subsystem approach will take some docs beyond API, and we're working on some design docs. |
@@ -94,48 +103,48 @@ public void Long_form_options_can_be_specified_using_equals_delimiter() | |||
result.GetResult(option).Tokens.Should().ContainSingle(a => a.Value == "there"); | |||
} | |||
|
|||
[Fact] |
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.
It is not clear to me why whitespace is messed up here. Ideas? Maybe I found or created formatting nits and reformatted. Do we keep?
@@ -148,11 +149,11 @@ string CurrentToken() | |||
|
|||
configuration ??= new CliConfiguration(rootCommand); | |||
|
|||
CliTokenizer.Tokenize( | |||
Tokenizer.Tokenize( |
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.
I am open to the CliToken name, but thought we might avoid it internal members
@@ -27,10 +29,13 @@ internal static class StringExtensions | |||
*/ | |||
} | |||
|
|||
internal static class CliTokenizer | |||
internal static class Tokenizer |
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.
Can we skip CLI for internals, or does it add meaning?
d4a316f
to
9419c21
Compare
* Preprocessed tokens can be skipped without messing up the location of subsequent tokens. * Tokens from response files can have accurate location information. This will enable better error handling and diagramming.
The configuration and args are now wrapped in an InitializationContext
The core parser no longer supports the special "directive" syntax, but this abstract class provides a reusable implementation of handling directive syntax in a subsystem using preprocessing.
9419c21
to
8cc20e9
Compare
8cc20e9
to
06fa079
Compare
This addresses some of the issues raised in #2342 regarding directives (not response files environment variables(..
Remains in draft because: