Language Server for Bash by Bitno
A lightweight, private and secure Bash language server for VS Code.
Early development: this extension is still being built. Expect missing features, rough edges and breaking changes between versions.
Lightweight, private and secure by design
Built by a developer, for developers, from Serbia. Free to use, with no paid tier.
- Lightweight: Starts only when you open a shell script. Linting and formatting are built in, so there's nothing to install.
- Private: No telemetry, no account, no network: nothing is downloaded or sent anywhere.
- Secure: Your scripts are checked and formatted, never run unless you click Run.
Features
- Syntax errors as you type: unbalanced quotes and parentheses, and missing
fi, done or esac, are underlined in shell scripts.
- Linting, built in: warnings and suggestions as you type, each linked to a page that explains it; nothing to install.
- Quick fixes: apply a warning's own fix, or disable a check for one command with a
# shellcheck disable= directive.
- Formatting, built in: Format Document prints scripts in the usual shell style, with the options in your
.editorconfig or the editor's indentation; nothing to install.
- Outline and navigation: the script's functions and variables in the outline, go to definition, find references, and highlighting of every use of the name under the cursor.
- Completion: variables after
$, and keywords, builtins, the script's functions and the commands on your PATH where a command starts.
- Run a script: a Run button at the top of a script runs it in VS Code's terminal, from its folder, with the interpreter its shebang names (Bash without one), so it runs without the executable bit. A changed script is saved first.
- Hover: a builtin's
help text or a command's man page, from your machine.
- Folding and expand selection: fold functions, loops,
if branches, here-documents and comment blocks; grow the selection along the script's structure.
- Server status beside the language mode: a script's
{} language status shows the Bash icon with the server's state ("Ready") or its current work; it comes into the status bar when the server failed to start or work failed, and opens the server's output.
What it reads and runs
- It reads only your open scripts, their
.editorconfig, the commands on your PATH, and the help text and man pages you hover over.
- It runs only
help and man, for hover, with the command's name as an argument and never through a shell, so nothing in a script can inject a command; and a script when you click its Run button, with its path as an argument, never through a shell.
- In Restricted Mode it works without running
help or man, and scripts have no Run button: hover shows their text, and Run shows, once you trust the folder.
- A warning links to the page that explains it, which opens only when you click it.
Feedback
Found a bug, or missing something? Open an issue. Questions and ideas go to Discussions. Blunt feedback is welcome.
| |