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

Cannot import Disposable #59842

Closed
alexdima opened this issue Aug 29, 2024 · 2 comments · Fixed by #59853
Closed

Cannot import Disposable #59842

alexdima opened this issue Aug 29, 2024 · 2 comments · Fixed by #59853
Assignees
Labels
Bug A bug in TypeScript Domain: Auto-import Fix Available A PR has been opened for this issue
Milestone

Comments

@alexdima
Copy link
Member

  • in the vscode repo, open src/vs/base/common/strings.ts
  • type:
class X extends Disposable {
}
  • do cmd+.
  • observe that the import Disposable from lifecycle.ts quick fix is not offerred

Image

@mjbvz mjbvz transferred this issue from microsoft/vscode Sep 3, 2024
@mjbvz mjbvz removed their assignment Sep 3, 2024
@mjbvz
Copy link
Contributor

mjbvz commented Sep 3, 2024

The root cause is that there's a global Disposable type that comes from globals.d.ts in @types/node

@jakebailey
Copy link
Member

Note that you'd hit this with just plain TS too, if your lib is high enough, since Disposable is a global too:

interface Disposable {

Node is just declaring it early because they have the feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Auto-import Fix Available A PR has been opened for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants