Working with Cody on a bug fix (Cody 7.75.0-nighly, GoLand 2024.3.4) and there’s a bit of a stutter. Cody doesn’t seem to recognized updated code when highlighted; I have to add the entire file to the follow-up prompts.
Start a new chat to fix a bug.
@options.go @repo @current selection
The function needs to verify that the prefix contains only valid characters. It has a bug and returns an error if the prefix contains any valid character.
Cody analyzes and suggests a fix. I don’t apply, I copy the bit that was changed and paste it in (that’s me providing value to the process (and the apply process scares me because of past experience)).
I select the function that was changed and ask a follow-up.
@current selection @cerr.go
The function has been updated and new error types created. Does the function work correctly now?
Response is that Cody can’t see the updated code, which is the current selection.
Let me review what I know about the code and the issue:
1. We identified a bug in ...
Now we're looking at cerr.go, which defines error constants ...
However, I haven't been shown an updated version of ...
Based only on the information provided, I can't determine if the function has been fixed to work correctly now.
Without seeing the updated code, I can't verify if the core logic issue has been fixed.
I respond with @config.go @cerr.go
. This time Cody does the right thing.
-- Thought Process
You're right - I should review the updated code I was given in the previous message. Let me analyze what I have:
This is consistent with Cody. It doesn’t recognize that the current selection is in one of the prompted files, so I have to add the file again. Not a major issue, just a bit of friction.
I know I shouldn’t ask multiple questions, but would using the Apply button help here? I avoid that button if I have a lot of work in progress because I have a mortal fear that it’ll change something somewhere that I don’t catch.