lsp

mcp
Security Audit
Fail
Health Pass
  • License — License: MIT
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Community trust — 15 GitHub stars
Code Fail
  • rm -rf — Recursive force deletion command in .github/workflows/release.yml
  • rm -rf — Recursive force deletion command in bench/tools/install.sh
  • rm -rf — Recursive force deletion command in scripts/build.sh
  • rm -rf — Recursive force deletion command in scripts/fetch-corpus.sh
Permissions Pass
  • Permissions — No dangerous permissions requested

No AI report is available for this listing yet.

SUMMARY

High-performance PHP 8+ LSP written in Go, focused on development speed

README.md

Tusk PHP logo

Tusk PHP

A fast, framework-aware PHP language server.
One small Go binary. Laravel and Symfony container intelligence. MIT licensed.

CI codecov GitHub Release License: MIT PHP 7.4-8.6

VS Code Marketplace Open VSX Zed: coming soon


Why Tusk PHP

⚡ Ready in under a third of a second On a 9,700-file Laravel app, Tusk PHP answers its first cross-file request in 283 ms using 162 MB. Intelephense needs 2.2 s and 686 MB. See the benchmarks.
🧠 Understands your container app('request')->, $container->get(...), #[Autowire] and interface bindings resolve to the concrete class, for completion, hover and go-to-definition.
🌍 Works where you work Local projects, Remote SSH in VS Code and Zed, vscode.dev (in the browser, through WebAssembly), and any editor that speaks LSP.
🤖 Talks to your AI agent tusk-php mcp gives Claude Code, Codex and Cursor the same index your editor uses: symbols, diagnostics, routes, models, test coverage and your database schema.

Get it

Editor How
VS Code / VSCodium Install from the VS Code Marketplace or Open VSX. The server is bundled, so there's nothing else to set up.
Zed Coming soon to Zed's extension registry. Until then, install Tusk-PHP/zed as a dev extension.
Neovim and others Download a binary from Releases (Linux, macOS, Windows · amd64/arm64) and run tusk-php --transport stdio.
AI agents claude mcp add tusk-php -- tusk-php mcp --root "$(pwd)". More agents.
CI and the terminal tusk-php check reports the same diagnostics as your editor, with a baseline so CI fails only on new ones. Command line.

Setup for each editor is in docs/editors.md, every setting is in docs/configuration.md, and every diagnostic, with how to turn it off, is in docs/diagnostics.md.

Features

Code intelligence

  • Completion that follows method chains through return types and docblocks, so User::query()->with('posts')->where()-> offers Builder methods. Picking a class adds its use line.
  • Hover with signatures, docblocks, inheritance and container bindings, plus php.net links for built-ins.
  • Go to definition, type definition and implementation. Type hierarchy: the parents, interfaces and traits of a class, and the classes below it. Find references, workspace symbols, highlights, folding, signature help.
  • Inlay hints for inferred variable types, foreach types, closure and method return types, and parameter names.

Smart renames and refactoring

  • Rename variables within their scope, and classes, methods and properties across the whole workspace.
  • Move to namespace moves a class, updates every reference and moves the file to match your PSR-4 autoload.
  • Copy namespace or a reference to the symbol under the cursor (FQN, Class::method() or the full signature).
  • Organize imports, remove unused ones and import unknown classes.
  • Generate constructors, getters and setters. Implement missing methods. Extract or inline a variable.

Diagnostics

  • Built-in checks for unknown classes, functions and members, undefined and unused variables, argument count, unused imports and private members, unreachable code, redundant types, deprecated functions, and abstract methods in concrete classes.
  • Fast checks run as you type; heavier ones run on save. Every rule can be turned off or given its own severity.
  • PHPStan and Laravel Pint results on save, when they're installed in your project.

Test coverage

  • Hover shows how much of a method your tests reach, with its CRAP score, from the Clover report PHPUnit or Pest last wrote. Works with reports from Docker and Sail. Setup.

Laravel

  • Service container bindings from your providers, plus 25+ core framework bindings.
  • config() keys with value preview, routes, views and translations, all with completion and go-to-definition.
  • Eloquent query chains, relations, casts and scopes. Unknown columns and relations are flagged in query builders.

