{"id":36293,"date":"2026-02-19T16:13:03","date_gmt":"2026-02-19T16:13:03","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cppblog\/?p=36293"},"modified":"2026-03-02T22:11:11","modified_gmt":"2026-03-02T22:11:11","slug":"c-symbol-context-and-cmake-build-configuration-awareness-for-github-copilot-in-vs-code","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/c-symbol-context-and-cmake-build-configuration-awareness-for-github-copilot-in-vs-code\/","title":{"rendered":"C++ symbol context and CMake build configuration awareness for GitHub Copilot in VS Code"},"content":{"rendered":"<p>C++ code navigation and build system tooling play an important role in the developer inner-loop. Code navigation tooling provides a precise, semantic understanding of your codebase, while build system tooling helps you express build configurations and variants for reproducible builds. In the VS Code ecosystem, these powerful capabilities are available through our <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-vscode.cpptools\">C\/C++<\/a> and <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-vscode.cmake-tools\">CMake Tools<\/a> extensions.<\/p>\n<p>With the latest updates to GitHub Copilot in VS Code, we&#8217;re bringing the same C++-specific intelligence directly into agent mode by surfacing key language and build system capabilities as tools the agent can invoke. The goal is simple: make AI-assisted C++ workflows more consistent and performant by grounding them in the same symbol and build context developers already use and trust.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/cpp-devtools.webp\"><img decoding=\"async\" class=\"size-full wp-image-36294 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/cpp-devtools.webp\" alt=\"List of C\/C++ DevTools for Copilot Chat \" width=\"1347\" height=\"411\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/cpp-devtools.webp 1347w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/cpp-devtools-300x92.webp 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/cpp-devtools-1024x312.webp 1024w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/cpp-devtools-768x234.webp 768w\" sizes=\"(max-width: 1347px) 100vw, 1347px\" \/><\/a>These tools are available through the new<a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-vscode.cpp-devtools\"> C\/C++ DevTools extension<\/a>, which ships as a part of the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-vscode.cpptools-extension-pack\">C\/C++ extension pack<\/a> for VS Code. To view the full documentation, please visit our <a href=\"https:\/\/code.visualstudio.com\/docs\/cpp\/cpp-devtools\">C++ DevTools docs<\/a>.<\/p>\n<h3>C++ code understanding tools<\/h3>\n<p>With the new C++ code understanding tools, agent mode now has access to rich C++ symbol context. Instead of relying solely on text search or file search, the agent can now reason about C++ code at the symbol level across your workspace, which it can leverage to intelligently perform code editing operations across a codebase.<\/p>\n<p>The current tools available for Copilot Chat include:<\/p>\n<ul>\n<li><strong>Get symbol definition<\/strong> \u2013 Retrieve detailed information about a C++ symbol, including where it is defined and its associated metadata<\/li>\n<li><strong>Get symbol references<\/strong> \u2013 Find all references to a given symbol across the codebase<\/li>\n<li><strong>Get symbol call hierarchy <\/strong>\u2013 Surface incoming and outgoing calls for a function to understand call patterns and dependencies<\/li>\n<\/ul>\n<p>To enable these tools, select the <strong>Enable Cpp Code Editing Tools<\/strong> setting in your VS Code user settings.<\/p>\n<h3><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/enable-cpp-code-editing-tools.webp\"><img decoding=\"async\" class=\"size-full wp-image-36295 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/enable-cpp-code-editing-tools.webp\" alt=\"VS code setting to enable C++ code editing tools\" width=\"753\" height=\"147\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/enable-cpp-code-editing-tools.webp 753w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/enable-cpp-code-editing-tools-300x59.webp 300w\" sizes=\"(max-width: 753px) 100vw, 753px\" \/><\/a><\/h3>\n<h3>Example use cases<\/h3>\n<p><strong>Memory safety<\/strong><\/p>\n<p>Memory safety issues in C++ are rarely isolated to a single line of code. Safely modernizing or hardening code requires understanding where memory is allocated, who owns it, and how it flows through the system. With C++ code understanding tools, agent mode can reason about these questions using symbol-level context rather than text search alone. For example, in the following refactor, Copilot was able to quickly locate relevant symbol information and all references to the symbol to rapidly collect relevant context rather than manually searching through .cpp and .h files.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/memory-safety-example.webp\"><img decoding=\"async\" class=\" wp-image-36296 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/memory-safety-example.webp\" alt=\"Example prompt to refactor a symbol to be more memory safe, which invokes the symbol info and references tools.\" width=\"685\" height=\"589\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/memory-safety-example.webp 906w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/memory-safety-example-300x258.webp 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/memory-safety-example-768x660.webp 768w\" sizes=\"(max-width: 685px) 100vw, 685px\" \/><\/a><\/p>\n<p><strong>Dependency analysis<\/strong><\/p>\n<p>Before moving a component to a new library or changing an API surface, developers need to understand what components depend on it. Call hierarchies let Copilot analyze dependency chains and highlight potential ripple effects before changes are made. For example, Copilot is able to determine call hierarchies related to <code>btDdvtBroadphase<\/code> to determine the relevant calls to and from a given function.<\/p>\n<h3><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/call-hierarchy-example.webp\"><img decoding=\"async\" class=\" wp-image-36297 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/call-hierarchy-example.webp\" alt=\"Example dependency analysis question where user asked to move module into a separate library, which called the get call hierarchy tool\" width=\"724\" height=\"838\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/call-hierarchy-example.webp 917w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/call-hierarchy-example-259x300.webp 259w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/call-hierarchy-example-885x1024.webp 885w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/call-hierarchy-example-768x889.webp 768w\" sizes=\"(max-width: 724px) 100vw, 724px\" \/><\/a><\/h3>\n<h3>CMake build and test configuration tools<\/h3>\n<p>In C++ development, every change must compile, link, and pass unit tests across the project\u2019s active build configuration, not just look correct in the editor.\nCMake build and test configuration tools leverage the build configurations identified and provided by the CMake tools extension, so Copilot Chat seamlessly builds and tests your project using the exact configuration you already have selected in VS Code. By working with the same CMake Tools integration you use in the editor, Copilot avoids relying on ad-hoc command-line invocations and stays aligned with your chosen targets, presets, and build state. This enables the agent to perform end-to-end C++ workflows greater accuracy and reliability.\nThe current tools available to Copilot Chat for build configuration include:<\/p>\n<ul>\n<li><strong>Build with CMake:\u00a0<\/strong>Build a CMake project using active configuration<\/li>\n<li><strong>Run CTests:<\/strong> Run CTest tests using active test suite<\/li>\n<li><strong>List Build Targets<\/strong>: List the available set of build targets for a CMake project<\/li>\n<li><strong>List CTest tests:<\/strong> List the available set of tests for a CMake project<\/li>\n<\/ul>\n<h3>Example use cases<\/h3>\n<p><strong>Fixing build errors<\/strong><\/p>\n<p>If a change to a codebase introduces a compiler or build error, Copilot can invoke the new CMake build tool using the active configuration, inspect the failure, and iterate on this fix until the project builds successfully with CMake.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/cmake-build-tool-example-1.webp\"><img decoding=\"async\" class=\"wp-image-36299 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/cmake-build-tool-example-1.webp\" alt=\"cmake build tool example image\" width=\"763\" height=\"685\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/cmake-build-tool-example-1.webp 1246w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/cmake-build-tool-example-1-300x269.webp 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/cmake-build-tool-example-1-1024x918.webp 1024w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/cmake-build-tool-example-1-768x688.webp 768w\" sizes=\"(max-width: 763px) 100vw, 763px\" \/><\/a><\/p>\n<p><strong>Modify code to pass test suite<\/strong><\/p>\n<p>When a change is introduced to code, Copilot can run relevant tests and adjust the code until they pass, using the same test infrastructure developers rely on manually, ensuring that the code not only builds successfully but passes the test suite.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/enhance-tests-v3-1.webp\"><img decoding=\"async\" class=\" wp-image-36333 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/enhance-tests-v3-1.webp\" alt=\"Enhance tests for parsing functions in C++ prompt being kicked off\" width=\"782\" height=\"804\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/enhance-tests-v3-1.webp 920w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/enhance-tests-v3-1-292x300.webp 292w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/enhance-tests-v3-1-768x790.webp 768w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/enhance-tests-v3-1-24x24.webp 24w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/enhance-tests-v3-1-48x48.webp 48w\" sizes=\"(max-width: 782px) 100vw, 782px\" \/><\/a><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/ehance-tests-v3-2.webp\"><img decoding=\"async\" class=\" wp-image-36334 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/ehance-tests-v3-2.webp\" alt=\"The tools for build and test now invoke in the prompt\" width=\"778\" height=\"764\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/ehance-tests-v3-2.webp 887w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/ehance-tests-v3-2-300x295.webp 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/ehance-tests-v3-2-768x754.webp 768w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/ehance-tests-v3-2-24x24.webp 24w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/ehance-tests-v3-2-48x48.webp 48w\" sizes=\"(max-width: 778px) 100vw, 778px\" \/><\/a><\/p>\n<h3>Tips for best results<\/h3>\n<ul>\n<li><strong>Be specific: <\/strong>Identify the exact symbol, file, or component you&#8217;re asking about (for example, &#8220;refactor the\u00a0getConfig()\u00a0function&#8221; rather than &#8220;make this faster&#8221;)<\/li>\n<li><strong>Reference context: <\/strong>Ask Copilot Chat to consider specific files, functions, or modules when analyzing changes.<\/li>\n<li><strong>Directly reference tools:<\/strong> Directly reference relevant tools using <strong>#<\/strong> in chat to ensure invocation.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/tool-invoke.webp\"><img decoding=\"async\" class=\" wp-image-36302 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/tool-invoke.webp\" alt=\"Directly invoke tools via # command\" width=\"1111\" height=\"306\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/tool-invoke.webp 1253w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/tool-invoke-300x83.webp 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/tool-invoke-1024x282.webp 1024w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/02\/tool-invoke-768x211.webp 768w\" sizes=\"(max-width: 1111px) 100vw, 1111px\" \/><\/a><\/p>\n<ul>\n<li><strong>Use custom instructions: <\/strong>Set up\u00a0<a href=\"https:\/\/github.com\/sinemakinci1\/vscode-docs\/blob\/sinemakinci\/symbol-references\/docs\/copilot\/customization\/custom-instructions.md\">custom instructions<\/a> to guide Copilot Chat. See example custom instructions for improving C++ tools call rates documented <a href=\"https:\/\/github.com\/github\/awesome-copilot\/blob\/main\/instructions\/cpp-language-service-tools.instructions.md\">here in the awesome-copilot repo<\/a>.<\/li>\n<li><strong>Leverage latest models: <\/strong>Use the latest AI models that support tool-calling for the most accurate code understanding and tool usage.<\/li>\n<li><strong>Optimize tool performance: <\/strong>Only enable relevant tools to your development workflow to avoid context bloat.<\/li>\n<\/ul>\n<h3>Let us know your feedback!<\/h3>\n<p>We\u2019re excited to continue improving these tools and other C++ integration points based on feedback, and we encourage you to try them out and let us know how they fit into your C++ workflows. Download the C\/C++ DevTools extension and give it a try. Please file any issues or feedback in the appropriate repository. For CMake-related functionality: <a href=\"https:\/\/github.com\/microsoft\/vscode-cmake-tools\/issues\">Issues \u00b7 microsoft\/vscode-cmake-tools<\/a> and for C++-related functionality: <a href=\"https:\/\/github.com\/microsoft\/vscode-cpptools\/issues\">Issues \u00b7 microsoft\/vscode-cpptools<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>C++ code navigation and build system tooling play an important role in the developer inner-loop. Code navigation tooling provides a precise, semantic understanding of your codebase, while build system tooling helps you express build configurations and variants for reproducible builds. In the VS Code ecosystem, these powerful capabilities are available through our C\/C++ and CMake [&hellip;]<\/p>\n","protected":false},"author":85413,"featured_media":36294,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,266,3949,275],"tags":[],"class_list":["post-36293","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus","category-cmake","category-copilot-2","category-visual-studio-code"],"acf":[],"blog_post_summary":"<p>C++ code navigation and build system tooling play an important role in the developer inner-loop. Code navigation tooling provides a precise, semantic understanding of your codebase, while build system tooling helps you express build configurations and variants for reproducible builds. In the VS Code ecosystem, these powerful capabilities are available through our C\/C++ and CMake [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/36293","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=36293"}],"version-history":[{"count":2,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/36293\/revisions"}],"predecessor-version":[{"id":36342,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/36293\/revisions\/36342"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/36294"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=36293"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=36293"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=36293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}