Artificial Intelligence - Visual Studio Blog https://devblogs.microsoft.com/visualstudio/tag/ai/ The official source of product insight from the Visual Studio Engineering Team Mon, 19 May 2025 17:10:22 +0000 en-US hourly one https://devblogs.microsoft.com/visualstudio/wp-content/uploads/sites/4/2018/10/Microsoft-Favicon.png Artificial Intelligence - Visual Studio Blog https://devblogs.microsoft.com/visualstudio/tag/ai/ thirty-two thirty-two Faster .NET Upgrades Powered by GitHub Copilot https://devblogs.microsoft.com/visualstudio/faster-net-upgrades-powered-by-github-copilot/ https://devblogs.microsoft.com/visualstudio/faster-net-upgrades-powered-by-github-copilot/#comments Mon, 19 May 2025 16:00:43 +0000 https://devblogs.microsoft.com/visualstudio/?p=253273 Introducing GitHub Copilot app modernization – Upgrade for .NET You probably don’t look forward to the process of modernizing your applications. It can be time consuming, risky, and full of manual toil. Today we’re changing that. We’re thrilled to introduce the public preview of GitHub Copilot app modernization – Upgrade for .NET, an AI-powered experience […]

The post Faster .NET Upgrades Powered by GitHub Copilot appeared first on Visual Studio Blog .

]]>
Introducing GitHub Copilot app modernization – Upgrade for .NET

You probably don’t look forward to the process of modernizing your applications. It can be time consuming, risky, and full of manual toil. Today we’re changing that.

We’re thrilled to introduce the public preview of GitHub Copilot app modernization – Upgrade for .NET , an AI-powered experience that helps you bring your .NET applications to the latest version quicker and more confidently than ever before. Powered by GitHub Copilot and Agent Mode, it serves as an intelligent upgrade companion that understands your code, determines the right upgrade path, and applies changes step by step with minimal manual effort.

Read more about the public preview on our .NET blog.

Get Started with Faster .NET Upgrades Today!

Getting started with GitHub Copilot app modernization – Upgrade for .NET is easy.

Step 1: Install the Extension Head to the Visual Studio Marketplace and download the GitHub Copilot app modernization – Upgrade for .NET extension. Once installed, you’re ready!

Step 2: Use Copilot Agent Mode To unlock the full power of AI-assisted upgrades, install the latest version of Visual Studio 17.14 and sign-in to a GitHub account with an active Copilot subscription.

  1. Ensure you have agent mode enabled: In Visual Studio, go to Tools > Options > GitHub > Copilot > Copilot Chat and select “Enable agent mode in the chat pane.”
  2. Turn on Agent Mode : To get started, open the GitHub Copilot Chat window, click the “ Ask ” button, then click “ Agent ”. This turns on Copilot Agent Mode, which gives you a smarter, more natural way to do the upgrades.
  3. Select the Upgrade Tool: Once in Copilot Agent Mode, be sure to select the “ Upgrade” tool from the Copilot Chat Tool Selector. Otherwise, Agent Mode won’t be able to use the specialized upgrade tools.

 A GIF of a user selecting the correct tool in Agent Mode in Copilot Chat

For more information on Agent Mode, check out our blog on the topic.

How to Run the Upgrade

You’ve got two options:

Right-click your project or solution in Solution Explorer and select “Upgrade with GitHub Copilot”

 solution explorer invocation 1 image

Or, just tell Copilot what you want to do in the chat: 👉 “Upgrade my solution to .NET 8”

 help me upgrade my solution 1 image

That’s it. GitHub Copilot gets to work analyzing your code, preparing the upgrade, and guiding you through code changes.

What’s Included?

 🛠 Automated code transformations: Copilot automatically makes the changes required to get your applications running on modern .NET.

 ⚙ Customizable workflows: You can tailor which projects to upgrade, whether to address packages with security vulnerabilities in your upgrade, and more.

 🧠 Learning from your manual changes: When manual intervention is required, GitHub Copilot can learn from your manual changes and apply those learnings if it encounters a similar situation later on in your upgrade.

 A GIF showingCopilot acknowledging it's recording user changes and learning from manual interventions

 🔀 Git Integration: Git commits are automatically created on your behalf so that you can adopt and test changes incrementally.

 A screenshot of the commits generated by the tool

 ✅ Automatic test validation: It automatically runs your application’s unit tests to ensure correct behavior post-upgrade.

 🤖 Agent Mode functionality: Take advantage of Copilot Agent Mode with the latest preview version of Visual Studio installed.

