Microsoft/TypeScript
Missing `Go to definition` links when accessing properties after `jsdoc` typecast
开放
#60,562 创建于 2024年11月22日
Experience EnhancementHelp WantedSuggestion
仓库指标
- 星标
- (108,860 个星标)
- PR 合并指标
- (PR 指标待抓取)
描述
🔎 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
💻 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