Symfony

  • Services from services.yaml, PHP config and autowiring, including #[Autowire] with service:, param: and env:.
  • Routes from attributes and config/routes.*, console commands, and translation keys across YAML, PHP and XLIFF.

PHP support

Tusk PHP indexes PHP 7.4 through 8.6. It picks the version from your Composer platform, .tusk-php.json or your local php, and defaults to 8.6.

Version Understood
7.4 typed properties, arrow functions, numeric separators, ??=, array spread
8.0 union types, named arguments, match, ?->, static / mixed, constructor promotion, attributes, throw expressions
8.1 intersection types, first-class callables, never, fibers, enums and their methods, readonly properties, new in initializers
8.2 readonly classes, true / false / null types, DNF types, constants in traits
8.3 json_validate(), typed class constants, #[\Override], dynamic constant fetch
8.4 property hooks, asymmetric visibility, new without parentheses, #[\Deprecated], array_find() and friends, lazy objects
8.5 pipe operator |>, #[\NoDiscard], clone with
8.6 partial function application (f(?, 1), f('x', ...)), parameter doc comments, readonly property defaults, #[\Override] on constants and enum cases, clamp(), SortDirection, Time\Duration, stream errors, the polling API and the 8.6 deprecations

Every entry is checked through the running server by internal/lsp/php_versions_test.go, so it means completion, hover, go-to-definition and diagnostics see the feature, not just that it parses.

PHPDoc generics are read the way PHPStan defines them: @template on classes, methods and functions (bound from arguments, class-string<T>, constructors and closures, with bounds and defaults), @extends / @implements / @use through every level, list<T>, iterable<K, V>, generators, array and object shapes, key-of / value-of, callable signatures, conditional return types decided by the arguments, generic @mixin, and narrowing with @phpstan-assert, @param-out and @phpstan-self-out. @phpstan- and @psalm- tags win over plain ones, and @phpstan-type / @psalm-type aliases resolve. Hover, completion and diagnostics all see the same types; internal/lsp/generics_test.go checks each of these through the running server.

Benchmarks

Every server gets the same LSP requests at the same cursor positions in the same workspaces, over stdio, with a cold cache and one server at a time. Measured on an Apple M3 Max: Tusk PHP 0.15.0 on 22 November 2026 with PHP 8.6.0, and Intelephense 1.18.5, Phpactor 2026.06.23.0, php-lsp 0.25.1 and PHPantom 0.10.0 on 13 November 2026 with PHP 8.5.11.

Time until the first correct cross-file answer, and peak memory

Workspace Tusk PHP Intelephense Phpactor php-lsp PHPantom
Laravel (9.7k files) 285 ms · 180 MB 3321 ms · 698 MB 5299 ms · 203 MB 282 ms · 178 MB 601 ms · 88 MB
Symfony (1.1k files) 282 ms · 58 MB 709 ms · 359 MB 3736 ms · 111 MB 226 ms · 287 MB 403 ms · 59 MB
Small project (6 files) 34 ms · 28 MB 300 ms · 293 MB 3849 ms · 168 MB 213 ms · 118 MB 176 ms · 32 MB

Correct answers (completion, definition, hover, references, signature help, symbols and diagnostics)

Workspace Tusk PHP Intelephense Phpactor php-lsp PHPantom
Laravel 19/19 12/19 14/19 3/3 (+16 errors) 16/19
Symfony 11/11 11/11 11/11 10/11 9/11
Diagnostics 6/6 6/6 5/6 6/6 6/6

Tusk PHP is among the fastest and lightest servers, and answers in well under a millisecond for completion, hover and definition. It answers every Laravel and Symfony question, including completion and hover on Eloquent's static calls (Category::where()), and passes all six diagnostics cases. Run make bench-install && make bench to reproduce the numbers; bench/README.md explains the method and how answers are graded.

Contributing

See CONTRIBUTING.md for development setup and guidelines.

License

MIT

Reviews (0)

No results found