sourcegraph / cody

AI that knows your entire codebase
https://cody.dev
Apache License 2.0
2.24k stars 213 forks source link

Edit: Fix JetBrains issue with range expansion #4673

Closed umpox closed 1 week ago

umpox commented 1 week ago

Description

Uses document.lineAt to get the end of a line, rather than Number.MAX_SAFE_INTEGER.

Test plan

  1. Create edits in JetBrains
  2. Undo them
  3. Check the undo functions correctly (only original code is returned)
umpox commented 1 week ago

@pkukielka @mkondratek This should fix the issues with inline edit + undo in JetBrains. It seems we have another issue with Number.MAX_SAFE_INTEGER somewhere.

I'm happy to merge this as we already have access to the document here, and it is technically more correct. But just wanted to make you aware that this could be a problem in future if we change it for whatever reason

mkondratek commented 1 week ago

I tested these changes in a dev run - works 🟢 I update cody commit and CI passed 🟢