From 23ea9b16b0baa6279576a61d3dafd9abb4debb67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 7 Nov 2022 10:31:15 +0100 Subject: [PATCH] fix: forward jdt:ls custom requests --- src/language-client-mutualization.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/language-client-mutualization.ts b/src/language-client-mutualization.ts index 7c2e303..9477672 100644 --- a/src/language-client-mutualization.ts +++ b/src/language-client-mutualization.ts @@ -261,11 +261,14 @@ function bindClientToServer ( }))) } - if (options.unknownClientRequestHandler != null) { - disposableCollection.push(clientConnection.onRequest(bindContext((method, params, token) => { - return options.unknownClientRequestHandler?.(serverConnection, method, params, token) - }))) - } + disposableCollection.push(clientConnection.onRequest(bindContext((method, params, token) => { + // Java JDT:LS defines a lot of `java/XXX` requests, let's forward them as well + if (method.startsWith('java/')) { + onRequestEmitter.fire() + return serverConnection.sendRequest(method, params, token) + } + return options.unknownClientRequestHandler?.(serverConnection, method, params, token) + }))) disposableCollection.push(clientConnection.onNotification(DidChangeConfigurationNotification.type, bindContext(() => { // There is multiple clients on the server, what to do with the configuration?