Add /find, /search and /regex to add files by symbol, exact match and regex #3747
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.
I've often found myself wanting to add 'the file that has the
handle_act
function in it' or something similar.The new
/context
command is powerful but slow, so I'm proposing commands here, which adds a files:/find
: by symbol using the repo map, instead of by path (useful to find all mentions of symbolhandle_act
)/search
: by exact string match (useful to finddef handle_act
to narrow to just the definition of a function)/regex
by regex string match (useful for e.g.def handle_.*
)A fairly obvious oversight here to me is the names, because it'd probably be good to have an accompanying read-only version of the commands (and
/find-read
doesn't seem quite right). They're not called/add-*
so as to not be annoying to autocomplete.That said, this works beautifully and I'm using it right now, complete with auto-completion of all symbols for
/find
and great performance.This is fully AI-written (Claude Code) although I've reviewed it and ensured that it passes lints and has appropriate tests. I believe that I've read and considered the contributing guidelines. Would love your thoughts (or in case I've missed something like this already in aider!)