Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Understand scope for types #10151
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
Describe alternatives you've considered
Teachability, Documentation, Adoption, Migration Strategy
Hey @conartist6! We really appreciate you taking the time to report an issue. The collaborators
It seems to me that there will likely be significant complexity in building these scope objects, which would probably belong in new plugins, along the lines of
Both languages are capable of referring to runtime symbols (e.g. classes) in types, so any
It is not immediately obvious in TS whether a symbol imported from another file is a type or runtime symbol. In flow it is. Still, this should not be troublesome. In both cases scope can capture the reference to the imported identifier, and the properties and parents of that identifier node will capture the rest of the information.
Both languages support parameterized functions, classes, and types. I don't foresee difficulty here, only benefit. Capturing scope information will make it clear whether a particular identifier is a generic type parameter, and if so which function, class, or type it belongs to.
Existing plugins which strip types would also want to prune out type scope if it is present.