-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add CancellationError #10035
Add CancellationError #10035
Conversation
@vince-fugnitto Sorry I overlooked that issue. Yes, this PR fixes that. |
@mtsmfm thanks for the PR. How can I test it? Why I'm asking is this: what happens when a plugin actually throws "CancelledError"? I think we should handle that more gracefully than to just display an error. What does VS Code do in this instance? |
This error was introduced to avoid showing busy error on host log. I'm not sure the equivalent place for theia so I understand this implementation is not enough though, Currently Theia can't load plugins which use newer vscode-languageserver package because it extends this class even if a plugin doesn't use this class at all. |
@tsmaeder VS Code made a function to intercept some calls and log or not some of the errors: It is then extensively used, but they only parameterize it in a few places to ignore logging
Since this is just related to logging, I think it is fine to do this as a follow-up. |
@mtsmfm overall the changes looks ok to me, but do you know which plugin/version I could use to compare the state of master vs your PR? I tried the latest release of |
@mtsmfm Theia is handling errors on remote calls generally here:
I agree we should not delay merging this PR because we're not "properly" handling |
The code looks good to me, but I can't provoke the error from #9136 (comment) on master. @vince-fugnitto you had analyzed the problem, right? |
@tsmaeder I don't really remember, in the issue all I did was help identify where |
@paul-marechal @tsmaeder Currently rust-analyzer compiles its extension for node 14, not 12. So latest rust-analyzer doesn't work because theia only supports 12 until #9936 Can you try my fork? https://github.com/mtsmfm/rust-analyzer/releases/tag/nightly It applies a patch to change target I tried che-theia with this PR and with my fork (https://gist.github.com/mtsmfm/a9b34a4004d20c38caf8e06f7929feb4) and I confirmed I got another error now though, it's not related to this PR.
For che-theia, rust-analyzer still doesn't work since its dependency requires vscode ^1.53.0. https://github.com/rust-analyzer/rust-analyzer/blob/f1d7f98ed07b9934286b9c4809dd4d7a47537879/editors/code/package-lock.json#L3764 I think if you can use latest theia, it should work since theia's default is 1.53.2 now. For che-theia, I think this patch is needed |
Or perhaps this release can work without patch since it's the last release which supports node 12 https://github.com/rust-analyzer/rust-analyzer/releases/tag/2021-08-09 |
Luckily, the newest vscode-java uses |
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 was able to test with vscode-java v.0.82.0, but we should move the type declaration.
@@ -40,6 +40,13 @@ export function isPromiseCanceledError(error: any): boolean { | |||
return error instanceof Error && error.name === canceledName && error.message === canceledName; | |||
} | |||
|
|||
export class CancellationError extends 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.
I just noticed that this is in quick-open.ts. However, this is a general class and should be moved to types-impl.ts
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.
Let me correct that: we're consuming cancellation-related stuff from core/common/cancellation.ts. We probably put the implementation of the class there, as well.
7fa4af1
to
14d7717
Compare
@tsmaeder I've moved class into core/common/cancellation.ts. Can you review again? |
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.
lgtm now
What it does
Fixes: #9988.
Add CancellationError to be compatible with VSCode.
#9136 (comment)
How to test
Review checklist
Reminder for reviewers