fix_issue
Apply SonarLint's suggested fix to a specific code quality issue at a given file, line, and rule. Modifies the file directly to resolve the issue.
Instructions
Automatically fix one specific code quality issue. Applies the SonarLint-suggested fix for the issue at the given file, line, and rule. The file is modified directly. To fix all issues in a file at once, use fix_all_issues instead.
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>",
"line": "<line>",
"rule": "<rule>"
},
"name": "fix_issue"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| line | Yes | Line number of the issue | |
| rule | Yes | Rule ID (e.g., 'javascript:S3504') | |
| filePath | Yes | Absolute path to the file to fix |