Maybe Lindow
Maybe Lindow

Reputation: 333

Github Copilot To Add Code instead Comments?

Using github copilot, whenever it processes a comment and tab and enter is pressed it just creates the same comment over and over again.

I want it to provide code. How?

Upvotes: 30

Views: 45640

Answers (3)

Devesh
Devesh

Reputation: 394

I had the exact same problem when I was learning Github Copilot with VS Code. Copilot was helping me complete the comment instead of generating code. I had to use "Ctrl + I" on Windows in order to open a co-pilot prompt dialog and writing the comment there. It didn't show the "Open Completion Panel" however.

Upvotes: -1

Atzuki
Atzuki

Reputation: 867

Go on new line after comment, and start typing what you want to create. In your case type def and wait a while. If not enough give the function name and wait a while again.

Upvotes: 35

twizelissa
twizelissa

Reputation: 161

First Add single line comment in you visual studio code that describe code you want to be written by github copilot like // function to add two numbers in javascript then press Enter wait for little seconds code that do what you described in comment will appear then press tab. Note : in some case your code might be incomplete just keep pressing enter then tab when code look like comment.

Upvotes: 7

Related Questions