Please Share Your Feedback

Start your upgrade journey today with GitHub Copilot app modernization – Upgrade for .NET! Your feedback is crucial to us as we aim to improve the product during this public preview. To share feedback with the team, please utilize the “Leave Feedback” button in the upper right corner of the Upgrade Manager UX in Visual Studio.

 A screenshot of the Upgrade Monitor UX showing where to find the Leave Feedback button

We also welcome feedback via email to ghcpuacusteng@microsoft.com , as well as direct responses to our feedback survey .

Check out the new Visual Studio Hub

Stay connected with everything Visual Studio in one place! Visit the Visual Studio Hub for the latest release notes, YouTube videos, social updates, and community discussions.

The post Faster .NET Upgrades Powered by GitHub Copilot appeared first on Visual Studio Blog .

]]>
https://devblogs.microsoft.com/visualstudio/faster-net-upgrades-powered-by-github-copilot/feed/ four
GPT-4o Copilot code completion model available now in Visual Studio public preview https://devblogs.microsoft.com/visualstudio/gpt-4o-copilot-code-completion-model-available-now-in-visual-studio-public-preview/ Tue, 11 Mar 2025 15:00:21 +0000 https://devblogs.microsoft.com/visualstudio/?p=252652 We are excited to announce that the new GPT-4o Copilot code completion model is now available for GitHub Copilot users in Visual Studio starting in 17.14 Preview 2! This new model, based on GPT-4o mini, has undergone additional training on over 275,000 high-quality public repositories across more than 30 popular programming languages. As a result, […]

The post GPT-4o Copilot code completion model available now in Visual Studio public preview appeared first on Visual Studio Blog .

]]>
 GitHub Copilot, GPT-4o Copilot

We are excited to announce that the new GPT-4o Copilot code completion model is now available for GitHub Copilot users in Visual Studio starting in 17.14 Preview 2! This new model, based on GPT-4o mini, has undergone additional training on over 275,000 high-quality public repositories across more than 30 popular programming languages. As a result, developers can expect more accurate suggestions and better performance.

Try it out now!

For Visual Studio users who have yet to use GitHub Copilot, get started today! There’s even a free plan that includes 2,000 completions and 50 chats per month. You can sign up directly in Visual Studio (version 17.8 or higher) or explore plans here .

Once you have enabled GitHub Copilot, try out the new model by going to Tools -> Options -> GitHub -> Copilot -> Copilot Completions and selecting “GPT-4o Copilot” in the dropdown. You can also access the settings by clicking the GitHub Copilot badge on the top right corner and go to Settings -> Options. Note that there might be a delay on retrieving the latest model list for the first time, please try restarting Visual Studio if you don’t see the new GPT-4o model in the dropdown.

 image highlighting how to customize models in the GitHub Copilot settings;  GitHub -> Copilot -> Copilot Completions and selecting "GPT-4o Copilot" in the dropdown menu under Copilot Completions Model

Learn more about the new model in the video:

GPT-4o Copilot Access Notes

  • Copilot Pro users: The new model is available for you now in 17.14 Preview 2 and later.
  • Copilot Business or Enterprise users: Your administrator needs to enable this model for your organization first by opting in to Editor preview features in the Copilot policy settings on github.com.
  • Copilot Free users: using this model will count toward your 2,000 free monthly completions.

We believe this model could further enhance your productivity in Visual Studio with higher quality code completions. We encourage you to give it a try and share your experience with us. Please share any feedback on Developer Community to help us deliver better experiences for all Visual Studio GitHub Copilot users. We are committed to improving de veloper productivity and joy with GitHub Copilot in Visual Studio and thank you for being part of this journey!

We appreciate the time you’ve spent reporting issues/suggestions and hope you continue to give us feedback when using Visual Studio on what you like and what we can improve. Your feedback is critical to help us make Visual Studio 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 YouTube , Twitter , LinkedIn , Twitch and on Microsoft Learn .

