dotnet / dotnet/command-line-api

Please document CompletionItem.Kind more

Open
#1,765 4 comments 0 reactions 0 assignees View on GitHub
needs documentation
Dominant language
C#
Stars
3.7k
Forks
428
PR merge metrics
No merged PRs in 30d

Description

I was implementing a [CompletionDelegate](https://docs.microsoft.com/dotnet/api/system.commandline.completions.completiondelegate) in my command-line application. That returns `IEnumerable` so my completion method needs to call the [CompletionItem constructor](https://docs.microsoft.com/en-us/dotnet/api/system.commandline.completions.completionitem.-ctor#system-commandline-completions-completionitem-ctor(system-string-system-string-system-string-system-string-system-string-system-string)). This constructor takes a `string kind = "Value"` parameter but it is not clear how to decide whether the default value "Value" is correct or the caller should pass in something else. The documentation of this parameter is just "The kind of completion item." and the documentation of the [CompletionItem.Kind](https://docs.microsoft.com/en-us/dotnet/api/system.commandline.completions.completionitem.kind) property is the same.

From the source code, I found the internal class [CompletionItemKind](https://github.com/dotnet/command-line-api/blob/209b724a3c843253d3071e8348c353b297b0b8b5/src/System.CommandLine/Completions/CompletionItemKind.cs), which defines "Keyword" and "Value". However, that does not document their meanings either and instead references , and that page no longer exists.

Please expand the documentation of the parameter and the property to list the completion item kinds that have been defined, or to point to other documentation that provides this information.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.