cline icon indicating copy to clipboard operation
cline copied to clipboard

Diff view completely broken and "revert selection" button is non-functional

Open AstroMined opened this issue 1 year ago • 2 comments

Which API Provider are you using?

Anthropic

Which Model are you using?

Claude 3.5 Sonnet

What happened?

EDIT Version 2: I have confirmed this is a problem with VS Code itself and not Claude-Dev. I reverted to VS Code 1.92.1 and the "Revert Selection" option is working as expected. Hopefully others will see this before banging their heads against this issue like I did.

Edit to add: I have seen the Wiki about this, but with the "Revert selection" button becoming non-functional, that article is largely irrelevant. I don't know if that's strictly a VS Code feature or something implemented in Claude Dev. I've seen this occasionally on prior versions, but at version 1.9.7 the extension has become unusable.

Almost every change that Claude makes causes the diff editor to pause for about 10 seconds after it loads, then almost all of the original script will disappear, marked by red in the diff view: image

Sometimes I don't even get the placeholder text, it just flat out deletes hundreds of lines of code: image

Also, the "Revert Selection" button is completely non-functional. The single button that shows up doesn't do anything when you click it, and I can't get it to show at all in the sections where there's actually a diff. This causes me to have to manually copy/paste in the lines that should still be there, which can be extremely tedious if there are a lot of legitimate changes that Claude wants to make. Even then, Claude no longer knows the actual content of the file and I find myself demanding Claude to read the file in again because it's clear he's not operating on the proper context.

OS: Ubuntu 22.04.5 LTS (Jammy Jellyfish) VS Code: 1.93.1 (Latest release)

If there's anything I can do to help troubleshoot the issue, please let me know. I absolutely love this project despite the frustrations and I'm perfectly willing to help in any way I can. I'm not great with Typescript (or anything other than Python), but I'll give it a shot if you can point me where to look in the codebase.

Steps to reproduce

  1. Ask Claude to make changes on a large file (seems to only happen on files larger than ~ 250 lines or so)
  2. Have Claude Dev save the initial changes
  3. After the initial change, Claude won't want to return the full output if you make subsequent changes, it only seems to return parts that changed
  4. View the diff editor to see results like above

Relevant API REQUEST output

No response

Additional context

No response

AstroMined avatar Sep 30 '24 02:09 AstroMined

I think I've convinced myself this isn't a Claude Dev problem, but rather a problem in VS Code itself. I've noticed I can't even revert changes in the standard VS Code Timeline, so it seems likely to be a global problem.

I'm going to try reverting VS Code to a previous version and see if the issue gets resolved.

EDIT: Confirmed VS Code issue. I reverted to VS Code 1.92.1 and the DiffEditor is fully functional again.

AstroMined avatar Sep 30 '24 08:09 AstroMined

Getting this very often on my prompts, since claude is outputting those comments verbatim, the claude-dev extension is taking it as if it should be the entire file... if you ignore the edit and say "please include the full code instead of the commented abridged version" it will output the full file at which point the diff works properly.

image

I think something is required at the prompt level OR at the extension itself to parse the "// (... leave this part unmodified)" and actually convert that into a diff command. If you preface the request with "do not comment out sections for brevity" it will return the full file, but this feels wasteful for output tokens.

image

as an aside, if you accepted the edit and want to revert, you can ask it to revert and it suually does.)

abale avatar Sep 30 '24 22:09 abale

@AstroMined thank you so much for looking into this and confirming its a vscode issue, it's worth creating an issue on their repo about this.

saoudrizwan avatar Oct 11 '24 02:10 saoudrizwan