diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index aaf3b4ebecc..62ae61e4cb4 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -5352,7 +5352,7 @@ namespace ts { parseExpected(SyntaxKind.EqualsToken); node.type = parseType(); parseSemicolon(); - return finishNode(node); + return addJSDocComment(finishNode(node)); } // In an ambient declaration, the grammar only allows integer literals as initializers. diff --git a/tests/cases/fourslash/jsDocForTypeAlias.ts b/tests/cases/fourslash/jsDocForTypeAlias.ts new file mode 100644 index 00000000000..dbda7ccbc13 --- /dev/null +++ b/tests/cases/fourslash/jsDocForTypeAlias.ts @@ -0,0 +1,7 @@ +/// + +/////** DOC */ +////type /**/T = number + +goTo.marker(); +verify.quickInfoIs("type T = number", "DOC ");