aider icon indicating copy to clipboard operation
aider copied to clipboard

Add /find, /search and /regex to add files by symbol, exact match and regex

Open tekacs opened this issue 1 year ago • 1 comments

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 symbol handle_act)
  • /search: by exact string match (useful to find def 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!)

tekacs avatar Apr 07 '25 05:04 tekacs

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Apr 07 '25 05:04 CLAassistant