Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>TEPLNew to Visual Studio Code? Get it now.
TEPL

TEPL

Onion Kim

|
1 install
| (0) | Free
Syntax highlighting, diagnostics, and configurable formatting for Tensor Equality Pattern Language
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

TEPL logo TEPL for VS Code

License: MIT VS Code: 1.90+

Syntax highlighting, diagnostics, and formatting for TEPL (Tensor Equality Pattern Language), a language for writing tensor rewrite rules, computation graphs, and operation dialects.

  • Highlight current TEPL rules, node labels, .attrs / .axes properties, descriptor constructors, and auto.
  • Highlight shape/dtype programs, axis bindings, semantic constructors, types, and builtins.
  • Report syntax errors while editing and upstream compiler diagnostics on open/save.
  • Highlight and format concrete graphs with inputs, let bindings, named attributes, and yield.
  • Format documents or automatically format when saving.
  • Wrap long rewrites with configurable line width and indentation.
  • Share formatting settings across a project with tepl-format.json.

Get started

  1. Open a .tepl file. The language indicator should say TEPL.
  2. Run Format Document from the Command Palette. If prompted, select TEPL as the formatter.

Requires VS Code 1.90 or newer. The parser and formatter are included with the extension.

Format on save

Add this to your VS Code settings:

{
  "[tepl]": {
    "editor.defaultFormatter": "5yearsKim.tepl-vscode",
    "editor.formatOnSave": true
  }
}

Diagnostics

Syntax checks work immediately, including in unsaved documents. Saved files are also checked with tepl check when the compiler is on PATH. Set its executable path in VS Code if needed:

{
  "tepl.lint.compilerPath": "/home/onion/Projects/tepl/bazel-bin/tepl",
  "tepl.lint.semanticPolicy": "strict"
}

Use your own compiler path. Compiler checks cover imports, types, operation signatures, axis semantics, and rewrite proofs. Diagnostics appear in Problems, including imported-file locations and related notes. Checks use the saved source and run only in trusted workspaces. If the compiler is unavailable, syntax checks continue; details appear in the TEPL output channel. Set compilerPath to "" for syntax checks only, or tepl.lint.enable to false to disable diagnostics. Use "algebraic" only when that arithmetic policy is appropriate for your project.

Format a project from the terminal

The standalone tepl-fmt CLI uses the same formatter:

tepl-fmt path/to/project --write --print-width 100 --tab-width 2
tepl-fmt path/to/project --check
tepl-fmt path/to/project --lint
tepl-fmt path/to/project --write --exclude path/to/project/generated

See the developer guide for installation and all options. --lint checks syntax; use tepl check path/to/project for semantic validation.

Formatting preferences

TEPL uses no semicolon terminators. Conditions use where expression or a block with local bindings and a final yield: where { let n = 1 yield n > 0 }.

The default line width is 80, with two-space indentation. Short rewrites stay on one line; longer rewrites put => on its own line and wrap expressions as needed. The formatter preserves comment text and literal spelling. Operation properties are ordered as alias, attrs, dtype, then shape or axes, then semantics, with comments kept with their properties. Invalid or incomplete TEPL is left untouched.

Create tepl-format.json in your project to customize formatting:

{
  "printWidth": 80,
  "tabWidth": 2,
  "useTabs": false,
  "rewriteLayout": "auto"
}

All properties are optional. Set rewriteLayout to "multiline" to always put => on its own line. Project settings take precedence over editor settings.

For development setup, testing, packaging, CLI/library usage, and advanced configuration, see the developer guide.

See the changelog for release notes.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft