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

No clear way to write no-op middleware for responses to client-initiated requests #1353

Closed
RobbyCBennett opened this issue Nov 9, 2023 · 1 comment

Comments

@RobbyCBennett
Copy link

The way isn't the languageClient.onRequest('method_here', handler_here) method, but it's with the middleware object in clientOptions. However, I just want to use the response. I don't want to augment/mutate it. How do I pass along the response unaltered in the middleware handler? This would be a lot easier if I could find some documentation for this library.

@dbaeumer
Copy link
Member

dbaeumer commented Nov 10, 2023

If you don't want to alter the result simply return the response from the next() handler.

Something like: https://github.com/microsoft/vscode-eslint/blob/24d2ac45b2fe1b8cc8639038b724ba48610da8e2/client/src/client.ts#L464

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