基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/microsoft/cpp-language-server --skill setup-cpp-language-server命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | setup-cpp-language-server |
| description | Checks that configuration files are correctly set up for using the LSP tool with C++. |
Using the LSP tool with C++ requires three configuration files before it will work correctly:
.github/lsp.json file that specifies how to launch the language server. It should have content like this:{
"lspServers": {
"cpp": {
"command": "mscppls",
"args": ["--lsp-config", ".mscppls/cpp-lsp.json"],
"fileExtensions": {
".cpp": "cpp",
".cxx": "cpp",
".c": "cpp",
".cc": "cpp",
".hpp": "cpp",
".hxx": "cpp",
".hh": "cpp",
".h": "cpp"
},
"requestTimeoutMs": 1000000
}
}
}
.mscppls/cpp-lsp.json file that configures the path to the compile_commands.json file. This file must follow the schema below, where all paths are relative to the .mscppls directory. repositoryPath is the relative path to the repository root and compileCommands is the relative path to the compile_commands.json file.{
"repositoryPath": "../",
"compileCommands": "../build/compile_commands.json"
}
compile_commands.json file that specifies the compile command lines for each file in the project. This file can exist anywhere in the project and is typically produced by the build system.Your job is to ensure these configuration files are correctly set up.
compile_commands.json does not exist, help the user create the file for their project. Don't complete any other tasks and ensure the compile_commands.json file is created before continuing.
a. For CMake projects, it's often possible to produce the file by including -DCMAKE_EXPORT_COMPILE_COMMANDS=ON. This option is not supported when using the Visual Studio generators (default for CMake on Windows), but it is supported with Ninja and Makefile generators.
b. For MSBuild-based C++ projects (.vcxproj, .sln, .slnx), use msbuild-extractor-sample to generate the file. Prefer committing a msbuild-extractor.json config file at the workspace root so the tool runs with no arguments (msbuild-extractor-sample.exe, which auto-detects ./msbuild-extractor.json); otherwise pass flags directly, e.g. msbuild-extractor-sample.exe --solution path\to\app.sln -c Debug -a x64 -o compile_commands.json..mscppls/cpp-lsp.json does not exist, create it based on the path to the compile_commands.json file..github/lsp.json does not exist or does not have an entry for C++, create or update it to include the configuration shown above. Make sure the args field points to the correct path to cpp-lsp.json.compile_commands.json, .mscppls/cpp-lsp.json, or .github/lsp.json, guide the user to restart their chat session before using the C++ LSP tools. The tools need to be restarted.