opencode icon indicating copy to clipboard operation
opencode copied to clipboard

[FEATURE]: `@file` should allow the opened list to be sorted automatically based on the currently active document

Open jackdov9 opened this issue 1 month ago • 4 comments

Feature hasn't been suggested before.

  • [ ] I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

The list of files opened by the current @file function seems to be sorted in the default order. It would be better if the list could be sorted based on the active document that is currently open, just like other CLI agent tools do. Thanks!

jackdov9 avatar Dec 17 '25 03:12 jackdov9

This issue might be a duplicate of existing issues. Please check:

  • #2401: File suggestion ordering - discusses sorting files in the @file list to prioritize exact matches and improve the selection experience
  • #5567: fuzzysort doesn't prioritize results/matches that start with the user input - discusses improving the sorting algorithm to prioritize matches that start with user input

Feel free to ignore if none of these address your specific case.

github-actions[bot] avatar Dec 17 '25 03:12 github-actions[bot]

as in current file being edited / interacted with? or what u have in ur editor

rekram1-node avatar Dec 17 '25 03:12 rekram1-node

I'm using opencode in vscode and the activated file means the current file I have open. For example, for this file I might need to ask/modify some function, it might be better if in the list opened by @file the file appears at the top of the list, so that I don't have to retrieve the filename to select the file.

jackdov9 avatar Dec 17 '25 05:12 jackdov9

Ah okay yeah that makes more sense, didn't realize u meant the vscode extension

rekram1-node avatar Dec 17 '25 17:12 rekram1-node