not sure if this is a calva problem. I am using windsurf on windows, whenever Cascade modifies the file. there will be some red marker, and paredit features like expand selection will highlight the wrong position. it will fix after restarting windsurf, close file and open again won't fix. any pointer how to debug this problem?
Ouch! What is Windsurf?
an ai editor like cursor, also based on vscode
Thanks. And what is Cascade?
Cascade is the name of the agent in Windsurf? it can read and modify file on user's behalf
only windows has this problem, wsl also works fine.
Only Windows, huh? Then I have a theory. Line ending mismatch. If the file has Unix lin endings and then Cascade is inserting Windows line endings (or vice versa), the characters in the file will be offset by one for each line. This will throw Calva’s structural editor out of whack. There may be an issue on Windsurf about line endings. Or there may be settings for it. VS Code can update line endings for the file too, and it also has some settings for it, so it may be able to control from there. In any case, Calva will not work well in a file where the line endings are not consistent with the OS, and certainly not if there are inconsistencies within the file.
I am using Windsurf on OSX with Calva and haven’t noticed this problem. PS. It was really cool to be able to try Cursor and Windsurf and take Calva with me!
I use dos2unix to convert linebreaks to LF before letting AI modify the file, and there are no more errors.
I guess it is because of the linebreak. I have switch to wsl
Cool. Thanks for reporting, and for updating back. 🙏