Skip to content

Add utility method for request cancellation#915

Merged
pisv merged 1 commit into
eclipse-lsp4j:mainfrom
pisv:cancel-request
Nov 5, 2025
Merged

Add utility method for request cancellation#915
pisv merged 1 commit into
eclipse-lsp4j:mainfrom
pisv:cancel-request

Conversation

@pisv

@pisv pisv commented Nov 4, 2025

Copy link
Copy Markdown
Contributor

This PR adds a utility method to cancel the JSON-RPC request associated with a CompletableFuture. It shall allow clients to avoid downcasts to JsonRpcRequestFuture in their code.

It is a follow-up to #907.

cc @sebthom

@sebthom

sebthom commented Nov 4, 2025

Copy link
Copy Markdown
Contributor

Maybe add a boolean that returns false if the provided future is not a JsonRpcRequestFuture?

@pisv

pisv commented Nov 4, 2025

Copy link
Copy Markdown
Contributor Author

@sebthom Thanks for the suggestion. I think it will not hurt, although I could not imagine a practical use-case for checking the return value, to be honest.

I have updated this PR accordingly.

@sebthom

sebthom commented Nov 4, 2025

Copy link
Copy Markdown
Contributor

LGTM!

@pisv pisv merged commit dcca7e0 into eclipse-lsp4j:main Nov 5, 2025
4 checks passed
@pisv pisv deleted the cancel-request branch November 5, 2025 14:27
@pisv pisv added this to the 1.0.0 milestone Nov 5, 2025
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

Successfully merging this pull request may close these issues.

2 participants