Editor support
The kits in editors/ give PAD templates highlighting, completion and snippets in Sublime Text, VS Code, Vim, Emacs, Kate, BBEdit and Notepad++. An editor that speaks the Language Server Protocol - Neovim, Helix, Zed, Emacs with eglot, Sublime Text with LSP - runs editors/lsp/pad-lsp.js, a Node server without dependencies.
The language server
-
Completion - the built-in tags, functions, options, properties and type prefixes, and after
{/the tags still open. -
Diagnostics - when a page is opened or saved, PAD itself renders it on the command line under the strict syntax check (
editors/render.php), and the error lands on the tag it names. A_inits.padis checked through the index page of its directory; a snippet in_includeor_tagshas no page of its own and is not rendered. -
Hover - the text of
docs/referencefor the tag, function, option, property or type prefix under the cursor; on an application's own tag or function, the comment at the top of its file; on a field, the line that assigns it. -
Go to definition - PAD's own lookup order:
{badge}to the nearest_tags/badge.*up the directories, then_common, then the engine;{include:footer}to_include/footer.pad;| moneyto_functions/money.php;callback='x'to_callbacks/x.php.
Page pairing makes one more jump possible: from a field in the template to the line of the paired .php that assigns it. Here, go to definition on {$total} lands on $total = 42;.
|
PHP fragments/editor_support_1.php |
HTML fragments/editor_support_1.pad |
Result |
|---|---|---|
|
|
Total: 42 |
Tree-sitter
editors/tree-sitter-pad is a Tree-sitter grammar: native highlighting in Zed, Helix and Neovim, with the HTML around the tags highlighted as HTML. A pair of tags is one node of the tree, so an editor can fold {orders} ... {/orders}, select it, or select just what is inside it. Whether a tag is a pair is decided as the engine decides it: {orders} opens a block only when a {/orders} closes it further on, so {else} and {echo $x} stay single tags.
AI assistants
editors/mcp/pad-mcp.js is an MCP server: an assistant such as Claude Code asks the engine itself instead of relying on what it remembers. It renders a page, or a template that exists in no file yet - given variables of its own when no PHP should run - and runs the strict syntax check on it; it traces a request, runs PHP in a booted application, renders the same template on the engine of an older commit to show what a change changed, runs one regression test, one suite or all of them, lists the applications, their pages and the built-ins, and looks a tag or function up in the reference. Register it with claude mcp add pad -- node editors/mcp/pad-mcp.js.
For Claude Code, editors/claude is a plugin with all of it in one install: the language server above - after every edit of a page Claude gets PAD's own error, without asking for it - the MCP server, and a skill on hunting, proving and fixing a bug in PAD. Install it with claude plugin marketplace add editors/claude and claude plugin install pad@pad.