phpactor / vscode-phpactor

Phpactor VS Code Extension

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can I somehow use this in the monaco editor?

justlunix opened this issue · comments

I am trying to implement the phpactor lsp in the monaco editor, yet I cannot get it to work. When using phpactor on 127.0.0.1:8000 and then using monaco-languageclient to connect to is, all I'm getting is Warning: Undefined array key 1 in phar:///Users/marc/.local/bin/phpactor/vendor/phpactor/language-server/lib/Core/Server/Parser/LspMessageReader.php on line 114.

Do I need to setup a proxy that connects between the monaco-languageclient and phpactor (since I want phpactor to run in STDIO anyway)?

Thanks

You can use stdio (there's an option for it)

I know I can use phpactor in stdio, but I don't get how to use it with https://github.com/TypeFox/monaco-languageclient then. I only see examples here where I have to pass an address and port.

ok, it's a "web" editor so I (guess) that makes sense. it seems the headers in the RPC request are malformed as the offending line is:

    private function parseHeaders(string $rawHeaders): array
    {
        $lines = explode("\r\n", $rawHeaders);
        $headers = [];

        foreach ($lines as $line) {
            [ $name, $value ] = array_map(function ($value) {
                return trim($value);
            }, explode(':', $line));
            $headers[$name] = $value;
        }

        return $headers;
    }

Do you have any raw LSP logs from the "client"?