-
Notifications
You must be signed in to change notification settings - Fork 731
Description
Problem
The composer @<file> autocomplete is unreliable when the mention is started in the middle of an existing prompt that already has text after the cursor.
In practice, this makes prompt editing awkward because the file/dir autocomplete UI often only appears or behaves correctly when the @ mention is effectively at the end of the input. Users may need to delete the text after the cursor, insert the file mention, and then retype the deleted text.
Repro
- Type a normal prompt with text both before and after the cursor.
- Move the cursor into the middle of that prompt.
- Type
@and start searching for a file or directory. - Observe that the autocomplete UI does not reliably appear or function correctly unless trailing text is removed first.
Example shape:
Please inspect @ in this sentence and summarize the result for me later.
Move the cursor after inspect and try to insert a file mention without deleting in this sentence and summarize the result for me later.
Expected
- File/dir autocomplete should work regardless of whether there is trailing text after the cursor
- Users should be able to insert an
@filemention in the middle of a prompt without deleting surrounding text - Selection should preserve the surrounding prompt text and place the caret in the expected position afterward
Actual
- Mid-prompt
@filecompletion is unreliable when text exists after the cursor - Editing a prompt to add file references becomes cumbersome because users may need to delete and retype trailing text
Notes
This appears related to existing composer mention/cursor handling issues, including #291, but this issue specifically tracks the inability to reliably use file mention autocomplete in the middle of an existing prompt with trailing text still present.