From the course: AI-Powered Development: GitHub Copilot in Visual Studio
Adjust Copilot settings and behavior - Visual Studio Tutorial
From the course: AI-Powered Development: GitHub Copilot in Visual Studio
Adjust Copilot settings and behavior
- [Instructor] The first thing we want to look at is whether or not GitHub Copilot is enabled in Visual Studio. We can tell by looking in the upper right-hand corner where it says, "GitHub Copilot." There is a green check mark next to it. That's one clue, and also if I hover over it, I'll see a tooltip that says, "GitHub Copilot is active." Now we wanna fine-tune how Copilot behaves. To do that, we'll go to Tools, Options, and then we'll look for GitHub, Copilot. Now, this is divided into sections, one for setting the settings for the chat, one for Code Completions, one for the Editor, another one for Source Control Integration, and then we have one here for Debugger and Diagnostics. Now, it's important to have some of these turned on for the course. We need to have Enable Agent mode in the chat pane enabled. We also want to have Enable Copilot Completions. I also have Enable Git preview features. This is a preview, meaning it's not fully ready yet, but I've turned that on for Source Integration. And I've also enabled all three settings here in the debugger and Diagnostics section. Now let's talk about a couple of these settings up here at the top. Below the Agent mode is this option, Enable referencing your #solution. You used the word #solution in your chat window to give permission to the chat engine to look through your entire solution. If the chat engine or the agent suggests some changes, this is a useful setting, Automatically select the different styles. Let's turn that one on. When refining a suggestion, what this means is when the chat engine suggests some code changes, and you look at a diff of the changes and your original code, Copilot will automatically select the side that it has suggested. Another useful feature is auto Attach the Active Document. What this means is that whatever code editor you have open, the chat window has access to the code in that window. Another useful one is Enable custom instructions to be loaded from this instructions.md file, this markdown file. This lets us define custom behavior for Copilot via a markdown file, ideal for enforcing coding standards or project-specific guidance. We'll talk more about Enable Next Suggestions and Collapse Next Edit Suggestions later in the course, and we'll talk more about some of these other options as well. At this point, we've picked some of the options that let us fine tune Copilot's role across our workflow, and this is whether we prefer lightweight completions or deeper AI assistance, or in areas like debugging, source control, or project navigation.