The post GPT-4o Copilot code completion model available now in Visual Studio public preview appeared first on Visual Studio Blog .

]]>
Introducing Code Referencing for GitHub Copilot Completions in Visual Studio https://devblogs.microsoft.com/visualstudio/introducing-code-referencing-for-github-copilot-completions-in-visual-studio/ Wed, 19 Feb 2025 16:40:08 +0000 https://devblogs.microsoft.com/visualstudio/?p=252415 When GitHub Copilot completions (or “gray text”) pop up on your screen, have you ever wondered where does the completions come from and worried about if it matches with public code leading to license issues? If you have, we are introducing code referencing to support you and provide more transparency! We are excited to announce […]

The post Introducing Code Referencing for GitHub Copilot Completions in Visual Studio appeared first on Visual Studio Blog .

]]>
When GitHub Copilot completions (or “gray text”) pop up on your screen, have you ever wondered where does the completions come from and worried about if it matches with public code leading to license issues? If you have, we are introducing code referencing to support you and provide more transparency!

We are excited to announce that code referencing is available now for GitHub Copilot Completions in Visual Studio 2022 17.13, a feature previously introduced in Copilot Chat (see previous blog post ). So you can feel more confident when accepting the completions!

Learn about Completions Public Code Match

When you accept a completion that matches code in a public GitHub repository for the first time in your solution, a toast notification will appear on the bottom right of your editor.

 A toast notification that pops up on the bottom right corner of Visual Studio with the title: Found similar code in public repos. Body text include: Copilot completion code matches will appear in the Copilot output window pane. There are two buttons in the toast: on the left, View code matches and on the right, More info.

From the toast, you can view code matches in the GitHub Copilot Output Window, where includes more detailed information about the license type and a link to GitHub.com, where the original public code file lives. You can click on the link to read more about the original file and make informed decisions, such as including code attribution or removing the code from your project.

 The Visual Studio Output Window, showing output from GitHub Copilot. One output message is highlighted with a red rectangular box. The highlighted output message is [Completions Public Code Match Information] Similar code with license type [MIT], followed by a link to github.

From the toast, you can also learn more information about public code match and how to manage it as an individual subscriber here: Managing Copilot policies as an individual subscriber .

In your future coding workflow, you can always check for any public code match by opening the Output Window (Ctrl+Alt+O) and searching for “Completions Public Code Match Information.”

Note:

  • Code referencing for completions only occurs for accepted Copilot completions. Any code you have written, as well as completions you have modified or dismissed, are not checked for public code matches.
  • Typically, matches to public code occur in less than one percent of Copilot completions, so you should not expect to see code references for many completions. This estimation is higher if you work in open-source repositories.

Configure Code Referencing

Note:  If you are a member of an organization on GitHub Enterprise Cloud and have been assigned a GitHub Copilot seat through your organization, you may not be able to configure suggestions matching public code in your personal account settings. Your settings will be inherited from your organization or enterprise.

If you are an individual subscriber, your personal settings for GitHub Copilot include an option to either allow or block code suggestions that match publicly available code:

  • Block suggestions matching public code : GitHub Copilot checks code suggestions with their surrounding code against public code on GitHub. If there’s a match or near match, the suggestion is not shown.
  • Allow suggestions matching public code : When Copilot suggests matching code, you can view details of the matches and navigate to the relevant repositories on GitHub.

To adjust your settings:

  1. In the upper-right corner of any page on GitHub, click your profile photo, then click  Your Copilot .
  2. Next to  Suggestions matching public code , use the dropdown menu to select  Allow  or  Block .

For more information, see  Managing Copilot policies as an individual subscriber .

Code with More Confidence and Transparency

This new functionality offers developers greater transparency on their code completions (or “gray text”) by providing detailed information on any public code matches found. Prior to this change, Copilot completions with public code match were automatically blocked. Now, developers have the choice to access more code completions and receive sufficient information about any public code matches, enabling them to make informed decisions.

Try It Out Today

We believe this new code referencing feature in Copilot Completions improves your development experience with more transparency and informed choices. Give it a try in Visual Studio 17.13 or later, and share your feedback with us.

We appreciate the time you’ve spent reporting issues/suggestions and hope you continue to give us feedback when using Visual Studio on what you like and what we can improve. Your feedback is critical to help us make Visual Studio 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 YouTube , Twitter , LinkedIn , Twitch and on Microsoft Learn .

