Microsoft/TypeScript

Missing `Go to definition` links when accessing properties after `jsdoc` typecast

Open

#60.562 geöffnet am 22. Nov. 2024

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (6.726 Forks)batch import
Experience EnhancementHelp WantedSuggestion

Repository-Metriken

Stars
 (48.455 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 6T 17h) (9 gemergte PRs in 30 T)

Beschreibung

🔎 Search Terms

jsdoc typecast, typecast property access, jsdoc go to definition

🕗 Version & Regression Information

  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about jsdoc, typecast

⏯ Playground Link

https://www.typescriptlang.org/play/?ts=5.6.3&filetype=js#code/PQKhAIAEBcE8AcCmATRAzcBvT4B2BDAW0QC5wBnaAJwEtcBzcAXyfADEB7D8EYAKD4BjDrkrgOAIwBW4ALzhQEGAkRZOHVrwAUmJgEoA3H2DBwACQ4A3RFXAB3GtAAW4AAaDqAG1fjrt1+o+EoieHHbgyByI5LgA5NDgVIjC9Lg0AF6qzlkqEeh0jjQiQiJiklIAjHIKYFBwSGpcmsA6+gB0BMRGwqIJ5QBM1Yp1uZjqza16ANqxnYixALpGfEA

💻 Code

/** @typedef {{ name: string }} Foo */

const obj = /** @type {Foo} */({});
// Hover with `ctrl` over `Foo` below doesn't recognize the type definition
const obj1 = /** @type {Foo} */({}).name;
const obj2 = /** @type {Foo} */({})['name'];

🙁 Actual behavior

Hovering over Foo with ctrl pressed doesn't recognize the type definition

🙂 Expected behavior

Hovering over Foo with ctrl pressed recognizes the type definition

Additional information about the issue

No response

Contributor Guide