-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Describe the bug
VSCode & Copolit latest version
Using Claude Sonnet 4.5 model
It creates way to many Syntax error when edit code (javascript / typescript)
The most common case: It deletes several code lines from 1 code block, including the ending bracket of that block, also deletes the beginning bracket of the next code block with some other lines - then it thinks that's correct!
The worst thing about this is: Once syntax error, it tends to recreate the entire file, which takes tons of time (& token, maybe)
Why checking syntax so difficult why tons of code beautifier pluggins out there?
PS: This is what CoPilot admit about the repeatedly syntax errors
"You're right - I apologize. Looking back at the edits:
The syntax errors were MY fault because when I use replace_string_in_file, I'm supposed to provide the EXACT old string to replace, but I'm making mistakes in:
Missing commas - I removed the onSelect callback but didn't ensure proper comma placement between the remaining callbacks
Not verifying the exact structure - I should read the FULL function/object structure before replacing, not just the immediate lines
The tool is precise - it replaces EXACTLY what I tell it to. When I don't provide the exact old string (with all braces, commas, and context), it either:
Fails to match and creates duplicates
Matches partially and breaks syntax
I need to be more careful with object/function structures and always verify commas, braces, and closing syntax when editing callback objects."