From the course: AI-Powered Development: GitHub Copilot in Visual Studio
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Code completion: Create method in C# - Visual Studio Tutorial
From the course: AI-Powered Development: GitHub Copilot in Visual Studio
Code completion: Create method in C#
- [Instructor] It's time to see our first GitHub Copilot feature in action. We're talking about code completions. We'll start by enabling Copilot or ensuring that it's enabled by going here and going to Settings and make sure there's a check mark here. Let's try that again. Let's verify there's a check mark. That's good. And now, I'll go to this empty method. I'll start here and see how far the code completion can take us just from typing a few partial lines of actual code. No comments, no chat, just code. One more note before starting. Copilot uses large language models, which means it's responses can vary depending on many factors such as the context, the phrasing, and even subtle differences in how my partial code is written. So, the code generated during this demo may differ from what you'd see if you ran the same prompt again later. I'll start by declaring a variable with the name random. So, here's our first…