A self-contained VS Code extension for Daml syntax highlighting and basic language features.
-
Syntax Highlighting: Full syntax highlighting for Daml files including:
- Keywords (template, choice, controller, signatory, observer, etc.)
- Control flow (do, if, then, else, case, of, etc.)
- Comments (line and block)
- Strings and numbers
- Types and functions
- Operators
-
Language Configuration:
- Auto-closing brackets, quotes, and backticks
- Comment toggling (Ctrl+/)
- Code folding based on indentation
-
Code Snippets: Quick snippets for common Daml constructs:
template- Template definitionchoice- Choice definitioncontroller- Controller with choicescript- Daml scriptdata- Data type declarationimport- Import statementmodule- Module declaration- And many more...
- Build the extension (see below)
- Open VS-Code
- Press
Ctrl+Shift+P(orCmd+Shift+Pon Mac) to open the Commands view - Search "Install from VSIX..."
- Navigate to:
~/daml-syntax-extension/daml-syntax-1.0.0.vsix - Click "Open" or "Install"
- Restart VS-Code if prompted
-
Copy this directory to your VS Code extensions folder:
- Linux:
~/.vscode/extensions/ - macOS:
~/.vscode/extensions/ - Windows: `%USERPROFILE%.vscode\extensions``
- Linux:
-
Restart VS Code
To package this extension as a VSIX file:
# Install vsce if you haven't already
npm install -g @vscode/vsce
# Package the extension
vsce packageThis will create a daml-syntax-1.0.0.vsix file that can be installed in any VS Code instance.
Once installed, the extension will automatically activate when you open any .daml file.
- Syntax Highlighting: Automatically applied to all
.damlfiles - Snippets: Start typing a snippet prefix (e.g.,
template) and press Tab to expand - Auto-closing: Brackets and quotes will automatically close
- Comment Toggle: Use Ctrl+/ (Cmd+/ on Mac) to toggle line comments
This is a lightweight extension focused on syntax highlighting and basic editor features. It does not include:
- Language server integration (go-to-definition, type checking, etc.)
- Daml compiler integration
- Scenario execution
For full IDE features, use the official Daml Studio with the complete Daml SDK.
Apache-2.0 (same as the Daml SDK)