@samveys/lsp

Version
1.0.2Nov 5, 2026
Install
pnpm add @samveys/lsp

From packages/lsp/README.md in the framework repository.

A language server for @samveys/template files (.tpl.html), with no dependencies. It speaks LSP 3.17 over stdio: samveys-lsp --stdio.

FeatureBehaviour
Completion<x- lists components from resources/views/components; @ lists directives
HoverA component shows its file and the props it reads; a directive shows its syntax
DiagnosticsThe real template compiler runs on every change; its SVS_E109 errors appear on their line. An unknown <x-name> is a warning
Go to definition<x-card>, @include('…') and @layout('…') open the file

VS Code

packages/lsp/vscode is a thin extension built on vscode-languageclient. It starts node_modules/.bin/samveys-lsp of the workspace for .tpl.html files; the samveys.lsp.command setting points it elsewhere. Package it with npx @vscode/vsce package in that folder.

Other editors

Any LSP client works. Start samveys-lsp --stdio with the workspace root as rootUri; views are read from <root>/resources/views.

Use it from code

ts
import { createTemplateLanguageService } from '@samveys/lsp'

const service = createTemplateLanguageService({ viewsDir: 'resources/views' })
const diagnostics = service.diagnose(source, 'resources/views/home.tpl.html')