GitHub has announced an enhancement to GitHub Copilot CLI for C++ code intelligence. This update introduces support for whole codebase indexing, aiming to accelerate operations within C++ repositories.
C++ projects often involve millions of lines of code distributed across numerous interconnected source files and headers. Previously, code intelligence requests might have necessitated repeated discovery of project information, leading to delays in tasks such as finding definitions or locating references. The new indexing approach addresses this by creating a persistent, reusable index.
Key Points
- GitHub Copilot CLI now includes whole codebase indexing for C++ code intelligence.
- Whole codebase indexing (WCI) creates a persistent index of symbols across a C++ project.
- The Microsoft C++ Language Server utilizes project compilation information to resolve types, symbols, includes, and file relationships.
- WCI makes symbol information reusable, reducing the need for rediscovery with each request.
- This feature is enabled by default.
- Initial index building may increase time and memory usage, especially for large repositories.
- After the initial build, the index is reused and dynamically updated.
Context
According to GitHub, the Microsoft C++ Language Server uses a project's compilation details to understand types, symbols, includes, and inter-file relationships. Whole codebase indexing makes this symbol information available for reuse, rather than requiring it to be rediscovered for each request. This process is intended to reduce waiting times for definitions, references, implementations, and symbol search results.
Why It Matters
This update aims to improve developer efficiency by reducing the time spent waiting for code intelligence features in GitHub Copilot CLI. For developers working with large C++ codebases, faster access to code information can streamline review, understanding, and modification processes.
What To Do
- Note that whole codebase indexing is enabled by default in GitHub Copilot CLI.
- Check indexing progress at any time using
/lsp logs. - If needed, consult the indexing documentation to temporarily disable WCI.
- Restart your Copilot session after changing WCI settings.
- Consider participating in the survey to provide feedback on the Microsoft C++ Language Server for Copilot CLI.
- Open an issue in the GitHub repository to report problems or suggest improvements.
