Skip to content

Commit 7161f5f

Browse files
committed
Do not write anonymous function name in type parameter details
1 parent 2cc2094 commit 7161f5f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/services/services.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2843,7 +2843,8 @@ module ts {
28432843
if (signatureDeclaration.kind === SyntaxKind.ConstructSignature) {
28442844
displayParts.push(keywordPart(SyntaxKind.NewKeyword));
28452845
displayParts.push(spacePart());
2846-
} else if (signatureDeclaration.kind !== SyntaxKind.CallSignature) {
2846+
}
2847+
else if (signatureDeclaration.kind !== SyntaxKind.CallSignature && signatureDeclaration.name) {
28472848
displayParts.push.apply(displayParts, symbolToDisplayParts(typeResolver, signatureDeclaration.symbol, sourceFile, /*meaning*/ undefined, SymbolFormatFlags.WriteTypeParametersOrArguments))
28482849
}
28492850
displayParts.push.apply(displayParts, signatureToDisplayParts(typeResolver, signature, sourceFile, TypeFormatFlags.NoTruncation | TypeFormatFlags.WriteTypeArgumentsOfSignature));

tests/cases/fourslash_old/completionBeforeSemanticDiagnosticsInArrowFunction1.ts renamed to tests/cases/fourslash/completionBeforeSemanticDiagnosticsInArrowFunction1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fs.edit.insert("A");
1515
// Bring up completion to force a pull resolve. This will end up resolving several symbols and
1616
// producing unreported diagnostics (i.e. that 'V' wasn't found).
1717
fs.verify.completionListContains("T");
18-
fs.verify.completionEntryDetailIs("T", "T in <T>(x: T): void");
18+
fs.verify.completionEntryDetailIs("T", "(type parameter) T in <T>(x: any): void");
1919

2020
// There should now be a single error.
2121
fs.verify.numberOfErrorsInCurrentFile(1);

0 commit comments

Comments
 (0)