Chat interaction?
I wonder if the following is possible.
Let's say I have the following line selected:
std::cout << "Hello, World!" << std::endl;
and I would like to give the prompt "Rewrite code using printf()". Is that possible?
I think it's possible, provided we implement something along the lines of #343 first.
Please see copilot-chat.el https://github.com/chep/copilot-chat.el
Please see
copilot-chat.elhttps://github.com/chep/copilot-chat.el
I'm using copilot-chat.el to have an interactive chat session with copilot. However I am not aware that I can select something in a source code buffer and give a command which will carry out a rewrite like in the example I gave above. Am I missing something?
@dov , upon further review I agree with you. It is close but a.f.a.i.k. not exactly what you want. Example for buffer A:
copilot-chat-custom-prompt-selection: asks for a prompt, applies it to the selection in bufferA, puts the output in the*Copilot Chat*buffer. The code is put into an Org-mode code block. Non-code etc. is outside the Org-mode code block.copilot-chat-yank: copies the Org-mode code block from the*Copilot Chat*buffer to the cursor in bufferA. Does not overwrite the previous selection. If it overwrote the previous selection, I think it would be what you are asking for.
I will make a feature request:
- combine these two commands into one
- overwrite the selection with the code block prompt output
@dov I think this is the main issue for this topic in copilot-chat https://github.com/chep/copilot-chat.el/issues/63
Just saying but gptel also have support for GithubCopilot. And it allows you to select a region and have it rewrite in place