Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>lua-resty-templateNew to Visual Studio Code? Get it now.
lua-resty-template

lua-resty-template

garciasdos

|
1 install
| (0) | Free
Syntax highlighting, snippets, and language support for lua-resty-template (.tpl) files
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

lua-resty-template for VS Code

Syntax highlighting, snippets, and language support for lua-resty-template .tpl files.

Features

  • Syntax highlighting for all template tags with embedded Lua and HTML support
  • Real-time diagnostics — inline error hints for:
    • Unclosed template delimiters ({% without %}, {{ without }}, etc.)
    • Unclosed brackets in content regions (missing }, ], ) in JSON/HTML between template tags)
    • Unclosed named blocks ({-name-} without matching closing tag)
    • Unclosed Lua control structures (if/end, for/do/end, repeat/until, etc.) across {% %} blocks
  • Auto-closing pairs for template delimiters ({{, {%, {#, etc.)
  • Comment toggling with {# #} block comments (Cmd+/ / Ctrl+/)
  • Code folding for Lua control structures and HTML tags
  • Bracket matching for all template delimiter pairs
  • 20 snippets for common template patterns

Supported Tags

Tag Description Snippet prefix
{{expression}} HTML-escaped output rto
{*expression*} Raw/unescaped output rtraw
{% code %} Lua code block rtcode
{(template)} Include template rtinc
{(file, {ctx})} Include with context rtincctx
{[expression]} Dynamic include rtexp
{# comment #} Template comment rtcomment
{-name-}...{-name-} Named block rtblock
{-verbatim-}...{-verbatim-} Verbatim (no processing) rtverbatim
{-raw-}...{-raw-} Raw (no processing) rtrawblock

Snippets

All snippets are prefixed with rt:

  • rtfor - For loop (ipairs)
  • rtforp - For loop (pairs)
  • rtforn - Numeric for loop
  • rtif - If block
  • rtife - If-else block
  • rtifee - If-elseif-else block
  • rtblock - Named content block
  • rtlayout - Layout template boilerplate
  • rtview - View template with block
  • rtlocal - Local variable declaration
  • rtcond - Inline conditional output

Installation

From VS Code Marketplace

Search for lua-resty-template in the Extensions panel (Ctrl+Shift+X).

From VSIX

  1. Download the .vsix file from Releases
  2. In VS Code: Extensions > ... menu > Install from VSIX

From Source

  1. Clone this repository
  2. pnpm install
  3. Open in VS Code and press F5 to launch the Extension Development Host
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft