Runa VS Code Extension (runa-vscode)
First-class authoring support for runa.toml, Markdown content (content/**/*.md
and SUMMARY.md), and Tessera templates (templates/**/*.{html,txt,xml,xsl,json})
powered by runa lsp.
1. Features
- Syntax Highlighting & Grammar Injection:
- Injects the full Tessera language into
html, xml, xsl, json, and
.runa.html templates (including inside HTML attribute values) while
preserving native HTML/Emmet support: {{ }} / {% %} / {# #} with
- trim markers, verbatim {% raw %} blocks, set/endset captures,
namespace(), include ... with ... only, filter sections, for ... if
loops with else, comprehensions, typed/nullable macro parameters with
defaults and ...rest, call/slot/render_slot [required], dot-call
macro namespaces, from ... import ... as, is [not] tests, filters,
optional chains (?., ?[), ??, **, //, ~, spreads, nested map
literals, and Tessera's exact string escape set.
- Distinguishes engine-reserved intrinsics (
super(), namespace(),
attrs(), classes(), | safe, is defined/undefined) from host
helpers, and flags super/namespace used as a macro name or named-import
alias, which Tessera rejects.
- Injects YAML frontmatter, inline
{{ name(...) }} and (multi-line) block
{% name(...) %}...{% end %} shortcodes, and @/... content links into
Markdown outside fenced code (matching Runa's expansion rules), plus
{{ @include path:anchor }} directives and literal include fences
(```rust {include="/path", start=1, end=9}) everywhere.
- Highlights
runa.toml tables, keys, and discovery mode enums.
- Cross-File Completions (
textDocument/completion):
runa.toml: Top-level settings, section headers, discovery enums, and
bidirectional [extra] keys inferred from templates/**.
content/**/*.md: Frontmatter keys and values (template:, sort_by:,
changefreq:, configured taxonomies: and existing terms, inferred extra:
keys), @/... content routes, @include paths and ANCHOR: names, and
shortcode names/parameters extracted from templates/shortcodes/*.html.
templates/**/*: page.*, section.*, config.*, pager.*, taxonomy.*,
term.*, book.*, chapter.*, loop.*, inferred config.extra.* /
page.extra.* / section.extra.* fields, filters, functions, template
paths, and imported namespace.macro(...) calls.
- Live Authoring Diagnostics (
textDocument/publishDiagnostics):
- Validates
runa.toml schema, YAML frontmatter, regex transforms, broken
@/... links, missing @include files or ANCHOR: / ANCHOR_END: regions,
unknown or unclosed shortcodes, missing template/macro targets, and
undeclared frontmatter taxonomies across unsaved editor buffers.
- Snippets & Editing:
t-* template snippets cover blocks, typed macros, call/slot,
captured set, namespace, include ... with ... only, filter
sections, raw, grouped and filtered loops, attrs(), classes(),
?? fallbacks, date formatting, and Runa helpers; fm-*, sc-*, and
fence-* cover frontmatter, shortcodes, and code-fence options.
.runa.html and .runa.md fold Tessera blocks and block shortcodes, and
auto-indent between Tessera block tags.
- Go to Definition, Hover & Document Links:
- Jump directly from
@/... links, @include path:anchor directives (to the
exact ANCHOR: line), shortcodes (templates/shortcodes/<name>.html),
frontmatter template: / taxonomies:, {% extends / include / import %},
namespace.macro_name() calls, and config.extra.* references.
- Hover over
@/... links, @include directives, shortcodes, extra fields,
and template helpers for rich Markdown previews.
2. Configuration & Commands
| Setting / Command |
Description |
runa.server.path |
Explicit path to the runa executable (falls back to runa on system PATH). |
runa.server.enabled |
Enable or disable the runa lsp background process (true by default). |
runa.check.allContent |
Pass --all-content when running Runa: Check Site (true by default). |
Runa: Check Site |
Run runa check on the active Runa workspace root. |
Runa: Build Site |
Run runa build on the active Runa workspace root. |
Runa: Serve Preview |
Run runa serve (live reload) for the active root in a dedicated terminal. |
Runa: New Content Page |
Scaffold a new content/.../*.md file with YAML frontmatter. |
Runa: Restart Server |
Restart the runa lsp language server process. |
3. Building and Testing
Unsaved configuration repairs retain the rest of the disk source inventory.
File names with spaces, Unicode, %, or # use encoded file URIs, including
Windows drive/UNC paths. Out-of-project URIs are rejected.
Server spawn/stdio errors and unexpected exits are reported rather than silently
switching modes. Stderr is drained with a bounded diagnostic tail; pending
requests reject on stop/failure or after 30 seconds. Restart does not inherit
stale child events.
cd editors/vscode
npm run compile
npm test
| |