File tree Expand file tree Collapse file tree 3 files changed +67
-1
lines changed Expand file tree Collapse file tree 3 files changed +67
-1
lines changed Original file line number Diff line number Diff line change @@ -2825,7 +2825,11 @@ namespace ts {
2825
2825
2826
2826
export function getHostSignatureFromJSDoc ( node : Node ) : SignatureDeclaration | undefined {
2827
2827
const host = getEffectiveJSDocHost ( node ) ;
2828
- return host && isFunctionLike ( host ) ? host : undefined ;
2828
+ if ( host ) {
2829
+ return isPropertySignature ( host ) && host . type && isFunctionLike ( host . type ) ? host . type :
2830
+ isFunctionLike ( host ) ? host : undefined ;
2831
+ }
2832
+ return undefined ;
2829
2833
}
2830
2834
2831
2835
export function getEffectiveJSDocHost ( node : Node ) : Node | undefined {
Original file line number Diff line number Diff line change
1
+ [
2
+ {
3
+ "marker": {
4
+ "fileName": "/tests/cases/fourslash/quickInfoLink9.ts",
5
+ "position": 47,
6
+ "name": ""
7
+ },
8
+ "quickInfo": {
9
+ "kind": "parameter",
10
+ "kindModifiers": "",
11
+ "textSpan": {
12
+ "start": 47,
13
+ "length": 1
14
+ },
15
+ "displayParts": [
16
+ {
17
+ "text": "(",
18
+ "kind": "punctuation"
19
+ },
20
+ {
21
+ "text": "parameter",
22
+ "kind": "text"
23
+ },
24
+ {
25
+ "text": ")",
26
+ "kind": "punctuation"
27
+ },
28
+ {
29
+ "text": " ",
30
+ "kind": "space"
31
+ },
32
+ {
33
+ "text": "a",
34
+ "kind": "parameterName"
35
+ },
36
+ {
37
+ "text": ":",
38
+ "kind": "punctuation"
39
+ },
40
+ {
41
+ "text": " ",
42
+ "kind": "space"
43
+ },
44
+ {
45
+ "text": "number",
46
+ "kind": "keyword"
47
+ }
48
+ ],
49
+ "documentation": []
50
+ }
51
+ }
52
+ ]
Original file line number Diff line number Diff line change
1
+ /// <reference path="fourslash.ts" />
2
+
3
+ //// type Foo = {
4
+ //// /**
5
+ //// * Text before {@link /**/a } text after
6
+ //// */
7
+ //// c: (a: number) => void;
8
+ //// }
9
+
10
+ verify . baselineQuickInfo ( ) ;
You can’t perform that action at this time.
0 commit comments