-
Notifications
You must be signed in to change notification settings - Fork 404
Expose List properties, remove Add* methods #1987
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
Changes from all commits
df9f188
371cb1f
7946cb0
42746f1
ab6c6cb
c2a7102
9d461f4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,10 +22,16 @@ public void Setup() | |
{ | ||
_nullConsole = new NullConsole(); | ||
|
||
Option<string> fruitOption = new("--fruit"); | ||
fruitOption.CompletionSources.Add("apple", "banana", "cherry"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This naming now looks wrong. The things being added here are really completion items, not completion sources. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jonsequitur I've tried renaming the
|
||
|
||
Option<string> vegetableOption = new("--vegetable"); | ||
vegetableOption.CompletionSources.Add("asparagus", "broccoli", "carrot"); | ||
|
||
var eatCommand = new Command("eat") | ||
{ | ||
new Option<string>("--fruit").AddCompletions("apple", "banana", "cherry"), | ||
new Option<string>("--vegetable").AddCompletions("asparagus", "broccoli", "carrot") | ||
fruitOption, | ||
vegetableOption | ||
}; | ||
|
||
_testParser = new CommandLineBuilder(eatCommand) | ||
|
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.
The difference between GetCompletions() and Completions is that the former is the result of evaluating the Funcs in the latter, right? Shouldn't we disambiguate? Maybe we can rename the List property to
CompletionSources
.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.
@jozkee that is a very good point!
@KathleenDollard what is your opinion on this?
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 agree.
Can you search the code to ensure we do not already have something called "CompletionSources" as I vaguely remember that. We should update the List name.
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.
Awesome, I've applied the rename and the PR is ready for review again. Thank you both for your feedback!