Changes and New Features of BashSupport Pro 2.0
BashSupport Pro Version 2.0 has been released today. It is a new major version, adding important new functionality and improving almost every existing feature. With this release, we consider BashSupport Pro now suitable for use in large and complex shell script projects.
This page contains an annotated list of new features and of most other changes since BashSupport Pro 1.5. There is also the complete changelog.
BashSupport Pro 2.0 can be used with all active subscriptions, existing or new.
Annual subscriptions bought at or after 2021-06-10 receive a fallback license for version 2.0 and updates of 2.x. Monthly subscriptions receive the same fallback license after 12 months of uninterrupted payment starting 2021-06-10.
Content
General Improvements
JetBrains IDE Support
BashSupport Pro is now available for the new JetBrains 2021.2 IDEs. Support for 2019.3 has been dropped, though.
Apple macOS
The plugin now bundles universal binaries of ShellCheck, shfmt, and the debugger support library for native support of Apple Silicon.
Additionally, support for earlier versions of macOS has been added: macOS 10.11+ is supported now, while previously ShellCheck and shfmt were only built for later versions of macOS.
Simplified Setup
A new wizard helps you with your first steps with BashSupport Pro. Previously, several notifications were displayed to set up your IDE in the most compatible way. Now, these notifications have been replaced with a single wizard guiding you through the setup.
Support for Google’s Shell Style Guide
Google defines a comprehensive guide for shell script development. BashSupport Pro 2.0 supports many of the defined rules to help you write better Bash.
Smart inspections and quick fixes help you to detect and fix scripts which don’t follow the style guide.
Altogether, nine new inspections were added to help you follow the Google Shell Style Guide. Most of the inspection provide quick fixes to save you precious time.
Example: Missing main()
For example, a missing main()
function is detected. A quick fix lets you create it.
Example: Function Comments
Missing function comments, which are clearly defined by the guide, are detected. Again, there’s a quick fix to create them.
Script Libraries
Support for user-defined Shell Script Libraries is now available in BashSupport Pro. These libraries let you quickly define relationships between shell script files.
You can use it in complex shell script projects such as acme.sh or bashdb to provide a great editor experience with full code inspection.
You can find out more about Shell Script Libraries in the documentation.
Project Variables
The new project variables feature lets you define a set of variables on which you can rely on as always being defined in your current project.
Project variables will not be flagged as undefined variables, which helps you write clean scripts by detecting the actually undefined variables.
Debugger
The debugger integration has been improved.
Better Debugging on Windows
Previously, debugging on Windows has been painful. A script’s STDIN and STDOUT were shared with the commands sent to the bashdb debugger. Now, input and output are separated from the debugger’s input and output.
Better Visibility of Debugger Settings
By default, only variables modified by the debugged script are displayed. There is a setting to control this behaviour, but it has been hard to find. Since version 2.0, you will be notified about this setting when you debug your first script.
Inline Value Hints
BashSupport Pro’s debugger now supports inline values. Inline values allow to quickly see the value of variables or variable definitions inside the editor.
Inline Watches
Inline watches are supported, too.
Completions and Go-to-Declaration for “Evaluate Expression”
The dialog to evaluate debugger expressions now supports code completion and the “Go to Declaration” feature. Both features consider all variables defined within the scope of the current breakpoint.
Support For “Set Value”
It is now possible to easily modify the value of a variable at runtime. You can either use the context menu or a shortcut to show an input field where to enter the new value.
Rendering of Variables
The presentation of variables in the variables panel is much nicer now. Now, an icon indicates the type of a variable, such as it being a plain value or an array. The type of array elements is shown as well.
Editor
The shell script editor is a bit smarter now. It automatically inserts a space and closing square brackets when you start typing conditional commands. [[
becomes [[ ]]
and [
is turned into [ ]
.
Syntax Improvements
The syntax support has been improved and extended.
For example, unary and binary operators of conditional commands are now fully supported.
The full set of variable attributes is supported now. This is especially useful with quick documentation, where these attributes are displayed. The following screenshot demonstrates this with the uppercase and trace attributes applied. Previously, these attributes were not tracked or displayed.
Functions referenced by the trap
builtin are supported.
Variables declared by printf -v
are supported now, too.
And the coproc
command is now properly parsed and highlighted:
Syntax Highlighting
A few minor improvements to syntax highlighting have been implemented:
- The shebang is now italic and bold by default to show that it is a special comment.
- Multi-line todo comments are properly highlighted.
- A new color setting for parameter expansions like in
${name}
is available. By default, it inherits the settings of{}
highlighting. - ShellCheck’s SC codes, e.g.
SC2086
, are now more visible with the default settings. - Embedded binary content at the end of a script is now highlighted and ignored by the parser.
- Commands
source
and.
are now highlighted as keywords. - Brace highlighting of process substitution elements like
<(...)
are adequately highlighted. - The technical feature to implement highlighting (i.e. the lexer) has been reimplemented to achieve better and faster results. For example, the highlighting of
echo [[ echo ]]
will not render the brackets as keywords anymore. - Highlighting of commands prefixed by
time
or!
is now working properly.
Find Usages
It is now possible to find usages of builtin variables like $HOME
and also of positional parameters $1
through $10
.
Quick Documentation
Quick documentation is now provided for all builtin variables. BashSupport Pro bundles documentation for all variables defined by the Bash shell or the POSIX standard.
There is also quick documentation for conditional operators.
Language Injection
With BashSupport 2.0, you get automatic code injection into YAML.
When you enable the YAML plugin, then the Bash language is injected where applicable. This happens for Codefresh and Travis CI files.
This automatic injection is enabled for 2021.1 and later versions. The YAML plugin of earlier versions is buggy, but you can enable language injection for it nonetheless if you would want to test it.
ShellCheck
ShellCheck 0.7.2, the latest version, is now bundled with BashSupport Pro. On macOS, there is now a universal binary. For Linux, ShellCheck for aarch64 is bundled.
The user interface to suppress ShellCheck warnings has been improved.
shfmt Formatter
The latest version of shfmt, version 3.3.0, is now bundled with BashSupport Pro.
It is now possible to format bats-core files within BashSupport Pro.
Run Configurations
Some improvements to run configurations have been made.
It is now possible to execute a script while your IDE is still indexing files.
You can now define arguments for your project interpreters in the settings. For example, this is useful under Windows to define which WSL distribution to use.
Custom environment variables are now properly passed on via $WSLENV
if you execute a script with Windows WSL.
There is now a run icon in the gutter for injected code fragments. It executes a run configuration with the injected script as a script snippet.
Inspections and Intentions
Detection of Unreferenced Function Arguments
A new inspection to highlight unused function arguments is now part of BashSupport Pro.
It considers the use of $*
, $@
, shift [n]
and implicit usage by for
and select
.
Unused Global Variables
In BashSupport Pro 1.x, the inspection “Unused global variable” has been available, but was marked as “beta” and disabled by default.
This inspection has been improved and is now enabled by default. It replaces ShellCheck’s less powerful equivalent.
Unresolved Variables
The inspection “Unresolved variable” has been available as a beta feature in BashSupport Pro 1.x. It is now mature and enabled by default. Again, it replaces ShellCheck’s less powerful equivalent. For example, BashSupport Pro also considers definitions in files sourcing the edited file.
bats-core
BashSupport Pro now ships with bats-core 1.3, the latest available version.
The support for the load
command has been extended: file.bash
is now used as a fallback for command load file
.
Subscribe to our newsletter to receive updates about important developments, tips, and special offers.