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.
Install the VS Code extension
Section titled “Install the VS Code extension”The extension lives in the repository at
editors/vscode/:
cd editors/vscodepnpm installOpen 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
.fluxsources. - 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.
Get diagnostics from the CLI
Section titled “Get diagnostics from the CLI”The same diagnostics are available headlessly through flux lsp. It parses
and type-checks one file and prints the findings as JSON:
flux lsp src/main.fluxThe 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:
flux lsp src/main.flux --no-typesHow diagnostics reach your editor
Section titled “How diagnostics reach your editor”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.
Next steps
Section titled “Next steps”- Formatting and CI gates to keep sources canonical before they reach review.
- CLI reference for the full
flux lspsurface.
