Skip to content

feat(adds-on): add warning messages for shell completion injection failures#28

Merged
benbenbang merged 1 commit into
mainfrom
fix/adds_on
Mar 28, 2026
Merged

feat(adds-on): add warning messages for shell completion injection failures#28
benbenbang merged 1 commit into
mainfrom
fix/adds_on

Conversation

@benbenbang

Copy link
Copy Markdown
Owner

This pull request enhances the shell completion injection logic by adding safety checks and user-facing warnings when injection points are not found. The changes improve robustness and debuggability when the underlying completion format changes.

Shell completion injection improvements:

  • Added validation checks in inject_bash() to detect when the bash completion injection point is not found, with a warning message to inform users that plugin completions were skipped
  • Enhanced inject_zsh() with similar validation to detect missing zsh completion injection points and warn users accordingly
  • Updated inject_zsh_dispatch() to validate dispatch injection points for each plugin and emit warnings when injection fails for specific plugins
  • Improved inject_nushell() to check injection success for each plugin individually and warn when nushell completion injection points are not found

Code quality improvements:

  • Extracted repeated string literals into needle variables for better readability and maintainability across all injection functions
  • Restructured replacement logic to compare results before and after injection, enabling detection of failed injections

…ilures

This pull request enhances the shell completion injection logic by adding safety checks and user-facing warnings when injection points are not found. The changes improve robustness and debuggability when the underlying completion format changes.

**Shell completion injection improvements:**
* Added validation checks in `inject_bash()` to detect when the bash completion injection point is not found, with a warning message to inform users that plugin completions were skipped
* Enhanced `inject_zsh()` with similar validation to detect missing zsh completion injection points and warn users accordingly
* Updated `inject_zsh_dispatch()` to validate dispatch injection points for each plugin and emit warnings when injection fails for specific plugins
* Improved `inject_nushell()` to check injection success for each plugin individually and warn when nushell completion injection points are not found

**Code quality improvements:**
* Extracted repeated string literals into `needle` variables for better readability and maintainability across all injection functions
* Restructured replacement logic to compare results before and after injection, enabling detection of failed injections
@benbenbang
benbenbang enabled auto-merge (squash) March 28, 2026 10:44
@github-actions github-actions Bot added enhancement New feature or request triage labels Mar 28, 2026
@benbenbang
benbenbang merged commit dbd3b6b into main Mar 28, 2026
2 checks passed
@benbenbang
benbenbang deleted the fix/adds_on branch March 28, 2026 10:44
@ptah-technical-app

Copy link
Copy Markdown

🎉 This PR is included in version 2.6.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request released triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant