microsoft/TypeScript

JSDoc for properties of intersected types is no longer merged

Open

#63 640 ouverte le 9 juil. 2026

Voir sur GitHub
 (0 commentaires) (4 réactions) (0 assignés)TypeScript (13 395 forks)batch import
BugDomain: LS: Quick InfoHelp Wanted

Métriques du dépôt

Stars
 (108 860 stars)
Métriques de merge PR
 (Merge moyen 6j 17h) (9 PRs mergées en 30 j)

Description

🔎 Search Terms

jsdoc intersection, documentation on intersected properties, documentation merge, jsdoc merge

🕗 Version & Regression Information

  • This changed between versions 6.0.3 and 7.0.2

⏯ Playground Link

https://www.typescriptlang.org/play/?ts=6.0.0-dev.20260416&ssl=19&ssc=17&pln=1&pc=1#code/JYOwLgpgTgZghgYwgAgILIN4EgCwAoLAegCpj8tljlRJZEVVzLDyAHKAe1YC5kAKAJTIAvAD5kIAK4BbAEbQA3PgC++fDWjwkyAEKZyJMgUrVwm+rqbEWBdl16CR4qXMUq1eMAE9WKAMIiaMgAZLpKeAAmEAgANnBQKAgcIADOYMgIvH7h+AgAdHas4YSEyAB6ZcgAEhwAbtDIYAAWwClAA

💻 Code

interface A {	
	/**
	 * interface A
	 */
	prop: () => number;
}

interface B {
	/**
	 * interface B
	 */
	prop: () => number;
}

type C = A & B;
declare const c: C;

c.prop;
// ^^ Hover this

🙁 Actual behavior

In versions 6 and earlier, the hover documentation of a property defined in two or more types of an intersection was merged from all the types.

In version 7, this behavior no longer seems to apply, as overlapping definitions of the same property just lead to the property not having any documentation within the intersection. (For example, with the code snippet above, c.prop shows no documentation on hover.)

🙂 Expected behavior

Documentation should be merged from both definitions of it, like it has in prior versions (such as 6.0.3).

I believe this is a convenient feature to have, as it allows one to document the methods of a base interface, and inheritors of that interface then to document additional clauses or invariants of the method implementation.

Additional information about the issue

VSCode version: 1.127.0

There is another seemingly related issue, #30901, which seems to be reporting this behavior as a bug. It is however still open, so I will for now be treating this change in behavior as a regression rather than a bugfix.

Guide contributeur