{"id":36613,"date":"2026-06-23T21:04:54","date_gmt":"2026-06-23T21:04:54","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/cppblog\/?p=36613"},"modified":"2026-06-23T21:04:54","modified_gmt":"2026-06-23T21:04:54","slug":"streamline-c-code-intelligence-setup-in-copilot-cli","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/streamline-c-code-intelligence-setup-in-copilot-cli\/","title":{"rendered":"Streamline C++ Code Intelligence Setup in Copilot CLI"},"content":{"rendered":"<p>C++ developers can now bring IDE-style semantic intelligence into Copilot CLI with less setup. The <a href=\"https:\/\/github.com\/microsoft\/cpp-language-server\/\">C++ language server plugin<\/a> supports richer code navigation, diagnostics, symbol understanding, and code changes by using the same build context your compiler does.<\/p>\n<p>That build context usually comes from a <code>compile_commands.json<\/code> file, which tells the language server how each source file is compiled. Instead of manually wiring that file together, the C++ language server plugin now provides a <a href=\"https:\/\/github.com\/microsoft\/cpp-language-server\/blob\/main\/plugins\/cpp-language-server\/skills\/generate-compile-commands\/SKILL.md\">setup LSP skill<\/a> that can help generate or refresh compile commands for common project types, including CMake and MSBuild. For custom build systems, teams can still provide their own<code> compile_commands.json<\/code> file or <a href=\"https:\/\/github.com\/microsoft\/cpp-language-server\/blob\/main\/AUTHORING_EXTRACTOR_SKILL.md\">create a project-specific skill<\/a> that captures their build setup once and makes it repeatable.<\/p>\n<p>To get started with the C++ language server for Copilot CLI, please download via the <a href=\"https:\/\/github.com\/github\/copilot-plugins\">Copilot Plugins<\/a> marketplace and follow <a href=\"https:\/\/github.com\/microsoft\/cpp-language-server\/#-quick-start\">the Quick Start guide in the repo<\/a> to accept EULA and configure<code> compile_commands.json<\/code>:<\/p>\n<pre>\/plugin install cpp-language-server@copilot-plugins<\/pre>\n<p>Whether your project uses CMake, MSBuild, or a custom build pipeline, the goal is the same: make it easier for you to configure the C++ language server for Copilot CLI so Copilot can provide better navigation, diagnostics, explanations, and code changes, even when you\u2019re outside the IDE.<\/p>\n<p><div class=\"alert alert-primary\">As you try out the Microsoft C++ language server across different project types and build environments, we\u2019d love to hear about your experiences. Let us know your thoughts through our survey: <a href=\"https:\/\/forms.office.com\/Pages\/ResponsePage.aspx?id=v4j5cvGGr0GRqy180BHbR3y0EFonU1lFoDzxL3GpYptUNDg0MzRWVkUyU0wxOU5BNEZXTkdFTFA3NC4u\">[Fill out form]<\/div><\/a><\/p>\n<h3>Configuring the language server<\/h3>\n<p>The language server needs a <code>compile_commands.json<\/code> file to understand your project. If you do not already have one generated via your build, you can utilize the skill to generate this for you.<\/p>\n<p>To generate compile commands, type &#8220;regenerate compile commands&#8221; or &#8220;load project&#8221; in Copilot CLI, based on your desired configuration and platform (if necessary).<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/06\/Video-Project-37-1.gif\"><img decoding=\"async\" class=\"alignnone size-full wp-image-36623\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2026\/06\/Video-Project-37-1.gif\" alt=\"VideoProject37 ezgif com video to gif converter image\" width=\"1920\" height=\"1080\" \/><\/a><\/p>\n<p>See \u201cRecommended configuration path by project type\u201d section below for suggestions based on your project build configuration.<\/p>\n<p>Note: If your configuration changes, the skill should be re-invoked to regenerate your <code>compile_commands.json<\/code> to keep the LSP server in sync. The LSP server will automatically watch for changes to the <code>compile_commands.json<\/code> file.<\/p>\n<h3>Recommended configuration path by project type<\/h3>\n<h4>CMake projects<\/h4>\n<p>For CMake-based projects, if you don&#8217;t have a <code>compile_commands.json<\/code> already generated from your CMake builds. the recommended path is to use the skill to onboard the project to generate <code>compile_commands.json<\/code>. You can also generate a <code>compile_commands.json<\/code> by passing <code><a href=\"https:\/\/cmake.org\/cmake\/help\/latest\/variable\/CMAKE_EXPORT_COMPILE_COMMANDS.html\">-DCMAKE_EXPORT_COMPILE_COMMANDS<\/a><\/code> set to &#8220;<code>TRUE<\/code>&#8221; when configuring CMake.<\/p>\n<p>CMake has native support for compile command generation and the skill can help configure the project, so the language server has the compilation database it needs.<\/p>\n<h4>MSBuild projects<\/h4>\n<p>For MSBuild-based projects, users have two options.<\/p>\n<p>For teams that want a guided setup, the skill can still help onboard the project by producing the configuration needed for the language server.<\/p>\n<p>However, if you\u2019d like to generate your own compile commands, you can refer to\u00a0<a href=\"https:\/\/github.com\/microsoft\/msbuild-extractor-sample\">this sample application<\/a>\u00a0for an example of how to generate\u00a0compile_commands.json\u00a0from MSBuild projects. While the sample application is designed to work out-of-the-box for many projects, it may require adaptation for complex projects.<\/p>\n<h4>Custom build systems<\/h4>\n<p>Custom builds often use hermetic, vendored, or wrapper-based toolchains that standard discovery cannot always detect.<\/p>\n<p>For teams with custom toolchains, a project-specific <a href=\"https:\/\/docs.github.com\/en\/copilot\/concepts\/agents\/about-agent-skills\">skill<\/a> can capture the setup once and make it repeatable. The <a href=\"https:\/\/github.com\/microsoft\/cpp-language-server\/blob\/main\/README.md\">detailed guidance provided in the cpp-language-server repo<\/a> covers when custom configuration is needed, what settings to pin, and how to structure a skill so Copilot can regenerate compile commands reliably. It is especially useful for repositories where the default extractor produces incomplete output, picks up the wrong toolchain, or needs to run through a repo-provided build environment.<\/p>\n<h3>Getting started with the Microsoft C++ language server<\/h3>\n<p>The Microsoft C++ language server is available as a Copilot CLI plugin and runs on Windows, Linux, and macOS. An <a href=\"https:\/\/github.com\/features\/copilot\/plans?ref_cta=See+pricing+and+plans&amp;ref_loc=hero&amp;ref_page=%2Ffeatures_copilot_copilot_ai_code_editor&amp;cft=copilot_li.features_copilot\">active GitHub Copilot subscription<\/a> is required.<\/p>\n<p>To get started, install the C++ language server plugin from the Copilot Plugins marketplace and follow <a href=\"https:\/\/github.com\/microsoft\/cpp-language-server\/#-quick-start\">the Quick Start guide<\/a>:<\/p>\n<pre>\/plugin install cpp-language-server@copilot-plugins<\/pre>\n<p>The Microsoft C++ language server requires a small amount of setup so it can understand your project the same way your compiler does:<\/p>\n<ol>\n<li>Authenticate with GitHub Copilot CLI<\/li>\n<li>Provide or generate a <code>compile_commands.json<\/code> file for your project<\/li>\n<\/ol>\n<h3>Share your feedback<\/h3>\n<p>Let us know your feedback and if there\u2019s anything else you\u2019d like to see. Help us improve the Microsoft C++ server for Copilot CLI by filling out this short survey: <a href=\"https:\/\/forms.office.com\/Pages\/ResponsePage.aspx?id=v4j5cvGGr0GRqy180BHbR3y0EFonU1lFoDzxL3GpYptUNDg0MzRWVkUyU0wxOU5BNEZXTkdFTFA3NC4u\">[Fill out form]<\/a>.<\/p>\n<p>To report a problem or suggest an improvement, <a href=\"https:\/\/github.com\/microsoft\/cpp-language-server\/#-reporting-feedback\">open an issue<\/a> in our GitHub repo.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>C++ developers can now bring IDE-style semantic intelligence into Copilot CLI with less setup. The C++ language server plugin supports richer code navigation, diagnostics, symbol understanding, and code changes by using the same build context your compiler does. That build context usually comes from a compile_commands.json file, which tells the language server how each source [&hellip;]<\/p>\n","protected":false},"author":85413,"featured_media":36616,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-36613","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus"],"acf":[],"blog_post_summary":"<p>C++ developers can now bring IDE-style semantic intelligence into Copilot CLI with less setup. The C++ language server plugin supports richer code navigation, diagnostics, symbol understanding, and code changes by using the same build context your compiler does. That build context usually comes from a compile_commands.json file, which tells the language server how each source [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/36613","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=36613"}],"version-history":[{"count":1,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/36613\/revisions"}],"predecessor-version":[{"id":36624,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/36613\/revisions\/36624"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/36616"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=36613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=36613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=36613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}