Code from comments

How can I generate code from coments without my comments being deleted or modified? Now after writing a comment, let’s say a docstring, I have to copy the docstring in order to paste it as a prompt to Ctrl-K. If I just write the prompt, it vanishes after some code is written.
One solution I just found is the prompt “Use the comment above”. It works but it’s not entirely satisfactory, because it’s not really faster than copy and paste.

After writing a comment, then ENTER, and wait a moment, the copilot++ can auto complete the code according to your comment.

You should switch on your Copilot feature in MORE tab on the right.

Thank you for your solution. But I’m not really convinced by the documentation:
“This is not a replacement for GitHub Copilot Autocomplete. We suggest using both GitHub Copilot Autocomplete and Cursor Copilot++ at the same time.”
Not only they suggest that it’s less efficient than github copilot, but also that we must use BOTH github copilot and Cursor. If I’m trying Cursor, it’s with the hope that it could replace and be better than github copilot.
In fact, the method I suggested in my original post works at least as well as github copilot, in my limited testing (201 gpt4 requests).

eh, no, I mean not GitHub Copilot, it is Copilot++, I think there may be some misunderstand.
image

I think Copilot++ is enough, you needn’t GitHub Copilot

You mean copilot++, but the Cursor documentation says to use github copilot alongside Cursor.

Oh, our documentation is out-dated.

We use the current version of Copilot++ without Github Copilot and really like the experience.

You can find a more accurate description of copilot++ in this forum thread: Copilot ++ Can someone give me an overview - #3 by npour

I have not yet used Copilot++ because it was presented as experimental. Since LLMs are so prone to errors, I dared not use an experimental one. But I will try it now.

You could do an empty Inline Generation (just put a single whitespace) under your comment. It should still get the context around it.

vid