microsoft / microsoft/TypeScript
Missing `Go to definition` links when accessing properties after `jsdoc` typecast
Open
Nobody has claimed this yet.
Experience Enhancement
Help Wanted
Suggestion
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
🔎 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the missing go-to-definition behavior in the linked TypeScript Playground using the JSDoc typecast examples, then trace the language-service handling for the typecast followed by .name and ['name'] access. Done means Ctrl-hovering Foo in both property-access forms recognizes and links to the typedef.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- developer-experience
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100