Skip to content

Commit

Permalink
fix: forward jdt:ls custom requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Mangeonjean committed Nov 7, 2022
1 parent c3cbb05 commit 23ea9b1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/language-client-mutualization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down

0 comments on commit 23ea9b1

Please sign in to comment.