-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
In services, show the aliasSymbol for a type even if it's not accessible in the current scope #17433
Conversation
…ble in the current scope
src/compiler/types.ts
Outdated
@@ -2691,6 +2691,8 @@ namespace ts { | |||
AddUndefined = 1 << 13, // Add undefined to types of initialized, non-optional parameters | |||
WriteClassExpressionAsTypeLiteral = 1 << 14, // Write a type literal instead of (Anonymous class) | |||
InArrayType = 1 << 15, // Writing an array element type | |||
UseAliasEvenIfNotAccessible = 1 << 16, // For a `type T = ... ` defined in a different file, write `T` instead of its value, |
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.
maybe "defined outside the current scope"?
src/compiler/types.ts
Outdated
@@ -2691,6 +2691,8 @@ namespace ts { | |||
AddUndefined = 1 << 13, // Add undefined to types of initialized, non-optional parameters | |||
WriteClassExpressionAsTypeLiteral = 1 << 14, // Write a type literal instead of (Anonymous class) | |||
InArrayType = 1 << 15, // Writing an array element type | |||
UseAliasEvenIfNotAccessible = 1 << 16, // For a `type T = ... ` defined in a different file, write `T` instead of its value, |
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.
This seems suspiciously correlated to UseTypeAliasValue
. I'm not sure what the right way to emphasize the difference is, but it seems like a smell.
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.
Looks like that flag isn't used. (#17779)
@aozgaa, good to go? |
LGTM |
Fixes #17322
This may show an unexpected type due to #17349 -- if there is
type T = string | number
somewhere and you happen to also havestring | number
in your file, you will seeT
. But such situations will hopefully be rare.