The post Introducing Code Referencing for GitHub Copilot Completions in Visual Studio appeared first on Visual Studio Blog .

]]>
Customize your AI-generated git commit messages https://devblogs.microsoft.com/visualstudio/customize-your-ai-generated-git-commit-messages/ Mon, 03 Feb 2025 16:00:58 +0000 https://devblogs.microsoft.com/visualstudio/?p=252252 When it comes to collaborative software development, clear and effective communication is key. One area that often gets overlooked is the Git commit message. Poorly crafted commit messages can lead to confusion and inefficiencies within a team. That’s why we’ve built on the suggestions and feedback for the AI-generated commit messages, and now you can […]

The post Customize your AI-generated git commit messages appeared first on Visual Studio Blog .

]]>
When it comes to collaborative software development, clear and effective communication is key. One area that often gets overlooked is the Git commit message. Poorly crafted commit messages can lead to confusion and inefficiencies within a team. That’s why we’ve built on the suggestions and feedback for the AI-generated commit messages , and now you can add custom prompt instructions!

This new capability enables you to tailor commit messages to fit your workflow and team’s standards seamlessly. Screenshot showing how you can customize the format of your git commit messages

This means you have control over the number of lines, the length of the lines, and even the style of the commit message. By specifying these details, you ensure that each commit message is meaningful and consistent with your team’s guidelines. Copilot understands terms like “subject,” “body,” and “footer.” Try out these examples as well:

  • Use all lowercase
  • Limit subject to 50 characters
  • Limit body to 2 sentences
  • Add a footer with three hash marks
  • Follow Conventional Commits standard
  • Use gitmoji

To make use of this feature, simply navigate to Tools > Options > Copilot and input your desired parameters. This customization can significantly enhance your workflow by making commit messages more informative and standardized, ultimately leading to better collaboration and less confusion.

We value your feedback

We continuously strive to improve our tools based on your feedback. Your insights are invaluable in making Visual Studio an even better platform for developers around the world. We appreciate your ongoing support and encourage you to keep sharing your thoughts with us. Let us know what you think of this feature in this suggestion ticket .

The post Customize your AI-generated git commit messages appeared first on Visual Studio Blog .

]]>
Copilot Content Exclusion Now Available in Visual Studio 2022 17.11 https://devblogs.microsoft.com/visualstudio/copilot-content-exclusion-in-visual-studio/ Thu, 15 Aug 2024 17:15:25 +0000 https://devblogs.microsoft.com/visualstudio/?p=249433 We are excited to announce that Copilot Content Exclusion is now available in Visual Studio 2022 17.11. This feature allows your admins to configure Copilot to ignore certain files in a repository or organization, giving you enterprise control that ensures sensitive information is protected while seamlessly integrating trusted AI for efficient coding. This will now […]

The post Copilot Content Exclusion Now Available in Visual Studio 2022 17.11 appeared first on Visual Studio Blog .

]]>
We are excited to announce that Copilot Content Exclusion is now available in Visual Studio 2022 17.11. This feature allows your admins to configure Copilot to ignore certain files in a repository or organization, giving you enterprise control that ensures sensitive information is protected while seamlessly integrating trusted AI for efficient coding.

This will now be available for Completions, Inline, Chat, for GitHub Copilot for Business and GitHub Copilot for Enterprise customers. Content Exclusion is not limited to repos hosted on GitHub but also available for repositories hosted on other platforms, such as Azure DevOps.

How to Exclude Content

Organization administrators or repository owners can choose which files or paths are excluded. This will prevent Copilot from accessing excluded files. Learn how to enable this feature here.

How to Check if Your Content is Excluded

Copilot experiences where exclusions apply:

Copilot experiences
Completions  Image Content Exclusion blogs completions

Verify if Content Exclusion is enabled on your file by checking the left side for the “Excluded” label.

Inline Chat  Image Content Exclusion blogs inline Verify if Content Exclusion is enabled in Inline Chat below the prompt box.
Chat Window  Image Content Exclusion blogs chat

Verify if Content Exclusion is enabled for the specific file you referenced by checking the tip at the top of your prompt box in the Chat Window.

Please note that certain GitHub Copilot features in Visual Studio may be fully disabled if any file is excluded. We hope this new feature enhances your experience with GitHub Copilot in Visual Studio

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 YouTube , Twitter , LinkedIn , Twitch and on Microsoft Learn .

