get_code_fixes
Retrieve TypeScript compiler-proposed fixes for errors, including missing imports, members, or unused code removal. Target fixes by symbol name or file position.
Instructions
Get the fixes TypeScript itself proposes for the errors at a position, such as adding a missing import, adding a missing member, or removing unused code. Prefer this over hand-writing a fix for a reported diagnostic: the compiler already knows the exact edit, including the correct import path. Target it either by "symbol" name (preferred: no need to know coordinates) or by explicit file/line/column.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | Path to the file (relative to project root) | |
| line | No | Line number (1-based) | |
| column | No | Column number (1-based) | |
| symbol | No | Name of the symbol to target, instead of line/column. Qualify as "Container.member" (e.g. "UserService.getUser") to disambiguate. Combine with "file" to restrict the search to one file. An ambiguous name returns an error listing the candidates. | |
| errorCodes | No | TypeScript error codes to fix (optional). Defaults to the diagnostics reported at this position. |