From a835635a1832cda94108d2318575390b242eeff2 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Thu, 6 Aug 2020 10:53:08 -0700 Subject: [PATCH] Fix triple-slash reference classification --- src/compiler/parser.ts | 2 +- src/compiler/utilities.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index dc4c0a58170..475216f6e1c 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -7215,6 +7215,7 @@ namespace ts { } function parseJSDocCommentWorker(startOrRanges: number | CommentRange[] = 0, length: number | undefined): JSDoc | undefined { + // const isTripleSlash = Array.isArray(startOrRanges); // TODO: Probably should save a boolean isTripleSlash at the beginning and make all the nested functions change their behaviour. const content = sourceText; // TODO: Why alias this? const comments: string[] = []; @@ -7226,7 +7227,6 @@ namespace ts { const ranges = startOrRanges; let currentTag: JSDocTag | undefined; // TODO: Probably can use tags for (const { pos: start, end } of ranges) { - if (isRecognizedTripleSlashComment(content, start, end)) continue; const length = end - start; scanner.scanRange(start + 3, length - 3, () => { while (nextTokenJSDoc() !== SyntaxKind.EndOfFileToken) { diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 25c1af7fa0f..4a783ebd6e4 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -1111,7 +1111,7 @@ namespace ts { text.charCodeAt(comment.pos + 1) === CharacterCodes.asterisk && text.charCodeAt(comment.pos + 2) === CharacterCodes.asterisk && text.charCodeAt(comment.pos + 3) !== CharacterCodes.slash - || isTripleSlashComment(comment, text)); + || isTripleSlashComment(comment, text) && !isRecognizedTripleSlashComment(text, comment.pos, comment.end)); } export const fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/;