The post Copilot Content Exclusion Now Available in Visual Studio 2022 17.11 appeared first on Visual Studio Blog .

]]>
Improve your code quality with GitHub Copilot in Visual Studio https://devblogs.microsoft.com/visualstudio/improve-your-code-quality-with-github-copilot-in-visual-studio/ Thu, 16 May 2024 12:01:13 +0000 https://devblogs.microsoft.com/visualstudio/?p=248901 In our previous post, we discussed GitHub Copilot’s Slash Commands, which allow you to trigger specific actions within Visual Studio with simple text-based inputs. Now, let’s explore the /optimize command and its potential to improve code quality in Visual Studio. Refactoring with /optimize In a recent exploration by Bruno Capuano, we see the transformative capabilities […]

The post Improve your code quality with GitHub Copilot in Visual Studio appeared first on Visual Studio Blog .

]]>
In our previous post, we discussed GitHub Copilot’s Slash Commands , which allow you to trigger specific actions within Visual Studio with simple text-based inputs. Now, let’s explore the /optimize command and its potential to improve code quality in Visual Studio.

Refactoring with /optimize

In a recent exploration by Bruno Capuano, we see the transformative capabilities of GitHub Copilot’s /optimize command. Bruno demonstrates its prowess by refactoring a code snippet, showcasing how simple text-based inputs can yield significant improvements in code structure and performance.

One of the prime examples showcased by Bruno involves the conversion of a traditional for loop utilizing numerical indices into a more readable and intuitive foreach loop. While foreach loops in .NET might seem more verbose, they often offer better readability, a crucial aspect in maintaining code quality and ease of understanding.

Here’s a glimpse of the original for loop snippet:

 for  ( int i =  zero ; i < chatHistory . Count ; i ++ )
 {
     var message = chatHistory [ i ] ;
     var msg =  new  ChatMessage ( ) ; msg . role = message . Role . ToString ( ) . ToLower ( ) ; msg . content = message . Content ; root . messages . Add ( msg ) ;
 }

To provide context to Copilot, Bruno selects the entire loop. He then initiates the inline chat dialog by typing “ Alt-/ ”.

 GitHub Copilot Chat dialog showing selected code with instructions to enhance code quality using the /optimize command in Visual Studio's chat interface

To guide Copilot in refactoring the code, Bruno types a Slash ‘ / ’, which opens the previously discussed dialog. He chooses the Optimize command from the menu and sends the command to Copilot.

Copilot responds with several optimization suggestions:

  • The ChatMessage  instance can be initialized during construction, enhancing efficiency.
  • A foreach  loop is utilized.

The refactored code appears as follows:

 foreach  ( var message in chatHistory )
 {
     var msg =  new  ChatMessage
     { role = message . Role . ToString ( ) . ToLower ( ) , content = message . Content } ; root . messages . Add ( msg ) ;
 }

Learn from Copilot: Give it a Try!

The most effective way to comprehend a tool’s functionality is to use it firsthand. I find it fascinating to apply the /optimize command to my production projects. At times, the modifications are minor, affirming the quality of my original code. However, there are instances when Copilot suggests ingenious alterations, often introducing me to new syntaxes.

Validating the output of GitHub Copilot is also crucial to ensure it hasn’t introduced any errors or regressions. Unit tests can serve as a safety net for these changes, just as they do during the refactoring of any piece of code.

Additional Resources

We offer a wealth of resources to further your understanding of GitHub Copilot for Visual Studio. We encourage you to explore this collection , you can watch the full video here and regularly visit this blog for more content.

The post Improve your code quality with GitHub Copilot in Visual Studio appeared first on Visual Studio Blog .

]]>
Mastering Slash Commands with GitHub Copilot in Visual Studio https://devblogs.microsoft.com/visualstudio/mastering-slash-commands-with-github-copilot-in-visual-studio/ Tue, 14 May 2024 08:00:25 +0000 https://devblogs.microsoft.com/visualstudio/?p=248869 GitHub Copilot, the AI-powered coding assistant, revolutionizes coding in Visual Studio with its advanced features. In this series, we delve into the efficiency and convenience offered by Slash Commands, elevating your coding workflow. Introducing Slash Commands Slash Commands are predefined actions within GitHub Copilot, accessible through the prompt interface. Bruno Capuano, in his latest video, […]

