microsoft / microsoft/TypeScript
JSDoc tags not parsed when a type may be present
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
### 🔎 Search Terms
jsdoc links missing in possible type position
### 🕗 Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about JSDoc
### ⏯ Playground Link
https://www.typescriptlang.org/play/?#code/MYGwhgzhAEDC0G8BQBfJB6AVJp1PQAEAXACwCcB7AdxgQJAEsA7AazjT3SQDMBXJ4EQYUm0LJnSxYACgCUiVEA
### 💻 Code
```ts
class C {
}
/**
* @throws {@link C}
*/
function /**/CC() {
}
```
### 🙁 Actual behavior
TypeScript does not resolve `{@link C}`.
Hover on the playground shows:
```
@throws — {
@link — C}
```
### 🙂 Expected behavior
TypeScript should resolve `{@link C}`
Hover on the playground should show this (or even better rendered links like it does in vscode)
```
@throws — {@link C }
```
### Additional information about the issue
Originally reported in https://github.com/TypeStrong/typedoc/issues/2993
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
Start with the provided TypeScript Playground link and the JSDoc example containing `@throws {@link C}`. Trace how JSDoc tags are parsed when a type may be present; done means the link resolves to `C` and the Playground hover displays the link content rather than splitting `@link` from `C`.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100