Changelog of BashSupport Pro 2.0
An annotated list of all changes is available in the release announcement.
General
Version 2.0 is a new major version. Make sure to use 1.x instead if you’re on a fallback license without renewal.
- Added Compatibility with 2021.2.
- Added Show notification with a link to the annotated list of changes at first start of version 2.0.
- Added Bundle shfmt binary for Linux PowerPC devices (
ppc64le
). Due to a lack of hardware and emulators this is mostly untested, so far. ShellCheck for ppc64le isn’t included yet because it’s crashing. - Added Settings for project-level global variables, which are ignored by the “Unresolved reference” inspection. Please note, that this is only used when the inspection is enabled. ShellCheck, which is used otherwise, isn’t capable to use the predefined variables.
- Added Wizard to simplify the initial setup of your IDE for best compatibility with BashSupport Pro. Before several notifications were shown and multiple restarts were necessary.
- Added Action “BashSupport Pro: Open setup wizard” to launch the setup after the first start.
- Added Initial implementation to support user-defined shellscript libraries. These libraries allow to work with complex shell projects where a lot of files are automatically sourced before a script is executed. The typical use case is collection of files, which provide many predefined functions. Tested with acme.sh and bashdb sources.
You can configure the new libraries atSettings > Languages & Frameworks > BashSupport Pro > Shell Script Libraries
.
Improvements to the UI and to the ShellCheck integration will be part of the next beta. - Added Code style setting “Use \n UNIX line separator”. By default, new files created from the BashSupport Pro templates have UNIX line separators. An inspection detects mismatched separators in existing scripts. This code style settings allows you turn off this behaviour and use your project’s default line separators instead. This is like IDEA-221381, but works differently.
- Added Changed the display names of BashSupport Pro’s script language and file type to “Shell Script”. It’s “Shell Script (BashSupport Pro)” if JetBrains Shell is enabled.
- Added Bundle ShellCheck and shfmt binaries for Linux ARM devices (
aarch64
). Editing and debugging should work fine now. Please note that JetBrains isn’t officially offering full support of this platform. - Updated Bundle universal ShellCheck binary for macOS.
- Improved “Find Usages” presentation, especially for function calls and variables declared by
for
orselect
. - Performance Use stub elements for files and functions, this reduces memory usage and also makes things slightly faster.
- Updated Dropped support for IDEs with major version 2019.3.
- Updated Built shared library for both Intel and Apple Silicon to prepare for native execution on Apple M1 systems.
- Updated Update BashSupport Pro’s customized pty4j library to latest upstream code.
- Updated Moved the shell interpreter settings into a separate configurable at
Preferences... > Lanuages & Frameworks > BashSupport Pro > Shell Interpreters
. - Updated Send
os.arch
andos.64bit
with the optional, anonymous telemetry data. - Updated The optional, anonymous telemetry now sends the IP address as a request property. The value is used to retrieve the country of origin. The address value is then removed from the event before the event is stored. The same data is stored for events as before.
- Fixed Shell files without extensions are now assigned to BashSupport Pro, even if JetBrains Shell is enabled.
- Fixed Shell functions and variables shown in “Go To Symbol” have a better presentation now.
- Fixed Fixed exception
Project(...) already disposed
, which was caused by the shfmt integration. - Fixed “Find usages” of a function call now displays “function call” instead of “unknown”
- Fixed Resolving of variables declared in files also sourced by a sourcing file, e.g. show declarations of
a.bash
when editingb.bash
ifmain.bash
includesa.bash
beforeb.bash
. - Fixed Find usages of declarations in parameter expansions, e.g.
${varName:=default}
. - Fixed Read/write access detection for parameter expansions, e.g.
${varName:=default}
or${varName}
. - Fixed Exception
Slow operations are prohibited on EDT
when opening theView
menu with a script editor opened. - Fixed Exception
Slow operations are prohibited on EDT.
when retrieving documentation for a variable reference. - Fixed Exception
Incorrect CachedValue use: same CV with different captured context
.
Editor
- Added Quickfix to register an unresolved variable as global variable.
- Added Show registered global variables in code completion.
- Added Automatically insert the closing square brackets when typing
[
or[[
where a command is accepted. - Added Automatically insert the 2nd needed space when typing a space in between
[]
or[[]]
where a command is accepted. - Added Intention on ShellCheck SC codes to open the wiki page using the keyboard.
- Added Show item to open the ShellCheck wiki page in submenu of ShellCheck warnings.
- Added Spellcheck for variable names, builtin variables are not checked.
- Added Highlighting of multi-line todo/fixme comments.
- Improved Add new highlighting option for parameter expansions
${...}
. - Improved Action “Extend selection” in
$variableName
now first selectsvariableName
before$variableName
. Previously the$
prefix was always included first. - Improved Highlight pairs of
<(...)
and>(...)
process substitution elements in the editor. - Added Color settings “Binary Content” for unparsed, binary content after a call to
exit
orexit 1
as a top-level command. This feature was still missing compared to legacy BashSupport. - Improved Changes default color configuration of “ShellCheck code” to “Document comment tag” to make it more visible.
- Improved Language injection in markdown files with code fence language “bash” is now injecting Bash and not POSIX, i.e. Bash variables and commands are now supported in the injected files. Both JetBrains Markdown and Markdown Navigator are supported.
- Updated Default to bold font style for shebang lines.
- Performance Large files are highlighted faster, time-consuming inspections were optimized.
- Fixed Automatic indentation when entering a linefeed in
$()
and$(())
. - Fixed Automatically remove the closing
}
when entering a backspace in${}
. - Fixed Code completion inside
${}
. - Fixed Highlight
source
and.
commands as keywords. Previously, no highlighting was applied. - Fixed Rename of variables declared by
${varName:=default value}
or${varName=default value}
. - Fixed Language injection into Makefiles is now working, even if JetBrains Shell is enabled.
- Fixed Folding of comments, which are indented with whitespace.
- Fixed Improve code completion for
[[ -v <caret>varName ]]
. - Fixed Improve code completion for
[[ -v <caret>varName[index] ]]
. - Fixed Highlighting of
$((...))
. - Fixed Exception
Changing the dummy identifier twice...
- Fixed Setting “Prefer the closest definition for Go to Declaration” wasn’t applied properly with variable references and variable re-declarations.
- Fixed Don’t insert a second
}
when typing}
in between{}
. - Fixed Insert closing
]
when typing the array reference in[[ -v name[...] ]]
.
Syntax
- Added Support variable references for the conditional operator
-v
, e.g.[[ -v varName ]]
. - Added Support function references as first argument of
trap
, e.g.trap functionName SIGNAL
. - Added Support variables declared by
printf -v VAR
. - Added
declare -p name
,declare -F name
, anddeclare -f name
are not declaring variables. - Added Support files with binary content. Content after
exit
orexit 0
on the top-level is treated as unparsed, binary content now. This allows to edit scripts, which bundle archives, for example. - Added Support
time
and!
in command pipelines. Rename, etc. now properly works with such commands, e.g.time ! myFunc arg
. - Added Support
SRANDOM
supported by Bash 5.1 for code completion, quick documentation, find usages, and more. - Added Find usages is now supported for positional parameters
$1
to$10
. - Added Support parsing of the
coproc
command, e.gcoproc COPROC_HANDLES { my_command; }
. - Improved Support more attributes of
declare
: integer, lowercase, uppercase, name-ref, trace. The attributes are displayed by the quick documentation popup, for example. - Improved Support
+
arguments ofdeclare
, which turn off flags, e.g.declare +i notAnInteger
. - Improved Parsing of glob expressions, e.g.
[[ $var == [a-z]+ ]]
- Improved Parsing of regular expressions
- Improved Highlighting and quick-documentation of builtin commands.
- Improved Properly handle variable definitions in implicit subshells of pipelines. Variables defined in pipelines, e.g.
cat ... | while ...; do myVar=value; done
, are not visible outside of the pipeline. - Improved New lexer, which means faster highlighting, higher quality of script file parsing and a much less workarounds, e.g. no more issues with
echo while for until do done
. - Improved Parsing of concatenated arguments, as in
cmd prefix$arg
. This is now one argument, and not two. Syntax-based selections now works as expected. - Improved Parsing of incomplete function definitions.
- Improved Parsing of arithmetic expressions, which span multiple lines.
- Improved Assignments with an assigned list, e.g.
declare myVar=(a b)
, is now treated as an array variable. - Improved Variable resolving for subshells, subshell expressions and command substitutions. Variables declared or redeclared in subshells are not visible anymore to elements outside.
- Performance Code completion, find usages and highlighting is faster now for projects with many sourced files.
- Fixed Limit the nesting level of source file relationships to 250 to prevent
StackOverflowExceptions
. - Fixed Parsing of conditional command with arithmetic conditions and multiple conditions, e.g.
[[ a == b || $v -gt 1 ]]
. - Fixed The expressions in
${name:expression:expression}
are now parsed as arithmetic expressions. - Fixed Fixed parsing of commands, which have
=
as arguments, e.g.echo = name
- Fixed Parsing of parameter expansions with escaped quotes now works correctly, e.g.
"${name%[\'\"]}"
. - Fixed Parsing compound test expressions (#65)
- Fixed Resolving, find usages, etc. for array references in arithmetic expressions, e.g.
(( my_var[0] ))
(issue). - Fixed Lexer error with
"$(declare ...)"
(issue). - Fixed Parsing error with
"${value# }"
. Whitespace wasn’t accepted before. - Fixed Parsing error with
[[ -v "name" || a > b ]]
(issue). - Fixed Parsing error with
[[ -v $a$b ]]
. - Fixed Parsing of here documents with escaped markers, e.g.
<< \EOF ... EOF
. Substitutions are turned off for such here documents. - Fixed Parsing error with line continuations following keywords (issue)
- Fixed Parsing of while command in
"$(while a; do b; done)"
. - Fixed Arguments passed to
let
are now parsed as separate expressions, not as one expression with whitespace delimiters. - Fixed Newline characters are now accepted in parameter expansion value expressions, e.g.
${var/\n/\\n}
. - Fixed Allow empty arithmetic expressions in
${var::}
. - Fixed Properly parse eval commands in command substitutions and subshells, e.g.
$(eval $var)
. - Fixed Parsing and highlighting of
(( opts['raw string'] ))
. - Fixed Error message about invalid filepath if a
shellcheck source=
directive comment had preceding comment lines. - Fixed Support variables declared by
mapfile myVar <<<content
(same forreadarray
). - Fixed Support variable references in
[[ -v myArrayVar[1] ]]
. - Fixed Exception
initial state must remain on lexer stack
for invalid code, e.g.case a in esac);; esac
orecho ;; esac
. - Fixed
Unexpected termination offset for lexer pro.bashsupport...
, e.g. when analyzing Bash injected into a Makefile. - Fixed #74: Syntax highlighting broken after exit
- Fixed More cases where
x && exit
ended up with broken highlighting. - Fixed Support variable reference of
[[ -v varName ]]
. - Fixed Support variable reference of
[[ -R varName ]]
. - Fixed Resolving of variables to definitions in deeply nested subshells.
- Fixed #77: Local variables definitions are visible to nested functions.
Quick Documentation
- Added Quick documentation for all Bash builtin variables is now available.
- Added Quick documentation for positional parameters
$1
to$10
is now available. - Added Quick documentation for POSIX special variables
$@
,$-
,$$
,$!
,$#
,$?
,$*
is now available. - Fixed Don’t show documentation for command arguments, e.g. for
printf
inecho printf
. - Fixed Quick documentation of
[[ -v varName[index] ]]
. - Fixed Quick documentation was shown for array reference brackets of
[[ -v varName[index] ]]
.
Debugger
- Added Hide the output of bashdb in the main console window when running on Windows. On Linux and macOS input and output are already handled by a separate bashdb console.
- Added Show a “Got it” message to tell a user how to show environment variables in the variables panel.
- Added Variable values are now displayed with inlays when debugging. This is only available for the top frame, atm.
- Added “Go to source” is now available for variables, which are displayed by the debugger
- Added Values of numeric variables are now displayed without string quotes.
- Added “Go to declaration” and code completion for code snippets of the “Expression evaluation” dialog.
- Added Support “Set Value” for variables displayed for the top-level frame. This allows you to modify script variables at runtime using the debugger.
- Improved Presentation of debugger values: compact values if inlined in the debugger, show icons with markers for “readonly” and “exported”. Arrays and non-array variables have their own variables now.
- Improved Rendering of variable attributes in the top frame: integer, exported, readonly.
- Improved Remember expand/collapse state of “Input arguments” element in the frame view
- Updated Use “Input arguments” instead of “Parameter passed to the current script or function”.
- Fixed Display attributes “read-only” and “exported” in the variables panel for array variable, too.
ShellCheck
- Updated Bundling the latest release, ShellCheck 0.7.2.
- Updated Updated descriptions of SC codes to ShellCheck 0.7.2.
- Added ShellCheck warnings can now be suppressed at file, function and statement scopes using quickfixes.
- Added Experimental compatibility with macOS 10.11 and later. Previously, it was build for 10.13+ and crashed on macOS 10.11.
- Added Notify when ShellCheck crashes to allow reporting this. Only the first 3 crashes show the error notification icon.
- Added Suppress warning
SC1072
onif
ofa() if ... fi
. BashSupport Pro supports compound commands for functions. - Updated Don’t exclude rule
SC1073
by default. It was excluded to avoid warnings on functions with compound command bodies (e.g.a() for ... done
), which is unsupported by ShellCheck, but supported by BashSupport Pro. Now, the error is suppressed only for this specific case and shown in other places. - Updated Automatically disable SC2034 (variable appears unused) when BashSupport Pro’s inspection “Unused global variable” is enabled.
- Updated Automatically disable SC2154 (unresolved variable) when BashSupport Pro’s inspection “Unresolved variable” is enabled.
- Fixed Don’t show an error when ShellCheck returned malformed JSON (JsonSyntaxException).
- Fixed Exception
Cannot start process, the working directory 'C:\Users\...' does not exist
. - Fixed Warning about high memory use when requesting info page documentation (IDEA-239688)
- Fixed Don’t show message about an incorrect path to ShellCheck for injected files.
- Fixed Suggest quickfix “Add shellcheck source= comment” for SC1090 (Can’t follow source).
- Fixed The working directory was incorrectly set when executing shellcheck. It’s now the file’s parent directory if a local file is validated.
- Fixed Properly handle ShellCheck annotations in files with TABs.
Code Completion
- Added Complete unary operators of
[ ]
,[[ ]]
, andtest
. Quick documentation of completion items is available. - Added Code completion in arithmetic expressions:
(( ))
,let
and$(( ))
are supported. - Added Complete function names for the first argument of
trap
, e.g.trap name SIGNAL
. - Added Complete variable names for the
-v
conditional operator, e.g.[[ -v myVar ]]
.
Formatter / shfmt
- Updated Bundle the latest release of shfmt, version 3.3.0.
- Added Support formatting of bats-core files (supported by shfmt 3.2).
- Added Experimental compatibility with macOS 10.11 and later. Previously, it was build for 10.13+.
- Added Notify when shfmt crashes to allow reporting this. Only the first 3 crashes show the error notification icon.
- Improved Support formatting of the currently selected text. Previously, the formatting wasn’t support in this scenario.
- Updated Experimental build of shfmt as universal build to run natively on both macOS Intel and arm64 architectures.
- Fixed Indentation after pressing enter inside of
{}
,()
,(())
.
bats-core
- Improved Update bundled bats-core to version 1.3.0.
- Added Support formatting of bats-core files (supported by shfmt 3.2).
- Updated Added
true
as default command in the bats-core file template to create a valid script. - Added Also search for
file.bash
whenload file
is used in a bats-core file - Fixed #53: Handle failing tests
- Fixed Parsing of
@test name() { ... }
is now supported
Google Shell Style Guide
- Added New inspection and quickfix to detect and create a missing function comment. The quickfix automatically inserts the names of all referenced global variables.
- Added New settings at
Editor > Code Style > BashSupport Pro
to enable inspections and quickfixes to detect incompatibilities with the style guide. - Added New file template for a file which follows Google’s Shell Style Guide.
- Added New inspection to mark top-level commands, which should be in the
main()
function. - Added Quickfix to create the main function for you and to move all top-level commands into it.
- Added New inspection to warn about main functions, which are not the last definition in a file.
- Added Quickfix to make a main function, which is at the wrong position, the last function definition in a file.
- Updated Live template
function
now inserts thefunction
keyword if the Google shell style guide setting is enabled. - Updated Disable inspection and quickfix to remove the
function
keyword in a.bash
file if the Google shell style guide setting is enabled. - Fixed The quick fix to make the definition of “main” the last definition is now also moving the documentation comment and moves an existing call to main to the end of the file.
- Fixed #75: When using the add function comment in google style mode it thinks local variables are global.
- Fixed Changes to the Google Shell Style Guide settings were not applied to open files.
File Support
- Added Treat
.bashrc
,.bash_profile
,.bash_logout
, and.bash_aliases
as Bash files
Run Configurations
- Added New column “Interpreter arguments” in the shell interpreter settings. This allows a more correct and more flexible configuration of interpreters, especially for WSL on Windows. Now
wsl.exe
can be used for both Bash and POSIX interpreter types and it’s automatically detected on Windows. - Added Environment variables defined by the run configuration are now properly passed on to the WSL environment with the help of the
WSLENV
variable. Values ofWSLENV
defined in the run configuration or the system environment are retained. - Added Injected shell scripts now show a run icon in the gutter, just like regular scripts do. This allows to quickly run injected scripts as a run configuration with an inlined snippet.
- Improved Run configuration can now be executed during indexing (aka “Dumb Mode”).
- Updated The debug action is now hidden for run configurations, which have an inline source snippet
- Fixed The line marker to execute an injected bash file now unescaped the content if the heredoc allows escape codes.
- Fixed
NullPointerException
related to Windows path mapping in the run configuration UI. - Fixed Message
Unable to locate interpreter
when trying to debug a run configuration with configured OS interpreter type.
Inspections and Intentions
- Added New inspection to highlight unused function arguments. It considers use of
$*
,$@
,shift [n]
and implicit usage byfor
andselect
. - Added New inspection “Function keyword” to highlight usage of the function keyword in POSIX scripts. It replaces ShellCheck’s SC2112 for less aggressive highlighting and also adds a quickfix to remove the keyword.
- Added New intention to add a function keyword to functions in files, which support it.
- Added New intention to remove the function keyword where both variants are supported.
- Added All inspections can now be suppressed for files, functions, and statements using quickfixes. Either ShellCheck directives or a special
# bashsupport disable=...
comment is used, similarly to ShellCheck. - Added New Inspection “Unused global variable”, which is disabled by default for now. If enabled, then the equivalent ShellCheck rule is disabled.
- Improved Inspection “Unresolved variable” is now treating variables in test commands in the same way as ShellCheck, e.g.
[[ $unresolvedVar ]]
. - Improved Inspection “Unresolved variable” is now using the same code as ShellCheck for suppression:
SC2154
. - Added Inspection “Unresolved variable” now has a setting to suppress warnings for UPPERCASE_VARIABLES. It’s disabled by default, just as in ShellCheck.
- Improved Inspection “Unresolved variable”. Variables in expansions with fallbacks are not highlighted, e.g.
${name:-fallback}
. Operators:-
,:?
,:=
,:+
with and without:
are supported. - Updated Enable inspection “Non-constant path of source directive” by default.
- Updated Disable ShellCheck’s equivalent test
SC1091
if inspection “Non-constant path of source directive” is enabled. - Fixed Exception
Argument rangeInElement (0,5750) endOffset must not exceed descriptor text range
in inspection “Missing source file”. - Fixed Don’t show “Convert to quoted string” for words subject to tilde expansion, e.g.
~/$dir/file.txt
. - Fixed Show quickfix to define a shellcheck source directive for values subject to tilde expansion, e.g.
~/data
. - Fixed Settings of inspections were not properly saved.
- Fixed Don’t show
Variable could be local
in files, which aren’t using bash. - Fixed Exception in inspection “Unused function argument” when
shift $var
was used in a function.
Language Injection
- Bash is automatically injected into
commands:
elements of YAML files namedcodefresh.yml
. Alternatively,# type=codefresh
in a YAML file with a different name turns on Codefresh injection. - Bash is automatically injected into
before_install:
,script:
, andafter_success:
elements of YAML files named.travis.yml
. Alternatively,# type=travis
in a YAML file with a different name turns on Travis injection. - Fix language injection with embedded sub-expressions
- Fix an edge-case with the fragment editor of language injection into heredocs
- Automatically escape
$
when it’s entered in a fragment editor of unquoted heredocs - Enable ShellCheck for injected Bash scripted edited via “Edit Shell Script Fragment…”
- New setting to control the automatic injection of Bash into Codefresh and Travis YAML files. Injection is disabled by default on 2020.2 and earlier, because the YAML plugin has bugs.
Spellchecker
- Added Add “bashsupport” to bashpro dictionary. It’s used by suppression comments, for example.
- Improved Spellchecking of function and identifier names in camelCase or split by separators such as
::
.
Libraries
- Added New flag “recursive” to library sources. By default script libraries are defined non-recursively.
- Updated Improve user interface of the library settings.
- Fixed Exception
java.lang.IllegalArgumentException: only VirtualFileWithId are supported
when using a shell script library with an injected shell script. - Fixed Libraries weren’t working properly on Windows.
- Fixed “Find references” is now working properly for definitions in library sources, which are referenced by other library sources.
Misc
- Added Track how many times ShellCheck and shfmt are executed, only the count is sent.
- Added Open https://www.bashsupport.com/uninstalled in the browser when the plugin is uninstalled.
- Added Sentry event “uninstalled” is sent when the plugin is uninstalled.
- Updated Builtin Bash dictionary to accept
Coprocess
,BASH_VERSINFO
, andSRANDOM
. - Updated Builtin Bash dictionary to accept
Coprocess
,BASH_VERSINFO
, andSRANDOM
. - Fixed Rename refactoring in scratch files was sometimes setting the wrong name.
- Updated Minor UI changes to the code style panel.