The post Mastering Slash Commands with GitHub Copilot in Visual Studio appeared first on Visual Studio Blog .

]]>
GitHub Copilot, the AI-powered coding assistant, revolutionizes coding in Visual Studio with its advanced features. In this series, we delve into the efficiency and convenience offered by Slash Commands, elevating your coding workflow.

Introducing Slash Commands

Slash Commands are predefined actions within GitHub Copilot, accessible through the prompt interface. Bruno Capuano, in his latest video, elucidates these commands, accessible via the Slash button in the Copilot Chat window or by typing a forward slash in the message box.

 Slash Commands menu by clicking the Slash button in the Copilot Chat window

Alternatively, you can also access the Slash Commands by typing a forward slash in the message box.

 Image LBugnion 1 1712226760337

Key commands include:

  • doc : Insert a documentation comment in the current cursor position.
  • exp : Start a new conversation thread with a fresh context.
  • explain : Provide an explanation for the selected code.
  • fix : Suggest fixes for code errors and typos.
  • generate : Generate new code snippets based on your input.
  • optimize : Recommend code optimizations to improve performance.
  • tests : Create a unit test for the current code selection.
  • help : Access help and support for GitHub Copilot.

 

A Practical Example with /fix

Demonstrating the power of Slash Commands, the /fix command automatically suggests corrections for typos and errors, enhancing code quality and efficiency.

In the video, Bruno demonstrates how GitHub Copilot can automatically suggest corrections for typos and other issues. This command can be used in the main chat window, and it’s also accessible in the inline chat by pressing Alt-Slash (Alt-/) or through the right-click context menu.

As you can see, these Slash Commands can significantly improve your productivity in Visual Studio. Learn how to Install GitHub Copilot in Visual Studio .

Additional Resources

To learn more about GitHub Copilot and Slash Commands, check out our resource collection here. You can watch the full video here . For ongoing updates, stay tuned to this blog and consider subscribing to our YouTube channel for more insights and tutorials.

The post Mastering Slash Commands with GitHub Copilot in Visual Studio appeared first on Visual Studio Blog .

]]>
Using GitHub Copilot as your Coding GPS https://devblogs.microsoft.com/visualstudio/using-github-copilot-as-your-coding-gps/ Tue, 07 May 2024 10:00:15 +0000 https://devblogs.microsoft.com/visualstudio/?p=248858 In this series, we delve into GitHub Copilot in Visual Studio, showcasing how it aids coding. GitHub Copilot functions as a coding GPS, guiding you through software development in Visual Studio. In our new short video, Bruno Capuano shows how this smart coding assistant boosts coding efficiency and quality. GitHub Copilot: an assistant, not a […]

The post Using GitHub Copilot as your Coding GPS appeared first on Visual Studio Blog .

]]>
In this series, we delve into GitHub Copilot in Visual Studio, showcasing how it aids coding. GitHub Copilot functions as a coding GPS, guiding you through software development in Visual Studio. In our new short video, Bruno Capuano shows how this smart coding assistant boosts coding efficiency and quality.

GitHub Copilot: an assistant, not a replacement

Bruno says GitHub Copilot improves your coding in Visual Studio, not replaces developers. Microsoft agrees, saying AI should help humans, not replace them. CEO Satya Nadella says AI should boost productivity without replacing people.

Developers should check the code GitHub Copilot suggests. Sometimes it may suggest wrong code, called “hallucinations.” Though GitHub Copilot is usually accurate, however, reviewing its suggestions is important to be sure.

First, install GitHub Copilot. You can find setup help in GitHub Copilot documentation or our Microsoft Learn tutorial for installing GitHub Copilot Chat in Visual Studio.

Using LLMs for a new way of interaction

GitHub Copilot uses Large Language Models (LLMs) for its core. LLMs bring a new way to interact with computers. They use probabilities and lots of data to generate responses from natural-language prompts, making coding feel like a conversation. This interaction covers more than text; it includes images and videos as well.

 Illustration with an overview of AI capabilities, including computer vision, voice recognition, image recognition, and more.

Because LLMs can vary, developers need to oversee this, ensuring consistency in their results.

Embracing the Future with GitHub Copilot

As AI becomes more common in industries, developers should adapt. Tools like GitHub Copilot can help by making coding more efficient and adaptable. To keep up, it’s important to learn about AI tools, their strengths, and their limits. Check out our resources and full-length video tutorial for more about GitHub Copilot and how to use it in your projects!

