continue icon indicating copy to clipboard operation
continue copied to clipboard

When using /edit in IntelliJ on Mac, original first line is preserved even if it was changed.

Open caseygum opened this issue 1 year ago • 0 comments

Before submitting your bug report

Relevant environment info

- OS: Apple M1 Max - Sonoma 14.3.1
- Continue: 0.0.34
- IDE: IntelliJ - 2023.3.4

Description

When using the /edit command, the code generated in the Diff window doesn't seem to diff against the original selection, often leaving the original first line followed by the changed first line in the code after you accept the change. It looks like it may have an off-by-one problem where it's leaving the first line that it should be replacing, but deleting the line after the end of the selection.

image image image image

To reproduce

  1. Run: cp ~/.continue/continue_tutorial.py . && idea ./continue_tutorial.py
  2. Select the entirety of mysterious_function (lines 23-29 - I'm using IdeaVIM, so Shift+V, J to block select lines)
  3. Cmd+J
  4. /edit rename this function to something more appropriate
  5. Accept changes

Expected result:

...
"""Step 1: Highlight the function below"""


def bubble_sort(x):
    for i in range(len(x)):
        for j in range(len(x) - 1):
            if x[j] > x[j + 1]:
                x[j], x[j + 1] = x[j + 1], x[j]

    return x


"""Step 2: Use the keyboard shortcut [⌘ J] to
select the code and toggle the Continue input box"""

Actual result

"""Step 1: Highlight the function below"""


def mysterious_function(x):
def bubble_sort(x):
    for i in range(len(x)):
        for j in range(len(x) - 1):
            if x[j] > x[j + 1]:
                x[j], x[j + 1] = x[j + 1], x[j]

    return x
XXX (one extra line was deleted here)
"""Step 2: Use the keyboard shortcut [⌘ J] to
select the code and toggle the Continue input box"""

Log output

don't have them.

caseygum avatar Mar 08 '24 21:03 caseygum