Syntax highlighting for .phv files and .phv.html templates, including HTML around <?phv ... ?> /
<?= ... ?>, string interpolation ("Hello, {$name}") and SQL in sql"..." literals.
Errors and warnings as you type, and the type of an expression on hover, from the PHV language server
(phv lsp).
Comment toggling, bracket matching and auto-closing pairs.
Installing
Install PHV Language from the Visual Studio Marketplace: search for it in the Extensions view, or run
code --install-extension phv-lang.phv-language
Or download phv-<version>.vsix from the releases and install it:
code --install-extension phv-0.3.0.vsix
Or, in VS Code, run Extensions: Install from VSIX... from the Command Palette.
Requirements
The language server needs the phv executable. Download it from the
releases or build it with cargo build --release, and put it on
your PATH (or set phv.path). Highlighting works without it.
Settings
Setting
Default
phv.path
phv
The phv executable. Only a user setting: a workspace's .vscode/settings.json cannot change which program runs.
phv.lsp.enabled
true
Start the language server.
Building the extension
npm install
npm test # checks the grammars
npx vsce package # writes phv-language-<version>.vsix
code --install-extension phv-language-0.3.0.vsix