Expressif Language Support for VS Code
This extension is a thin client for Expressif.LanguageServer. It registers .expressif files and forwards editor activity to the server over the Language Server Protocol. Parsing and every language feature remain in the server.
Create an untitled Expressif document by choosing Expressif File from VS Code's New File... picker, or create a file whose name ends in .expressif or .expr.
Right-click an .expressif or .expr file in the Explorer and choose Format Document to open and format it with the language server. In an open Expressif editor, VS Code's standard Format Document command uses the same formatter.
Run an expression
Press Ctrl+Shift+Enter (Cmd+Shift+Enter on macOS), use the play button in the editor title, or run Expressif: Run Expression from the Command Palette. The command evaluates the current selection, or the whole document when nothing is selected. Before evaluation, choose whether to use no input, enter a literal, select a JSON or CSV file, use an open JSON/CSV editor or its current selection, or reuse the previous input. Then choose .expressif or .json for the result representation. To use the active JSON/CSV editor, select the expression once, focus the JSON/CSV editor, and invoke the command from the Command Palette; the extension remembers the most recently active Expressif editor. Results open in a read-only editor beside the Expressif script. Re-running the same script with the same output format refreshes that result editor.
Tuple binding migrations
The language server highlights deprecated implicit callable binding in adjacent, chunk-while,
map-over, and map-with. When the resolved runtime binding proves the migration safe, use the
editor's Quick Fix action to convert the callable to explicit ~function or function~ syntax.
The diagnostic targets only the affected callable; the operator and callable themselves remain supported.
Press Ctrl+Enter (Cmd+Enter on macOS), or run Expressif: Run Expression with Last Input and Output, to evaluate with the most recently selected input and output format. If either selection has not yet been made in the current VS Code session, the extension prompts only for the missing choice.
Evaluation results use compact rendering by default. Open VS Code Settings (Ctrl+, or Cmd+,), search for Expressif Output, and choose compact or pretty. In pretty mode, set Expressif › Output: Indent to the number of spaces per indentation level. You can make the same change in settings.json:
{
"expressif.output.formatting": "pretty",
"expressif.output.indent": 4
}
Change pretty to compact for single-line results; expressif.output.indent is ignored in compact mode. Changes apply to the next evaluation without reloading VS Code.
Development
Prerequisites are Node.js, npm, the .NET 10 SDK, and VS Code.
cd vscode-extension
npm install
npm run compile
Open the repository in VS Code and press F5. The extension development host uses the server path configured in expressif.languageServer.path. For an unpackaged development run, first publish the server with:
node ./scripts/publish-server.mjs
Open a .expressif file in the development host to activate the extension. Server stderr and language-client traces are available in View > Output > Expressif Language Server. Set expressifLanguageServer.trace.server to messages or verbose for LSP tracing.
Package and install
Run the following from this directory:
npm install
npm run package
code --install-extension ./artifacts/expressif-language-support.vsix
Packaging publishes a self-contained server for the operating system and architecture on which the command runs, then embeds it in the VSIX. Build the VSIX on each target platform. A locally installed package therefore requires neither the .NET runtime nor a separate server installation.
To use a separately installed server, set expressif.languageServer.path to its absolute executable path and reload VS Code.