{"id":35931,"date":"2025-11-12T17:31:14","date_gmt":"2025-11-12T17:31:14","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cppblog\/?p=35931"},"modified":"2025-11-12T17:31:44","modified_gmt":"2025-11-12T17:31:44","slug":"perform-wide-sweeping-refactors-using-c-code-editing-tools-for-github-copilot","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/perform-wide-sweeping-refactors-using-c-code-editing-tools-for-github-copilot\/","title":{"rendered":"Perform wide-sweeping refactors using C++ code editing tools for GitHub Copilot"},"content":{"rendered":"<p><div  class=\"d-flex justify-content-center\"><a class=\"cta_button_link btn-primary mb-24\" href=\"https:\/\/aka.ms\/code-editing-tools-private-preview\" target=\"_blank\">Sign up for our Private Preview<\/a><\/div><\/p>\n<p>Refactoring a C++ codebase can often require tracking updates across various sections of multiple files to ensure accuracy and relevancy. \u00a0Historically, developers have relied on manual searches across a codebase and refactoring tools to perform these types of edits. However, with GitHub Copilot agents, developers can now delegate these complex editing tasks to the agent, which understands your intent and can carry out codebase-wide edits, reducing the manual effort required to perform these refactors.<\/p>\n<p>To make this experience even more powerful for C++ developers, we\u2019re introducing C++ Code Editing Tools for GitHub Copilot, now <a href=\"https:\/\/aka.ms\/cpp-agents-private-preview\">available in Private Preview<\/a> in the latest version of <a href=\"https:\/\/visualstudio.microsoft.com\/insiders\/\">Visual Studio 2026 Insiders<\/a>.<\/p>\n<p>These tools bring the power of C++ IntelliSense to <a href=\"https:\/\/learn.microsoft.com\/en-us\/visualstudio\/ide\/copilot-agent-mode?view=vs-2022\">Visual Studio agent mode<\/a>, enabling faster and more accurate codebase-wide edits. With these tools, GitHub Copilot can now access rich context for any C++ symbol, including:<\/p>\n<ul>\n<li>Viewing all references across your codebase<\/li>\n<li>Understanding relevant metadata (e.g. type, declaration, and scope)<\/li>\n<li>Visualizing class inheritance hierarchies<\/li>\n<li>Tracing function call chains<\/li>\n<\/ul>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/11\/Picture1.webp\"><img decoding=\"async\" class=\" wp-image-35932 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/11\/Picture1.webp\" alt=\"The list of C++ tools available for Agent Mode to invoke\" width=\"408\" height=\"223\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/11\/Picture1.webp 307w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/11\/Picture1-300x164.webp 300w\" sizes=\"(max-width: 408px) 100vw, 408px\" \/><\/a><\/p>\n<p>By grounding edits in semantic understanding rather than syntactic-level text matching, these tools help reduce the manual effort required for refactors.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/11\/find-all-references.webp\"><img decoding=\"async\" class=\"wp-image-35933 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/11\/find-all-references.webp\" alt=\"The agent mode invokes get_symbol_References to find all references to the specified symbol\" width=\"858\" height=\"498\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/11\/find-all-references.webp 1368w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/11\/find-all-references-300x174.webp 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/11\/find-all-references-1024x594.webp 1024w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2025\/11\/find-all-references-768x446.webp 768w\" sizes=\"(max-width: 858px) 100vw, 858px\" \/><\/a><\/p>\n<p>To see these tools in action, please watch our demo below<\/p>\n<p><iframe title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/PWmLjg0HFT4?si=CH2s4dwrMOp1rq57\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>You can invoke these tools directly in Copilot Chat and use <a href=\"https:\/\/devblogs.microsoft.com\/visualstudio\/boost-your-copilot-collaboration-with-reusable-prompt-files\/\">prompt files<\/a> for more complex refactoring tasks. For best results, we recommend that you be clear and specific with your prompts and break larger ideas into smaller, fine-grained tasks for the agent to execute.<\/p>\n<h2>Want to try it out?<\/h2>\n<p>These tools are now available in Private Preview as we work to shape the user experience and gather feedback from our C++ developers. If you\u2019re interested in signing up to try these out for yourself, please <a href=\"https:\/\/aka.ms\/cpp-agents-private-preview\">join our Private Preview waitlist<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Refactoring a C++ codebase can often require tracking updates across various sections of multiple files to ensure accuracy and relevancy. \u00a0Historically, developers have relied on manual searches across a codebase and refactoring tools to perform these types of edits. However, with GitHub Copilot agents, developers can now delegate these complex editing tasks to the agent, [&hellip;]<\/p>\n","protected":false},"author":85413,"featured_media":35932,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[270,1,3940,3949,3920,230,3958],"tags":[],"class_list":["post-35931","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-announcement","category-cplusplus","category-copilot","category-copilot-2","category-github","category-new-feature","category-visual-studio"],"acf":[],"blog_post_summary":"<p>Refactoring a C++ codebase can often require tracking updates across various sections of multiple files to ensure accuracy and relevancy. \u00a0Historically, developers have relied on manual searches across a codebase and refactoring tools to perform these types of edits. However, with GitHub Copilot agents, developers can now delegate these complex editing tasks to the agent, [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/35931","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/85413"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=35931"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/35931\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/35932"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=35931"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=35931"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=35931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}