added cancel handling to code lens requests
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2017, 2018 Pivotal, Inc.
|
||||
* Copyright (c) 2017, 2021 Pivotal, Inc.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
@@ -14,10 +14,11 @@ import java.util.List;
|
||||
|
||||
import org.eclipse.lsp4j.CodeLens;
|
||||
import org.eclipse.lsp4j.CodeLensParams;
|
||||
import org.eclipse.lsp4j.jsonrpc.CancelChecker;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface CodeLensHandler {
|
||||
|
||||
List<? extends CodeLens> handle(CodeLensParams params);
|
||||
List<? extends CodeLens> handle(CancelChecker cancelToken, CodeLensParams params);
|
||||
|
||||
}
|
||||
|
||||
@@ -422,7 +422,7 @@ public class SimpleTextDocumentService implements TextDocumentService, DocumentE
|
||||
|
||||
if (handler != null) {
|
||||
return CompletableFutures.computeAsync(cancelToken -> {
|
||||
return handler.handle(params);
|
||||
return handler.handle(cancelToken, params);
|
||||
});
|
||||
}
|
||||
return CompletableFuture.completedFuture(Collections.emptyList());
|
||||
|
||||
Reference in New Issue
Block a user