Write more useful types in .types test outputs#48578
Conversation
|
With this change in place, how are PRs like the above ones tested/verified to still be working in the future? The two linked PRs are all code changes + |
|
The type we use for what the user sees can be verified when it's used in other places. The user never sees We also could leverage fourslash tests for things like verifying quickinfo as well. Traditionally, the .types tests are for us to verify the correct types are being produced, not for reporting what the user sees in the editor. |
#42149 and #42284 improved what we display to users when presenting complex type aliases, but this had the downside of making hundreds of
.typestest outputs mostly useless, as numerous test outputs would now reportT : Tfor the type of a type alias, when we were actually using those results to validate the expected type.This changes the type writer we use to generate
.typestests to compare the stringified type to the name of the type alias and, if they match, to re-stringify the type without using its name (by passingTypeFormatFlags.InTypeAliastotypeToString).This change makes over a thousand individual tests across over 427
.testsfiles useful again.