Batch operations (rewrites) on multiple files

I’d like to request a feature that allows batch operations or automated rewrites across multiple files,

Current Limitations:

Currently, applying changes or generating content across multiple files requires adding each file individually to the context. This process is cumbersome, especially for large codebases.

Desired Functionality:

Enable a way to specify groups of files dynamically, such as:

  • All open files (e.g. @openFiles)
  • All files matching search results (e.g. @searchResults)
  • All files with unstaged changes in the git workspace (e.g. @gitUnstagedFiles)

Examples:

  1. Renaming Call Sites:
    I might update a custom hook property and want all call sites across the codebase to be rewritten. The default refactor tool would make the callsites look like:

    const { newPropName: oldPropName } = myCustomHook();
    // rest of the code using `oldPropName`
    

    I’d like to simplify this to:

    const { newPropName } = myCustomHook();
    // rest of the code using `newPropName`
    

    …across all affected files.

  2. Generating Documentation:
    Suppose I want to generate official documentation for all components under src/components. Instead of manually adding each file, I could open all files in that directory, and use a command like @openFiles to include all relevant files in my prompt, enabling automated doc generation for each component.

This functionality would greatly enhance productivity by allowing automated operations on multiple files simultaneously, without the need for manual file selection.

Thank you!
Laurens.

1 Like