continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
19.61k stars 1.71k forks source link

Jetbrains Extension Inline Edits bugged out. Leaves red and green lines in editor. #2602

Closed that-guy-scott closed 2 days ago

that-guy-scott commented 1 month ago

Before submitting your bug report

Relevant environment info

- OS: Windows 11 
- Continue version: 0.0.76 EAP
- IDE version: 2024.2.3 (Ultimate Edition)
- Model: 4o-mini
- config.json:

{
  "models": [
    {
      "title": "GPT4o-mini inline",
      "provider": "openai",
      "model": "gpt-4o-mini",
      "apiKey": "hey-you-dont-get-my-key!",
      "systemMessage": "Please provide the updated code without any additional text or explanations."
    },
    {
      "title": "GPT4o-mini",
      "provider": "openai",
      "model": "gpt-4o-mini",
      "apiKey": "hey-you-dont-get-my-key!"
    },
    {
      "model": "claude-3-5-sonnet-20240620",
      "provider": "anthropic",
      "apiKey": "hey-you-dont-get-my-key!",
      "title": "Claude 3.5 Sonnet"
    }
  ],
  "tabAutocompleteModel": {
    "title": "Codestral",
    "provider": "mistral",
    "model": "codestral-latest",
    "apiKey": ""
  },
  "customCommands": [
    {
      "name": "test",
      "prompt": "{{{ input }}}\n\nWrite a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
      "description": "Write unit tests for highlighted code"
    }
  ],
  "contextProviders": [
    {
      "name": "diff",
      "params": {}
    },
    {
      "name": "folder",
      "params": {}
    },
    {
      "name": "codebase",
      "params": {}
    }
  ],
  "slashCommands": [
    {
      "name": "edit",
      "description": "Edit selected code"
    },
    {
      "name": "comment",
      "description": "Write comments for the selected code"
    },
    {
      "name": "share",
      "description": "Export the current chat session to markdown"
    },
    {
      "name": "commit",
      "description": "Generate a git commit message"
    }
  ]
}


### Description

_I have my keyboard shortcut set to Ctrl+i for inline edits. I also have the Ideavim plugin installed. (0.0.73) seemed to work._ 

If I highlight a chunk of code and hit Ctrl+i for my inline edits, type my prompt and hit enter I get all kinds of strange things happening now. Sometimes it actually works just fine. Most of the time it doesn't. I'm attaching a couple of screen shots. I can't cancel the edit or back out like I used to be able to do if I didn't like the results. I have to click each Alt+n instead of being able to cancel the whole block. I feel this plugin was working for me but after the last few versions it seems busted. 

