Skip to content

Commit

Permalink
Do not log errors when a request in cancelled by the server (eclipse#967
Browse files Browse the repository at this point in the history
)
  • Loading branch information
rubenporras committed Apr 16, 2024
1 parent 99e4872 commit 0d8fa0a
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,7 @@ private static IContextInformation toContextInformation(SignatureInformation inf
if (docString!=null && !docString.isEmpty()) {
signature.append('\n').append(docString);
}
final var contextInformation = new ContextInformation(information.getLabel(), signature.toString());
return contextInformation;
return new ContextInformation(information.getLabel(), signature.toString());
}

private void getFuture(CompletableFuture<@NonNull List<@NonNull Void>> future) {
Expand All @@ -328,13 +327,15 @@ private void getFuture(CompletableFuture<@NonNull List<@NonNull Void>> future) {

try {
future.get(TRIGGERS_TIMEOUT, TimeUnit.MILLISECONDS);
} catch (OperationCanceledException | ExecutionException e) {
LanguageServerPlugin.logError(e);
} catch (InterruptedException e) {
LanguageServerPlugin.logError(e);
Thread.currentThread().interrupt();
} catch (TimeoutException e) {
LanguageServerPlugin.logWarning("Could not get trigger characters due to timeout after " + TRIGGERS_TIMEOUT + " milliseconds", e); //$NON-NLS-1$//$NON-NLS-2$
} catch (OperationCanceledException | ResponseErrorException | ExecutionException | CancellationException e) {
if (!CancellationUtil.isRequestCancelledException(e)) { // do not report error if the server has cancelled the request
LanguageServerPlugin.logError(e);
}
}
}

Expand Down

0 comments on commit 0d8fa0a

Please sign in to comment.