Allow unexported local type aliases to be displayed in quickinfo. (#13095)#23638
Allow unexported local type aliases to be displayed in quickinfo. (#13095)#23638kpdonn wants to merge 1 commit intomicrosoft:masterfrom
Conversation
|
This will greatly help library author to give a good hover experience! Thanks! |
|
@HerringtonDarkholme Thanks, but just so you know this might not help as much as you are hoping if you are referring to giving users of your libraries a good hover experience. This PR only changes the behavior in the specific case of quick info in the same file as a type alias that isn't exported. So users of a library still won't see the library's type aliases in quick info unless they explicitly import the aliases in each file they want it to work in. I'm interested in that use case also though and just opened #23642 as an idea for how type aliases could appear in quick info across files without requiring them to be explicitly imported. |
|
@weswigham can you please review |
| } | ||
| if (!inTypeAlias && type.aliasSymbol && (context.flags & NodeBuilderFlags.UseAliasDefinedOutsideCurrentScope || isTypeSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration))) { | ||
| if (!inTypeAlias && type.aliasSymbol && (context.flags & NodeBuilderFlags.UseAliasDefinedOutsideCurrentScope || | ||
| isTypeSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration, !!(context.flags & NodeBuilderFlags.UseLocalAliases)))) { |
There was a problem hiding this comment.
This is used by the declaration emitter, in addition to quick info and signature help, and I don't see any checks actually accounting for the enclosing declaration context, which worries me. Additionally, given that we have a UseAliasDefinedOutsideCurrentScope flag, I'm led to believe that one would believe that this should be the default behavior! However that may have to wait for #23351 though, which may, incidentally, subsume this. Will have to test.
|
Thanks for your contribution. This PR has not been updated in a while and cannot be automatically merged at the time being. For housekeeping purposes we are closing stale PRs. If you'd still like to continue working on this PR, please leave a message and one of the maintainers can reopen it. |
This PR makes it so type aliases that are not exported are still able to be displayed by quickinfo for the file they are local to. Example:
Quickinfo for
apreviously displayed{property1: string}becauseAlias<K>was not exported, but will displayAlias<string>with this PR.Fixes #13095
Also partially but not entirely addresses #18754