Skip to content

fix(cosh): add auto-completion for /statusline subcommands#408

Merged
samchu-zsl merged 1 commit intoalibaba:mainfrom
samchu-zsl:fix/cosh/406-statusline-autocomplete
Apr 29, 2026
Merged

fix(cosh): add auto-completion for /statusline subcommands#408
samchu-zsl merged 1 commit intoalibaba:mainfrom
samchu-zsl:fix/cosh/406-statusline-autocomplete

Conversation

@samchu-zsl
Copy link
Copy Markdown
Collaborator

Description

Refactored the /statusline command to use the SlashCommand subcommand registration pattern. Previously, /statusline parsed arguments manually with string matching, which meant the auto-completion framework had no awareness of its show and clear subcommands. Now these are registered as proper subCommands, enabling the existing completion engine to suggest them automatically when users type /statusline.

Related Issue

closes #406

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • CI/CD or build changes

Scope

  • cosh (copilot-shell)

Checklist

  • I have read the Contributing Guide
  • My code follows the project's code style
  • I have added tests that prove my fix is effective or that my feature works
  • For cosh: Lint passes, type check passes, and tests pass
  • Lock files are up to date (package-lock.json / Cargo.lock)

Testing

cd src/copilot-shell
npm run build && npm run test && npm run lint && npm run typecheck
# All 178 test files passed (3858 tests), lint clean, typecheck clean

Additional Notes

  • clear subcommand retains off as an altName for backward compatibility
  • Parent action still handles arbitrary command strings (e.g., /statusline echo "hello") for setting the status line command
  • No public API or configuration format changes

@gemini-code-assist
Copy link
Copy Markdown

Important

Installation incomplete: to start using Gemini Code Assist, please ask the organization owner(s) to visit the Gemini Code Assist Admin Console and sign the Terms of Services.

@samchu-zsl
Copy link
Copy Markdown
Collaborator Author

Caution

This PR was generated and submitted by AI.
Please review all changes carefully before merging. Pay special attention to logic correctness, edge cases, and potential side effects.

@samchu-zsl
Copy link
Copy Markdown
Collaborator Author

已手动测试,符合显示子命令的要求
image

@samchu-zsl samchu-zsl marked this pull request as ready for review April 28, 2026 11:07
@samchu-zsl samchu-zsl requested a review from kongche-jbw as a code owner April 28, 2026 11:07
@gemini-code-assist
Copy link
Copy Markdown

Important

Installation incomplete: to start using Gemini Code Assist, please ask the organization owner(s) to visit the Gemini Code Assist Admin Console and sign the Terms of Services.

@github-actions github-actions Bot added the component:cosh src/copilot-shell/ label Apr 28, 2026
Refactor /statusline to register show and clear as SlashCommand
subCommands, enabling the existing auto-completion framework to
suggest them. Add i18n entries for en/zh locales.

Closes alibaba#406
@samchu-zsl samchu-zsl force-pushed the fix/cosh/406-statusline-autocomplete branch from 4719ebc to c05e5f5 Compare April 28, 2026 11:55
Copy link
Copy Markdown
Collaborator

@KaiLongZhou KaiLongZhou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@samchu-zsl samchu-zsl merged commit d2f24a9 into alibaba:main Apr 29, 2026
11 checks passed
@samchu-zsl samchu-zsl deleted the fix/cosh/406-statusline-autocomplete branch April 29, 2026 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:cosh src/copilot-shell/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[cosh] bug: /statusline 的参数应该能自动联想出来

2 participants