Go To Declaration
BashSupport Pro helps you to quickly navigate in shell scripts.
Place the text cursor on an element in a shell script and choose Navigate → GoTo to navigate to the declaration (JetBrains help pages).
BashSupport Pro lets you navigate to the declarations of these elements:
- Function Calls
- It navigates to the definition of the function.
- Variable References
- It navigates to the definition of the variable. For example, it navigates to
export myVar
if you invoke it for$myVar
. - Variable Declarations
- It navigates to the closest, earlier declaration of a variable declaration.
- For example, for
myVar=1; myVar=2; export myVar
, it will navigate tomyVar=2
if you call it for the exported definition. When you invoke the action again, then it will navigate tomyVar=1
. - See below for a setting to configure this behaviour.
Settings
By default, Go To Declaration
navigates to the closest re-declaration of a variable. This should be the most useful implementation to navigate within complex shell scripts. If you don’t like this, then the setting Prefer the closest definition for Go To Declaration
lets you change the behaviour. To do this, disable the checkbox in the settings at
Settings →
Languages & Frameworks →
BashSupport Pro
.
Local Scope
BashSupport Pro supports the local
variable scope. local
allows to restrict the visibility of variables to the current function. It’s only available for Bash scripts, i.e. it’s not available in POSIX scripts.
Go To
supports local scope. If you call it within a function, then it’ll only navigate to the local declarations. If you call it outside of a function, then it’ll ignore variables, which were declared as local.
|
|
Unset
BashSupport Pro supports the unset
command. unset
allows you to make a variable unavailable to all following commands.
The plugin considers variables, which have been unset
as a new variable.
|
|
Scratch Files
BashSupport Pro allows you to navigate in scratch files. The complete feature–set is available, but limited to the current file.
Injected Code
BashSupport Pro allows you to navigate in code with language injection. The complete feature–set is available, but limited to the code block. Navigation between multiple blocks is not yet supported.
