Skip to content

Draft:Add PHP LSP

Reinhart Previano Koentjoro requested to merge (removed):master into master

Hello, I would like to submit Vimeo's Psalm as the default language server for PHP in Kate. There are a few notes, though:

  1. Kate currently does not start the server when I set the highlightingModeRegex value into ^PHP$, ^Php$, ^php$, and even ^PHP (HTML)$, hence I omitted that from the config.json for PHP/Psalm.
  2. Unlike other (especially non-PHP) language servers, Psalm is expected to be installed on the current working directory (composer require --dev vimeo/psalm instead of composer global require vimeo/psalm) and initialized first by generating a config file (./vendor/bin/psalm --init). The full installation instructions for Psalm are detailed in https://github.com/vimeo/psalm/blob/master/docs/running_psalm/installation.md.
  3. Psalm's language server has a verbose mode which is quite convenient to check for it's overall compatibility with Kate. Simply change the command parameter from ["vendor/bin/psalm-language-server"] to ["vendor/bin/psalm-language-server", "--verbose"]. I have done the same thing with Phpactor language server and instead found a critical bug (caused by Phpactor, not by Kate) - see https://github.com/phpactor/phpactor/issues/1304
  4. I'm aware that I haven't edited the docbook yet, since I'm waiting for feedback before finalizing this merge request.

Merge request reports

Loading