I really like the Cody edit function: select the whole content in a file and submit a request for a refactor then it will do the magic. But sometimes we need to refactor across multiple files, how can I select multiple files and submit a refactor request, then let Cody change the code simultaneously across various files?
Hey @shallker great question. Right now, it isnât possible but I will make sure the product team sees this in the weekly community feedback report.
What other features are you enjoying? How can they be better?
I would really love to see this feature. in my opinion itâs so critical - i really donât know how it wasnât done yet. itâs so simple to implement, yet i think itâs a real game changer.
imagine just telling cody:
add a ajax form to this page, and cody would add some css to the css file, some html / php / jsx to the current file, and some ajax related functions to another file in one go⌠isnât it a life changer?
Also - it would be great to be able to tell cody to edit a file from the chat. so for example i ask cody:
how would i make this function more secure and cody answers, and i ask him, but maybe this way? and he answers, and then i tell him:
great. do that.
A life changer in my opinion.
This would be awesome addition, for example like Cursor composer and Claud Dev.
Hello @benadam This functionality is now available as âSmart Applyâ feature from the Cody Chat where you can apply code blocks to multiple files in a sequentially way manually controlled by the user.
You can read more here.
Thanks @PriNova,
This is really exciting. I tried it today.
I did stumble across two problems:
- A lot of time it doesnât get the code in the right place in the file. just drops it in the end.
- It is never putting the code in the file it says the code should be written in, unless it is the current file.
Btw - for me at least, it also works very very slow.
You are welcome.
Yes, I observed it sometimes too, but hard to pin point it.
- My observations is so far, that if it is a entire function, it is placed at the end of the file (not always). Not bad if the language support out-of-order function definitions.
- If it is a new file, it works for me, if it is a change in a file, which is not opened in a tab it sometimes fails, but w/o observable pattern
The slowness is known and they are working on it.
Thanks for reporting.
Related to this, I have simply seen VSCodeâs Cody integration stop making multiple edits. It was working for awhile, and not isnât making any changes without a specific single file context, even as it tells me again and again that it is doing so.
Thereâs a weird bug where in conversations it randomly stops being able to see the code, yet insists that it can see it, yet no longer can make any edits, or reverts to older version of the code. Is your comment similar?
It will agree âYes, Iâll do Xâ, âOK do it nowâ, âOK, Iâll do nowâ, etc. in each subsequent comment but never actually outputs any code changes anymore.
This happens especially in long lasting conversation. My suggestion is to start a new chat and continue where you left off from the old one.
I donât see editing across multiple files feature working.
This feature is called âSmart Applyâ and needs to be triggered manually, which is much more reliable because of pre-evaluating if the changes are aligned with the task at hand.