Skip to content

Would be nice if the copilot would also help in code refactoring work #10114

Answered by oxysoft
Freestyle00 asked this question in Copilot
Discussion options

You must be logged in to vote

There needs to be a feature to make prompt templates, e.g.

<ORIGINAL_CODE>
---
[Rewrite the above code to <PROMPT>]
<CARET>

So you would select a piece of code, enter your prompt, and we can cycle through ways to rewrite the original code that the model spat out. You can do a LOT with this, like "remove the error checking" and it will work 99% of the time if it's self-documenting and everything. Game-changing, in many ways, I can't imagine what the community would come up with. It can fix exceptions and non-compiling code as well, "Rewrite the code to fix <COMPILE_ERROR>".

Some times it needs to be started with the first couple of words of the original code.

You can probably even direct …

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
10 replies
@andraz
Comment options

@Anselmoo
Comment options

@sanikolov
Comment options

@fssrepository
Comment options

@ayim
Comment options

Answer selected by Freestyle00
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement An idea, feature request, or improvement to a GitHub feature Copilot Code accurately and faster with your AI powered pair-programmer. Product Feedback