Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Template Expander V3 GrammarNew to Visual Studio Code? Get it now.
Template Expander V3 Grammar

Template Expander V3 Grammar

Simon Ottenhaus

|
4 installs
| (1) | Free
Syntax highlighting and Language Server for Template Expander V3 (.te3)
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Template Expander V3 — VS Code Extension

VS Code Extension für Template Expander V3 (.te3, .te3.txt) mit:

  • Syntax-Highlighting (TextMate Grammar)
  • Language Server (LSP) mit Diagnostics, Go to Definition, Find References, Document Symbols, Hover

Features

Syntax Highlighting

  • Rule IDs (RULE_NAME)
  • Quoted/Unquoted strings
  • Comments (#)
  • Operators (=, |, ;)
  • Metadata blocks ({weight=10})
  • Tags (<tag>content</tag>)
  • Labels ([key: VALUE])

Language Server

  • Diagnostics:
    • Syntax-Fehler (mit Position)
    • Undefined Rule References
    • Duplicate Rule Definitions
    • Rekursive Regelabhängigkeiten (Regelgraph muss ein DAG sein)
    • Unused Rules (nicht erreichbar vom Start)
    • Hinweis bei leeren Terminals ""
  • Go to Definition (F12 auf RULE_ID)
  • Find All References (Shift+F12 auf RULE_ID)
  • Document Symbols (Ctrl+Shift+O)
  • Hover zeigt Infos an.
  • Rule Inspector (Rechtsklick auf eine Regel → Template Expander V3: Inspect Rule) Zeigt mehr Informationen und Beispiele zur Regel an.

Installation / Entwicklung

# Dependencies installieren
npm install

# TypeScript kompilieren
npm run build

# Extension testen (VS Code)
# Drücke F5 → öffnet Extension Development Host

Testen

# TextMate Grammar Tests (Tokenization)
npm test

# Language Server Tests
npm run test:server

# Alle Tests
npm run test:all

Projektstruktur

├── client/
│   └── src/extension.ts      # VS Code Extension Client
├── server/
│   └── src/
│       ├── server.ts         # Language Server
│       └── parser.ts         # Parser (Tokenizer + AST)
├── syntaxes/
│   └── template-expander-v3.tmLanguage.json  # TextMate Grammar
├── tests/
│   ├── tokenize.test.js      # TextMate Tests
│   └── server.test.js        # LSP Tests
├── examples/
│   └── sample.te3
├── package.json
├── tsconfig.json
└── language-configuration.json

Build-Skripte

Script Beschreibung
npm run compile TypeScript kompilieren
npm run watch TypeScript watch mode
npm run build Alias für compile
npm test TextMate Grammar Tests
npm run test:server Language Server Tests
npm run test:all Alle Tests
npm run package VSIX erstellen

Installation der Extension

  1. VSIX erstellen: npm run package → erzeugt template-expander-v3-x.y.z.vsix
  2. VSIX installieren: In VS Code Extensions → ... Menü → Install from VSIX... → Datei auswählen ODER: code --install-extension template-expander-v3-x.y.z.vsix

Debugging

  1. Extension starten: F5 (startet Extension Development Host)
  2. Server debuggen: Launch "Extension + Server" in VS Code
  3. Eine .te3 Datei öffnen → LSP aktiviert sich automatisch

Beispiel Grammar

# Template Expander V3 Example
START = GREETING " " NAME "!";

GREETING = "Hello"
         | "Hi"
         | "Hey";

NAME = "World"
     | "User";
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft