Skip to content

Consider removing CompletionSourceList #1911

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

Closed
Tracked by #1891
jonsequitur opened this issue Nov 2, 2022 · 0 comments · Fixed by #1946
Closed
Tracked by #1891

Consider removing CompletionSourceList #1911

jonsequitur opened this issue Nov 2, 2022 · 0 comments · Fixed by #1946
Assignees
Labels
Area-API Area-Completions Related to support for tab completion
Milestone

Comments

@jonsequitur
Copy link
Contributor

jonsequitur commented Nov 2, 2022

    // IReadOnlyList, yet it has an Add.  Why isn't it IList?
    // Of course, there's also
    // Guideline: DO use the “Collection” suffix in names of types implementing IEnumerable (or any of its descendants) and representing a list of items.
    // So "CompletionSourceCollection" is the name the guidelines suggest.  (It doesn't get the exception of "if you're just being a general data structure and explaining the kind of data structure" that List has)
    // Why doesn't this look like other collections? (Count property, etc)?
    public class CompletionSourceList : IEnumerable<ICompletionSource>, IReadOnlyCollection<ICompletionSource>, IReadOnlyList<ICompletionSource>, IEnumerable 
    {
        public CompletionSourceList();
        public int Count { get; }
        public ICompletionSource Item { get; }
        public void Add(ICompletionSource source);
        public void Clear();
        public IEnumerator<ICompletionSource> GetEnumerator();
    }
@jonsequitur jonsequitur mentioned this issue Nov 2, 2022
56 tasks
@jonsequitur jonsequitur added Area-API Area-Completions Related to support for tab completion labels Nov 2, 2022
@adamsitnik adamsitnik self-assigned this Nov 3, 2022
adamsitnik added a commit to adamsitnik/command-line-api that referenced this issue Nov 3, 2022
…instead:

- it has Add and Clear
- it has no indexer, but we don't need it

fixes dotnet#1911
adamsitnik added a commit that referenced this issue Nov 4, 2022
…on (#1946)

* remove CompletionSourceList, expose a ICollection<ICompletionSource> instead:

- it has Add and Clear
- it has no indexer, but we don't need it

fixes #1911

* replace CompletionDelegate with a Func, fixes #1927

* remove DirectiveCollection, use dictionary instead, fixes #1912

* replace HelpSectionDelegate with Action<HelpContext>, fixes #1932

* replace ParseArgument<T> with Func<ArgumentResult, T>, fixes #1939

* Replace ValidateSymbolResult delegate with Action<T>, fixes #1944
@jonsequitur jonsequitur added this to the 2.0 GA milestone Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-API Area-Completions Related to support for tab completion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants