Skip to content

No error for markdown links in @see #46348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/compiler/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
10 changes: 10 additions & 0 deletions tests/baselines/reference/seeTag3.js
Original file line number Diff line number Diff line change
@@ -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() {
}
6 changes: 6 additions & 0 deletions tests/baselines/reference/seeTag3.symbols
Original file line number Diff line number Diff line change
@@ -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))
}

6 changes: 6 additions & 0 deletions tests/baselines/reference/seeTag3.types
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
=== tests/cases/conformance/jsdoc/seeTag3.js ===
/** @see [The typescript web site](https://typescriptlang.org) */
function theWholeThing() {
>theWholeThing : () => void
}

7 changes: 7 additions & 0 deletions tests/cases/conformance/jsdoc/seeTag3.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// @outdir: out/
// @checkJs: true
// @filename: seeTag3.js

/** @see [The typescript web site](https://typescriptlang.org) */
function theWholeThing() {
}