3 ms·
I have a bunch of code I need to refactor, and also write tests for. (I guess I should make the tests before the refactor). How do you do a refactor with GPT-4?
by TaylorAlexander 3y ago
I have a bunch of code I need to refactor, and also write tests for. (I guess I should make the tests before the refactor). How do you do a refactor with GPT-4? Do you just dump the file in to the chat window? I also pay for github copilot, but not GPT-4. Can I use copilot for this?
Any advice appreciated!
- rkuykendall-com 3y ago> Do you just dump the file in to the chat window? Yes, along with what you want it to do. > I also pay for github copilot, but not GPT-4. Can I use copilot for this? Not that I know of. CoPilot is good at generating new code but can't change existing code.
- redblacktree 3y agoCopilot will change existing code. (though I find it's often not very good at it) I frequently highlight a section of code that has an issue, press ctrl-i and type something like "/fix SomeError: You did it wrong"
- jjwiseman 3y agoGitHub Copilot Chat (which is part of Copilot) can change existing code. The UI is that you select some code, then tell it what you want. It returns a diff that you can accept or reject. https://docs.github.com/en/copilot/github-copilot-chat/about-github-copilot-chat https://docs.github.com/en/copilot/github-copilot-chat/about...