The C++ language has several levels of context outside of the active file. We have been working to improve the quality of C++ GitHub Copilot completions and have new updates shipping to Copilot for C++ in VS Code. Copilot is now able to detect more relevant context in C++ projects in order to provide more accurate code suggestions. For example, Copilot is able to detect the accurate code completion for the below member list, despite how the classes are structured.

C++ code completions for a Frog class

To access these improvements, ensure you are on 1.322.0 of the Copilot extension and 1.26.0 of the C/C++ extension with IntelliSense configured.

We are committed to delivering similar improvements to Visual Studio 2022 17.14, so stay tuned for updates.