insert_before_symbol
Inserts code content before a specific symbol definition in a file, enabling precise code modifications like adding imports, classes, or functions at targeted locations.
Instructions
Inserts the given content before the beginning of the definition of the given symbol (via the symbol's location). A typical use case is to insert a new class, function, method, field or variable assignment; or a new import statement before the first symbol in the file.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name_path | Yes | Name path of the symbol before which to insert content (definitions in the `find_symbol` tool apply). | |
| relative_path | Yes | The relative path to the file containing the symbol. | |
| body | Yes | The body/content to be inserted before the line in which the referenced symbol is defined. |