← Back to context

Comment by Xmd5a

1 month ago

I tried aider and had problems having it update code in existing files. Aider uses a search and replace pattern to update existing code. So you often end up with

    >>>SEARCH
        }
    >>>REPLACE
        }, {'more': 'data'}

Of course aider will try to apply this kind of patch even when the search pattern matches several occurrences in the target file. Looking at the Github issues, this is a problem that was brought up several times and was never fixed because apparently it's not even problematic. I moved to cursor, which doesn't have this problem, and never looked back.

For what it's worth, gptme will refuse non-unique matches (and ask the LLM to try again). I thought Aider did too (easy win after all), but apparently not.

  • For me this happened at the end of functions in vanilla JS; I used to work around it by putting "// end of foo()" comments after the closing brace. However, Aider has multiple modes for LLM editing, including diff, udiff, and whole file; you can switch between those when needed.