The MUFL language server is a VS Code extension that provides
syntax highlighting, diagnostics, go-to-definition, and rename for
.mufl, .mu, and .mm files. It is built from source out of the
adapt-toolkit/adapt
repository.
The language server packages (
@adapt-toolkit/langserver-client,@adapt-toolkit/langserver-server) are not currently published to npm. Building from source is the only supported install path.
Prerequisites
- Node.js ≥ 20.19 and
npm. - Visual Studio Code.
- The
vscetool for packaging extensions:npm install -g @vscode/vsce - A local checkout of the ADAPT toolkit (see
Build from source — Linux or
Build from source — macOS). The
language server depends on
mufl-compile.wasm, which is produced by the WASM build of the toolchain.
Build the language server
From the root of the adapt checkout:
cd typescript
npm ci
npm run build
This builds every workspace in the TypeScript monorepo, including
the language-server client and server packages at
typescript/langserver/client and typescript/langserver/server.
Package and install the VS Code extension
Package the client workspace as a .vsix:
cd typescript/langserver/client
vsce package
Then install it into your VS Code:
code --install-extension mufl-langserver-*.vsix
Open any .mufl, .mu, or .mm file. The extension activates
automatically.
Configure the extension
Once installed, open VS Code Settings and search for mufl language server. The notable settings are:
- Enable Meta — when on, the language server runs the
metatype-checking stage on every save. Slower, but catches type errors in-editor. You can also toggle this per file withpragma langserver force_metaorpragma langserver no_meta. - Environment Variables — JSON map passed through to the
compiler. Useful for setting
MUFL_STDLIBso the compiler can find the standard library. - Path To Meta — absolute path to the directory containing
meta.mm. - Path To Transactions — absolute path to the directory containing
transaction.mmand__t_wrapper.mm. - Trace: Server — controls the verbosity of the client↔server log channel.
To make the meta toggle a one-keystroke action, bind a shortcut to
the muflLangServer.enableMeta command under File → Preferences →
Keyboard Shortcuts.