indent_dedent
Adjust indentation of code blocks by marking boundaries with ⬥ and specifying a delta. Works on a range of lines in a file.
Instructions
Indents or unindents a range of lines in a file.
Specify the range using substring matching with a ⬥ marker. The ⬥ identifies which line is the boundary — the full line containing the ⬥ is included in the range.
Common pattern — indent a block, then wrap it: 1. indent_dedent(indentStartAt="# Create home URL\n⬥", ..., indentDelta=1) 2. replace_string_in_file to insert "if True:" before the indented block
⬥ in boundaries anywhere on a line marks the line to indent when the context contains multiple lines. No ⬥ is needed if the context is within a single line only.
Whitespace at the end of lines is ignored when matching substrings.
Empty lines within the range are left unchanged (no whitespace added). Non-empty lines (including whitespace-only lines) are indented/unindented.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | ||
| indentStartAt | Yes | ||
| indentEndAt | Yes | ||
| indentDelta | Yes | ||
| indentSize | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |