Code Completion

BashSupport Pro supports code completions of variables, functions, and commands.

Elements of the current file, of files sourced by the current file, of all files sourcing the current file, and of configured shell script libraries, are shown.

Variables

Variables, which are valid at the current position show up in code completion. Variables, which are out of scope are not displayed.

Completion of script variables in BashSupport Pro
Completion of script variables in BashSupport Pro

Variable Declarations

Variables are suggested for commands, which expect variable names as arguments.

Variable Declaration Completion in BashSupport Pro
Variable Declaration Completion in BashSupport Pro

Built-In Variables

Shells provide declare many built-in variables. Code completion suggests the built-in variables of the currently used shell-type in your editor.

Refer to the following pages for a list of all supported built-in variables:

Functions

All functions, which are available at the current position, are shown in code completion. Functions, which are out of scope, are not displayed.

Variable Declaration Completion in BashSupport Pro
Variable Declaration Completion in BashSupport Pro

Commands

BashSupport Pro suggests built-in commands and commands, which are defined by the POSIX standard.

Please note, that POSIX commands are shown even when they’re not present on the current machine.

Command Name Completion in BashSupport Pro
Command Name Completion in BashSupport Pro

Shebang

Commonly used shebang commands are displayed, when you start typing in the shebang line.

Shebang Completion in BashSupport Pro
Shebang Completion in BashSupport Pro

File Paths

File paths are completed, too. If you’re referencing a path where a command is expected, then the popup is shown automatically. But to avoid unnecessary automatic completions, you have to manually invoke code completion for arguments.

Please note, that this is using the paths of the current machine. Make sure, that you’re only using paths, which are also available in the target environment of your script.

Path Completion in BashSupport Pro
Path Completion in BashSupport Pro

Zsh Code Completion

To support Zsh’s complex syntax, there’s extended code completion available.

Parameter Expansion Flags

Zsh supports flags for its parameter expansion, for example ${(U)variableName} to convert the variable’s value into uppercase.

Inside () of ${()variable} all available flags are shown along with a short description.

Variable Modifiers

Zsh’s variable modifiers allow to post-process the result of variable substitution and parameter example. For example, flag A of $relativePath:A or ${relativePath:A} turns the value of variable relativePath into an absolute path.

Code completion suggests all available variable modifiers after : of $name: and ${name:}.

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