Blech Language Services - the VS Code extension
Visual Studio Code and the Blech Language Services
We package the Blech Language Servicex as an extension for VS Code that provides two functionalities:
- syntax highlighting, and
- a language server which checks the code every time it is saved.
This gives you editing support like code snippets, correct indentation, type checking or causality checking. In case of errors, it returns error messages to the user. It also supports a few basic IDE functionalities.
In order to use this, install Visual Studio Code (a.k.a. VS Code) either from https://code.visualstudio.com/ or from https://github.com/VSCodium/vscodium/releases. It can be installed locally without admin rights.
Build the extension from source
The build from source needs .NET Core and NodeJS for the Blech Language Services.
If you built the Blech compiler from source .NET Core is already installed.
To install NodeJS download and install the Long Term Support version
Enclosed is a version of the Node Package Manager
Test it with:
npm is frequently updated. In order to keep it up-to-date run:
npm install npm@latest -g
In most case you should see an upgrade when you run:
Prerequisites for building the extension
blech-tools repository, including the blech compiler submodule.
git clone --recurse-submodules https://github.com/boschresearch/blech-tools.git
Change to the
Install the node package
vsce, which is able to package VS Code extensions.
npm -g install vsce
npm -g install typescript
Install the necessary node modules for this project.
ide subdirectory run
Optionally: Run the TypeScript compilation.
npm run compile
If you like, you can learn more about the TypeScript language , which is created by Microsoft.
Build the extension
Besides syntax highlighting the Blech Language Services consisting of two parts which need to be compiled.
A language server written in F#, which is a small wrapper around the Blech compiler.
The language server is build using dotnet. From the
dotnet publish -c Release -o bin -r win-x64
Choose your runtime above as necessary (
A VS code extension, which runs a client to the language server. To build and package the client and the server as an extension run:
If you get a security warning when using Windows powershell. Try running it from
This gives you a
blech-language-services-0.<i>.<j>.vsix file in the same directory.
Install the extension
You can install the Blech Language Services VS Code extension via the commandline or interactively.
From the command line go to the
ide subdirectory run
with the correct version number.
If VS Code is already running:
Open the Extension section, go to the
... menu, and select
Install from VSIX....
blech-language-services-0.<i>.<j>.vsix file to install the extension.
Verify it works by opening some
If the keywords are coloured, it works.
Furthermore, if you hover over an activity name, you should see its signature in a tooltip.