Skip to content

Repository files navigation

PHP Strom

Open-source PHP language support for VS Code. A TypeScript client talks to a bundled Go language server that runs go-php-parser for parsing, indexing, and diagnostics.

Not a complete Intelephense/PhpStorm stand-in. Unimplemented LSP features (formatting, rename, folding, code actions, code lens, inlay hints, document links, type hierarchy, implementations, references, highlights, and similar) are not advertised until implemented.

What it does now

  • Workspace indexing of PHP files, with bundled extension stubs and Composer PHP-version detection (autocomposer.json, else 8.3)
  • Diagnostics from the parser analyser (syntax, undefined symbols/variables, class model, invalid calls, language, types, visibility, throws, deprecated, unreachable, empty statements, assignment-in-condition; optional side-effects and style). Toggle families under phpstrom.diagnostics.analysis.*
  • Hover (inferred type + PHPDoc when indexed)
  • Go to definition and declaration, including typed -> / :: members
  • Go to type definition
  • Signature help for calls and new
  • Completion from the symbol index plus PHP keywords
  • Document outline and workspace symbol search
  • Problems view (list/tree, path/regex/error filters) and status for indexing/analysis
  • Commands: restart server, clear cache, re-index, refresh problems scan

Install

Marketplace publisher: AOSSoftware. Or build a VSIX locally:

make install    # Go server + extension, package, install into VS Code
# or
make package    # VSIX only

Needs Go 1.23+, Node.js, and the code CLI on PATH for make install.

Release

Move the entries under Unreleased in CHANGELOG.md into the new version, then bump and validate the extension with make release. After the version commit is on main, run the Publish extension GitHub Actions workflow. It packages one VSIX and publishes that exact file to both the VS Code Marketplace and Open VSX.

The workflow requires repository Actions secrets named VSCE_PAT and OVSX_PAT. The equivalent local command is:

VSCE_PAT=... OVSX_PAT=... make publish-all

Use make publish-marketplace or make publish-open-vsx when intentionally publishing to only one registry. make publish remains an alias for the VS Code Marketplace target.

Develop

Release and local builds use the parser revision pinned in server/go.mod. They do not require a sibling checkout.

make build-server-local   # host language-server binary
make build-ext
make test-server
make test-ext
make test-editor-latency  # synthetic editor-path regression gate

Local extension JavaScript is always dist/extension.js (webpack via make build-ext or npm run package); out/ is only the test harness.

To build against a local parser checkout:

make build-server-dev LOCAL_PHP_PARSER_DIR=/path/to/go-php-parser
make test-server-dev

Configuration

Settings live under phpstrom.* in VS Code. The ones that affect behaviour today:

  • phpstrom.enable
  • phpstrom.environment.phpVersion / phpVersionOverride / includePaths
  • phpstrom.files.associations / files.exclude / files.maxSize
  • phpstrom.stubs
  • phpstrom.diagnostics.enable / run / workspaceScanOnStart / exclude / overrides
  • phpstrom.diagnostics.analysis.* (style and side-effects default off)

phpstrom.diagnostics.overrides example:

{
  "phpstrom.diagnostics.overrides": {
    "PSR1.Classes.ClassDeclaration.PascalCase": {
      "classes": ["/^Legacy_/", "SpecialClass"]
    }
  }
}

Format, completion use-insert, PHPDoc generation, code lens, and inlay-hint settings exist in the schema but have no working Go providers yet.

Packaging

One VSIX bundles language-server binaries for darwin-arm64, darwin-x64, linux-arm64, linux-x64, win32-arm64, and win32-x64.

License

MIT. Source: https://github.com/ayanozturk/vscode-php-strom

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages