Psalm

May 27, 2026 · View on GitHub

Psalm

Psalm — PHP Static Analysis for VS Code

VS Marketplace version VS Code Version TypeScript License MIT

Integrates Psalm — a static analysis tool for PHP — directly into VS Code via the Language Server Protocol. Get inline diagnostics, type-aware autocompletion, and hover definitions as you type, all powered by Psalm's analysis engine.

Requirements

  • PHP 7.0 or later (with pcntl module recommended)
  • Psalm installed in your project (vendor/bin/psalm-language-server)
  • A psalm.xml or psalm.xml.dist configuration file at the root of your workspace

Installation

Via VS Code Marketplace:

ext install getpsalm.psalm-vscode-plugin

Or search for Psalm in the Extensions view (Ctrl+Shift+X / Cmd+Shift+X).

Via Open VSX Registry:

Search for Psalm (PHP Static Analysis Linting Machine) at open-vsx.org.

Note

This extension only runs in workspace trust mode. Opening untrusted workspaces with this extension enabled is not supported, since Psalm can execute code as part of its analysis.

Features

  • Inline diagnostics — Psalm errors and warnings appear directly in the editor as you open and save files
  • Autocompletion — Type-aware completions for methods and properties
  • Hover definitions — See inferred types and documentation on hover
  • Unused variable detection — Optionally surface unused variables and parameters
  • Multi-workspace support — Automatically switches the active Psalm config when you move between workspace folders
  • Config file watching — Restarts the language server automatically when psalm.xml changes

Commands

All commands are available from the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) under the Psalm category.

CommandDescription
Psalm: Restart Psalm Language serverRestart the language server
Psalm: Analyze WorkspaceRe-analyze the entire workspace
Psalm: Show OutputOpen the Psalm output channel
Psalm: Report IssueOpen a pre-filled GitHub issue with logs and settings

Configuration

SettingDefaultDescription
psalm.phpExecutablePathphp (from $PATH)Path to the PHP executable
psalm.phpExecutableArgsxdebug disabledAdditional CLI arguments for the PHP executable
psalm.psalmScriptPathvendor/vimeo/psalm/psalm-language-serverPath to the Psalm language server script
psalm.psalmScriptArgs[]Additional arguments passed to the language server
psalm.psalmVersionauto-detectedOverride Psalm version detection
psalm.configPaths["psalm.xml", "psalm.xml.dist"]Config file locations to search (relative to workspace root)
psalm.analyzedFileExtensionsphpFile types to send to Psalm for analysis
psalm.unusedVariableDetectionfalseEnable unused variable and parameter detection
psalm.disableAutoCompletefalseDisable method and property autocompletion
psalm.disableProvideHoverfalseDisable hover type information
psalm.connectToServerWithTcpfalseUse TCP instead of stdio to connect to the language server
psalm.enableUseIniDefaultsfalseUse PHP's default ini values for memory and error display
psalm.enableVerbosefalsePass --verbose to the language server
psalm.logLevelINFOExtension log verbosity: NONE, ERROR, WARN, INFO, DEBUG, TRACE
psalm.trace.serveroffTrace LSP traffic: off, messages, verbose
psalm.hideStatusMessageWhenRunningtrueHide the status bar item once Psalm is running
psalm.maxRestartCount5Max number of automatic restarts after a language server crash

Tip

Most settings require a window reload to take effect. VS Code will prompt you when a relevant setting changes.

Contributing

Clone the repository and install dependencies:

npm install

To launch the extension in a development host window, open the project in VS Code and use Run and DebugLaunch Extension (or press F5).

To compile a production bundle:

npm run package