microsoft / microsoft/TypeScript

JSDoc tags not parsed when a type may be present

Open
#62,244 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Domain: JSDoc Help Wanted
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.