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
14.38k stars 1.05k forks source link

/edit always tries to edit the first linked file you added with Ctrl+M #555

Open klauern opened 10 months ago

klauern commented 10 months ago

Before submitting your bug report

Relevant environment info

- OS:
- Continue:

Description

This might be a bigger topic around session management, but when I am working on a change, I sometimes find that the context passed in by typing Ctrl+M into the editor doesn't give enough context, so I add more. Later, I want to do a different /edit and find that suggestions always go to the first attached file.

I already added a number of files to the context, so I was hesitant to start a new conversation and lose all that context, so I was hoping to re-use the session to edit other files that were related. One example of this is any change in a Rails app. You add the model, controller, view, schema.rb, etc, and then you have to make changes to multiple files. This is simply broken when trying to do it through Continue

To reproduce

No response

Log output

No response

sestinj commented 10 months ago

@klauern I'm planning to make a few changes to how this works soon so that it's more obvious, but if you click on one of the other context items, it will show a paint brush icon, and if you click that you can change the range that you are editing

Sounds like it might be more intuitive for you though if cmd+shift+M would by default edit the most recently highlighted range instead of the first?

klauern commented 10 months ago

Perhaps, although when I think about what the continue dialog is doing, I usually have open the file that I am looking to edit, so would it be possible to default to the focused editor file? I tend to add all of those files as context and then Ctrl+Tab to the file I want to edit, so if I had to re-select, it might not be as intuitive (for me).

sestinj commented 10 months ago

I'm intrigued by this solution. In the end I'll take a look at this, play around a bit myself and make a decision, but this new idea is now definitely in the mix.