Get Code Fixes
getCodeFixesRetrieve available code fixes for specific error codes at a defined range in a TypeScript or JavaScript file. Uses diagnostic error codes and range to return tsserver's suggested code actions.
Instructions
Get available code fixes for specific error codes at a range in a TypeScript/JavaScript file. Returns the raw list of code actions tsserver suggests for the given diagnostics. Use getDiagnostics first to discover error codes and ranges, then pass them here.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | File path (absolute or relative to cwd) | |
| endLine | Yes | 1-based end line | |
| endOffset | Yes | 1-based end character offset | |
| startLine | Yes | 1-based start line | |
| errorCodes | Yes | Diagnostic error codes to get fixes for | |
| startOffset | Yes | 1-based start character offset |