fix: prioritize @ file search over slash command completion#2519
Open
Br1an67 wants to merge 1 commit intoQwenLM:mainfrom
Open
fix: prioritize @ file search over slash command completion#2519Br1an67 wants to merge 1 commit intoQwenLM:mainfrom
Br1an67 wants to merge 1 commit intoQwenLM:mainfrom
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
Collaborator
|
@Br1an67 Thanks for your contributions to Qwen Code! But we are really appreciate if you can take time to do manual testing before submitting PR, I mean it is kind of the bottleneck work of current "Vibe Coding" world. A screenshot after fix would be very great. We will take it as a proof of work to guide us to allocate resources for the PR review. |
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 #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