GitHub Copilot in VS Code now features enhanced C++ support, offering symbol context and CMake build awareness on par with Microsoft’s dedicated C/C++ DevTools and CMake Tools extensions.
Microsoft has rolled out significant enhancements to GitHub Copilot in Visual Studio Code, introducing C++ symbol context and comprehensive CMake build configuration awareness.
These improvements for C++ code comprehension were officially revealed on February 19. The updates empower GitHub Copilot in VS Code with the same level of C++ insight found in Microsoft’s established C/C++ and CMake Tools extensions. This is achieved by making core language and build system capabilities available as invokable tools for the agent. According to Microsoft, the aim is to boost the consistency and performance of AI-assisted C++ workflows by rooting them in the trusted symbol and build context that developers are already familiar with.
These advanced tools are integrated within the C/C++ DevTools extension for VS Code, which is part of the C/C++ Extension Pack for VS Code. Thanks to these new C++ code understanding tools, the agent mode now benefits from rich C++ symbol context. Rather than relying solely on text or file searches, the agent can logically interpret C++ code at a symbol level across an entire workspace, enabling it to intelligently execute code editing tasks throughout the codebase.
GitHub Copilot Chat now includes the following C++ code understanding tools:
- Retrieve Symbol Definition: Gathers exhaustive details about a C++ symbol, including its declaration location and relevant metadata.
- Find Symbol References: Locates all instances where a specified symbol is used across the entire codebase.
- Explore Symbol Call Hierarchy: Reveals both incoming and outgoing function calls to help visualize call patterns and dependencies.
Developers can activate these functionalities by selecting the “Enable Cpp Code Editing Tools” option within their VS Code user settings.
Furthermore, Microsoft has seamlessly integrated CMake build and test configuration tools into GitHub Copilot in VS Code. GitHub Copilot Chat can now leverage the specific build configurations identified and provided by the CMake Tools extension. This allows it to build and test projects using the exact settings already chosen within VS Code. By aligning with the same CMake Tools integration used by developers in the editor, GitHub Copilot avoids relying on improvised command-line calls and maintains consistency with selected targets, presets, and current build states, as noted by Microsoft.
For build configuration, GitHub Copilot Chat now supports these tools:
- Build with CMake: Compiles a CMake project utilizing the currently active configuration.
- Run CTests: Executes CTest tests based on the active test suite.
- List Build Targets: Provides a comprehensive list of all available build targets within a CMake project.
- List CTest Tests: Displays all available tests configured for a CMake project.