Microsoft brings C++ smarts to GitHub Copilot in Visual Studio Code

Microsoft has introduced C++ symbol context and CMake build configuration awareness for GitHub Copilot in Visual Studio Code.

The C++ code understanding improvements were announced on February 19. The updates to GitHub Copilot in VS Code bring the same C++ intelligence as the Microsoft’s C/C++ and CMake Tools extensions directly into agent mode by surfacing key language and build system capabilities as tools the agent can invoke. The goal is making AI-assisted C++ workflows more consistent and performant by grounding them in the same symbol and build context developers already use and trust, Microsoft said.

These tools are available as a part of the C/C++ DevTools extension for VS Code, which ships as part of C/C++ Extension Pack for VS Code. Through 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 reason about C++ code at the symbol level across a workspace and intelligently perform code editing operations across a codebase.  

Current C++ code understanding tools available for GitHub Copilot Chat include the following:

  • Get symbol definition, which retrieves detailed information about a C++ symbol including where it is defined and its associated metadata.
  • Get symbol references, which finds all references to a given symbol across the codebase.
  • Get symbol call hierarchy, which surfaces incoming and outgoing calls for a function to understand call patterns and dependencies.

To enable these tools, developers can select the “Enable Cpp Code Editing Tools” setting in the VS Code user settings.

Microsoft also has integrated CMake build and test configuration tools with GitHub Copilot in VS Code. Now GitHub Copilot Chat can leverage the build configurations identified and provided by the CMake Tools extension to build and test a project using the exact configuration already selected in VS Code. By working with the same CMake Tools integration developers use in the editor, GitHub Copilot avoids relying on ad hoc command-line invocations and stays aligned with chosen targets, presets, and build state, Microsoft said.

The current tools available to GitHub Copilot Chat for build configuration include:

  • Build with CMake, which builds a CMake project using the active configuration.
  • Run CTests, which runs CTest tests using the active test suite.
  • List Build Targets, which lists the available set of build targets for a CMake project.
  • List CTest tests, which lists the available set of tests for a CMake project.

Go to Source

Author: