Have QuickInfo use import types to display type aliases that are not in scope #23642
Labels
Awaiting More Feedback
This means we'd like to hear from more people who would be helped by this feature
Domain: Quick Info
e.g. hover text, tool-tips, and tooltips.
Suggestion
An idea for TypeScript
Search Terms:
type alias, import, display, quickinfo, intellisense
Code
Current behavior:
The quick info type shown for
result
is a fully expanded anonymous type becauseComplicatedType
is not in scope infile2
. ImportingComplicatedType
infile2
makes quick info displayconst result: ComplicatedType<SomeInterface, "a">
, but I don't think it's common to import a type alias purely for the quick info benefit if it isn't actually used anywhere in the file.While the example above isn't that bad, in some cases (#18754, #23458) the fully expanded types can be so large that they actually cause a performance issue for the language service.
Suggested behavior:
Use
import
types from #22592 to display an accurate qualified reference toComplicatedType
. So in the example above quick info forresult
could instead display something like:Which, although a little verbose, would be much more readable than many fully expanded types.
Related Issues:
#22592 added
import
types.#18754, #23458, #6070, #13095 - Various issues related to the display of types.
The text was updated successfully, but these errors were encountered: