Skip to content

zenith-network/daml-syntax-extension

Repository files navigation

Daml Syntax Extension

A self-contained VS Code extension for Daml syntax highlighting and basic language features.

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 definition
    • choice - Choice definition
    • controller - Controller with choice
    • script - Daml script
    • data - Data type declaration
    • import - Import statement
    • module - Module declaration
    • And many more...

Installation

Option 1: Install from VSIX (Recommended)

  1. Build the extension (see below)
  2. Open VS-Code
  3. Press Ctrl+Shift+P (or Cmd+Shift+P on Mac) to open the Commands view
  4. Search "Install from VSIX..."
  5. Navigate to: ~/daml-syntax-extension/daml-syntax-1.0.0.vsix
  6. Click "Open" or "Install"
  7. Restart VS-Code if prompted

Option 2: Install from Source

  1. Copy this directory to your VS Code extensions folder:

    • Linux: ~/.vscode/extensions/
    • macOS: ~/.vscode/extensions/
    • Windows: `%USERPROFILE%.vscode\extensions``
  2. Restart VS Code

Building

To package this extension as a VSIX file:

# Install vsce if you haven't already
npm install -g @vscode/vsce

# Package the extension
vsce package

This will create a daml-syntax-1.0.0.vsix file that can be installed in any VS Code instance.

Usage

Once installed, the extension will automatically activate when you open any .daml file.

  • Syntax Highlighting: Automatically applied to all .daml files
  • 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

Notes

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.

License

Apache-2.0 (same as the Daml SDK)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published