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

Do not log errors when a request in cancelled by the server #967

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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