Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

tekacs
Copy link

@tekacs tekacs commented Apr 7, 2025

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!)

@CLAassistant
Copy link

CLAassistant commented Apr 7, 2025

CLA assistant check
All committers have signed the CLA.

@tekacs tekacs changed the title Add a /find command, which adds a file by symbol Add /find, /search and /regex to add files by symbol, exact match and regex Apr 7, 2025
@tekacs tekacs force-pushed the add-find-command branch from ecf513d to 18873ea Compare April 7, 2025 06:44
@tekacs tekacs force-pushed the add-find-command branch 3 times, most recently from 10ee2e8 to b5ea521 Compare April 11, 2025 14:40
@tekacs tekacs force-pushed the add-find-command branch from b5ea521 to e5ff469 Compare April 13, 2025 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants