JSDoc for properties of intersected types is no longer merged
#63.640 geöffnet am 9. Juli 2026
Repository-Metriken
- Stars
- (108.860 Stars)
- PR-Merge-Metriken
- (Durchschn. Merge 6T 17h) (9 gemergte PRs in 30 T)
Beschreibung
🔎 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
💻 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.