fix: prioritize @ file search over slash command completion#62
Open
BingqingLyu wants to merge 1 commit into
Open
fix: prioritize @ file search over slash command completion#62BingqingLyu wants to merge 1 commit into
BingqingLyu wants to merge 1 commit into
Conversation
When typing @ after a custom slash command on the same line (e.g., `/qc:create-issue @readme`), the @ file search feature was not triggered because the slash command check ran first and returned SLASH mode for the entire line. Reorder the completion mode detection to check for @ file references before slash commands. This ensures file search works correctly when @ appears after a slash command, while preserving all existing slash command and @ completion behaviors. Fixes QwenLM#2518
This was referenced Apr 28, 2026
Owner
Author
Conflict Group 1This PR shares modified functions with 2 other PR(s): #74, #9. These PRs should be reviewed as a batch — merging one may affect the others.
graph LR
PR62["PR #62"]
FuseCommandCompletion_8197["useCommandCompletion<br>useCommandCompletion.tsx"]
PR62 -->|modifies| FuseCommandCompletion_8197
PR74["PR #74"]
PR74 -->|modifies| FuseCommandCompletion_8197
PR9["PR #9"]
PR9 -->|modifies| FuseCommandCompletion_8197
Posted by codegraph-ai conflict detection. |
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.
TLDR
Fix
@file search not working after selecting a custom slash command on the same line.Fixes QwenLM#2518
Dive Deeper
Root Cause
In
useCommandCompletion, the completion mode detection checks for slash commands before checking for@file references:Since
isSlashCommand()returnstruefor any line starting with/(excluding//and/*), typing@after a completed slash command like/qc:create-issue @readmestill matches the slash command check first, and the@file search code is never executed.Fix
Reorder the completion mode detection to check for
@file references before slash commands. When the cursor is positioned after an@character (within the current word boundary),ATmode takes priority. If no@is found, the slash command check runs as before.This preserves all existing behaviors:
/help→ SLASH mode (no@in text) ✓/model qwen3→ SLASH mode (no@in text) ✓/qc:create-issue @readme→ AT mode (@found before cursor) ✓@file→ AT mode (no change) ✓plain text→ IDLE mode (no change) ✓Testing Matrix
useCommandCompletion.test.ts)@after slash command triggers AT completion