Phel Lang for VS Code

VS Code support for Phel, a functional Lisp that compiles to PHP.
Features
- Syntax highlighting for every literal the Phel reader accepts — characters, regex literals, radix / BigInt / BigDecimal / ratio numbers,
##Inf / ##NaN, gensyms, tagged literals, reader conditionals, metadata tags — plus the Clojure-style PHP interop spellings ((.method obj), (.-field obj), Class/CONST, Class/$prop, (Class. args)).
- Navigation that understands scope — go-to-definition, find-references, rename, hover and signature help resolve a local to its own binding, so renaming a parameter never touches a same-named global.
- Completion over special forms, macros, core and workspace symbols, with docs and call snippets. Understands
alias/… and the (ns …) form, and can auto-add a missing :require. In PHP-interop positions ((php/-> x …), \Foo, php/strto…) the compiler answers instead, with the members, classes and functions your project can actually load.
- Outline & workspace symbols for every defining form, each with a matching icon.
- Parameter inlay hints (opt-in) —
(assoc ds: m key: :k value: v), threading-aware and silent wherever a label would mislead.
- Diagnostics via
phel lint, formatting via phel format, both on save — plus indentation as you type that follows the same rules, so the save has nothing to move.
- Tasks for the CLI —
test, test --watch, lint, build, format, bench under Run Task, with problem matchers that route lint findings and watch-mode test failures into the Problems panel. See commands.
- Refactorings (
Ctrl+.) — thread / unwind, cycle collection delimiters, add missing :require.
- REPL and nREPL client, with inline evaluation results, namespace reloading, and hover evaluation against the live runtime while connected.
- Test Explorer + CodeLens for
deftest, with per-test results and coverage, and a second Phel Benchmarks tree for defbench that reports each mean as its duration; ▶ Run benchmark for one. Run a file, its tests or its benchmarks from the right-click menu, the editor title bar or the Explorer.
- Paredit — slurp / barf / raise / wrap / drag / splice / kill, form-aware folding and expand-selection.
- Debugger with real breakpoints in
.phel files, via Xdebug and source maps.
- 66 snippets, plus semantic highlighting, unused-local hints, and Phel 0.50 migration diagnostics with quick fixes.
Optionally delegates to Phel's own language server (phel lsp, off by default) for compiler-backed intelligence including PHP interop. See settings.
Install
Marketplace: https://marketplace.visualstudio.com/items?itemName=Phel-Lang.phel-lang
Open Extensions (Cmd+Shift+X), search "Phel Lang", click Install. Or:
code --install-extension Phel-Lang.phel-lang
Requires VS Code 1.88+.
Configuration
The extension expects the Phel CLI at vendor/bin/phel (Composer default). For other layouts, set phel.executablePath once in .vscode/settings.json:
{ "phel.executablePath": "bin/phel" }
Per-subsystem overrides (phel.diagnostics.command, phel.format.command, phel.test.command, phel.repl.command) take precedence when set, and every one of them can also be set per workspace folder. Full settings reference: docs/settings.md.
Documentation
Full docs live in docs/ — installation, syntax, completion & snippets, REPL & paredit, refactoring, debugging, taps, commands, settings, troubleshooting.
Contributing: docs/CONTRIBUTING.md. Release history: CHANGELOG.md.
| |