August 22nd, 2024

Enhancing Code Comprehension: GitHub Copilot’s Features in Visual Studio 2022 17.11

Rhea Patel
Product Manager

GitHub Copilot in Visual Studio 2022 17.11 now offers an improved experience you to refer to their methods, classes, functions, and entire solution directly within the chat. By using the # symbol followed by the name of a method, class, or function, or by referring to your solution with @workspace, you can provide specific context that helps GitHub Copilot better understand their code and the problem at hand.

Refer to your solution

GitHub Copilot Chat now allows you to refer to your entire solution. This feature helps provide an even deeper understanding of your solution to get the best results. To refer to your solution, simply use the @workspace and Copilot will answer high level questions about your solution, files and how they work together.

Image workspace

Try asking GitHub Copilot Chat questions like:

  1. @workspace What project can I run in my solution?
  2. @workspace In my workspace, where is #methodname referenced?
  3. @workspace Where does serialization occur in my solution?

 

Reference your methods, classes, functions

GitHub Copilot Chat now allows you to refer to your methods, classes, and functions inline. By referring to methods, classes, and functions directly within the chat, you can provide specific context that helps GitHub Copilot better comprehend your code and the problem at hand. This feature empowers you to provide richer context to GitHub Copilot, enabling it to deliver more precise responses by gaining a deeper understanding of your codebase.

Image copilot symbols

Try asking GitHub Copilot Chat questions like:
  1. I have a test method named #methodName. How can I ensure that it’s being executed correctly?
  2. What are some optimizations that could be applied to #methodName?
  3. How does #methodName1 use #methodName2 and what issues should I look out for?
  4. /explain #methodName

 

Search the web in Copilot Chat

GitHub Copilot now includes context from your entire repository & can search the web.

GitHub Copilot Enterprise subscribers in Visual Studio can now use GitHub Copilot Chat to get answers enriched with context from their entire repository and Bing search results.

Image githubagent

Get answers from across your entire codebase

GitHub Copilot Chat can now answer questions with understanding of your full repository, not just the tabs you have open. Index your repository on GitHub.com, and then ask a question mentioning @github. You can ask questions like @github where is rate limiting implemented?

Search with the context of the web

GitHub Copilot chat can also search Bing to find information outside of its general knowledge or your codebase. When you mention @github, GitHub Copilot will intelligently decide when to use Bing. You can ask questions like @github what is the latest LTS version of .NET?

Bing search is only available if enabled by an administrator – for more details, see Enabling GitHub Copilot Enterprise features or read the docs.

Try it out today!

We hope you enjoy this new feature in GitHub Copilot for Visual Studio! Your feedback is important to us, so please share your thoughts using the thumbs up or down in the Chat, or by visiting the Developer Community. We look forward to hearing from you!

Image send us feedback

Happy coding!

We appreciate the time you’ve spent reporting issues/suggestions and hope you continue to give us feedback when using GitHub Copilot in Visual Studio on what you like and what we can improve. Your feedback is critical to help us make GitHub Copilot  the best tool it can be! You can share feedback with us via Developer Community: report any bugs or issues via report a problem and share your suggestions for new features or improvements to existing ones.

Stay connected with the Visual Studio team by following us on YouTubeTwitterLinkedInTwitch and on Microsoft Learn.

Author

Rhea Patel
Product Manager