Lash — VSCode Extension
Full IDE support for the Lash shell language.
Syntax highlighting, script runner, LSP diagnostics/completion/formatting, and DAP debugging — all native VSCode UI, no webviews, no JSON editing required.
Features
Syntax Highlighting
TextMate grammar with scopes for:
- Keywords (
let, mut, fn, if, for, match, usage, write to, unittest, ...)
- Strings (double-quoted, single-quoted, backtick commands)
- String interpolation (
$var, ${var}, $(expr), $((arith)))
- Escape sequences (
\n, \t, \\, \$)
- Numbers, booleans, operators, redirects, pipes
- Function declarations, method calls, function calls
- Assertion chains (
.must.equal(), .must.contain(), etc.)
- Comments (
#)
Script Runner (CodeLens)
Every .lash file shows CodeLens actions at line 1:
Run | Debug | Set Args <- no args
Run | Debug | Args: 8080 myapp | Clear <- args configured
- Run — executes the script in a VSCode integrated terminal
- Debug — launches the DAP debugger with breakpoints
- Set Args — native input box for space-separated arguments (supports quoted strings)
- Clear — removes saved args
Arguments persist per-file in workspace state across restarts.
LSP Integration
Connects to lash-lsp when available on PATH. Provides:
- Diagnostics (parse + semantic errors)
- Completion (keywords, builtins, variables, functions, env vars)
- Hover (type info, mutability, signatures)
- Go to definition
- Formatting (Shift+Alt+F / format-on-save)
Test Explorer
Integrated with VSCode's Test Explorer for unittest blocks in .lash files.
- Tests auto-discovered from all
.lash files in the workspace
- Test names extracted from the
# comment preceding each unittest block
- Run individual tests or all tests at once from the Test Explorer sidebar
- Inline run button next to each
unittest block in the editor
- Pass/fail results with failure messages displayed in the Test Explorer
- Tests execute via
lash <file> --test
# doubles a positive number
unittest {
double(5).must.equal(10)
}
Debugger (DAP)
Connects to lash-debug when available on PATH. Provides:
- Breakpoints, stepping (over/into/out), continue
- Variable inspection and stack traces
- Hover evaluation during debug
- F5 launches with zero config (no
launch.json needed)
All settings under lash.formatter.*:
| Setting |
Default |
Options |
indentStyle |
spaces |
spaces, tabs |
indentSize |
4 |
1-8 |
braceStyle |
same-line |
same-line, next-line |
pipelineStyle |
inline |
inline, split |
pipelineThreshold |
80 |
40-200 |
trailingNewline |
true |
bool |
maxBlankLines |
2 |
0-5 |
spaceAroundOperators |
true |
bool |
spaceAfterComma |
true |
bool |
Project-level overrides via .lashfmt in workspace root.
Configuration
| Setting |
Default |
Description |
lash.lashPath |
lash |
Path to the lash interpreter |
lash.lspPath |
lash-lsp |
Path to the language server |
lash.debugPath |
lash-debug |
Path to the debug adapter |
lash.suppressToolCheck |
false |
Suppress missing tool notifications |
Requirements
- Syntax highlighting and script runner work standalone with no external tools
- Test discovery works standalone (highlighting
unittest blocks)
- Running tests and scripts requires
lash on PATH
- LSP features require
lash-lsp on PATH
- Debugging requires
lash-debug on PATH
Install lash from the releases page or build from source:
git clone https://gitlab.com/szabobogdan3/lash.git
cd lash
dub build --compiler=ldc2 --build=release --config=application
Build & Install
npm install
npm run compile
# Package as .vsix
npx vsce package
# Install locally
code --install-extension vscode-lash-0.1.0.vsix
Install on a Remote SSH Host
When using VS Code Remote-SSH, the extension must be installed on the remote machine:
- Build the
.vsix as shown above.
- Copy it to the remote host:
scp vscode-lash-0.1.0.vsix user@host:~/
- Connect to the remote host in VS Code (Remote-SSH).
- Open the Extensions sidebar, click
... > Install from VSIX..., and select the file.
Or from the remote terminal:
code --install-extension ~/vscode-lash-0.1.0.vsix
Make sure lash, lash-lsp, and lash-debug are also installed on the remote machine.
License
MIT