mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 03:23:08 -06:00
Fix triple-slash reference classification
This commit is contained in:
parent
ae4b29c559
commit
a835635a18
@ -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) {
|
||||
|
||||
@ -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*<reference\s+path\s*=\s*)('|")(.+?)\2.*?\/>/;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user