TypeScript: Type information doesn't always show up, even though TS has it Follow
I've noticed various cases similar to this one, often when using mapped typed, unfortunately I don't have a minimal example:
Notice that `message.p` suggest `payload` with type `Field`. This is correct. However once I select `.payload` I get this behavior:
http://g.recordit.co/BOBvxhKlhS.gif
- Mousing over `message.payload` doesn't give me the type (holding Cmd)
- Mousing over the assinged `foo` incorrect says the type is `any`
This makes it hard to tell in the IDE what's going on, although the TS compiler knows. Especially since cmd-clicking `payload` (go to source) only takes you to the mapped type expression, not where the type is derived from, so you basically can't tell what the type is. Yet the original type suggestion shows it correctly.
Please sign in to leave a comment.
Please can you provide files/code snippets that can be used to recreate the issue?
This probably isn't the minimal example but it's the case that I'm seeing this issue with (actual usage has a lot more classes and methods across multiple modules):
portfolioService.ts
main.ts
If I mouse over `foo` I get `const foo: any` but the type is `Portfolio`. Compiler will flag this correctly, but IDE doesn't give me the correct type feedback. For example type suggestions don't work right.
thanks! Logged as https://youtrack.jetbrains.com/issue/WEB-33161, please follow it for updates