insert_after_symbol
Insert code or content after a specific symbol definition in files using Serena's MCP server. Automates precise code additions while maintaining proper indentation for improved readability and consistency.
Instructions
Inserts the given body/content after the end 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.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
body | Yes | The body/content to be inserted. Important: the insterted code will automatically have the same indentation as the symbol's body, so you do not need to provide any additional indentation. | |
name_path | Yes | For finding the symbol to insert after, same logic as in the `find_symbol` tool. | |
relative_path | Yes | The relative path to the file containing the symbol. |