From 413a26b94d4cea5d0b1b3aa08ee149794437df77 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Tue, 11 Oct 2016 11:14:15 -0700 Subject: [PATCH] Support JSDoc for type alias --- src/compiler/parser.ts | 2 +- tests/cases/fourslash/jsDocForTypeAlias.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 tests/cases/fourslash/jsDocForTypeAlias.ts 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 ");