Additional Resources:

The post Using GitHub Copilot as your Coding GPS appeared first on Visual Studio Blog .

]]>
How to use GitHub Copilot Chat in Visual Studio https://devblogs.microsoft.com/visualstudio/how-to-use-github-copilot-chat-in-visual-studio/ Tue, 16 Apr 2024 10:00:38 +0000 https://devblogs.microsoft.com/visualstudio/?p=248626 In this series, we will explore the capabilities and how to use GitHub Copilot Chat within Visual Studio, demonstrating how it can elevate your coding efficiency. GitHub Copilot serves as an AI-powered coding assistant designed to enhance your coding experience across various development environments. Exploring code with GitHub Copilot Chat In our latest video, my […]

The post How to use GitHub Copilot Chat in Visual Studio appeared first on Visual Studio Blog .

]]>
In this series, we will explore the capabilities and how to use GitHub Copilot Chat within Visual Studio, demonstrating how it can elevate your coding efficiency. GitHub Copilot serves as an AI-powered coding assistant designed to enhance your coding experience across various development environments.

Exploring code with GitHub Copilot Chat

In our latest video, my colleague Bruno Capuano showcases the utility of GitHub Copilot Chat within Visual Studio, specifically focusing on populating arrays with random numbers. While arrays are a fundamental data structure, GitHub Copilot Chat facilitates exploration beyond arrays, guiding users towards utilizing more versatile structures like Lists.

Make sure to have GitHub Copilot installed, refer to the documentation to learn how to install GitHub Copilot Chat for Visual Studio.

GitHub Copilot Chat streamlines the understanding of differences between arrays and Lists, highlighting key distinctions such as:

  • Size: Arrays have a fixed-size structure, whereas Lists can dynamically adjust their size during runtime.
  • Performance: Arrays generally offer higher efficiency due to their static sizing, while Lists excel in scenarios requiring frequent size adjustments.
  • Functionality: Lists boast a broader array of methods compared to arrays, enabling more versatile data manipulation.

Additionally, GitHub Copilot Chat offers code examples demonstrating the creation of arrays and Lists, alongside basic element addition operations.

You need not explicitly specify the programming language or framework to GitHub Copilot Chat; it intuitively adapts to the context of your solution and file, mimicking the natural flow of communication during pair-programming sessions.

Converting code

In a practical demonstration, Bruno utilizes GitHub Copilot Chat to seamlessly transition code initially utilizing arrays into more flexible List-based implementations. Notably, the preview feature provides a comprehensive overview of proposed code modifications, empowering users to validate Copilot-generated solutions before implementation.

I’ve replicated Bruno’s example below, showcasing the code suggested by Copilot Chat both before and after the conversion:

Before

 // fill an array with 10 random numbers int[] numbers = new int[10]; Random random = new Random(); for (int i = 0; i < numbers.Length; i++) { numbers[i] = random.Next(1, 100); }

When selecting the code and opening the GitHub Copilot chat dialogue window, we’ll ask Copilot to convert the code to use the list format.

 Asking Copilot to convert the code
Asking Copilot to convert the code

After

 // fill a list with 10 random numbers List<int> numbers = new List<int>(); Random random = new Random(); for (int i = 0; i < 10; i++) { numbers.Add(random.Next(1, 100)); }

 The proposed solution
The proposed solution

 

 The Preview feature
The Preview feature

Conclusion

Now that you have successfully installed GitHub Copilot in Visual Studio, you can now enjoy the benefits of AI-powered coding assistance. GitHub Copilot can help you write code faster and you can also learn from the suggestions and examples that GitHub Copilot provides. To learn more about GitHub Copilot and how to use it, check our collection with resources here  or via our  full-length video .

Additional Resources

The post How to use GitHub Copilot Chat in Visual Studio appeared first on Visual Studio Blog .

]]>
Introducing the new Copilot experience in Visual Studio https://devblogs.microsoft.com/visualstudio/introducing-the-new-copilot-experience-in-visual-studio/ Tue, 09 Apr 2024 18:24:33 +0000 https://devblogs.microsoft.com/visualstudio/?p=247314 GitHub Copilot your AI-powered coding companion is now seamlessly woven into your Visual Studio IDE, enhancing your everyday tasks and bringing you the latest AI-driven coding experiences. Copilot is designed to elevate your efficiency, by offering personalized code suggestions, crafting your git commit messages, answering coding-related queries, and much more. We’re thrilled to introduce the […]

