3 ms·
Here is a screenshot from my Webstorm IDE. The Playgrond is less useful, even when I had a demo it showed a thousand completely useless completions in addition
by nosianu 3y ago
Here is a screenshot from my Webstorm IDE. The Playgrond is less useful, even when I had a demo it showed a thousand completely useless completions in addition to the two string constants and I'm not editing in there but in the IDE anyway so that is what matters.
https://imgur.com/a/fntl6GX https://imgur.com/a/fntl6GX
It also works when the type is defined in another file/module.
Playground: https://www.typescriptlang.org/play?noUnusedLocals=true&noUnusedParameters=true&preserveConstEnums=true&target=99&jsx=0&pretty=true&q=283#code/KYDwDg9gTgLgBDAnmYcCyiBqBDANgV2ABVlUBeOAcm0rgB8qAjZ2hgZxigEsA7AcwDcAWABQogMYQeHOEQCiAZSIAudFjyESKOBUqVhYkZOkRcwAHS4IfABTylASgNA https://www.typescriptlang.org/play?noUnusedLocals=true&noUn...
I don't know where exactly the suggestions come from, if it's the language service or something else. Why would that matter? The only point I care about is that those suggestions are made, making those useless-for-type-checks union components still useful. I found WebStorm to show them even after I unchecked the TS language service in the settings. So what?