Skip to content

Commit

Permalink
Allow parsing TS-style generics in JSDoc
Browse files Browse the repository at this point in the history
Fixes microsoft#6814

(cherry picked from commit 6e06bb3)

# Conflicts:
#	tests/cases/fourslash/jsDocGenerics1.ts
  • Loading branch information
RyanCavanaugh committed Feb 5, 2016
1 parent 7823773 commit 4035bf3
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/compiler/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5765,16 +5765,22 @@ namespace ts {
const result = <JSDocTypeReference>createNode(SyntaxKind.JSDocTypeReference);
result.name = parseSimplePropertyName();

while (parseOptional(SyntaxKind.DotToken)) {
if (token === SyntaxKind.LessThanToken) {
result.typeArguments = parseTypeArguments();
break;
}
else {
result.name = parseQualifiedName(result.name);
if (token === SyntaxKind.LessThanToken) {
result.typeArguments = parseTypeArguments();
}
else {
while (parseOptional(SyntaxKind.DotToken)) {
if (token === SyntaxKind.LessThanToken) {
result.typeArguments = parseTypeArguments();
break;
}
else {
result.name = parseQualifiedName(result.name);
}
}
}


return finishNode(result);
}

Expand Down

0 comments on commit 4035bf3

Please sign in to comment.