Skip to content

getTypeFromJSDocValueReference: handle import types #34683

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

Merged
merged 1 commit into from
Oct 23, 2019

Conversation

sandersn
Copy link
Member

Previously it only handled types whose declaration was from require, but now it handles types whose reference is an import type as well.

Fixes #34671

This doesn't explain the differences in chrome-devtools-frontend, so I'm going to investigate those now.

Previously it only handled types whose declaration was from `require`,
but now it handles types whose reference is an import type as well.
class C {
s() { }
}
module.exports.C = C
Copy link
Member

@weswigham weswigham Oct 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is needed because this line isn't treated like an alias declaration, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and the fixup code in getTypeFromJSDocValueReference didn't handle import types before this.

@sandersn sandersn merged commit 8223c07 into master Oct 23, 2019
@sandersn sandersn deleted the fix-jsdoc-import-type-w/class branch October 23, 2019 22:53
@sandersn
Copy link
Member Author

@typescript-bot cherry-pick this to release-3.7

@typescript-bot
Copy link
Collaborator

Hey @sandersn, I've opened #34705 for you.

typescript-bot pushed a commit to typescript-bot/TypeScript that referenced this pull request Oct 24, 2019
Component commits:
2aa257d getTypeFromJSDocValueReference: handle import types
Previously it only handled types whose declaration was from `require`,
but now it handles types whose reference is an import type as well.
sandersn pushed a commit that referenced this pull request Oct 24, 2019
Component commits:
2aa257d getTypeFromJSDocValueReference: handle import types
Previously it only handled types whose declaration was from `require`,
but now it handles types whose reference is an import type as well.
mheiber pushed a commit to mheiber/TypeScript that referenced this pull request Oct 25, 2019
Previously it only handled types whose declaration was from `require`,
but now it handles types whose reference is an import type as well.
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.

In JS, imported class type references resolve to static, not instance type.
3 participants