Skip to content

Commit

Permalink
Merge pull request #18 from CodinGame/fix-jdt-ls-lsp-custom-requests
Browse files Browse the repository at this point in the history
Forward jdt:ls custom requests
  • Loading branch information
samuel-olivier authored Nov 7, 2022
2 parents c3cbb05 + 23ea9b1 commit 248ca41
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 248ca41

Please sign in to comment.