formatRange
Format a specific line range in a file using the LSP formatter, improving speed for large files compared to formatting the entire document.
Instructions
Format a line range via LSP formatter. Faster than full formatDocument for large files.
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": {
"filePath": "<filePath>",
"startLine": "<startLine>",
"endLine": "<endLine>"
},
"name": "formatRange"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| endLine | Yes | 1-based end line (inclusive) | |
| filePath | Yes | Workspace or absolute path | |
| startLine | Yes | 1-based start line (inclusive) |