Skip to content

Respect custom sort text for option completions - #2858

Open
zjdangge wants to merge 1 commit into
dotnet:mainfrom
zjdangge:fix/option-completion-sort-text
Open

zjdangge wants to merge 1 commit into
dotnet:mainfrom
zjdangge:fix/option-completion-sort-text

Conversation

@zjdangge

Copy link
Copy Markdown

Option completions currently discard custom CompletionItem.SortText ordering. For example, help displays 10|20|30|5|6 even when sort keys specify numeric order.

Order matches by their position in the displayed label, then by SortText. This preserves prefix-first matching and the existing label fallback when no custom sort text is provided. Tests cover help output, custom ordering, partial input, and the default ordering.

Fixes #2705.

Validation on Windows:

  • Before the fix, all three new regression cases fail; the completion/help group has 162 passed, 3 failed, and 2 existing skips.
  • Debug solution build: 0 warnings and 0 errors.
  • All five Debug test assemblies: 1,949 passed, 0 failed, 14 existing skips, including core tests on .NET 10 and .NET Framework 4.7.2.

Tests used English UI culture and disabled xUnit AppDomains. Built assemblies ran from a path without spaces to avoid existing test/script path-handling issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CompletionSources not sorted properly when building HelpName default suggestions

1 participant