inline_variable
Inline local variables in Java code by replacing variable usages with their initializer expressions, generating text edits for refactoring while ensuring safety by checking for modifications after initialization.
Instructions
Inline a local variable by replacing all usages with its initializer expression.
Returns the text edits needed to inline the variable. The caller should apply these edits to perform the inlining.
USAGE: Position cursor on variable declaration or usage OUTPUT: Edits to delete declaration and replace usages with initializer
IMPORTANT: Uses ZERO-BASED coordinates. SAFETY: Will refuse if variable is modified after initialization.
Requires load_project to be called first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | Path to source file | |
| line | Yes | Zero-based line number of variable declaration or usage | |
| column | Yes | Zero-based column number |