{"id":244544,"date":"2023-08-22T08:00:56","date_gmt":"2023-08-22T15:00:56","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/visualstudio\/?p=244544"},"modified":"2023-09-20T14:30:26","modified_gmt":"2023-09-20T21:30:26","slug":"simplified-code-refinement-and-debugging-with-github-copilot-chat","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/visualstudio\/simplified-code-refinement-and-debugging-with-github-copilot-chat\/","title":{"rendered":"Simplified Code Refinement and Debugging with GitHub Copilot Chat"},"content":{"rendered":"<p>This March, we announced <a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/github-copilot-chat-for-visual-studio-2022\/\" target=\"_blank\" rel=\"noopener\">GitHub Copilot chat for Visual Studio 2022<\/a>. With Chat, Copilot has moved beyond code completions, offering in-depth analysis and explanations of how code works. It supports the generation of unit tests, and even helps with proposed fixes to bugs, and explaining exceptions. By gathering useful context data from Visual Studio, Copilot Chat helps you form great questions to get useful answers. Using GitHub Copilot with Visual Studio gives you more time for creativity by spending less time on boilerplate manual tasks and diagnosis.<\/p>\n<p>Now, we\u2019ve taken deep integration with Visual Studio a step further. Using the Interactive Code Assistant view, you can seamlessly refine your code with Copilot Chat, without ever needing to leave the comfort of your editor window. Your workflow is uninterrupted &#8211; no more going back and forth to the chat window! Get started using &#8220;ask Copilot&#8221; wherever in your code file you want to work &#8211; ask your questions and see answers inline with the code they relate to. Whenever Copilot suggests code changes, you\u2019ll see your code side by side with Copilot\u2019s suggestion &#8211; the normal Visual Studio diff view pattern &#8211; to help you thoroughly review, correct and refine what is being proposed at your own pace before applying to your code. We\u2019ve taken care to make sure you are always in the driver&#8217;s seat, with complete control throughout the process.<\/p>\n<p>Check out the video below to see how Copilot\u2019s Interactive Code Assistant works:<\/p>\n<div style=\"width: 80%; margin: 0 auto; display: block;\">\n<p><div style=\"width: 640px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-244544-1\" width=\"640\" height=\"360\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/08\/CopilotChatVSInlineRefinement.mp4?_=1\" \/><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/08\/CopilotChatVSInlineRefinement.mp4\">https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/08\/CopilotChatVSInlineRefinement.mp4<\/a><\/video><\/div><\/p>\n<\/div>\n<h3><strong>Enhanced diagnostics with Copilot<\/strong><\/h3>\n<p>The team\u2019s also been hard at work bringing Copilot Chat to your fingertips in more places when you are debugging in Visual Studio. The three features below illustrate some of that work:<\/p>\n<h4>CPU Usage auto insights in the profiler<\/h4>\n<p>A profiler can help you make informed decisions quickly by providing a visual depiction of execution times and CPU usage for your application. Copilot now gives you detailed information via CPU Usage auto insights. It now provides more detailed information and insights for specific methods and properties, including Enum.HasFlag, Enum.ToString, String.StartsWith, ConcurrentDictionary.Count and more. With Copilot, you can ask questions about functions on the identified hot paths in your code, which can help you produce more efficient or cost-effective code. Just click \u201cAsk Copilot\u201d to start exploring.<\/p>\n<div style=\"width: 80%; margin: 0 auto; display: block;\">\n<p><div style=\"width: 1920px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-244544-2\" width=\"1920\" height=\"1080\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/08\/profiler-helper-2.mp4?_=2\" \/><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/08\/profiler-helper-2.mp4\">https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/08\/profiler-helper-2.mp4<\/a><\/video><\/div><\/p>\n<\/div>\n<h4>Copilot Exception Helper<\/h4>\n<p>Copilot can provide you with meaningful help when you are debugging your code. For example, when an exception is thrown, it gives you the opportunity to start asking questions. Copilot has access to exceptions, call stack, local variables, and code. By forming good questions based on the right parts of the data Visual Studio has when you&#8217;re at an exception, Copilot Chat can provide useful insights and fixes for the issue.<\/p>\n<p>See how this works in this video<\/p>\n<div style=\"width: 80%; margin: 0 auto; display: block;\">\n<p><div style=\"width: 1920px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-244544-3\" width=\"1920\" height=\"1080\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/08\/exception-assistant-1a.mp4?_=3\" \/><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/08\/exception-assistant-1a.mp4\">https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/08\/exception-assistant-1a.mp4<\/a><\/video><\/div><\/p>\n<\/div>\n<h4>Debugger \u201cRubber Ducking\u201d<\/h4>\n<p>Copilot can now understand call stacks, frames, variable names, and values. This means you can pose detailed questions to a debugger-aware Copilot.<\/p>\n<p>Check out the video below to see how this works:<\/p>\n<div style=\"width: 80%; margin: 0 auto; display: block;\">\n<p><div style=\"width: 1718px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-244544-4\" width=\"1718\" height=\"908\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/08\/rubber-ducking-3.mp4?_=4\" \/><a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/08\/rubber-ducking-3.mp4\">https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2023\/08\/rubber-ducking-3.mp4<\/a><\/video><\/div><\/p>\n<\/div>\n<h3><strong>How can I get these Copilot Chat preview features?<\/strong><\/h3>\n<p>All Copilot for Individuals users now have access to the GitHub Copilot Chat preview for Visual Studio! See <a href=\"https:\/\/github.blog\/2023-09-20-github-copilot-chat-beta-now-available-for-all-individuals\/\" rel=\"noopener\" target=\"_blank\">Shuyin Zhao&#8217;s blog post<\/a> for more details.  If you are already a user of Copilot for Individuals, just get the <a href=\"https:\/\/aka.ms\/VSXGHCopilot\" rel=\"noopener\" target=\"_blank\">latest version of the extension<\/a> to see the new features.<\/p>\n<h3><strong>We want to hear from you!<\/strong><\/h3>\n<p>We\u2019re really grateful for all the feedback you\u2019ve provided so far as we\u2019ve been creating Copilot Chat, and excited to see where this next wave of AI-assisted productivity takes you as you create great software. Please try the new features and share your feedback \u2013 just use <a href=\"https:\/\/learn.microsoft.com\/en-us\/visualstudio\/ide\/how-to-report-a-problem-with-visual-studio?view=vs-2022\" target=\"_blank\" rel=\"noopener\">Visual Studio &#8220;Report a Problem&#8221;<\/a> to send us your suggestions, feedback and issues for GitHub Copilot Chat in Visual Studio.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This March, we announced GitHub Copilot chat for Visual Studio 2022. With Chat, Copilot has moved beyond code completions, offering in-depth analysis and explanations of how code works. It supports the generation of unit tests, and even helps with proposed fixes to bugs, and explaining exceptions. By gathering useful context data from Visual Studio, Copilot [&hellip;]<\/p>\n","protected":false},"author":587,"featured_media":244702,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[6887,6888,155],"tags":[6913],"class_list":["post-244544","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-artificial-intelligence","category-copilot","category-visual-studio","tag-chat"],"acf":[],"blog_post_summary":"<p>This March, we announced GitHub Copilot chat for Visual Studio 2022. With Chat, Copilot has moved beyond code completions, offering in-depth analysis and explanations of how code works. It supports the generation of unit tests, and even helps with proposed fixes to bugs, and explaining exceptions. By gathering useful context data from Visual Studio, Copilot [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/244544","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/users\/587"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/comments?post=244544"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/244544\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media\/244702"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media?parent=244544"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/categories?post=244544"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/tags?post=244544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}