Skip to content

Data loss scenario: Large edits exceed undo history #2245

@GregDomzalski

Description

@GregDomzalski

Before submitting your bug report

Relevant environment info

- Continue: 0.0.65
- IDE: JetBrains PHP Storm 2024.2.1

Description

Using the inline edit functionality (CTRL+I), edits are applied line-by-line (or maybe even character by character?). This eats through JetBrain's default undo history. I have now had two separate instances in the last week where the edits applied were not able to be rolled back via CTRL+Z due to the way the model updates are applied to the active file. Even clicking the red "ALT SHIFT N" button in the prompt control does not properly roll back all changes. This results in data loss! If I'm being good, thankfully my commit is likely not that large and I can do a partial rollback on that file. But on one of these occasions, I had already made some refactoring edits that were irrevocably lost due to Continue wiping out my undo history.

I am aware that I can change some of my own behaviors, such as committing more often, not highlighting as much code before using the inline edit, etc. But none of those are acceptable. If I'm to try to use this in my workflow, I may be iterating quickly alongside the assists from Continue. Falling into this trap is far too easy, and data / work loss simple is not acceptable.

To reproduce

  1. Select a medium sized function, say ~50 LoC?
  2. CTRL+I
  3. Prompt: "Add a list of manual test cases for the selected code and place them in a comment above the function signature."

In a few cases, the model will then replace the contents of the function with something like:

{
    // The rest of the function, unmodified.
}

This repro obviously won't be 100% - but it should be easy enough to replicate it by asking it to add inline comments in the function, or to ask it to do some refactoring.

Log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:inline-editRelates to the auto refactor featureide:jetbrainsRelates specifically to JetBrains extensionkind:bugIndicates an unexpected problem or unintended behaviorpriority:highIndicates high prioritystale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions