KATE: Unable to use LSP server for PHP

Christoph Cullmann christoph at cullmann.io
Thu Dec 19 12:28:36 GMT 2019


On 2019-12-17 15:36, Stolz wrote:
> Hi.
> 
> I'm trying to configure the new Kate (version 19.12.0) LSP plugin to
> use a server other than the ones listed in
> https://invent.kde.org/kde/kate/blob/master/addons/lspclient/settings.json
> 
> Specifically I want to have LSP support for PHP language via this
> server implementation:
> https://github.com/felixfbecker/php-language-server
> 
> I've successfully installed the PHP server and I can run it without
> issues but after enabling the LSP plugin in Kate and providing my own
> server config file for Kate to "discover" the new LSP server, when I
> open a PHP file in Kate I see the message "No LSP server for this
> document" and none of the LSP features are available. See screenshot
> at https://imgur.com/a/LHDerBi
> 
> The command to run the server in my computer is "php
> /home/stolz/php-language-server/bin/php-language-server.php" and
> therefore I have created this custom server config JSON file:
> 
> {
>   "servers": {
>     "php": {
>       "command": ["php",
> "/home/stolz/php-language-server/bin/php-language-server.php"],
>       "url": "https://github.com/felixfbecker/php-language-server"
>     }
>   }
> }
> 
> Since the plugin is new there isn't much documentation around so I'm
> not sure if I'm following the expected JSON format. Also, the server
> implementation supports input from both STDIN/STDOUT or TCP. Which one
> does Kate use for the client-server communication? I don't see any
> option to specify server address nor port, so I guess Kate uses
> STDIN/STDOUT.
> 
> Any help would be much appreciated.

Hi,

Kate uses STDIN/STDOUT for the communication.

A problem could the that the mapping of syntax name => lsp language name 
doesn't work
here.

We have some mapping defined in

https://invent.kde.org/kde/kate/blob/master/addons/lspclient/lspclientservermanager.cpp

static QString languageId(const QString &mode)

I assume the *PHP* stuff will need some more if's there.

Greetings
Christoph


> 
> Regards.

-- 
Ignorance is bliss...
https://cullmann.io | https://kate-editor.org


More information about the KWrite-Devel mailing list