Skip to content

Commit dfa22fa

Browse files
authored
Port TS PR 59675 (JsDoc is missing/duplicated in declarations for overloads declared in classes declared in functions) (#1261)
1 parent 0d27774 commit dfa22fa

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed

internal/checker/nodebuilderimpl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2129,7 +2129,7 @@ func (b *nodeBuilderImpl) addPropertyToElementList(propertySymbol *ast.Symbol, t
21292129
name: propertyName,
21302130
questionToken: optionalToken,
21312131
})
2132-
b.setCommentRange(methodDeclaration, propertySymbol.ValueDeclaration) // !!! missing JSDoc support formerly provided by preserveCommentsOn
2132+
b.setCommentRange(methodDeclaration, core.Coalesce(signature.declaration, propertySymbol.ValueDeclaration)) // !!! missing JSDoc support formerly provided by preserveCommentsOn
21332133
typeElements = append(typeElements, methodDeclaration)
21342134
}
21352135
if len(signatures) != 0 || optionalToken == nil {

testdata/baselines/reference/submodule/compiler/signatureOverloadsWithComments.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ declare function Foo(): {
3636
*/
3737
foo(bar: string): void;
3838
/**
39-
* comment 1
39+
* @deprecated This signature is deprecated
40+
*
41+
* comment 2
4042
*/
4143
foo(): string;
4244
};

testdata/baselines/reference/submodule/compiler/signatureOverloadsWithComments.js.diff

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)