![2024-10-21 12_52_16-Clipboard](https://github.com/user-attachments/assets/5a8f9d8a-2f79-4f23-8566-e9d918c24bd6)
![2024-10-21 12_53_26-Clipboard](https://github.com/user-attachments/assets/d194b23a-be91-4838-9dad-27e704942d3b)

### To reproduce

_No response_

### Log output

_No response_
that-guy-scott commented 1 month ago

2024-10-21 12_52_16-Clipboard 2024-10-21 12_53_26-Clipboard

The screenshots didn't show up in my original post. The inline edits are showing up but the 'Accept all' 'Reject all' buttons do not show up.

Patrick, if you need anything from me just let me know. I'll keep an eye on this pretty closely as I love the plugin and I would love to see these features functioning. Thanks buddy!

Patrick-Erichsen commented 1 month ago

Thanks for the writeup + screenshot here @that-guy-scott . The accept all/reject all buttons should be showing up in the same place they were prior to the 0.0.76 release, e.g. in the chat input. Looking into this now!

that-guy-scott commented 1 month ago

I'm trying to reproduce the bug and it's pretty consistently not showing the reject button. It showed up this time but in an odd place. Usually it shows at the top of the edit, this time it showed up after the first 'chunk'. Idk, might be relevant so I'll post it. It just made me wonder if it's showing up but not in a place I can see it. I've had css do that to me where the element is actually on the page but it's position is off.

2024-10-21 13_22_43-Clipboard 2024-10-21 13_23_33-Clipboard

Patrick-Erichsen commented 1 month ago

Thanks for the additional detail here @that-guy-scott ! There are a few bugs here that I'm working on.

Question for you based on this comment of yours: "I have my keyboard shortcut set to Ctrl+i for inline edits."

Did you have to manually set that shortcut, e.g. to override the default ctrl + i to create a new interface?

that-guy-scott commented 1 month ago

@Patrick-Erichsen , I'm an idiot... lol I've got so many keyboard shortcuts I thought I had re-mapped the ctrl-i but that's stock continue key mappings. Sorry for the confusion.

that-guy-scott commented 1 month ago

This is still bugged out for me. I reset intellij ultimate 2024.2.4 back to stock settings, installed continue and tried inline edits for an .sql file and it doesn't work. It'll run thru the code updating things but then bugs out at the end. I don't get the accept/reject buttons. I do get the individual buttons for each block but that's bugged out too. It'll end and leave red and green lines in the editor. I have to close the file and reopen it in order to remove the red or green lines. If I edit a regular txt file it works fine. For some reason it just does not like .sql files or the sql query console. I have noticed it will do this with other files. For example, we use .conf files for settings and it'll do this on those as well. But it seems to work with my other project files like html, css, js ect...

that-guy-scott commented 1 month ago

image image

Patrick-Erichsen commented 1 month ago

Thanks for reopening this and providing those screenshots. My hunch is that it's a file extension specific issue as you mentioned. Will circle back here when we take a look into it 👍

Hakenadu commented 1 month ago

I also have the same behavior with 0.0.76, but also with 0.0.75 (see attached video).

https://github.com/user-attachments/assets/28862ee4-8e8f-4b49-a440-5c2ed51b1237

It seems to me that this did not occur in 0.0.70 - at least I cannot reproduce the behaviour with that version

IntelliJ IDEA 2024.1.4 (Ultimate Edition) Windows 11 Pro (Build 22631.4317)

config.json:

{
  "models": [
    {
      "title": "GPT-4o",
      "provider": "openai",
      "model": "gpt-4o",
      "apiKey": "censored",
      "systemMessage": "You are an expert software developer. You give helpful and concise responses.",
      "contextLength": 100000,
      "completionOptions": {
        "maxTokens": 4000
      }
    }
  ],
  "embeddingsProvider": {
    "provider": "ollama",
    "model": "nomic-embed-text"
  },
  "contextProviders": [
    {
      "name": "file"
    },
    {
      "name": "diff"
    },
    {
      "name": "codebase"
    },
     {
      "name": "open",
      "params": {
        "onlyPinned": true
      }
    }
  ],
  "customCommands": [],
  "allowAnonymousTelemetry": false,
  "docs": []
}
that-guy-scott commented 4 weeks ago

Issue still persist in v0.0.79

Rolling back to 0.0.70

@Hakenadu video is exactly the issue I'm experiencing.

that-guy-scott commented 3 weeks ago

I just had this happen on 0.0.70 with a css file.

Hakenadu commented 2 weeks ago

@Patrick-Erichsen is there some sort of workaround for this behaviour? I'm a bit confused that this issue is not upvoted more as it effectively prevents us from using the inline edit Feature in jetbrains.

With Versions greater than 0.0.70 it happens extremely often which is why we currently suggest our devs to stay at 0.0.70 (even though it really also occurs with that Version but much more rarely)

Meanwhile with 0.0.80 already released I'm afraid we won't be able to keep that Suggestion up for much longer as we are missing much of the great Features that you've implemented.

Patrick-Erichsen commented 2 weeks ago

@that-guy-scott @Hakenadu - thanks for your patience here. My original hunch was that this was file specific but after testing it out some more I was able to repro the issue of the individual diff block buttons not rendering. Here is a PR that should fix that: https://github.com/continuedev/continue/compare/pe/jb-osr-bugfixes?expand=1

However, I wasn't able to repro the issue of the "accept all"/"reject all" buttons not rendering.

@Hakenadu - it looks like the video you uploaded is no longer available, if you wouldn't mind reposting that would be appreciated.

There are some other subtle/not-so-subtle bugs with inline edit in JetBrains so please feel free to share anything else that is high priority for either of you.

Hakenadu commented 2 weeks ago

@Patrick-Erichsen thank you for your work on this topic and your openness to our comments! I'm looking forward to using the version that includes your PR since I use the inline edit functionality very inflationary 😄

https://github.com/user-attachments/assets/ba887401-4c94-4ad5-8c12-d3f392ba0fbb

Patrick-Erichsen commented 2 weeks ago

I'm optimistic that the above PR will fix this based on your video, the root issue was that we were updating the UI off of the main thread for UI updates in IntelliJ. So our diff stream was erroring out before we draw the buttons on the screen.

Hakenadu commented 1 week ago

Sounds great! I'm looking forward to the Version which includes your fix

that-guy-scott commented 1 week ago

Any update on this new version? I'm not familiar with the build process. Can we get an EAP release in the marketplace? maybe a zip upload that allows us to install it?

that-guy-scott commented 2 days ago

@Patrick-Erichsen, it looks like this has been resolved in your 82 patch but we're waiting on an update for this issue 2956 before we can build the intellij plugin. Feel free to close this ticket.

Patrick-Erichsen commented 2 days ago

@that-guy-scott will do, please follow up in that thread once the release is out if you have any issues! 👍