Knowledge File / AI技能杠杆
针对 Copilot CLI 的新 C++ 语言服务器配置技能
微软C++语言服务器作为插件上架Copilot插件市场,新增内置设置技能,自动生成compile_commands.json,简化项目配置。
SOURCE / AI技能杠杆
MIN / 4
ACCESS / 会员
POST / 2026-07-02 04:32:52
原贴
查看原文原文
The Microsoft C++ Language Server is now available as a plugin on the Copilot Plugins marketplace. It includes a new built-in setup skill that helps automate project setup, making it easier to generate and maintain the compile_commands.json file the language server needs to understand your code. The C++ language server relies on a compile_commands.json file to provide precise semantic intelligence (i.e., symbol navigation, diagnostics, and code changes that reflect how your compiler actually sees the code). Previously, creating this file required manual steps that varied by build system. The new setup skills handle this automatically for CMake and MSBuild projects, and they provide a repeatable pattern for custom build systems. The C++ language server can now be installed directly as a Copilot CLI plugin: /plugin install cpp-language-server@copilot-plugins This replaces the previous npm-based installation and simplifies getting started and staying updated with the latest releases on Windows, Linux, and macOS. The new generate compile commands skill lets you generate or refresh your compile_commands.json directly from Copilot CLI. Simply say “regenerate compile commands” or “load project” and the skill will configure your compilation database based on your project type and platform. The language server automatically watches for changes to compile_commands.json , so updates take effect without restarting. If you don’t already have a compile_commands.json generated from your CMake builds, the recommended path is to use the skill to generate one for you. Alternatively, you can pass -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE when configuring CMake to directly produce the file from your build. CMake has native support for compile command generation, and the skill helps configure the project so the language server has the compilation database it needs. For MSBuild-based projects, you have two options: Guided setup: Use the skill to onboard the project by saying “regenerate compile commands” or “load project.” The skill produces the configuration needed for the language server. Manual generation: Use the sample extractor application to generate compile_commands.json from your MSBuild project. While it works out-of-the-box for many projects, it may require adaptation for complex configurations.
中文翻译
微软 C++ 语言服务器现已作为插件上架 Copilot 插件市场。它包含一个新的内置设置技能,可以帮助自动化项目设置,让生成和维护语言服务器理解代码所需的 compile_commands.json 文件更加容易。C++ 语言服务器依赖 compile_commands.json 文件来提供精确的语义智能(即符号导航、诊断和反映编译器实际查看代码方式的代码更改)。以前,创建此文件需要手动步骤,且因构建系统而异。新的设置技能可自动处理 CMake 和 MSBuild 项目,并为自定义构建系统提供可重复的模式。C++ 语言服务器现在可以直接作为 Copilot CLI 插件安装:/plugin install cpp-language-server@copilot-plugins。这取代了之前基于 npm 的安装,简化了在 Windows、Linux 和 macOS 上的入门和最新版本更新。新的生成编译命令技能允许你直接从 Copilot CLI 生成或刷新 compile_commands.json。只需说“regenerate compile commands”或“load project”,该技能就会根据项目类型和平台配置编译数据库。语言服务器会自动监视 compile_commands.json 的更改,因此更新无需重启即可生效。如果你还没有从 CMake 构建中生成 compile_commands.json,推荐的方法是使用该技能为你生成一个。或者,你可以在配置 CMake 时传递 -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE 来直接从构建生成文件。CMake 原生支持编译命令生成,该技能有助于配置项目,以便语言服务器拥有所需的编译数据库。对于基于 MSBuild 的项目,你有两个选项:引导式设置:使用该技能通过说“regenerate compile commands”或“load project”来引入项目。该技能会生成语言服务器所需的配置。手动生成:使用示例提取器应用程序从 MSBuild 项目生成 compile_commands.json。虽然它可以开箱即用地用于许多项目,但可能需要针对复杂配置进行调整。
核心信息
微软C++语言服务器作为插件上架Copilot插件市场,新增内置设置技能,自动生成compile_commands.json,简化项目配置。
- 微软C++语言服务器作为插件上架Copilot插件市场,新增内置设置技能,自动生成compile_commands.json,简化项目配置。
- 原贴提到:The Microsoft C++ Language Server is now available as a plugin on the Co
- 来源:github.blog
试看内容
成为会员查看完整内容
你已经看到了这篇内容的前置整理,剩余深度部分仅对会员开放。
详细解读
信息差价值
参考来源
成为会员查看完整内容