Changes and New Features of BashSupport Pro 2.0

Published

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.

First steps with BashSupport Pro
First steps with BashSupport Pro

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.

Detection of a missing main function
Detection of a missing main function

Example: Function Comments

Missing function comments, which are clearly defined by the guide, are detected. Again, there’s a quick fix to create them.

Detection of a missing function comment
Detection of a missing function comment

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.

Settings for user-defined script libraries
Settings for user-defined script libraries

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.

Settings for project variables of BashSupport Pro
Settings for project variables of BashSupport Pro

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.

Tooltip highlighting how to enable environment variables
Tooltip highlighting how to enable environment variables

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.

Inlay hints of BashSupport Pro's debugger
Inlay hints of BashSupport Pro's debugger

Inline Watches

Inline watches are supported, too.

Inlay watches of BashSupport Pro's debugger
Inlay watches of BashSupport Pro's debugger

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.

Code completion in evaluate expression dialog
Code completion in evaluate expression dialog

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.

Value modification with BashSupport Pro's debugger
Value modification with BashSupport Pro's debugger

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.

Rendering of an associative array and an indexed array
Rendering of an associative array and an indexed array

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.

Tracking of variable attributes
Tracking of variable attributes

Functions referenced by the trap builtin are supported.

Function referenced by the trap builtin
Function referenced by the trap builtin

Variables declared by printf -v are supported now, too.

Variable defined by printf -v
Variable defined by printf -v

And the coproc command is now properly parsed and highlighted:

Variable defined by the coproc builtin
Variable defined by the coproc builtin

Syntax Highlighting

A few minor improvements to syntax highlighting have been implemented:

Improvements to editor highlighting
Improvements to editor highlighting

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.

Quick documentation for a builtin Bash variable
Quick documentation for a builtin Bash variable

There is also quick documentation for conditional operators.

Quick documentation for conditional operator -r
Quick documentation for conditional operator -r

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.

Suppression with highlighted command scope
Suppression with highlighted command scope

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.

Suppression with highlighted function scope
Suppression with highlighted function scope

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.

Highlighting of an unused argument
Highlighting of an unused argument

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.

Detection of an unused variable definition
Detection of an unused variable definition

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.

Highlighting of an unresolved variable reference
Highlighting of an unresolved variable reference

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.

BashSupport Pro Newsletter

Subscribe to our newsletter to receive updates about important developments, tips, and special offers.


© 2020–2024 Joachim Ansorg
Imprint
Privacy Policy
Legal