Skip to content

Go To Type Definition fails if the identifier is a type name #46627

Closed
@justingrant

Description

@justingrant

Bug Report

Go To Type Definition fails if the identifier is a type name. This is confusing. Instead, Go to Type Definition should navigate to the declaration of the type.

I'm filing this bug as requested by @weswigham in #6209 (comment)

🔎 Search Terms

Go To Type Definition

🕗 Version & Regression Information

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about Go to Type Definition

⏯ Playground Link

This issue cannot be reproduced in TS Playground because the "Go to Type Definition" context menu is not available in the Playground.

However, reproducing it in VSCode is trivial.

💻 Code

type T = string;
const x: T;
// in VS Code, right click on the second `T` and choose "Go To Type Definition"

🙁 Actual behavior

image

🙂 Expected behavior

Navigates to the declaration of T

Metadata

Metadata

Assignees

No one assigned

    Labels

    Effort: CasualGood issue if you're already used to contributing to the codebase. Harder than "good first issue".Experience EnhancementNoncontroversial enhancementsHelp WantedYou can do thisSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions