Tooltips / IntelliSense: Don't resolve type aliases (aka "semantic sugar") set explicitly
See original GitHub issueWe have defined a bunch of “semantic sugar” type aliases like:
Status quo (bad): VS Code is resolving these along the alias chain in tooltips and IntelliSense suggestions (which kinda makes non-sense of the type alias in the first place)
(c.f. hovered tooltip over this.url
at bottom)
Better: Let VS Code show UrlString
as type here instead of string
to aid developers with semantic sugar as of what type of string to expect.
Alternative: Show both, i.e. BufferingWebSocket.url: UrlString (= string)
.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:74
- Comments:23 (2 by maintainers)
Top Results From Across the Web
Typescript type alias let Intellisense show alias name, not ...
Type aliases as their name suggests are just different names for another types. Type alias names are not something the compiler is ...
Read more >Bug List - Bugs - Eclipse
Chandra, NEW, ---, PDE container does not resolve fragment if environment not set in target and target doesn't match running platform, 2022-11-19.
Read more >Release 7.25.0 The IPython Development Team
This help to type unicode character that do not have short latex aliases, and have long unicode names. for example ,.
Read more >npmsearchfullcat_npm143.txt - GitHub
=imzshh 2013-05-08 0.2.1 ach Connect middleware for setting Access-Control ... api-media-type A Node.js module exporting a map of common media type names…
Read more >Blog | HHVM
To set up the VS Code based HHVM development environment on any Linux or macOS machines: Install Nix; Checkout HHVM with all submodules:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@miyauchiakira True, just adding
& {}
(which does not change the type at all) causes TypeScript not to expand the type. I have no idea why this workaround works. Ugly, but effective – still would prefer TypeScript to “just work”.+1 for this.
In our project, I wanted to declare some semantic types representing numbers, to remove some of the ambiguity of “what does this random float value actually mean?”, so I added these type alias declarations:
I was quite disappointed to see that the assorted tooltips/intellisense did not keep the alias in tact, and just resolved down to a
number
.