zlacker

[parent] [thread] 3 comments
1. Taylor+(OP)[view] [source] 2024-02-13 21:43:46
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!

replies(1): >>rkuyke+H2
2. rkuyke+H2[view] [source] 2024-02-13 21:58:20
>>Taylor+(OP)
> 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.

replies(2): >>redbla+64 >>jjwise+s4
◧◩
3. redbla+64[view] [source] [discussion] 2024-02-13 22:06:15
>>rkuyke+H2
Copilot 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"
◧◩
4. jjwise+s4[view] [source] [discussion] 2024-02-13 22:09:27
>>rkuyke+H2
GitHub 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...
[go to top]