Skip to content

Match and deduplicate suggestion registrations by full path - #2859

Open
zjdangge wants to merge 1 commit into
dotnet:mainfrom
zjdangge:fix/suggestion-registration-matching
Open

zjdangge wants to merge 1 commit into
dotnet:mainfrom
zjdangge:fix/suggestion-registration-matching

Conversation

@zjdangge

Copy link
Copy Markdown

FileSuggestionRegistration can select a different executable whose path starts with the requested path, and repeated registrations can append duplicate entries. Relative paths also fail lookup because queries use FileInfo.FullName while registration stores the original text.

  • Match the complete executable path and return the first match.
  • Keep case-insensitive matching on Windows and use ordinal matching on other platforms.
  • Store new registrations as full paths and skip entries already registered.

Tests cover duplicate and relative registrations, the register command, prefix collisions in either file order, and platform-specific casing. Existing registration files retain their format and are not rewritten.

Fixes #2749.

Validation on Windows:

  • Before the fix, the file-registration group has 5 passed and 7 failed cases; all 12 pass afterward.
  • Debug solution build: 0 warnings and 0 errors.
  • All five Debug test assemblies: 1,949 passed, 0 failed, 14 existing skips.

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. Non-Windows casing expectations await upstream CI.

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.

dotnet-suggest: Don't duplicate registration entries, don't return false matches, and be more careful about casing

1 participant