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.

xeladu
2 min readOct 21, 2023

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.

GitHub code example shortcut in Visual Studio tooltip

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.

Demo video of how Visual Studio shows GitHub code examples in the IDE

Find more tips for Visual Studio here:

Visual Studio Tips

14 stories

--

--

xeladu
xeladu

Written by xeladu

Flutter and Firebase expert, blogger on QuickCoder.org, find my ebooks and freebies on shop.quickcoder.org, contact me on me.quickcoder.org!

No responses yet