Hi, I’m trying out Cody in Visual Studio. So far it’s been helpful but one of the biggest frustrations and frictions is that I always have to cut an paste the changes into my code. And if I make a change to the code file, Cody doesn’t see the changes.
I have tried the insert code at cursor, but I can’t seem to get that feature to work, and it’s only slightly better than cut and paste.
I realize the Visual Studio implementation is still experimental, and I’m so far still just exploring on the free plan. But is pushing updates back to the file and file change awareness something that comes with pro?
Hey @blairtj
When you start a conversation in Cody and add a file as context and make changes to that file during the chat session, Cody will not see those changes by design. This would be a destructive action.
Cody can only infer the changes during the chat session from the suggested changes from the messages in that session.
If you want that Cody sees those changes, you can:
Start a new chat session
Explicitly instruct to build up on those suggested changes based on the ongoing chat messages
Thanks PriNova. Yes, this was the behaviour I observed. I could continue to iterate changes in the file in chat. And it is absolutely necessary to not change code without user control so that makes perfect sense.
The problem for me is the workflow from each Cody iteration to the source file. At various points in the conversation I need to try compiling the code. And sometimes you have to make adjustments to actual file to get it to compile or just fix something you see. But want to consider iterating.
Cody sometimes shows changes to the whole file and sometimes just to a class or method. It’s obviously keeping the state of the file in the conversation, I need to apply the changes I see to the file. This requires figuring out what part of the file I see in the Cody window and copy that, then identify the same part in the actual file and paste over that. And if I just select a block I think changed I may miss another corresponding change in the file.
Two things I think would better leverage running in the IDE would be being able to push changes to the file from the conversation and to refresh the files in the conversation. I did start a new conversation but it makes back and forth iterations very disjoint.
My reference here is working with Canvas in ChatGPT which I realize is relatively new and not integrated in the IDE, but I can copy/paste the whole file and replace it in the IDE compile it. If I make any changes in the IDE to get it to compile, I can just paste the IDE copy over the canvas copy and continue my conversation.
Of course it’s not in the IDE so I still have to copy paste but at least I don’t have worry about what part of the file I’m copying as I just copy the whole thing. That was the experience I was looking for from something running in the IDE, a smoother back and between chat drafts and the live file.
As well as having the project as context which Cody does make easier for sure as I can just select files rather than having to copy over what I need. I’m still exploring how that works in Cody.