microsoft / microsoft/TypeScript
`{@link Class.name}` resolves wrongly to `Function.name`
@sandersn arbeitet bereits daran.
Seit 20.3.2025.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 2 T. 4 Std.
- Gemergte PRs (30 T.)
- 132
Beschreibung
### 🔎 Search Terms
JSDoc, TSDoc, Link, Resolve, Name
### 🕗 Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries
### ⏯ Playground Link
https://www.typescriptlang.org/play/?ts=5.8.0-dev.20250215#code/MYGwhgzhAEAqCmEAu0DeBYAUNH0D0AVAVrjgdABLwggD2JpBeDOAdmALbwBcyATgEtWAc2gBeaACIEySVgC+WLIWLZyqAAIghAaziIkAOnZdFa5pgBmAV1bAkA2q2hgAFEm4ykASjQtofPBI1nzORibwANwKQA
### 💻 Code
```ts
class Test {
/**
* Hello
*/
name:string = "Test"
}
/**
* {@link Test.name}
*/
function a(t:Test) {
return t.name;
}
```
### 🙁 Actual behavior
The `Test.name` reference in the JSDoc/TSDoc resolves to the symbol `Function.name`. This is not correct because the `Test` class has an own property declaration for `name`.
In my real world usecase am generating markdowns from my typescript code via TypeScript compiler API and I get the wrong symbol using `typeChecker.getSymbolAtLocation(tsDocLinkNode.name)` leading to wrong documentation links.

### 🙂 Expected behavior
The correct documentation of my `name` property should be shown.
The typeChecker should resolve this expression to the correct symbol to allow tooling to resolve these cross references and link to the respective documentation page.
### Additional information about the issue
_No response_
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Bewertung
Dieses Issue wurde noch nicht bewertet.