Skip to content

VS Code Extension

Lash provides full editor integration for VS Code through two protocol servers that follow standard specifications. Both communicate over stdin/stdout and work with any editor that supports the respective protocols.

The lash_lsp binary implements the Language Server Protocol using JSON-RPC over stdin/stdout. It provides:

  • Diagnostics — real-time errors and warnings from the semantic analyzer as you type.
  • Hover — type information and documentation for variables, functions (including typed signatures and doc comments from ///), user-defined types, and built-in methods.
  • Go-to-definition — scope-aware resolution for variables and user-defined functions.
  • Code completion — context-aware suggestions including variables, functions, user-defined types, built-in methods, file paths, native-plugin fns, and PATH executables (with lazy whatis descriptions).
  • Subcommand completion — after a known CLI like git, docker, or kubectl, the matching subcommands show up with descriptions. Falls back to <cmd> --help parsing and bash-completion invocation for tools without hardcoded specs.
  • Semantic tokens — doc comments attached to a fn, type, or unittest get a documentation modifier so editors can style them distinctly.
  • Document sync — incremental document synchronization so the server stays up to date with every edit.

The lash_debug binary implements the Debug Adapter Protocol over stdin/stdout. It provides:

  • Breakpoints — set breakpoints by source file and line number.
  • Step execution — continue, next, stepIn, stepOut, and pause commands.
  • Variable inspection — inspect variables, scopes, and the full stack trace at any breakpoint.

Add the following to your VS Code settings.json:

{
"lash.lsp.path": "lash_lsp",
"lash.lsp.args": [],
"files.associations": {
"*.lash": "lash"
}
}

Create or update .vscode/launch.json in your project:

{
"version": "0.2.0",
"configurations": [
{
"type": "lash",
"request": "launch",
"name": "Debug lash script",
"program": "${file}",
"debugServer": null,
"runtimeExecutable": "lash_debug",
"args": []
}
]
}

Lash scripts use the .lash file extension. The VS Code extension registers this extension automatically for syntax highlighting, diagnostics, and debugging.

Install the extension directly from the VS Code Marketplace, or search for lash in the Extensions panel inside VS Code.