Loading...

The AskVS command in GitHub Copilot for Visual Studio

The AskVS command in GitHub Copilot for Visual Studio

GitHub Copilot is a coding assistant powered by Artificial Intelligence (AI), which can run in various environments and help you be more efficient in your daily coding tasks. In this new series of content, we will show you how GitHub Copilot works in Visual Studio specifically and how it helps you being more productive.

 

The new short video I just published concentrates on one specific command you can use in GitHub Copilot for Visual Studio: The AskVS command. As for the 3 previous videos in this series, my colleague Bruno Capuano is showing you how this works.

 

 

The AskVS command

In the example, Bruno selected a piece of code and then typed the following command in the GitHub Copilot Chat window:

 

/AskVS refactor the #

 

 

At this point, some auto-replace is happening: The / command opens the Slash command menu, in which Bruno selected the AskVS command. Then typing the # character opens another menu in which Bruno can select the lines that he selected in the file. Note that in this menu, he could also select another context, for example another code file.

 

Continuing to type the command, we now have:

 

askvs refactor the CustomChatCompletionService.cs:25-32 to a new function

 

 

This instructs Copilot to refactor the lines 25-32 in the CustomChatCompletionService.cs file.

 

The result

As a result, Copilot will propose the new code in a dialog with a preview button, like we saw a few times in previous videos. It will also propose code showing how to call the newly created function.

 

LBugnion_0-1711640619830.png

 

Getting more information from AskVS

The AskVS command can also be used to get more information about Visual Studio functionalities and settings. In the video. Bruno uses this to ask Copilot how to change from light theme to dark theme. As a result, Copilot lists all the steps, and even provides hyperlinks leading directly to the dialogs in Visual Studio that are used to perform the change.

 

More information

More slash commands are available as we saw in the previous videos. You can see the full length video here. For more information, check our collection with resources here. Stay tuned to this blog for more content posted regularly. And of course you can also subscribe to our YouTube channel to get more video content!

Published on:

Learn more
Azure Developer Community Blog articles
Azure Developer Community Blog articles

Azure Developer Community Blog articles

Share post:

Related posts

This Month in Azure Static Web Apps | 09/2024

    We are back with another edition of the Azure Static Web Apps Community! :party_popper:   September was yet another month ...

1 year ago

GitHub Copilot for Azure: 6 Must-Try Features

As developers, we are constantly seeking tools that streamline our workflows and boost productivity. … Enter GitHub Copilot for Azure, now in ...

1 year ago

Responsible AI Mitigation Layers

Generative AI is increasingly being used in various kinds of systems to augment humans and infuse intelligent behavior into existing and new a...

1 year ago

Streamline Your Azure Workflow: Introducing GitHub Copilot for Azure in VS Code

I'm excited to announce the public preview of GitHub Copilot for Azure - a new addition to your toolkit that seamlessly integrates with G...

1 year ago

Build Intelligent Apps Code-First with Prompty and Azure AI

      Building Generative AI applications can feel daunting for traditional app developers. What does the end-to-end applicati...

1 year ago

Certificación AI-900 (Fundamentos de IA) con Chicas en IA

La inteligencia artificial ha llegado para quedarse, ¡y más aún con la revolucionaria IA generativa! Para ayudar a los profesionales a especia...

1 year ago

Get certified with Learn Live GitHub series!

GitHub Universe is coming, and Microsoft and GitHub are partnering to offer a new special Learn Live series in Brazilian Portuguese, English a...

1 year ago

Certifícate con Learn Live GitHub en Español

Microsoft y GitHub se han unido para ofrecer una nueva serie especial de Learn Live en inglés y español: GitHub 2024. Del 10 al 24 de Octubre,...

1 year ago

Evaluating generative AI: Best practices for developers

As a developer working with generative AI, you've likely marveled at the impressive outputs your models can produce. But how do you ensure the...

1 year ago

Introducing Azure Product Retirement Livestreams

The Azure Retirements team, in collaboration with key partner groups, is excited t...

1 year ago

Newsletter

Get the latest Dynamics 365 and Power Platform content in your inbox

A curated digest of community blogs, product news, videos, and podcasts — delivered without the noise.

Weekly updates Unsubscribe anytime Fresh community picks
We use your email only for the newsletter and you can unsubscribe at any time.
By subscribing, you agree to the privacy policy.