clangd_definition
Finds the C/C++ symbol definition at a given file, line, and column, returning the defining file and selection range for precise code navigation.
Instructions
查询某个位置符号的定义(textDocument/definition)。输入 file(绝对路径或相对 projectRoot)、1-based line/column;返回定义所在文件与选区范围(1-based,end exclusive)。
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>",
"line": "<line>",
"column": "<column>"
},
"name": "clangd_definition"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | 源文件路径:绝对路径,或相对 projectRoot 的路径 | |
| line | Yes | 1-based 行号 | |
| limit | No | 最多返回多少条定义,默认 maxResults | |
| column | Yes | 1-based 列号(UTF-16) |