File tree Expand file tree Collapse file tree 5 files changed +17
-418
lines changed Expand file tree Collapse file tree 5 files changed +17
-418
lines changed Original file line number Diff line number Diff line change @@ -1467,7 +1467,7 @@ namespace ts {
1467
1467
}
1468
1468
1469
1469
const typeChecker = program . getTypeChecker ( ) ;
1470
- const nodeForQuickInfo = getNodeForQuickInfo ( node , typeChecker ) ;
1470
+ const nodeForQuickInfo = getNodeForQuickInfo ( node ) ;
1471
1471
const symbol = getSymbolAtLocationForQuickInfo ( nodeForQuickInfo , typeChecker ) ;
1472
1472
1473
1473
if ( ! symbol || typeChecker . isUnknownSymbol ( symbol ) ) {
@@ -1495,17 +1495,9 @@ namespace ts {
1495
1495
} ;
1496
1496
}
1497
1497
1498
- function getNodeForQuickInfo ( node : Node , typeChecker : TypeChecker ) : Node {
1499
- const firstParentNode = node . parent . getFirstToken ( ) ;
1500
- const firstNodeSyntaxKind = firstParentNode ? firstParentNode . kind : undefined ;
1501
-
1502
- if ( node . kind === SyntaxKind . NewKeyword || firstNodeSyntaxKind === SyntaxKind . NewKeyword ) {
1503
- for ( const singleNode of node . parent . getChildren ( ) ) {
1504
- const symbol = getSymbolAtLocationForQuickInfo ( singleNode , typeChecker ) ;
1505
- if ( symbol ) {
1506
- return singleNode ;
1507
- }
1508
- }
1498
+ function getNodeForQuickInfo ( node : Node ) : Node {
1499
+ if ( isNewExpression ( node . parent ) && node . pos === node . parent . pos ) {
1500
+ return node . parent . expression ;
1509
1501
}
1510
1502
return node ;
1511
1503
}
Original file line number Diff line number Diff line change 79
79
"marker": {
80
80
"fileName": "/tests/cases/fourslash/jsDocTags.ts",
81
81
"position": 981
82
- },
83
- "quickInfo": {
84
- "kind": "constructor",
85
- "kindModifiers": "",
86
- "textSpan": {
87
- "start": 977,
88
- "length": 3
89
- },
90
- "displayParts": [
91
- {
92
- "text": "constructor",
93
- "kind": "keyword"
94
- },
95
- {
96
- "text": " ",
97
- "kind": "space"
98
- },
99
- {
100
- "text": "Foo",
101
- "kind": "className"
102
- },
103
- {
104
- "text": "(",
105
- "kind": "punctuation"
106
- },
107
- {
108
- "text": "value",
109
- "kind": "parameterName"
110
- },
111
- {
112
- "text": ":",
113
- "kind": "punctuation"
114
- },
115
- {
116
- "text": " ",
117
- "kind": "space"
118
- },
119
- {
120
- "text": "number",
121
- "kind": "keyword"
122
- },
123
- {
124
- "text": ")",
125
- "kind": "punctuation"
126
- },
127
- {
128
- "text": ":",
129
- "kind": "punctuation"
130
- },
131
- {
132
- "text": " ",
133
- "kind": "space"
134
- },
135
- {
136
- "text": "Foo",
137
- "kind": "className"
138
- }
139
- ],
140
- "documentation": [
141
- {
142
- "text": "This is the constructor.",
143
- "kind": "text"
144
- }
145
- ],
146
- "tags": [
147
- {
148
- "name": "myjsdoctag",
149
- "text": "this is a comment"
150
- }
151
- ]
152
82
}
153
83
},
154
84
{
Original file line number Diff line number Diff line change 2991
2991
"position": 337
2992
2992
},
2993
2993
"quickInfo": {
2994
- "kind": "constructor ",
2994
+ "kind": "var ",
2995
2995
"kindModifiers": "",
2996
2996
"textSpan": {
2997
- "start": 334 ,
2998
- "length": 2
2997
+ "start": 337 ,
2998
+ "length": 9
2999
2999
},
3000
3000
"displayParts": [
3001
3001
{
3002
- "text": "constructor ",
3002
+ "text": "var ",
3003
3003
"kind": "keyword"
3004
3004
},
3005
3005
{
3006
3006
"text": " ",
3007
3007
"kind": "space"
3008
3008
},
3009
3009
{
3010
- "text": "c2",
3011
- "kind": "className"
3012
- },
3013
- {
3014
- "text": "<",
3015
- "kind": "punctuation"
3016
- },
3017
- {
3018
- "text": "c",
3019
- "kind": "className"
3020
- },
3021
- {
3022
- "text": "<",
3023
- "kind": "punctuation"
3024
- },
3025
- {
3026
- "text": "string",
3027
- "kind": "keyword"
3028
- },
3029
- {
3030
- "text": ">",
3031
- "kind": "punctuation"
3032
- },
3033
- {
3034
- "text": ">",
3035
- "kind": "punctuation"
3036
- },
3037
- {
3038
- "text": "(",
3039
- "kind": "punctuation"
3040
- },
3041
- {
3042
- "text": "a",
3043
- "kind": "parameterName"
3044
- },
3045
- {
3046
- "text": ":",
3047
- "kind": "punctuation"
3048
- },
3049
- {
3050
- "text": " ",
3051
- "kind": "space"
3052
- },
3053
- {
3054
- "text": "c",
3055
- "kind": "className"
3056
- },
3057
- {
3058
- "text": "<",
3059
- "kind": "punctuation"
3060
- },
3061
- {
3062
- "text": "string",
3063
- "kind": "keyword"
3064
- },
3065
- {
3066
- "text": ">",
3067
- "kind": "punctuation"
3068
- },
3069
- {
3070
- "text": ")",
3071
- "kind": "punctuation"
3010
+ "text": "cInstance",
3011
+ "kind": "localName"
3072
3012
},
3073
3013
{
3074
3014
"text": ":",
3078
3018
"text": " ",
3079
3019
"kind": "space"
3080
3020
},
3081
- {
3082
- "text": "c2",
3083
- "kind": "className"
3084
- },
3085
- {
3086
- "text": "<",
3087
- "kind": "punctuation"
3088
- },
3089
3021
{
3090
3022
"text": "c",
3091
3023
"kind": "className"
3098
3030
"text": "string",
3099
3031
"kind": "keyword"
3100
3032
},
3101
- {
3102
- "text": ">",
3103
- "kind": "punctuation"
3104
- },
3105
3033
{
3106
3034
"text": ">",
3107
3035
"kind": "punctuation"
You can’t perform that action at this time.
0 commit comments