Skip to content

Latest commit

 

History

62 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Expressif.LanguageServer

Expressif logo

Language Server Protocol support for Expressif, bringing diagnostics, completion, hover information, signature help, semantic highlighting, formatting, quick fixes and expression evaluation to your editor.

The repository also contains Expressif Language Support, a thin Visual Studio Code client that bundles and connects to the language server.

About | Features | Installing | Using Visual Studio Code | Development

About

Social media: website twitter badge

Releases: GitHub releases GitHub Release Date licence badge

Dev. activity: GitHub last commit Still maintained GitHub commit activity

Continuous integration builds: Build CodeFactor codecov

Status: stars badge Bugs badge Top language

Features

Expressif.LanguageServer exposes editor-independent language features through the Language Server Protocol.

Feature Status Description
Diagnostics Reports syntax errors, invalid function calls, lifecycle/deprecation warnings and supported migration warnings.
Function completion Completes Expressif functions and aliases using the shared function catalog.
Hover Shows function information and contextual information for fields and input bindings.
Signature help Shows function signatures and the active parameter while editing calls.
Semantic highlighting Provides semantic tokens for Expressif language constructs.
Document highlights Highlights relationships between field references and their supplying expressions.
Document formatting Formats complete Expressif documents using the server's canonical formatting rules.
Quick fixes Offers supported replacements for deprecated functions, legacy tuple references and binding migrations.
Expression evaluation Evaluates a selection or complete Expressif document with optional input data.
On-type formatting Planned Tracked by #67.
Type-aware completion ranking Planned Tracked by #58.
Go to definition / references / rename Not currently implemented.

The language server communicates with editors over standard input and output. Editor-specific behavior belongs in thin clients such as the VS Code extension.

Installing

Visual Studio Code

The recommended way to use Expressif.LanguageServer today is through the Expressif Language Support VS Code extension.

Download the .vsix package from the latest GitHub release, then install it from Extensions → … → Install from VSIX….

It can also be installed from the command line:

code --install-extension .\Expressif-LanguageSupport-<version>-win-x64.vsix

The packaged extension contains a self-contained language server. A separate .NET installation or language-server installation is therefore not required.

GitHub releases currently provide Windows x64 packages.

Standalone language server

A standalone self-contained server is also available from the GitHub releases.

Download and extract:

Expressif-LanguageServer-<version>-net10.0-win-x64.zip

Then configure an LSP-compatible editor or client to launch:

Expressif-LanguageServer.exe

The process communicates using the Language Server Protocol over standard input and output; it is not an interactive command-line application.

Using Visual Studio Code

Open a .expressif or .expr file after installing the extension. The language server starts automatically and provides diagnostics, completion, hover information, signature help, semantic highlighting, formatting and quick fixes.

Run an expression

Press Ctrl+Shift+Enter (Cmd+Shift+Enter on macOS), select the play button in the editor title, or run Expressif: Run Expression from the Command Palette to choose the input and output format.

If text is selected, only that selection is evaluated. Otherwise, the complete document is evaluated.

The input picker supports no input, an Expressif literal, a JSON or CSV file, an open JSON/CSV editor, the current selection in such an editor, or the previously used input.

After choosing the input, choose the result representation:

.expressif
.json

Evaluation results open as read-only virtual documents beside the Expressif script. .expressif results use Expressif language mode and .json results use JSON language mode. Re-running the same script with the same output format refreshes the existing result editor.

Press Ctrl+Enter (Cmd+Enter on macOS), or run Expressif: Run Expression with Last Input and Output, to evaluate using the most recently selected input and output format. If either choice is unavailable, only the missing choice is requested.

Configuration

The VS Code extension exposes these settings:

Setting Description
expressif.languageServer.path Optional path to a separately installed language-server executable. When empty, the bundled server is used.
expressif.output.formatting Evaluation result rendering: compact (the default) or pretty.
expressif.output.indent Spaces per indentation level for pretty evaluation results. Defaults to 2 and does not affect compact rendering.
expressifLanguageServer.trace.server LSP tracing level: off, messages or verbose.

To change evaluation rendering, open VS Code Settings (Ctrl+, or Cmd+,), search for Expressif Output, and choose compact or pretty. When pretty is selected, set Expressif › Output: Indent to the number of spaces to use at each level. The equivalent settings.json configuration is:

{
  "expressif.output.formatting": "pretty",
  "expressif.output.indent": 4
}

Change pretty to compact for single-line results. The indent setting is ignored in compact mode. Changes apply to the next evaluation without reloading VS Code.

Language-server logs and protocol traces are available from View → Output → Expressif Language Server.

Current limitations

Some pieces of the editor experience are deliberately still evolving.

Evaluation results currently use the Output panel. #115 will move them to a regular read-only editor pane.

The language-server extension currently owns the expressif language registration itself. #117 will make it depend on the dedicated Expressif syntax-highlighting extension instead.

Completion is currently based on the function catalog rather than inferred input types. Type-aware ranking is tracked by #58.

Whole-document formatting is available, while formatting as you type is tracked separately by #67.

Additional semantic validation and editor assistance for tuple-binding shorthands is tracked by #102.

Development

Development requires the .NET 10 SDK, Node.js with npm, and Visual Studio Code.

Build and test the language server from the repository root:

dotnet restore Expressif.LanguageServer.sln
dotnet build Expressif.LanguageServer.sln -c Release -f net10.0
dotnet test Expressif.LanguageServer.sln -c Release -f net10.0

Build the VS Code client with:

cd vscode-extension
npm ci
npm run compile

For a local extension-development session, publish a self-contained server into the extension first:

node ./scripts/publish-server.mjs

Then open the repository in VS Code and press F5 to launch the Extension Development Host.

The VS Code client is intentionally thin: parsing, diagnostics and language semantics remain in Expressif.LanguageServer and its Core project rather than being duplicated in TypeScript.

Contributing

See CONTRIBUTING.md for contribution guidelines and SECURITY.md for reporting security issues.

Expressif.LanguageServer is licensed under the Apache License 2.0.

About

Language Server Protocol implementation for Expressif, providing editor features such as diagnostics, completion, hover information, and navigation based on Expressif.Syntax.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages