clangd_diagnostics
Fetches clangd diagnostics for a C/C++ source file, returning errors, warnings, hints, or pending results when diagnostics are not ready before the wait timeout.
Instructions
获取某个文件的 clangd 诊断(错误/警告/提示)。会先 didOpen/didChange 再等待 publishDiagnostics 推送;waitMs 超时则返回 pending=true 与已缓存的诊断。
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"file": "<file>"
},
"name": "clangd_diagnostics"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | 源文件路径:绝对路径,或相对 projectRoot 的路径 | |
| waitMs | No | 等待诊断的最长时间,默认 diagnosticsWaitMs | |
| severity | No | 只返回某一严重级别;缺省返回全部 | |
| includeRelated | No | 是否包含 relatedInformation,默认 false |