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

fix: improve exception handling in InlayHintProvider #1151

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

joaodinissf
Copy link
Contributor

@joaodinissf joaodinissf commented Dec 2, 2024

If the request for an inlayHint() ends exceptionally, always return an empty list.

In addition, if the exception is due to a cancellation request, skip the logging of the error. This is analogous to

symbols.exceptionally(ex -> {
if (!(ex instanceof CancellationException || CancellationUtil.isRequestCancelledException(ex))) {
lastError = ex;
LanguageServerPlugin.logError(ex);
}
viewer.getControl().getDisplay().asyncExec(viewer::refresh);
return Collections.emptyList();
});

@joaodinissf joaodinissf force-pushed the inlay-exception branch 2 times, most recently from c0b1eb9 to abfb978 Compare December 2, 2024 10:32
If the request for an inlayHint() ends exceptionally, always return an empty list.

In addition, if the exception is due to a cancellation request, skip error logging. This is analogous to https://github.com/eclipse-lsp4e/lsp4e/blob/2f4198aa4bf739c76ab92eecdf891b889d7fc7cb/org.eclipse.lsp4e/src/org/eclipse/lsp4e/outline/LSSymbolsContentProvider.java#L429-L436
@rubenporras rubenporras merged commit 53fc96a into eclipse-lsp4e:main Dec 2, 2024
6 checks passed
@rubenporras
Copy link
Contributor

thanks

@joaodinissf joaodinissf deleted the inlay-exception branch December 2, 2024 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants