Improve composer completion target resolution (#32628)

## What changed

- Resolve `@` and `$` completion targets on either side of the cursor while treating atomic text elements and line breaks as boundaries.
- Prefer the nearest editable mention when file, skill, and plugin candidates compete, and avoid treating common uppercase environment variables as skill queries.
- Insert a separator before completions adjacent to atomic elements and keep dismissed popup state scoped to the matching editable token occurrence.

## Testing

- Add unit and snapshot coverage for adjacent and partially bound mentions, whitespace boundaries, shell variables, popup dismissal, and file, image, skill, and plugin insertion.

GitOrigin-RevId: 352a42c7bcdbf4f6cd35368ced25f71926fdbc1b
This commit is contained in:
Charlie Marsh authored and copyberry committed 2026-07-12 19:18:37 +00:00
1 parent 9e552e9d15
commit c888e8e75a
13 files changed
+1273 -196

No files matched your search

+1 -1
View File
@@ -251,7 +251,7 @@ fn is_mention_name_char_char(ch: char) -> bool {
ch.is_ascii_alphanumeric() || matches!(ch, '_' | '-')
}
fn is_common_env_var(name: &str) -> bool {
pub(crate) fn is_common_env_var(name: &str) -> bool {
let upper = name.to_ascii_uppercase();
matches!(
upper.as_str(),