Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I somehow use this in the monaco editor? #56

Open
justlunix opened this issue Aug 31, 2023 · 3 comments
Open

Can I somehow use this in the monaco editor? #56

justlunix opened this issue Aug 31, 2023 · 3 comments

Comments

@justlunix
Copy link

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

@dantleech
Copy link
Contributor

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

@justlunix
Copy link
Author

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.

@dantleech
Copy link
Contributor

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"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants