Skip to content

Flux ships a language server (flux-lsp, built on async-lsp) and a VS Code extension that wraps it. Together they give you syntax highlighting, diagnostics, hot-reload status, and a one-click run on device.

The extension lives in the repository at editors/vscode/:

Terminal
cd editors/vscode
pnpm install

Open the folder in VS Code and launch it as an extension development host (press F5), or package it with vsce and install the produced .vsix. The extension bundles the Flux TextMate grammar — the same grammar this docs site uses for flux code blocks — so highlighting matches the CLI’s view of the language.

While the extension is active you get:

  • Syntax highlighting for .flux sources.
  • Diagnostics pushed from parse and type checks.
  • Hot-reload status for the connected dev server.
  • “Run on device” to point the current project at a connected host.

The same diagnostics are available headlessly through flux lsp. It parses and type-checks one file and prints the findings as JSON:

Terminal
flux lsp src/main.flux

The output carries each diagnostic’s message, span, and hint, so you can pipe it into review tooling:

{ "diagnostics": [ { "message": "expected `Int`, got `String`", "span": { "file": "src/main.flux", "start": 214, "end": 228 }, "hint": "`count` was inferred as Int at line 18" } ] }

On large files where you only need syntax errors, skip the type checker:

Terminal
flux lsp src/main.flux --no-types

Every error Flux produces carries a source Span — file, line, and column — which is what makes the editor integration useful: you get caret-positioned diagnostics instead of a log dump. The troubleshooting guide explains what each diagnostic class means and how to fix it.