continuedev / contribution-ideas

A Repo to which to Attach Contribution Ideas
2 stars 0 forks source link

/refactor Slash Command #19

Open sestinj opened 10 months ago

sestinj commented 10 months ago

For situations where you are looking to find all occurrences of some pattern, or usages of a function, etc... and you need to edit all of them, but it is slightly more complicated that find and replace.

The /refactor slash command would:

  1. Find all occurrences of a pattern in the codebase, either by using ripgrep, or semantic search, or other
  2. Write a prompt for each of these and pass each to the LLM in parallel
  3. Once all edits are done, parse them so that the edit can be applied to the file
  4. Apply them to each of the files. One way of doing this is with sdk.ide.showDiff, but we might also consider a better refactoring UI here.

If you're interested in working on this, feel free to reach out and ask questions first