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.27k stars 1.66k forks source link

/code takes code output and inserts it into the editor where cursor is. #622

Open webber-naut opened 1 year ago

webber-naut commented 1 year ago

Validations

Problem

Im still fresh into the extension. Using ollama with custom model to run locally, setup was pretty easy. What I really would like is to not have to copy and paste code snippets from the chat pane to my file. So for instance if there was a command like /code

/code using bootstrap 5.0, write html code for an image caoursel

This would write only the code snippets in the response to where the cursor is currently in the document. Or you can use the /edit functionally where it previews it first then you accept/edit/cancel ect. I think this is similar to the tab completion feature some one referenced but this seems like something easier to implement and actually cut down on lag time for tab completion, plus less messy in my opinion.

Solution

No response

sestinj commented 1 year ago

@webber-naut This is an awesome idea. I do agree that we could do better than just inserting at the cursor, so some kind of "smart insertion". I'm thinking it would make sense to have a button on any code block next to the "copy" button in the top right? Displaying the diff definitely makes sense

webber-naut commented 1 year ago

Yes a button next to copy for inserting into editor would be fantastic. Or even something like your edit highlight feature where you have the keyboard shortcodes of highlight and then editing.

For example if I typed the command in my editor. /code using bootstrap 5.0, write html code for an image caoursel Then highlighted it, then had some keyboard short cut that would output the code snippets into the editor and remove the /code line instructions.

sestinj commented 9 months ago

@webber-naut We now have this button in the VS Code extension. Would love to hear your thoughts on it!

khanakia commented 2 months ago

I do not see it /code Screenshot 2024-09-02 at 12 11 07 AM