Skip to content

Use more specific Go to Type Definition message than "no type definition found" on literal values #48065

@JoshuaKGoldberg

Description

@JoshuaKGoldberg

TS Template added by @mjbvz

TypeScript Version: 4.6

Search Terms

  • definitionAndBoundSpan
  • definitions
  • f12

Asking VS Code to go to type definition on a primitive such as true or "hello" in TypeScript gives the general No type definition found for '{0}' message:

Screenshot of 'No type definition found for 'true' on a line of code saying true;

It would be a little more accurate -and less misleading in the case of a user misclicking when they'd meant to select something else- to give an error message tailored to the value in question being a literal.

How about... '{0}' is the built-in {1} type, where {1} would be boolean, string, etc.?

I'd be happy to send this PR myself. 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions