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

feat: cancel willSaveWaitUntil if the result will no longer be used #1170

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rubenporras
Copy link
Contributor

No description provided.

@@ -259,18 +259,13 @@ public void documentAboutToBeSaved() {

// Use @link{TextDocumentSaveReason.Manual} as the platform does not give enough information to be accurate
final var params = new WillSaveTextDocumentParams(identifier, TextDocumentSaveReason.Manual);

CompletableFuture<@Nullable List<TextEdit>> edits = languageServerWrapper.executeImpl(ls -> ls.getTextDocumentService().willSaveWaitUntil(params));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember whether the return value of "executeImpl" is actually cancellable.
The best way to check that is to enable the log, get into a case where cancellation happens, and then check is the $cancel request was send from LSP4E to the LS. Did you verify it that way?
IIRC there is also a test case somewhere about cancellation that intercept those cancellation request between client and LS to verify them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not though about that. Thanks for the hint. I will check.

@rubenporras rubenporras marked this pull request as draft January 6, 2025 14:45
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