diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 2465c336345..3b303c65eb8 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -2825,7 +2825,11 @@ namespace ts { export function getHostSignatureFromJSDoc(node: Node): SignatureDeclaration | undefined { const host = getEffectiveJSDocHost(node); - return host && isFunctionLike(host) ? host : undefined; + if (host) { + return isPropertySignature(host) && host.type && isFunctionLike(host.type) ? host.type : + isFunctionLike(host) ? host : undefined; + } + return undefined; } export function getEffectiveJSDocHost(node: Node): Node | undefined { diff --git a/tests/baselines/reference/quickInfoLink9.baseline b/tests/baselines/reference/quickInfoLink9.baseline new file mode 100644 index 00000000000..ec7a9ec78d2 --- /dev/null +++ b/tests/baselines/reference/quickInfoLink9.baseline @@ -0,0 +1,52 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoLink9.ts", + "position": 47, + "name": "" + }, + "quickInfo": { + "kind": "parameter", + "kindModifiers": "", + "textSpan": { + "start": 47, + "length": 1 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "parameter", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "a", + "kind": "parameterName" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "number", + "kind": "keyword" + } + ], + "documentation": [] + } + } +] \ No newline at end of file diff --git a/tests/cases/fourslash/quickInfoLink9.ts b/tests/cases/fourslash/quickInfoLink9.ts new file mode 100644 index 00000000000..676234396cd --- /dev/null +++ b/tests/cases/fourslash/quickInfoLink9.ts @@ -0,0 +1,10 @@ +/// + +//// type Foo = { +//// /** +//// * Text before {@link /**/a} text after +//// */ +//// c: (a: number) => void; +//// } + +verify.baselineQuickInfo();