Skip to content

Add navigation path for going to JS node_modules definitions instead of .d.ts declarations #37777

@davidmurdoch

Description

@davidmurdoch

Issue Type: Bug

When I "go to definition" of module in a JavaScript project it jumps to the TypeScript types file, if available, not the actual definition. If the TypeScript types are not available it will work as expected.

In the past, VSCode maintainers have commented:

It's not that TypeScript types are blocking you from jumping to the implementation
microsoft/vscode#68782 (comment)

and

In general, you cannot jump to the js implementation of a npm module
microsoft/vscode#68782 (comment)

and

it's that there in general is not logic to examine the code of an arbitrary node module and figure out which external invocations map to which implementations in the module.

microsoft/vscode#68782 (comment)

but that's is so clearly just flat-out wrong. There is a separate command for navigating to TypeScript types in the Right-Click context menu: "Go to Type Definition", it appears directly beneath "Go to Definition".

To reiterate: if the TypeScript file is removed everything works as expected.

People don't want to browse TypeScript definition files when stepping through source definitions. Abstractions are leaky. We need to find out why.

VS Code version: Code 1.43.2 (0ba0ca52957102ca3527cf479571617f0de6ed50, 2020-03-24T07:52:11.516Z)
OS version: Linux x64 5.0.0-16-generic

Metadata

Metadata

Assignees

No one assigned

    Labels

    Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions