Search code examples
c#.netvisual-studiogithub-copilot

Visual Studio 2022 not generating code from comment with GitHub Copilot


I have installed GitHub Copilot from Visual Studio extensions

enter image description here

It works fine for autocompletes

enter image description here

But when I add a commented line asking for some implementation and press enter, there is no code suggested. Is there a way to "activate" this feature?

enter image description here

I'm using .NET 8.0 and the version of my VisualStudio is 17.8.2


Solution

  • Try telling it what to do without the "Create code do" bit. That much is implied. I have also noticed that copilot prefers to leave a line after the comment before giving code completions.