diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 4182d621cfafe..6d94ef225b14c 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -8256,8 +8256,9 @@ namespace ts { } function parseSeeTag(start: number, tagName: Identifier, indent?: number, indentText?: string): JSDocSeeTag { - const isLink = lookAhead(() => nextTokenJSDoc() === SyntaxKind.AtToken && tokenIsIdentifierOrKeyword(nextTokenJSDoc()) && scanner.getTokenValue() === "link"); - const nameExpression = isLink ? undefined : parseJSDocNameReference(); + const isMarkdownOrJSDocLink = token() === SyntaxKind.OpenBracketToken + || lookAhead(() => nextTokenJSDoc() === SyntaxKind.AtToken && tokenIsIdentifierOrKeyword(nextTokenJSDoc()) && scanner.getTokenValue() === "link"); + const nameExpression = isMarkdownOrJSDocLink ? undefined : parseJSDocNameReference(); const comments = indent !== undefined && indentText !== undefined ? parseTrailingTagComments(start, getNodePos(), indent, indentText) : undefined; return finishNode(factory.createJSDocSeeTag(tagName, nameExpression, comments), start); } diff --git a/tests/baselines/reference/seeTag3.js b/tests/baselines/reference/seeTag3.js new file mode 100644 index 0000000000000..7d13f07d66701 --- /dev/null +++ b/tests/baselines/reference/seeTag3.js @@ -0,0 +1,10 @@ +//// [seeTag3.js] +/** @see [The typescript web site](https://typescriptlang.org) */ +function theWholeThing() { +} + + +//// [seeTag3.js] +/** @see [The typescript web site](https://typescriptlang.org) */ +function theWholeThing() { +} diff --git a/tests/baselines/reference/seeTag3.symbols b/tests/baselines/reference/seeTag3.symbols new file mode 100644 index 0000000000000..2eb5284aaaf69 --- /dev/null +++ b/tests/baselines/reference/seeTag3.symbols @@ -0,0 +1,6 @@ +=== tests/cases/conformance/jsdoc/seeTag3.js === +/** @see [The typescript web site](https://typescriptlang.org) */ +function theWholeThing() { +>theWholeThing : Symbol(theWholeThing, Decl(seeTag3.js, 0, 0)) +} + diff --git a/tests/baselines/reference/seeTag3.types b/tests/baselines/reference/seeTag3.types new file mode 100644 index 0000000000000..6f150952c9e1e --- /dev/null +++ b/tests/baselines/reference/seeTag3.types @@ -0,0 +1,6 @@ +=== tests/cases/conformance/jsdoc/seeTag3.js === +/** @see [The typescript web site](https://typescriptlang.org) */ +function theWholeThing() { +>theWholeThing : () => void +} + diff --git a/tests/cases/conformance/jsdoc/seeTag3.ts b/tests/cases/conformance/jsdoc/seeTag3.ts new file mode 100644 index 0000000000000..abd16226fee94 --- /dev/null +++ b/tests/cases/conformance/jsdoc/seeTag3.ts @@ -0,0 +1,7 @@ +// @outdir: out/ +// @checkJs: true +// @filename: seeTag3.js + +/** @see [The typescript web site](https://typescriptlang.org) */ +function theWholeThing() { +}