added cancel handling to highlight requests
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018, 2020 Pivotal, Inc.
|
||||
* Copyright (c) 2018, 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.DocumentHighlight;
|
||||
import org.eclipse.lsp4j.DocumentHighlightParams;
|
||||
import org.eclipse.lsp4j.jsonrpc.CancelChecker;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface DocumentHighlightHandler {
|
||||
|
||||
List<? extends DocumentHighlight> handle(DocumentHighlightParams highligtParams);
|
||||
List<? extends DocumentHighlight> handle(CancelChecker cancelToken, DocumentHighlightParams highligtParams);
|
||||
|
||||
}
|
||||
|
||||
@@ -473,7 +473,7 @@ public class SimpleTextDocumentService implements TextDocumentService, DocumentE
|
||||
DocumentHighlightHandler handler = this.documentHighlightHandler;
|
||||
if (handler != null) {
|
||||
return CompletableFutures.computeAsync(cancelToken -> {
|
||||
return handler.handle(highlightParams);
|
||||
return handler.handle(cancelToken, highlightParams);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user