Repository navigation
Conversation
Global tool discovery and the list command both called Path.GetFileNameWithoutExtension, so a dotted command such as Example.Tools.StatusMonitor.Console lost a segment each time and was listed as Example.Tools. Only an .exe extension is removed now. Fixes dotnet#2887 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2887
dotnet-suggest listshortened dotted global tool commands:Example.Tools.StatusMonitor.Consolewas listed asExample.Tools, so the PowerShell shim registered its completer for the wrong name.Two places called
Path.GetFileNameWithoutExtension:FileEnumerator.EnumerateFilesWithoutExtension, when discovering the shims under~/.dotnet/tools. On Linux and macOS the shim has no extension, so this removed.Console.SuggestionDispatcher.ShellPrefixesToMatch, when writing thelistoutput, which removed.StatusMonitorfrom the already shortened path. This one also affects Windows, because the global tools registration builds its paths from the names without.exe.Both now use a small
FileEnumerator.GetCommandNamehelper that takes the file name and removes only an.exeextension. Undotted names and Windows.exepaths give the same result as before.Tests (in
dotnet-suggest.Tests):FileEnumeratorTests.EnumerateFilesWithoutExtension_keeps_dotted_names_and_removes_only_exe_extensionSuggestionDispatcherTests.List_command_keeps_dotted_global_tool_names, throughGlobalToolsSuggestionRegistrationBoth fail without the change.
dotnet-suggest.Tests: 32 passed, 3 skipped. I built with the 11.0.100 RC SDK locally (global.json pins a 12.0 alpha I don't have; that change is not part of this PR).The fix and tests were written with Claude Code (AI assistance); I reviewed and ran them.
🤖 Generated with Claude Code