The post Introducing the new Copilot experience in Visual Studio appeared first on Visual Studio Blog .

]]>
GitHub Copilot your AI-powered coding companion is now seamlessly woven into your Visual Studio IDE, enhancing your everyday tasks and bringing you the latest AI-driven coding experiences. Copilot is designed to elevate your efficiency, by offering personalized code suggestions, crafting your git commit messages , answering coding-related queries, and much more .

We’re thrilled to introduce the new, unified Copilot experience in Visual Studio 17.10, now available in Preview 3 (General availability in May). This combines the features of Copilot and Copilot Chat into one convenient package. Eliminating the need to install two separate extensions and bringing you more deeply integrated AI experiences in the future. Activate your GitHub Copilot subscription today, by signing in to GitHub or start a free trial for the latest AI experience.

See Copilot in action

 

note: Copilot in now in the top right side of your Visual Studio

What is GitHub Copilot?

Copilot is your AI-powered coding companion designed to enhance your IDE experience . It helps you in the following ways:

  • Speeding up your coding tasks with Copilot generated snippet, methods, and even entire programs.
  • Improve your code quality with Copilot’s optimization feature “/optimize” in Copilot Chat to improve your code’s performance, readability, and security.
  • Learn new coding patterns , languages, and frameworks by getting explanations and documentation for the suggested code from Copilot.
  • Focus on more satisfying and creative work by allowing Copilot to handle the repetitive, boilerplate, or tedious code, and conserving your mental energy and flow.

GitHub Copilot offers an interactive experience throughout Visual Studio, through chat both in a separate window and directly in your code, allowing you to start a conversation or simply begin typing. Copilot provides context-aware code completions, suggestions, and even entire code snippets. It’s like having a pair programmer who can help you, write commit messages, debug your code, generate your unit tests and more. GitHub Copilot serves as a valuable resource for information and answers about your code, including documentation, definitions, references, error explanations, and best practices.

Accessing Copilot

If you are a customer in Visual Studio 17.10 Preview:

  1. If you are using Visual Studio 17.10, GitHub Copilot is included right out of the box as a recommended component and will be installed on update or install .
    • If you need to install GitHub Copilot later, you can do so from the Visual Studio Installer by search for the “GitHub Copilot” component in the “Individual Component” tab. Note : If you prefer not to use Copilot installed in your Visual Studio, you have the option to hide the feature by selecting the GitHub Copilot badge and choosing “Hide Copilot”.
  2. For Versions 17.8 to 17.9 you will still be able to download “GitHub Copilot Chat” and “GitHub Copilot Completions” via Extension Manager, however, to get the latest Copilot features update to 17.10.

Getting Started

To use the new Copilot extension, you’ll need a GitHub Copilot subscription . GitHub Copilot is free for verified students and for maintainers of popular open-source projects on GitHub. If you’re not a student or a maintainer of a popular open-source project, you can try GitHub Copilot for free with a one-time 30-day trial. After the free trial, a paid subscription is required for continued use.

Once you have Copilot installed, you can easily sign in and manage your Copilot directly from the top right corner of the title bar in Visual Studio 17.10.

 

Using Copilot

Code Completions

Start writing in the editor and Copilot will suggest code as you type. 💡 Tip: press "tab" to accept a suggestion.

Inline Chat

Use Inline Chat will help you write your methods, classes, unit tests by c onverting your prompts to code. Open Inline by right-clicking in your text file and selecting “Ask Copilot” or Alt + / `

 💡 Tip: Use "/" to state your intent or  "#" to refer to your files(s). Like "/test for #filename"

Chat Window

Ask questions about your solution or files.  O pen from the Copilot Badge or CTRL + /, C.

 💡 Tip: Use #solution  to refer to your active solution (only for C#) in Visual Studio

 

We Value Your Feedback

We hope you find the new Copilot experience beneficial for your development needs. Your feedback and suggestions for improvement are always welcome. You can reach out to us through this survey or submit for feature requests here: Developer Community (visualstudio.com) .

Happy coding! 🚀

 

The post Introducing the new Copilot experience in Visual Studio appeared first on Visual Studio Blog .

]]>