Improvement

October 29, 20241 Minute Read

Improving GitHub Copilot code suggestions in Visual Studio for C# developers

In the latest versions of Visual Studio 2022, GitHub Copilot Completions now automatically considers semantically relevant C# files as additional context, even if those files are not open in your editor. This enhancement helps reduce hallucinations and provides more accurate, relevant suggestions.

GitHub Copilot provides autocomplete suggestions inline as you code. These suggestions are generated based on the content in your currently active file and any other open files in your editor. However, we’ve found that incorporating more relevant context leads to better suggestions.

To get started in Visual Studio 2022, ensure you’re using version 17.11 or later and have an active GitHub Copilot subscription. We hope this enhancement improves your experience with GitHub Copilot in Visual Studio. Our team is committed to improving Copilot support for C# developers in both Visual Studio and VS Code, with similar updates coming to VS Code soon.

For more details, visit the .NET team blog here.

Join our dedicated Community Discussions to discuss this update, share tips, and connect with other coders.

Subscribe to our developer newsletter

Discover tips, technical guides, and best practices in our biweekly newsletter just for devs.

By submitting, I agree to let GitHub and its affiliates use my information for personalized communications, targeted advertising, and campaign effectiveness. See the GitHub Privacy Statement for more details.

Improving GitHub Copilot code suggestions in Visual Studio for C# developers - GitHub Changelog