Visual Studio Quick Tip
Get Enhanced Code Examples from GitHub for your API Methods in Visual Studio 2022
Place your mouse on an API method, press a shortcut, and Visual Studio shows you matching code examples from GitHub.
When you have to deal with APIs that you haven’t used before, it sometimes is hard to find out how they exactly work and what they can do.
Visual Studio can show you code examples from GitHub if there are any available for the corresponding code. Just type the method that you are struggling with and hover over it.
The tooltip shows the already-known method documentation but at the bottom, there is a new shortcut. Press it and the tool opens a window with code examples of that method. This handy tip might save you a Google search or a ChatGPT prompt!
This works only if you are using an API or Nuget package that is hosted on GitHub. However, the majority of public and famous Nuget packages already are.
Find more tips for Visual Studio here: