VS Code Extensions
PHP LSP

PHP LSP

by jorgsowa

A high-performance PHP Language Server for VS Code with IntelliSense, diagnostics, navigation, code actions, type support, and developer tooling.

Downloads

216

Rating

5.0 / 5 (1)

Version

0.7.0

Last updated

Jul 31, 2026

PHP language support for VS Code powered by php-lsp — a high-performance Language Server written in Rust.

Features

  • Completions — type-aware -> / :: chains, match enum-case, auto use insertion
  • Hover — inline type and doc information
  • Go to definition / declaration / type definition
  • Find references & rename
  • Diagnostics — undefined variables, functions, classes, arity errors, type errors, deprecated calls, missing types, mixed usage
  • Call hierarchy & type hierarchy
  • Semantic tokens, inlay hints, code lens
  • Signature help & document highlight
  • Code actions — extract variable/method/constant/interface, inline variable, generate constructor/getters/setters, implement missing methods, organize imports, add/update PHPDoc, add return type, add missing @throws tags, change visibility, convert local variable to instance property, convert switch to match, convert between closures and arrow functions
  • Folding, selection range, on-type formatting, document links

Bundled versions

Component Version
Extension v0.7.0
php-lsp v0.22.0

Requirements

The extension ships a pre-built php-lsp binary for your platform — no separate installation needed.

If you prefer to manage the binary yourself, install via Cargo:

cargo install php-lsp

Or download a pre-built binary from php-lsp releases and place it on your PATH.

Extension Settings

Setting Default Description
php-lsp.serverPath "" Absolute path to the php-lsp binary. Leave empty to use the bundled binary, PATH, or auto-download.
php-lsp.phpVersion "8.3" PHP version for diagnostics and completions (7.4–8.5).
php-lsp.excludePaths [] Glob patterns to exclude from workspace indexing.
php-lsp.maxIndexedFiles 50000 Maximum number of files indexed during workspace scanning.
php-lsp.diagnostics.enabled true Master switch for all diagnostics.
php-lsp.diagnostics.undefinedVariables true Undefined variable references.
php-lsp.diagnostics.undefinedFunctions true Calls to undefined functions.
php-lsp.diagnostics.undefinedClasses true References to undefined classes, interfaces, or traits.
php-lsp.diagnostics.arityErrors true Wrong number of arguments.
php-lsp.diagnostics.typeErrors true Return-type mismatches.
php-lsp.diagnostics.deprecatedCalls true Calls to @deprecated members.
php-lsp.diagnostics.duplicateDeclarations true Duplicate class or function declarations.
php-lsp.diagnostics.missingTypes false Missing return, parameter, and property type declarations.
php-lsp.diagnostics.mixedUsage false Usages of mixed-typed values.

Commands

Command Description
PHP LSP: Restart Server Restart the language server.
PHP LSP: Show Output Channel Open the PHP LSP output log.

License

MIT