Skip to content

Idea: Infer types / parameters from runtime (V8 debugger/inspector protocol) #19641

Closed
@niieani

Description

@niieani

Given the new "infer parameters from usage" functionality, it would seem doable to do something similar like "infer parameters from runtime/debugger", especially in environments like VSCode, which tightly integrate a debugger.

In runtime you get most of the information to generate pretty good types, at least for a start, so... why not? This would be a massive help in migrating JavaScript to TypeScript.

Also, V8 has just recently introduced takeTypeProfile to the inspector protocol, that could be used to leverage just that. There's an example usage here: https://github.com/fhinkel/type-profile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Community ToolingThis might be better handled by tooling from the community instead of built into TypeScriptSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions