Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Use This Snippet" Button #14

Open
sestinj opened this issue Sep 4, 2023 · 1 comment
Open

"Use This Snippet" Button #14

sestinj opened this issue Sep 4, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@sestinj
Copy link
Contributor

sestinj commented Sep 4, 2023

It would be great if you could click a button in the top right of any code block from Continue's output and have it automatically inserted into your code.

If you're interested in making this contribution, don't worry about the button - we can help with that. The real task is to come up with a good prompt that reliably converts (contents of file in question, code block snippet generated by Continue) --> new contents of file.

To do this, you should implement a new subclass of Step and write the run method, where you'll have access to the ContinueSDK, including all of the utilities you need to interact with the IDE, Language Server Protocol, and more. There are many examples of steps in the plugins/steps directory, but the important part is the prompting, so there's probably no need to even clone the Continue repository for the first part of working on this - might be easier to try things in the OpenAI playground.

@sestinj sestinj added the enhancement New feature or request label Sep 4, 2023
@sestinj
Copy link
Contributor Author

sestinj commented Jan 28, 2024

Edit: This is now implemented in VS Code by clicking the "Apply to current file" button on any code snippet. But I still think that the prompting could be improved. Most likely this is a more specific task than just "rewrite the code with given instructions". There are likely to be cases where the entire file is being replaced, or a single function is just being replaced, or there is a single insertion somewhere. In these cases, getting the LLM to call a function may be significantly faster than rewriting the entire file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

1 participant