-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Fix completion command to exclude plugin-prefixed aliases #19094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix completion command to exclude plugin-prefixed aliases #19094
Conversation
Plugin-prefixed aliases are now excluded by default to avoid duplicate completions. Use verbose mode (-v) to include all aliases. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
a0179a1 to
03af26e
Compare
| // Plugin-prefixed aliases should not be in the output | ||
| // as they are duplicates of the short form |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not always true though. If multiple plugins have the same command, only the names containing . will work consistently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see.
But we could detect the true duplicates at least couldnt we?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we could compare the values and find duplicates.
|
What changed:
|
|
Note sure if this is correct, though, it outputs again a bit more than I would like: before:
after:
it correctly filters "migrations.migrations", but all those extra bake ones dont seem necessary either IMO. |
| 'test_plugin.example', | ||
| 'test_plugin.sample', | ||
| 'test_plugin_two.example', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now there isn't any example command in the completion list. Should example be added here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, fixed that up.
5f9a936 to
eac0677
Compare
Summary
The
completion commandsmode was outputting both short names and plugin-prefixed aliases (e.g., bothmigrationsandmigrations.migrations), causing duplicate suggestions in shell autocompletion.This change filters out plugin-prefixed command names (those containing
.) from the commands output, showing only the primary short form.Before:
After:
The
subcommandsandoptionsmodes still support plugin-prefixed names for backward compatibility when explicitly used.Changes
getCommands()to skip command names containing.testCommandsExcludesPluginAliases()to verify the fixThis is a critical fix needed to get CLI autocomplete to work properly:
//EDIT
I changed it so in verbose mode it retains current behavior if really needed (even though doubtful).