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

Support CancellationToken when calling LSP workspaceCommand #1591

Merged
merged 1 commit into from
Aug 28, 2020

Conversation

testforstephen
Copy link
Collaborator

@testforstephen testforstephen commented Aug 24, 2020

Signed-off-by: Jinbo Wang jinbwan@microsoft.com

This PR makes the workspace command cancellable. The usage is passing an instance of vscode.CancellationToken as the last parameter of the workspace command. Cancel the token will cancel the LSP request.

A sample:

vscode.commands.executeCommand(Commands.EXECUTE_WORKSPACE_COMMAND, commands.JAVA_RESOLVE_MAINMETHOD, uri.toString(), token);

Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
@testforstephen
Copy link
Collaborator Author

// @jdneo @Eskibear
The codenlens and completion provider registered at vscode side can benefit from the cancellation mechanism. Also you should check the progress monitor to return early at the java plugin command handler.

@fbricon fbricon merged commit 748bbb0 into redhat-developer:master Aug 28, 2020
@fbricon
Copy link
Collaborator

fbricon commented Aug 28, 2020

@testforstephen thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants