Rename Refactoring

BashSupport Pro allows to rename elements in your shell and Bash scripts.

Rename in shell scripts works in the same way as with other supported languages of your IDE. Refer to JetBrains’ help page how to rename a code element to learn how to use this feature.

Usage

Place the text cursor on the element you would like to rename and then invoke Refactor → Rename… to rename it. Then enter the new name in the text input field and press Enter to perform the rename.

How to rename a variable
How to rename a variable

Scope of the Rename Refactoring

Local Variables

Rename supports locally and globally scoped declarations. Renaming a local variable does not change a global variable of the same name.

Renaming a locally scoped variable
Renaming a locally scoped variable

Sourced Files

The rename operation supports elements in sourced files. Both declarations and references are supported in such files.

Supported Elements

Variables

Variable declarations and variable references are supported in the same way. You can begin a rename operation on the definition itself or on a reference to that variable. The refactoring will always rename the declaration and all references referring to it.

Functions

Function declarations and all commands, which reference it, are renamed by the rename refactoring.

Heredoc Markers

Refactor → Rename… is supported on the start and end markers of here documents.

Renaming a heredoc marker
Renaming a heredoc marker
© 2020–2024 Joachim Ansorg
声明
隐私政策
许可条款