agent_ui: Trigger @-mention menu after opening brackets#55504
Merged
Conversation
Typing `@` immediately after `(`, `[`, or `{` did not open the agent
panel's @-mention completion menu, so `(@file)`, `[@file]`, and
`{@file}` were unusable.
The comment in `MentionCompletion::try_parse` claimed the parser
required a "word boundary before `@`", but the implementation only
treated whitespace (and start-of-line) as a boundary - any
non-whitespace character disqualified the `@`. A real `\b`-style word
boundary would have treated brackets as boundaries (since they are
not word characters), so the user-visible behavior should have matched
the comment all along.
The minimal `\b`-style fix - treating any non-word char as a boundary -
would have regressed `@fetch` URL parsing. URLs frequently contain
`/@`, and treating `/` as a boundary makes the inner `@` (e.g. `@org`
in `https://example.com/@org/@repo/file`) win over the leading
`@fetch`, breaking existing tests.
Instead, allow exactly the three opening brackets the user reported,
alongside whitespace. Closing `)`, `]`, `}` are deliberately not
boundaries; they almost always follow a word in prose, and the existing
`test@` / `Lorem@symbol` negatives already cover that path.
The new tests cover one positive case per arm of
`matches!(c, '(' | '[' | '{')`, so the suite shrinks to zero if the fix
is reverted.
bennetbo
approved these changes
May 19, 2026
TomPlanche
pushed a commit
to TomPlanche/zed
that referenced
this pull request
May 20, 2026
…es#55504) Typing `@` immediately after `(`, `[`, or `{` did not open the Agent Panel’s @-mention completion menu, so `(@file)`, `[@file]`, and `{@file}` were unusable. This has been bothering me for quite some time now. Overall, I believe this is a QoL improvement, albeit a small one. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [ ] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [ ] Performance impact has been considered and is acceptable Release Notes: - Fixed the Agent Panel’s @-mention menu not appearing when `@` immediately follows `(`, `[`, or `{`. --------- Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
This was referenced May 27, 2026
TomPlanche
pushed a commit
to TomPlanche/zed
that referenced
this pull request
Jun 2, 2026
…es#55504) Typing `@` immediately after `(`, `[`, or `{` did not open the Agent Panel’s @-mention completion menu, so `(@file)`, `[@file]`, and `{@file}` were unusable. This has been bothering me for quite some time now. Overall, I believe this is a QoL improvement, albeit a small one. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [ ] Unsafe blocks (if any) have justifying comments - [ ] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [ ] Performance impact has been considered and is acceptable Release Notes: - Fixed the Agent Panel’s @-mention menu not appearing when `@` immediately follows `(`, `[`, or `{`. --------- Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
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.
Typing
@immediately after(,[, or{did not open the Agent Panel’s @-mention completion menu, so(@file),[@file], and{@file}were unusable. This has been bothering me for quite some time now. Overall, I believe this is a QoL improvement, albeit a small one.Self-Review Checklist:
Release Notes:
@immediately follows(,[, or{.