diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 2887481d78..3b67298ee9 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -1666,11 +1666,15 @@ namespace ts { } function bindJSDocTypeAlias(node: JSDocTypedefTag | JSDocCallbackTag | JSDocEnumTag) { - setParent(node.tagName, node); + bind(node.tagName); if (node.kind !== SyntaxKind.JSDocEnumTag && node.fullName) { + // don't bind the type name yet; that's delayed until delayedBindJSDocTypedefTag setParent(node.fullName, node); setParentRecursive(node.fullName, /*incremental*/ false); } + if (typeof node.comment !== "string") { + bindEach(node.comment); + } } function bindJSDocClassTag(node: JSDocClassTag) { diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 135d73a04b..0aa0a8fb09 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -530,8 +530,8 @@ namespace ts { visitNode(cbNode, (node as JSDocTypedefTag).fullName) || (typeof (node as JSDoc).comment === "string" ? undefined : visitNodes(cbNode, cbNodes, (node as JSDoc).comment as NodeArray | undefined)) : visitNode(cbNode, (node as JSDocTypedefTag).fullName) || - visitNode(cbNode, (node as JSDocTypedefTag).typeExpression)) || - (typeof (node as JSDoc).comment === "string" ? undefined : visitNodes(cbNode, cbNodes, (node as JSDoc).comment as NodeArray | undefined)); + visitNode(cbNode, (node as JSDocTypedefTag).typeExpression) || + (typeof (node as JSDoc).comment === "string" ? undefined : visitNodes(cbNode, cbNodes, (node as JSDoc).comment as NodeArray | undefined))); case SyntaxKind.JSDocCallbackTag: return visitNode(cbNode, (node as JSDocTag).tagName) || visitNode(cbNode, (node as JSDocCallbackTag).fullName) || diff --git a/tests/baselines/reference/quickInfoLink2.baseline b/tests/baselines/reference/quickInfoLink2.baseline new file mode 100644 index 0000000000..3219b7cc60 --- /dev/null +++ b/tests/baselines/reference/quickInfoLink2.baseline @@ -0,0 +1,105 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoLink2.js", + "position": 39, + "name": "" + }, + "quickInfo": { + "kind": "type", + "kindModifiers": "", + "textSpan": { + "start": 16, + "length": 23 + }, + "displayParts": [ + { + "text": "type", + "kind": "keyword" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "AdditionalWallabyConfig", + "kind": "aliasName" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "=", + "kind": "operator" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "{", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "autoDetect", + "kind": "propertyName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "boolean", + "kind": "keyword" + }, + { + "text": ";", + "kind": "punctuation" + }, + { + "text": "\n", + "kind": "lineBreak" + }, + { + "text": "}", + "kind": "punctuation" + } + ], + "documentation": [ + { + "text": "Additional valid Wallaby config properties\nthat aren't defined in ", + "kind": "text" + }, + { + "text": "{@link ", + "kind": "link" + }, + { + "text": "IWallabyConfig ", + "kind": "linkText" + }, + { + "text": "}", + "kind": "link" + }, + { + "text": ".", + "kind": "text" + } + ] + } + } +] \ No newline at end of file diff --git a/tests/cases/fourslash/quickInfoLink2.ts b/tests/cases/fourslash/quickInfoLink2.ts new file mode 100644 index 0000000000..4713446b90 --- /dev/null +++ b/tests/cases/fourslash/quickInfoLink2.ts @@ -0,0 +1,12 @@ +/// + +// @checkJs: true +// @Filename: quickInfoLink2.js +//// /** +//// * @typedef AdditionalWallabyConfig/**/ Additional valid Wallaby config properties +//// * that aren't defined in {@link IWallabyConfig}. +//// * @property {boolean} autoDetect +//// */ + +verify.noErrors() +verify.baselineQuickInfo();