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
Inlining a variable reference in a shell script

Examples

Simple Values

Inlining a value handles unquoted and quoted references.

Inlining a reassigned variable
Inlining a reassigned variable

Reassigned Variables

If you inline the value of a reassigned variable, then the last assigned value is inlined.

Inlining a reassigned variable
Inlining a reassigned variable
© 2020–2024 Joachim Ansorg
Imprint
Privacy Policy
Legal