Skip to content

[API Question] Is there a type resolution depth limit difference between compiling and running the language service? #29511

Closed
@AnyhowStep

Description

@AnyhowStep

TS 3.3.0-dev.20190103

I don't exactly have a minimal repro but I figured I'd ask my question first.

I'm experiencing a problem that I can only think is because TS is "giving up" on resolving the type in the IDE. But it resolves the type correctly during compile time.

IDE

I'm currently seeing this in my IDE,

image

And it seems to think that the following type, ReturnType<SelectDelegateT>[index] is any.

It also thinks that ReturnType<SelectDelegateT> is any.

However, when I just use SelectDelegateT, it gives me the full type, which is correct.

Compile-time

It was really weird because I was pretty sure I shouldn't get an error. I gave up on the IDE and decided to run tsc. I configured it to have noEmitOnError : true.

So, if there really is an error, it should spit out the same error as the IDE and not emit any types.

However, tsc ran fine. No errors.

image

I checked the emitted .d.ts file and the emitted type was resolved correctly.


So... Is my hunch right? Is there a "depth limit" difference between the language service that runs for the IDE (VS Code) vs the compiler?

And if so, is there a way for me to make it so that both have the same limit?
If possible, I'd like to make the limit as large as possible for both VS code and during compile-time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs InvestigationThis issue needs a team member to investigate its status.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions