[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"docs:\u002Fdocs\u002Ftooling\u002Feditors":3},"\u003Cp>Every editor gets Phaenon&#39;s findings from the same place: \u003Ccode>phn lsp\u003C\u002Fcode>, the compiler&#39;s language\nserver, run from the project&#39;s own \u003Ccode>vendor\u002Fbin\u002Fphn\u003C\u002Fcode>, so the editor checks with the compiler the\nproject builds with. On top of that, the PhpStorm plugin makes \u003Ccode>.phn\u003C\u002Fcode> a PHP file to PhpStorm, and\nthe VS Code extension adds highlighting and commands. Any editor with an LSP client can use the\nserver, and a terminal can run \u003Ccode>phn watch\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Ch2 id=\"phpstorm\">PhpStorm\u003Ca class=\"docs-anchor\" href=\"#phpstorm\" aria-hidden=\"true\" tabindex=\"-1\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>The plugin teaches PhpStorm that a \u003Ccode>.phn\u003C\u002Fcode> file is PHP code from its first byte, without the open\ntag, and hides Phaenon&#39;s syntax from PhpStorm&#39;s parser. According to the plugin&#39;s README, a\n\u003Ccode>.phn\u003C\u002Fcode> then gets PhpStorm&#39;s own PHP support: highlighting, completion, parameter info, navigation\nand Find Usages across \u003Ccode>.phn\u003C\u002Fcode> and \u003Ccode>.php\u003C\u002Fcode> files, refactorings, PHP&#39;s inspections, and Reformat\nCode. Phaenon&#39;s types reach it: a\n\u003Ccode>list&lt;User&gt;\u003C\u002Fcode> is a \u003Ccode>User[]\u003C\u002Fcode> to completion, a \u003Ccode>class&lt;User&gt;\u003C\u002Fcode> names \u003Ccode>User\u003C\u002Fcode> behind \u003Ccode>::\u003C\u002Fcode> and \u003Ccode>new\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Cp>With a \u003Ccode>phn\u003C\u002Fcode> at hand, the plugin also starts \u003Ccode>phn lsp\u003C\u002Fcode>, for two things only:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Cstrong>the checker&#39;s findings\u003C\u002Fstrong>, as you type, against the whole project with the open files as they\nare, and on save for the whole project, with their quick-fixes;\u003C\u002Fli>\n\u003Cli>\u003Cstrong>build on save\u003C\u002Fstrong>: after each save the outputs are written as \u003Ccode>phn build\u003C\u002Fcode> writes them, a file\nwith errors withheld. The status bar shows the last build.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>Everything else (navigation, completion, formatting) stays PhpStorm&#39;s. And through the line map\n(\u003Ca href=\"\u002Fdocs\u002Ftooling\u002Fdebugging#xdebug-in-phpstorm\">Line maps and debugging\u003C\u002Fa>) the plugin opens a\nposition in compiled code (a stack trace in a console, a PHPUnit failure, a PHPStan finding) at\nits \u003Ccode>.phn\u003C\u002Fcode> line, and debugs \u003Ccode>.phn\u003C\u002Fcode> files with Xdebug.\u003C\u002Fp>\n\u003Ch3 id=\"installing-the-plugin\">Installing the plugin\u003Ca class=\"docs-anchor\" href=\"#installing-the-plugin\" aria-hidden=\"true\" tabindex=\"-1\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>The plugin is on the \u003Ca href=\"https:\u002F\u002Fplugins.jetbrains.com\u002Fplugin\u002F35870-phaenon\">JetBrains Marketplace\u003C\u002Fa>.\nIn PhpStorm, open \u003Cstrong>Settings → Plugins → Marketplace\u003C\u002Fstrong>, search for \u003Cem>Phaenon\u003C\u002Fem>, install it and\nrestart; the Marketplace then brings the updates.\u003C\u002Fp>\n\u003Cp>To install a particular release from disk instead:\u003C\u002Fp>\n\u003Col>\n\u003Cli>Download \u003Ccode>phaenon-jetbrains-&lt;version&gt;.zip\u003C\u002Fcode> from the\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fphaenonlang\u002Fjetbrains\u002Freleases\">releases page\u003C\u002Fa>.\u003C\u002Fli>\n\u003Cli>In PhpStorm, \u003Cstrong>Settings → Plugins → ⚙ → Install Plugin from Disk…\u003C\u002Fstrong>, pick the zip, and restart.\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cp>It requires PhpStorm 2026.1.4 or newer, or another JetBrains IDE of that version with the PHP\nplugin. The language server part uses the LSP API of the commercial IDEs; in an IDE without it the\nplugin works without the server. In an IDE without the PHP plugin (IntelliJ IDEA Community,\nWebStorm) it falls back to a TextMate grammar and highlights only.\u003C\u002Fp>\n\u003Cp>A project with a \u003Ccode>phaenon.json\u003C\u002Fcode> needs no IDE setup: the plugin excludes the output directories,\nso every class resolves to its \u003Ccode>.phn\u003C\u002Fcode> and is indexed once.\u003C\u002Fp>\n\u003Ch3 id=\"settings\">Settings\u003Ca class=\"docs-anchor\" href=\"#settings\" aria-hidden=\"true\" tabindex=\"-1\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>\u003Cstrong>Settings | Languages &amp; Frameworks | Phaenon\u003C\u002Fstrong> names the \u003Ccode>phn\u003C\u002Fcode> to run and turns build on save off.\nWithout a setting, the plugin runs \u003Ccode>$PHN_BINARY\u003C\u002Fcode>, else the project&#39;s \u003Ccode>vendor\u002Fbin\u002Fphn\u003C\u002Fcode>, else \u003Ccode>phn\u003C\u002Fcode>\non the \u003Ccode>PATH\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Cp>\u003Cstrong>Reformat Code\u003C\u002Fstrong> writes PhpStorm&#39;s PHP style with Phaenon&#39;s layout: it runs \u003Ccode>phn fmt --stdin\u003C\u002Fcode>,\nthe first layer of \u003Ca href=\"\u002Fdocs\u002Ftooling\u002Fformatting\">\u003Ccode>phn fmt\u003C\u002Fcode>\u003C\u002Fa>, before and after PhpStorm&#39;s formatter,\non a whole-file reformat. A \u003Ccode>.phn\u003C\u002Fcode> is always indented with spaces.\u003C\u002Fp>\n\u003Ch3 id=\"known-limits\">Known limits\u003Ca class=\"docs-anchor\" href=\"#known-limits\" aria-hidden=\"true\" tabindex=\"-1\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>The plugin&#39;s README lists them in full; among them:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>PhpStorm holds Phaenon&#39;s types as it can: a \u003Ccode>map&lt;K, V&gt;\u003C\u002Fcode> is a \u003Ccode>V[]\u003C\u002Fcode>, its key type lost; a tuple\nis the union of its elements; the type arguments of your own generics are dropped, so\n\u003Ccode>$box-&gt;get()\u003C\u002Fcode> has the bound of \u003Ccode>Box\u003C\u002Fcode>&#39;s type parameter. \u003Ccode>phn check\u003C\u002Fcode> is the authority on types.\u003C\u002Fli>\n\u003Cli>PhpStorm&#39;s exception analysis reads \u003Ccode>@throws\u003C\u002Fcode> tags, not \u003Ccode>throws\u003C\u002Fcode> clauses, and its quick-fixes add\n\u003Ccode>@throws\u003C\u002Fcode> tags.\u003C\u002Fli>\n\u003Cli>A refactoring that adds a statement to an expression body (\u003Ccode>=&gt; expr;\u003C\u002Fcode>), such as Introduce\nVariable on part of it, breaks the body: write it as a block first.\u003C\u002Fli>\n\u003Cli>Rename of a \u003Ccode>type\u003C\u002Fcode> alias is refused, and Find Usages does not know aliases.\u003C\u002Fli>\n\u003Cli>The debugger&#39;s Frames list labels a compiled frame with the compiled file&#39;s name, and coverage\nin PhpStorm reports compiled lines.\u003C\u002Fli>\n\u003Cli>After a plugin update that changes how a \u003Ccode>.phn\u003C\u002Fcode> parses, the plugin re-indexes the project&#39;s\n\u003Ccode>.phn\u003C\u002Fcode> once; if &quot;PSI and index do not match&quot; still shows, \u003Cstrong>File | Invalidate Caches\u003C\u002Fstrong> clears it.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"visual-studio-code\">Visual Studio Code\u003Ca class=\"docs-anchor\" href=\"#visual-studio-code\" aria-hidden=\"true\" tabindex=\"-1\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>VS Code has no PHP engine for \u003Ccode>.phn\u003C\u002Fcode>, so everything beyond highlighting comes from \u003Ccode>phn lsp\u003C\u002Fcode>. The\nextension&#39;s README lists:\u003C\u002Fp>\n\u003Cdiv class=\"docs-table\">\u003Ctable>\u003Cthead>\u003Ctr>\u003Cth>Feature\u003C\u002Fth>\u003Cth>What it gives\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\u003Ctbody>\u003Ctr>\u003Ctd>Diagnostics\u003C\u002Ftd>\u003Ctd>The checker&#39;s codes and messages, with &quot;declared here&quot; as related information; the quick-fix that replaces tabs\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>Hover\u003C\u002Ftd>\u003Ctd>The type in Phaenon&#39;s spelling (\u003Ccode>map&lt;string, User&gt;\u003C\u002Fcode>, \u003Ccode>class&lt;T&gt;\u003C\u002Fcode>, \u003Ccode>(int, string)\u003C\u002Fcode>) and the docblock\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>Go to definition\u003C\u002Ftd>\u003Ctd>Into \u003Ccode>.phn\u003C\u002Fcode>, vendor \u003Ccode>.php\u003C\u002Fcode> and PHP&#39;s stubs\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>Outline\u003C\u002Ftd>\u003Ctd>The file&#39;s declarations\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>Completion\u003C\u002Ftd>\u003Ctd>Members, names in scope, classes with their \u003Ccode>use\u003C\u002Fcode>; after \u003Ccode>|&gt;\u003C\u002Fcode>, the functions that take the left side\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>Signature help\u003C\u002Ftd>\u003Ctd>The parameters of the call being typed\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>Format Document\u003C\u002Ftd>\u003Ctd>The first layer of \u003Ccode>phn fmt\u003C\u002Fcode>\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>Build on save\u003C\u002Ftd>\u003Ctd>The outputs written after each save, a file with errors withheld\u003C\u002Ftd>\u003C\u002Ftr>\u003C\u002Ftbody>\u003C\u002Ftable>\u003C\u002Fdiv>\n\u003Cp>The highlighting is VS Code&#39;s PHP grammar plus Phaenon&#39;s syntax, with PHP&#39;s scope names, so a\ntheme colours Phaenon as it colours PHP.\u003C\u002Fp>\n\u003Ch3 id=\"installing-the-extension\">Installing the extension\u003Ca class=\"docs-anchor\" href=\"#installing-the-extension\" aria-hidden=\"true\" tabindex=\"-1\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>The extension is not on the VS Code Marketplace or Open VSX yet. Each release is a \u003Ccode>.vsix\u003C\u002Fcode> on the\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fphaenonlang\u002Fvscode\u002Freleases\">releases page\u003C\u002Fa>:\u003C\u002Fp>\n\u003Cfigure class=\"docs-code phn-code-surface\">\u003Cdiv class=\"docs-code-body\">\u003Cpre class=\"shiki shiki-themes phaenon-light phaenon-dark\" style=\"--phn-light:#1f2127;--phn-dark:#e2e3e7;--phn-light-bg:#f9fafb;--phn-dark-bg:#0f1115\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--phn-light:#7A3D99;--phn-dark:#C9A0F0\">code\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#B4431A;--phn-dark:#F29D6B\"> --install-extension\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#2A7A4B;--phn-dark:#8FD3A3\"> phaenon-0.4.0.vsix\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\u003C\u002Ffigure>\n\u003Cp>or \u003Cstrong>Extensions → … → Install from VSIX…\u003C\u002Fstrong>. It works on VS Code 1.91 and later, needs VS Code&#39;s\nbuilt-in PHP language support (the \u003Ccode>vscode.php\u003C\u002Fcode> extension, for the grammar), and \u003Ccode>php\u003C\u002Fcode> on the\n\u003Ccode>PATH\u003C\u002Fcode>, which the compiler asks for the extensions it has loaded.\u003C\u002Fp>\n\u003Cp>The extension runs, in order: the \u003Ccode>phaenon.binary\u003C\u002Fcode> setting, \u003Ccode>$PHN_BINARY\u003C\u002Fcode>, the project&#39;s\n\u003Ccode>vendor\u002Fbin\u002Fphn\u003C\u002Fcode>, then \u003Ccode>phn\u003C\u002Fcode> on the \u003Ccode>PATH\u003C\u002Fcode>. In an untrusted workspace it highlights only, since\nthe server and the commands run the project&#39;s \u003Ccode>vendor\u002Fbin\u002Fphn\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Ch3 id=\"settings-commands-and-tasks\">Settings, commands and tasks\u003Ca class=\"docs-anchor\" href=\"#settings-commands-and-tasks\" aria-hidden=\"true\" tabindex=\"-1\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cdiv class=\"docs-table\">\u003Ctable>\u003Cthead>\u003Ctr>\u003Cth>Setting\u003C\u002Fth>\u003Cth>Default\u003C\u002Fth>\u003Cth>\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\u003Ctbody>\u003Ctr>\u003Ctd>\u003Ccode>phaenon.binary\u003C\u002Fcode>\u003C\u002Ftd>\u003Ctd>empty\u003C\u002Ftd>\u003Ctd>The \u003Ccode>phn\u003C\u002Fcode> to run\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>\u003Ccode>phaenon.buildOnSave\u003C\u002Fcode>\u003C\u002Ftd>\u003Ctd>\u003Ccode>true\u003C\u002Fcode>\u003C\u002Ftd>\u003Ctd>Builds the project after each save\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>\u003Ccode>phaenon.traceRoots\u003C\u002Fcode>\u003C\u002Ftd>\u003Ctd>\u003Ccode>{}\u003C\u002Fcode>\u003C\u002Ftd>\u003Ctd>For the trace commands: \u003Ccode>{&quot;\u002Fapp&quot;: &quot;.&quot;}\u003C\u002Fcode> reads a trace from a container, as \u003Ccode>phn trace --root\u003C\u002Fcode> does\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>\u003Ccode>phaenon.trace.server\u003C\u002Fcode>\u003C\u002Ftd>\u003Ctd>\u003Ccode>off\u003C\u002Fcode>\u003C\u002Ftd>\u003Ctd>Logs the messages with the server in the Phaenon output\u003C\u002Ftd>\u003C\u002Ftr>\u003C\u002Ftbody>\u003C\u002Ftable>\u003C\u002Fdiv>\n\u003Cul>\n\u003Cli>\u003Cstrong>Phaenon: Build the Project\u003C\u002Fstrong> and \u003Cstrong>Phaenon: Check the Project\u003C\u002Fstrong> run \u003Ccode>phn build\u003C\u002Fcode> and\n\u003Ccode>phn check\u003C\u002Fcode> as tasks. The \u003Ccode>phaenon\u003C\u002Fcode> task type lists \u003Ccode>build\u003C\u002Fcode>, \u003Ccode>check\u003C\u002Fcode> and \u003Ccode>watch\u003C\u002Fcode> for every\nproject, also for \u003Ccode>tasks.json\u003C\u002Fcode>: \u003Ccode>{&quot;type&quot;: &quot;phaenon&quot;, &quot;command&quot;: &quot;watch&quot;}\u003C\u002Fcode>.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Phaenon: Trace the Selection to .phn Positions\u003C\u002Fstrong> runs \u003Ccode>phn trace\u003C\u002Fcode> on the selection, or on the\nwhole document; \u003Cstrong>Trace the Terminal&#39;s Text\u003C\u002Fstrong> on the terminal&#39;s selection or buffer.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Phaenon: Restart the Language Server\u003C\u002Fstrong>, after a \u003Ccode>composer install\u003C\u002Fcode> that changed the compiler.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>Each project gets its own server: a file belongs to the nearest \u003Ccode>phaenon.json\u003C\u002Fcode> above it, else the\nnearest \u003Ccode>composer.json\u003C\u002Fcode>. A \u003Ccode>.phn\u003C\u002Fcode> under \u003Ccode>vendor\u002F\u003C\u002Fcode> is installed code and is highlighted only.\u003C\u002Fp>\n\u003Cp>Debugging \u003Ccode>.phn\u003C\u002Fcode> is not there yet: VS Code&#39;s PHP debug adapter maps directories, not a file to one\nwith another extension. PhpStorm debugs \u003Ccode>.phn\u003C\u002Fcode> today.\u003C\u002Fp>\n\u003Ch2 id=\"other-editors-phn-lsp\">Other editors: phn lsp\u003Ca class=\"docs-anchor\" href=\"#other-editors-phn-lsp\" aria-hidden=\"true\" tabindex=\"-1\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>\u003Ccode>phn lsp\u003C\u002Fcode> speaks the Language Server Protocol on standard input and output. It serves the project\naround its working directory, the nearest directory above it with a \u003Ccode>phaenon.json\u003C\u002Fcode>, else a\n\u003Ccode>composer.json\u003C\u002Fcode>, so start it there. It answers diagnostics, hover, go to definition, document\nsymbols, completion, signature help and formatting, and builds the outputs after each save.\u003C\u002Fp>\n\u003Cp>Two initialization options adjust it:\u003C\u002Fp>\n\u003Cdiv class=\"docs-table\">\u003Ctable>\u003Cthead>\u003Ctr>\u003Cth>Option\u003C\u002Fth>\u003Cth>Effect\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\u003Ctbody>\u003Ctr>\u003Ctd>\u003Ccode>buildOnSave\u003C\u002Fcode>\u003C\u002Ftd>\u003Ctd>\u003Ccode>false\u003C\u002Fcode> turns the build on save off (default \u003Ccode>true\u003C\u002Fcode>)\u003C\u002Ftd>\u003C\u002Ftr>\u003Ctr>\u003Ctd>\u003Ccode>features\u003C\u002Fcode>\u003C\u002Ftd>\u003Ctd>\u003Ccode>&quot;diagnostics&quot;\u003C\u002Fcode> makes it advertise diagnostics and their quick-fixes only, for an editor that answers the rest itself\u003C\u002Ftd>\u003C\u002Ftr>\u003C\u002Ftbody>\u003C\u002Ftable>\u003C\u002Fdiv>\n\u003Cp>After a build on save it sends its own notification, \u003Ccode>phaenon\u002Fbuild\u003C\u002Fcode>, with the counts of files\nwritten and withheld; a client may show it or ignore it.\u003C\u002Fp>\n\u003Ch3 id=\"neovim\">Neovim\u003Ca class=\"docs-anchor\" href=\"#neovim\" aria-hidden=\"true\" tabindex=\"-1\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>With Neovim 0.12&#39;s built-in client, in \u003Ccode>init.lua\u003C\u002Fcode>:\u003C\u002Fp>\n\u003Cfigure class=\"docs-code phn-code-surface\">\u003Cdiv class=\"docs-code-body\">\u003Cpre class=\"shiki shiki-themes phaenon-light phaenon-dark\" style=\"--phn-light:#1f2127;--phn-dark:#e2e3e7;--phn-light-bg:#f9fafb;--phn-dark-bg:#0f1115\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--phn-light:#6A6F7C;--phn-light-font-style:italic;--phn-dark:#7D8393;--phn-dark-font-style:italic\">-- .phn files get a filetype of their own, so that no PHP language server attaches to them.\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\">vim.filetype.\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#7A3D99;--phn-dark:#C9A0F0\">add\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\">({ extension \u003C\u002Fspan>\u003Cspan style=\"--phn-light:#6A6F7D;--phn-dark:#8B91A2\">=\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\"> { phn \u003C\u002Fspan>\u003Cspan style=\"--phn-light:#6A6F7D;--phn-dark:#8B91A2\">=\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#2A7A4B;--phn-dark:#8FD3A3\"> 'phaenon' \u003C\u002Fspan>\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\">} })\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\">vim.lsp.\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#7A3D99;--phn-dark:#C9A0F0\">config\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\">(\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#2A7A4B;--phn-dark:#8FD3A3\">'phn'\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\">, {\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\">  filetypes \u003C\u002Fspan>\u003Cspan style=\"--phn-light:#6A6F7D;--phn-dark:#8B91A2\">=\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\"> { \u003C\u002Fspan>\u003Cspan style=\"--phn-light:#2A7A4B;--phn-dark:#8FD3A3\">'phaenon' \u003C\u002Fspan>\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\">},\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\">  root_markers \u003C\u002Fspan>\u003Cspan style=\"--phn-light:#6A6F7D;--phn-dark:#8B91A2\">=\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\"> { \u003C\u002Fspan>\u003Cspan style=\"--phn-light:#2A7A4B;--phn-dark:#8FD3A3\">'phaenon.json'\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\">, \u003C\u002Fspan>\u003Cspan style=\"--phn-light:#2A7A4B;--phn-dark:#8FD3A3\">'composer.json' \u003C\u002Fspan>\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\">},\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--phn-light:#6A6F7C;--phn-light-font-style:italic;--phn-dark:#7D8393;--phn-dark-font-style:italic\">  -- The project's own compiler, started in the project's directory: phn lsp serves the\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--phn-light:#6A6F7C;--phn-light-font-style:italic;--phn-dark:#7D8393;--phn-dark-font-style:italic\">  -- project around its working directory.\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--phn-light:#7A3D99;--phn-dark:#C9A0F0\">  cmd\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#6A6F7D;--phn-dark:#8B91A2\"> =\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#8F5E00;--phn-dark:#F2B43F\"> function\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#6A6F7D;--phn-dark:#8B91A2\">(\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\">dispatchers\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#6A6F7D;--phn-dark:#8B91A2\">,\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\"> config\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#6A6F7D;--phn-dark:#8B91A2\">)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--phn-light:#8F5E00;--phn-dark:#F2B43F\">    local\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\"> phn \u003C\u002Fspan>\u003Cspan style=\"--phn-light:#6A6F7D;--phn-dark:#8B91A2\">=\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\"> config.root_dir \u003C\u002Fspan>\u003Cspan style=\"--phn-light:#6A6F7D;--phn-dark:#8B91A2\">..\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#2A7A4B;--phn-dark:#8FD3A3\"> '\u002Fvendor\u002Fbin\u002Fphn'\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--phn-light:#8F5E00;--phn-dark:#F2B43F\">    if\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\"> vim.fn.\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#7A3D99;--phn-dark:#C9A0F0\">executable\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\">(phn) \u003C\u002Fspan>\u003Cspan style=\"--phn-light:#6A6F7D;--phn-dark:#8B91A2\">==\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#B4431A;--phn-dark:#F29D6B\"> 0\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#8F5E00;--phn-dark:#F2B43F\"> then\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\">      phn \u003C\u002Fspan>\u003Cspan style=\"--phn-light:#6A6F7D;--phn-dark:#8B91A2\">=\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#2A7A4B;--phn-dark:#8FD3A3\"> 'phn'\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--phn-light:#8F5E00;--phn-dark:#F2B43F\">    end\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--phn-light:#8F5E00;--phn-dark:#F2B43F\">    return\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\"> vim.lsp.rpc.\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#7A3D99;--phn-dark:#C9A0F0\">start\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\">({ phn, \u003C\u002Fspan>\u003Cspan style=\"--phn-light:#2A7A4B;--phn-dark:#8FD3A3\">'lsp' \u003C\u002Fspan>\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\">}, dispatchers, { cwd \u003C\u002Fspan>\u003Cspan style=\"--phn-light:#6A6F7D;--phn-dark:#8B91A2\">=\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\"> config.root_dir })\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--phn-light:#8F5E00;--phn-dark:#F2B43F\">  end\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\">,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\">})\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\">vim.lsp.\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#7A3D99;--phn-dark:#C9A0F0\">enable\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\">(\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#2A7A4B;--phn-dark:#8FD3A3\">'phn'\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#1F2127;--phn-dark:#E2E3E7\">)\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\u003C\u002Ffigure>\n\u003Cp>This configuration was run with Neovim 0.12.2, headless, on a project with the compiler installed\nby Composer: the checker&#39;s findings arrived as diagnostics, hover answered with the type\n(\u003Ccode>$sum: int\u003C\u002Fcode>), \u003Ccode>vim.lsp.buf.format()\u003C\u002Fcode> laid out \u003Ccode>map&lt; string,int &gt;\u003C\u002Fcode> as \u003Ccode>map&lt;string, int&gt;\u003C\u002Fcode>, and a\nsave built the outputs, also when Neovim was started outside the project. Add\n\u003Ccode>init_options = { buildOnSave = false }\u003C\u002Fcode> to turn the build on save off. It was not tried with\nolder releases of Neovim, and it gives no highlighting: the \u003Ccode>phaenon\u003C\u002Fcode> filetype has no syntax\nof its own.\u003C\u002Fp>\n\u003Ch3 id=\"any-other-client\">Any other client\u003Ca class=\"docs-anchor\" href=\"#any-other-client\" aria-hidden=\"true\" tabindex=\"-1\">#\u003C\u002Fa>\u003C\u002Fh3>\n\u003Cp>Configure the command \u003Ccode>vendor\u002Fbin\u002Fphn lsp\u003C\u002Fcode>, run in the project&#39;s root, for files ending in\n\u003Ccode>.phn\u003C\u002Fcode>. Keep other PHP language servers off those files: they would read Phaenon&#39;s syntax as\nerrors.\u003C\u002Fp>\n\u003Ch2 id=\"phn-watch-in-a-terminal\">phn watch in a terminal\u003Ca class=\"docs-anchor\" href=\"#phn-watch-in-a-terminal\" aria-hidden=\"true\" tabindex=\"-1\">#\u003C\u002Fa>\u003C\u002Fh2>\n\u003Cp>For an editor without an LSP client, or beside any editor, \u003Ccode>phn watch\u003C\u002Fcode> checks and builds the\nproject each time one of its files changes:\u003C\u002Fp>\n\u003Cfigure class=\"docs-code phn-code-surface\">\u003Cdiv class=\"docs-code-body\">\u003Cpre class=\"shiki shiki-themes phaenon-light phaenon-dark\" style=\"--phn-light:#1f2127;--phn-dark:#e2e3e7;--phn-light-bg:#f9fafb;--phn-dark-bg:#0f1115\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan style=\"--phn-light:#7A3D99;--phn-dark:#C9A0F0\">vendor\u002Fbin\u002Fphn\u003C\u002Fspan>\u003Cspan style=\"--phn-light:#2A7A4B;--phn-dark:#8FD3A3\"> watch\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\u003C\u002Ffigure>\n\u003Cfigure class=\"docs-code phn-code-surface\">\u003Cdiv class=\"docs-code-body\">\u003Cpre class=\"shiki shiki-themes phaenon-light phaenon-dark\" style=\"--phn-light:#1f2127;--phn-dark:#e2e3e7;--phn-light-bg:#f9fafb;--phn-dark-bg:#0f1115\" tabindex=\"0\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan>5 files checked: 0 errors, 0 warnings\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>5 files compiled, 0 outputs written, 0 withheld (0.3s)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>phn watch: waiting for changes (Ctrl-C to stop)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>src\u002FDiscount.phn:8:16: error P2202: App\\Discount::applies() should return bool but returns int\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>    8 |         return $cents;\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>      |                ^^^^^^\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>5 files checked: 1 errors, 0 warnings\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>5 files compiled, 0 outputs written, 1 withheld (0.0s)\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>phn watch: waiting for changes (Ctrl-C to stop)\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>\u003C\u002Fdiv>\u003C\u002Ffigure>\n\u003Cp>\u003Ccode>--no-build\u003C\u002Fcode> checks only. It reads \u003Ccode>phaenon.json\u003C\u002Fcode> and \u003Ccode>composer.json\u003C\u002Fcode> again when either changes.\nCtrl-C stops it.\u003C\u002Fp>\n",1794925619664]