-
Notifications
You must be signed in to change notification settings - Fork 6k
Dead code #1927
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
Dead code #1927
Conversation
- dashboard - app api
A provider can now be registered on multiple endpoints (or potentially moved if needed).
It can still be used to check for updates but will not apply them. For now also remove the update check loop in VS Code since it's currently unused (update check is hardcoded off right now) and won't work anyway since it also applies the update which now won't work. In the future we should integrate the check into the browser update service.
This is for applications like Jupyter that aren't base path agnostic.
const providers = Array.from(this.providers.values()) | ||
// Catch so all the errors can be seen rather than just the first one. | ||
const responses = await Promise.all<Error | undefined>(providers.map((p) => p.dispose().catch((e) => e))) | ||
return responses.filter<Error>((r): r is Error => typeof r !== "undefined") |
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.
Why do we need to use typeof
here versus !== undefined
?
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.
Practically no difference, just a stylistic choice. It might be because I'm thinking of it in terms of the type rather than the value. It parallels what I'd do if I wanted to filter strings instead, and I like the consistency. It also works for undeclared variables, further enforcing the consistency.
It might also be partly force of habit from back when you could overwrite undefined on the global object. 😛
But even though the global undefined is read-only now it still feels weird to me that I can do const undefined = "something"
and now my checks have a different meaning.
Removes all the code not currently in use.