Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Can you share a playground link? When I try I do get the suggestion, but that suggestion is coming from the list of words in the file, not from typescript's language service. In the playground you can see the difference because the the autocomplete entry for the suggestion has an abc icon rather than a cube icon.


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

It also works when the type is defined in another file/module.

Playground: 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?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: