opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat(lsp): add phpactor lsp support for php

Open calebdw opened this issue 1 week ago • 1 comments

Hello!

This adds support for the phpactor lsp for php files. phpactor has several benefits over the intelephense lsp that is currently included for php:

  • 100% free (does not require a license key, unlike intelephense)
  • open source
  • active maintainer that is responsive to issues and bug reports
  • interfaces with phpstan and other php tools

[!NOTE] Currently both the intelephense and phpactor lsp servers would be started for php files, there's a couple of paths forward depending on how y'all would like to handle this:

  1. do nothing, it probably won't hurt to have both lsps running and users could simply disable the one they don't want
  2. add some heuristics to determine which one should run (e.g., run intelephense if the user has the license file)
  3. make one the default (e.g., phpactor since it's free) that autodownloads, the other would not autodownload, but could be used if the user installs the binary manually and disables the default
  4. remove the autodownload from both, this would allow the user to determine which one is installed and used

Just let me know how y'all would like to proceed.

Thanks!

calebdw avatar Jan 07 '26 18:01 calebdw