eclipse-lsp4j/lsp4j

Websocket and binary messages?

javaduke opened this issue · 1 comments

I ran into an issue when trying to connect my vscode extension to the remote LSP4J server via websockets. Apparently VScode sends all messages as BINARY and lsp4j does not handle them properly. I found the existing issue #604 and it is closed without any comments. I'm wondering if there's any sort of configuration or additional steps I need to take when implementing the server. Here's the relevant portion of my code:

public void launch(String[] args) throws Exception {
        int _port = getPort(args);

        Server server = new Server(_port);
        ServerConnector connector = new ServerConnector(server);
        server.addConnector(connector);

        ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
        context.setContextPath("/");
        server.setHandler(context);

        JavaxWebSocketServletContainerInitializer.configure(context, (servletContext, wsContainer) ->
        {
            // Configure default max size
            wsContainer.setDefaultMaxTextMessageBufferSize(65535);
            wsContainer.setDefaultMaxBinaryMessageBufferSize(65535);
            // Add websockets
            wsContainer.addEndpoint(MyWSEndpoint.class);

        });

        server.start();
        server.join();
    }

NM, looks like my issue is #406