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
18.53k stars 1.54k forks source link

Jetbrains Extension (EAP v0.0.76) Inline Edits bugged out. #2602

Open that-guy-scott opened 5 days ago

that-guy-scott commented 5 days 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 5 days 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 5 days 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 4 days 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 4 days 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 4 days 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 day 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 day ago

image image

Patrick-Erichsen commented 1 day 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 day 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": []
}