Repository navigation
fix: sub command names missing from tab completion and in random order - #212
Open
DragonL0508 wants to merge 1 commit into
Open
DragonL0508 wants to merge 1 commit into
DragonL0508 wants to merge 1 commit into
Conversation
completeArguments only added the sub command names when no command matched at all. Two common cases therefore never suggested them: - a no-arg command (@command("#")) exists: it is matched whenever no sub command name is, so typing "/shop se" suggested nothing instead of "sell" and "sellall"; - one name is a prefix of another: "/shop sell" matches "sell", so "sellall" was never suggested. The names are now always merged into the argument completions (getCommandsForCompletion only returns names that start with what has been typed, so nothing changes once a sub command's arguments are being typed), without duplicates. They were also collected in a HashSet, so their order changed between calls; they are now sorted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
completeArgumentsonly added the sub command names when no command matched at all. Two common cases never suggested them:@Command("#")), it is matched whenever no name is, so typing/shop sesuggested nothing instead ofsellandsellall;/shop sellmatchessell, sosellallwas never suggested.The names are now always merged into the argument completions, without duplicates.
getCommandsForCompletiononly returns names that start with what has been typed, so nothing changes once a sub command's arguments are being typed. The names were also collected in aHashSet, so their order changed between calls; they are now sorted.Tests:
SubCommandCompletionTest. It adds the sameCoreTestingHandletest helper as #211 (identical files, so the two PRs merge cleanly in either order).🤖 Generated with Claude Code