GH-1380: return null instead of empty list when there are no document hightlights found to avoid confusion on the client side
This commit is contained in:
@@ -654,12 +654,13 @@ public class SimpleTextDocumentService implements TextDocumentService, DocumentE
|
||||
DocumentHighlightHandler handler = this.documentHighlightHandler;
|
||||
if (handler != null) {
|
||||
return CompletableFutures.computeAsync(messageWorkerThreadPool, cancelToken -> {
|
||||
return handler.handle(cancelToken, highlightParams);
|
||||
List<? extends DocumentHighlight> result = handler.handle(cancelToken, highlightParams);
|
||||
return result != null && result.size() > 0 ? result : null;
|
||||
|
||||
});
|
||||
}
|
||||
else {
|
||||
return CompletableFuture.completedFuture(Collections.emptyList());
|
||||
return CompletableFuture.completedFuture(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user