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.43k stars 1.69k forks source link

Tab autocomplete while indenting #2987

Open seliquity opened 3 days ago

seliquity commented 3 days ago

Before submitting your bug report

Relevant environment info

- OS: macOS
- Continue version: v0.8.5
- IDE version: VSCode 1.95.2 
- Model: Codestral

Description

The tab button generates autocompletes, but often conflicts when I'm trying to indent. A simple example would be if I had the following line:

result = example->model()->bunch()->of()->calls();

But I'm refactoring to make it look like this:

result = example->model()
    ->bunch()
    ->of()
    ->calls();

If I move my cursor to the end of "model()" on the original line and hit enter, then it'll look like this:

result = example->model()
->bunch()->of()>calls();

In this state, Continue will often generate an autocomplete, which is immediately applied when I hit tab to indent that second line. This feels like a footgun, since it's applying suggestions I don't want and I have to be on guard to prevent them.

I don't think Continue should generate an autocomplete if both of the following are true: 1) there is only whitespace before the cursor 2) There is a character immediately after the cursor

I think those two rules definitely identify an indent scenario, although to be honest I'm not sure why you'd want a suggestion if there's text immediately after the cursor in any situation.

To reproduce

No response

Log output

No response

Patrick-Erichsen commented 2 days ago

Appreciate the feedback here @seliquity ! @tomasz-stefaniak has been making a ton of improvements to autocomplete recently, cc'ing him here