-
Notifications
You must be signed in to change notification settings - Fork 51
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: ResponseErrorException when Ctrl+Hover due to cancellation #1137
Conversation
src/main/java/com/redhat/devtools/intellij/lsp4ij/internal/CancellationUtil.java
Outdated
Show resolved
Hide resolved
@@ -52,15 +54,16 @@ public List<MarkupContent> getHoverContent(PsiElement element, int targetOffset, | |||
// The LSP hover request are finished, don't need to cancel the previous LSP requests. | |||
previousCancellationSupport = null; | |||
return result; | |||
} catch (ExecutionException e) { | |||
if (!(e.getCause() instanceof CancellationException)) { | |||
} catch (ResponseErrorException | ExecutionException | CancellationException e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't CancellationExceptions be rethrown?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, because I think IJ will log this error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so throw it as ProcessCanceledException?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honnest with you, I don't know how IJ documentation is working and I don't know if ProcessCanceledException will be logged as an error or used for a particular behavior (ex: retry the hover).
My PR should keep the current behavior. We could investigate more in a separate PR i fthrowing ProcessCanceledException could be interesting.
5c13e1c
to
7a22633
Compare
src/main/java/com/redhat/devtools/intellij/lsp4ij/internal/CancellationUtil.java
Show resolved
Hide resolved
Fixes redhat-developer#1136 Signed-off-by: azerr <[email protected]>
7a22633
to
9110c2e
Compare
Kudos, SonarCloud Quality Gate passed! |
Thanks @angelozerr! |
fix: ResponseErrorException when Ctrl+Hover due to cancellation
Fixes #1136