Skip to content
edge-language-tools
Esc
navigateopen⌘Jpreview
On this page

Introduction

Type safety and editor tooling for EdgeJS templates.

edge-language-tools brings full code intelligence to EdgeJS templates: a real language server — type-aware diagnostics, autocomplete for props, expressions, and tags (including your components as supercharged shorthand tags), hover types, and template-path completion for @include/@component — plus a CI type-checker and compile-time-checked edge.render() calls. Built on TypeScript and Volar.js, the same machinery behind Vue and Astro tooling. Works with bare edge.js; no AdonisJS required.

Declare a template’s interface once, in a comment today’s Edge already ignores:

{{--
@types {
  user: import('#models/user').User
  items: string[]
}
--}}

<h1>{{ user.name }}</h1>
@each(item in items)
  <li>{{ item }}</li>
@end

Everything below the block is inferred by TypeScript: @let locals, @each item types, narrowing in @if. A typo like user.nmae gets a diagnostic on the exact characters — in the editor and in CI.

What you get

How it works, in one sentence

Each template compiles to a virtual TypeScript module — expressions copied verbatim with exact offset mappings, constructs emitted as real control flow — so TypeScript does the checking and Volar.js serves it to editors. Read How it works for the details.

Was this page helpful?