Skip to content
Open
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
4 changes: 3 additions & 1 deletion src/compiler/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9374,7 +9374,9 @@ namespace Parser {

function tryParseTypeExpression(): JSDocTypeExpression | undefined {
skipWhitespaceOrAsterisk();
return token() === SyntaxKind.OpenBraceToken ? parseJSDocTypeExpression() : undefined;
if (token() === SyntaxKind.OpenBraceToken && !lookAhead(() => nextTokenJSDoc() === SyntaxKind.AtToken)) {
return parseJSDocTypeExpression();
}
}

function parseBracketNameInPropertyAndParamTag(): { name: EntityName; isBracketed: boolean; } {
Expand Down
97 changes: 97 additions & 0 deletions tests/baselines/reference/inlineTagInTypePosition.baseline
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
// === QuickInfo ===
=== /tests/cases/fourslash/inlineTagInTypePosition.ts ===
// class C {
// }
// /**
// * @throws {@link C}
// */
// function CC() {
// ^^
// | ----------------------------------------------------------------------
// | function CC(): void
// | @throws {@link C}
// | ----------------------------------------------------------------------
// }

[
{
"marker": {
"fileName": "/tests/cases/fourslash/inlineTagInTypePosition.ts",
"position": 50,
"name": ""
},
"item": {
"kind": "function",
"kindModifiers": "",
"textSpan": {
"start": 50,
"length": 2
},
"displayParts": [
{
"text": "function",
"kind": "keyword"
},
{
"text": " ",
"kind": "space"
},
{
"text": "CC",
"kind": "functionName"
},
{
"text": "(",
"kind": "punctuation"
},
{
"text": ")",
"kind": "punctuation"
},
{
"text": ":",
"kind": "punctuation"
},
{
"text": " ",
"kind": "space"
},
{
"text": "void",
"kind": "keyword"
}
],
"documentation": [],
"tags": [
{
"name": "throws",
"text": [
{
"text": "",
"kind": "text"
},
{
"text": "{@link ",
"kind": "link"
},
{
"text": "C",
"kind": "linkName",
"target": {
"fileName": "/tests/cases/fourslash/inlineTagInTypePosition.ts",
"textSpan": {
"start": 0,
"length": 11
}
}
},
{
"text": "}",
"kind": "link"
}
]
}
]
}
}
]
11 changes: 11 additions & 0 deletions tests/cases/fourslash/inlineTagInTypePosition.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
///<reference path="fourslash.ts" />

//// class C {
//// }
//// /**
//// * @throws {@link C}
//// */
//// function /**/CC() {
//// }

verify.baselineQuickInfo();
Loading