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

Handle errors coming from LS responses for completion items #1039

Merged
merged 4 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion org.eclipse.lsp4e/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Language Server Protocol client for Eclipse IDE (Incubation)
Bundle-SymbolicName: org.eclipse.lsp4e;singleton:=true
Bundle-Version: 0.18.11.qualifier
Bundle-Version: 0.18.12.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-17
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.12.0",
org.eclipse.equinox.common;bundle-version="3.8.0",
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.lsp4e/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<artifactId>org.eclipse.lsp4e</artifactId>
<packaging>eclipse-plugin</packaging>
<version>0.18.11-SNAPSHOT</version>
<version>0.18.12-SNAPSHOT</version>

<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,19 @@ public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int
if (isIncomplete) {
anyIncomplete.set(true);
}
}).exceptionally(t -> {
if (!CancellationUtil.isRequestCancelledException(t)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need now lines 152-154?

Copy link
Contributor Author

@BoykoAlex BoykoAlex Jul 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No those lines are not needed any more indeed. Corrected as well

LanguageServerPlugin.logError("'%s' LS failed to compute completion items.".formatted(w.serverDefinition.label), t); //$NON-NLS-1$
}
return null;
}));
cancellationSupport.execute(completionLanguageServersFuture);
this.cancellationSupport = cancellationSupport;

// Wait for the result of all LSP requests 'textDocument/completions', this future will be canceled with the next completion
this.completionLanguageServersFuture.get();
} catch (ResponseErrorException | ExecutionException | CancellationException e) {
if (!CancellationUtil.isRequestCancelledException(e)) { // do not report error if the server has cancelled the request
LanguageServerPlugin.logError(e);
}
} catch (ExecutionException e) {
// Ideally exceptions from each LS are handled above and we shouldn't be getting into this block
this.errorMessage = createErrorMessage(offset, e);
return createErrorProposal(offset, e);
} catch (InterruptedException e) {
Expand Down
Loading