Inline Variable Refactoring
The inline refactoring lets you replace a variable reference with its assigned value.
Usage
Place the text cursor on the variable declaration or reference you would like to inline. Then invoke Refactor → Inline… to start the operation.
If you inline a variable declaration, then all references will be inlined without prompting you. If you line a variable reference, then you can choose if you would like to inline this reference only or all references of the declaration.
![Inlining a variable reference in a shell script](/pngs/editor/refactorings/inline_variable_dialog_400.ef4479bdda49f1ce51b80c176107dea1.png)
Examples
Simple Values
Inlining a value handles unquoted and quoted references.
![Inlining a reassigned variable](/pngs/editor/refactorings/inline_variable_string_400.186133c36021aa8263f702f3673dbdcc.png)
![](/pngs/editor/refactorings/inline_variable_string_after_400.339590a47e97aa7ea269e31f8f4fbec8.png)
Reassigned Variables
If you inline the value of a reassigned variable, then the last assigned value is inlined.
![Inlining a reassigned variable](/pngs/editor/refactorings/inline_variable_reassigned_400.96890511a2298bbe17d151b467406dff.png)
![](/pngs/editor/refactorings/inline_variable_reassigned_after_400.ef1a6aaea88745db34d32a9002635aa4.png)