Apply Changes - Wrong File

When using the apply changes feature, Cursor suggests the wrong file to apply changes to.

For example:
I have a file: test.js
I have a seperate file test.js-meta.xml

When attempting to make changes to test.js, cursor will apply the changes to test.js-meta.xml

3 Likes

Hi @seanfdc

Thank you for sharing the information. We’ll try to figure this out.

meanwhile you can also specify to use exact file name in your prompt.

I am dealing with the same problem and think I can add some information.

For me, this problem allways occurs when I open files that dont belong to the current workspace.

In that case. Composer and Chat provide two options, both with the same path E.g. /path/to/foreign/file. However one will grab the correct (global) path, and the other will simply create a new file in the opened workspace. E.g. workspace/path/to/foreign/file

This is really annoying since this can not be undone! If I reject the file and re-apply the changes, it will still apply them to the wrong directory, with no option to change the directory. The only way to bypass this is to generate new changes through prompting, and then hoping cursor grabs the correct path that time.

Workspace support is not yet available in Cursor, as our codebase indexing relies heavily on everything being in the same folder, but I’m hoping we can add workspace support in a future release so this kind of workflow works!

Still apply to wrong file.

It want to apply change to index.html, but can only apply to main.go.

Still a problem:

i.e. I have files A.txt, B.txt, C.txt in the weird box that I can not remove files from. File D.txt is added to context. In file E.txt I select code and press CMD+I, I see E.txt(50-60) added to context. I ask to change a line of code expecting it to change file E.txt. Cursor completes the request and suggest a change in B.txt. Hheee?