File tree 4 files changed +185
-27
lines changed
4 files changed +185
-27
lines changed Original file line number Diff line number Diff line change @@ -644,7 +644,8 @@ namespace ts.FindAllReferences {
644
644
return checker . getExportSpecifierLocalTargetSymbol ( declaration ) ! ;
645
645
}
646
646
else if ( isPropertyAccessExpression ( declaration ) && isModuleExportsAccessExpression ( declaration . expression ) && ! isPrivateIdentifier ( declaration . name ) ) {
647
- return checker . getExportSpecifierLocalTargetSymbol ( declaration . name ) ! ;
647
+ // Export of form 'module.exports.propName = expr';
648
+ return checker . getSymbolAtLocation ( declaration ) ! ;
648
649
}
649
650
else if ( isShorthandPropertyAssignment ( declaration )
650
651
&& isBinaryExpression ( declaration . parent . parent )
Original file line number Diff line number Diff line change 3
3
// /*FIND ALL REFS*/[|f|]
4
4
5
5
// === /a.js ===
6
- // function [|f|] () { }
7
- // module.exports.f = [|f|]
6
+ // function f () { }
7
+ // module.exports.[|f|] = f
8
8
9
9
[
10
10
{
119
119
"containerKind" : " " ,
120
120
"containerName" : " " ,
121
121
"fileName" : " /a.js" ,
122
- "kind" : " function " ,
123
- "name" : " function f(): void" ,
122
+ "kind" : " property " ,
123
+ "name" : " (property) f: () => void" ,
124
124
"textSpan" : {
125
- "start" : 9 ,
125
+ "start" : 32 ,
126
126
"length" : 1
127
127
},
128
128
"displayParts" : [
129
129
{
130
- "text" : " function" ,
131
- "kind" : " keyword"
130
+ "text" : " (" ,
131
+ "kind" : " punctuation"
132
+ },
133
+ {
134
+ "text" : " property" ,
135
+ "kind" : " text"
136
+ },
137
+ {
138
+ "text" : " )" ,
139
+ "kind" : " punctuation"
132
140
},
133
141
{
134
142
"text" : " " ,
135
143
"kind" : " space"
136
144
},
137
145
{
138
146
"text" : " f" ,
139
- "kind" : " functionName"
147
+ "kind" : " propertyName"
148
+ },
149
+ {
150
+ "text" : " :" ,
151
+ "kind" : " punctuation"
152
+ },
153
+ {
154
+ "text" : " " ,
155
+ "kind" : " space"
140
156
},
141
157
{
142
158
"text" : " (" ,
147
163
"kind" : " punctuation"
148
164
},
149
165
{
150
- "text" : " :" ,
166
+ "text" : " " ,
167
+ "kind" : " space"
168
+ },
169
+ {
170
+ "text" : " =>" ,
151
171
"kind" : " punctuation"
152
172
},
153
173
{
160
180
}
161
181
],
162
182
"contextSpan" : {
163
- "start" : 0 ,
183
+ "start" : 17 ,
164
184
"length" : 16
165
185
}
166
186
},
167
187
"references" : [
168
188
{
169
189
"textSpan" : {
170
- "start" : 9 ,
171
- "length" : 1
172
- },
173
- "fileName" : " /a.js" ,
174
- "contextSpan" : {
175
- "start" : 0 ,
176
- "length" : 16
177
- },
178
- "isWriteAccess" : true ,
179
- "isDefinition" : true
180
- },
181
- {
182
- "textSpan" : {
183
- "start" : 36 ,
190
+ "start" : 32 ,
184
191
"length" : 1
185
192
},
186
193
"fileName" : " /a.js" ,
187
194
"contextSpan" : {
188
195
"start" : 17 ,
189
196
"length" : 20
190
197
},
191
- "isWriteAccess" : false ,
192
- "isDefinition" : false
198
+ "isWriteAccess" : true ,
199
+ "isDefinition" : true
193
200
}
194
201
]
195
202
}
Original file line number Diff line number Diff line change
1
+ // === /lib/plugins/aws/package/compile/events/httpApi/index.js ===
2
+ // const { [|logWarning|] } = require('../../../../../../classes/Error');
3
+
4
+ // === /lib/classes/Error.js ===
5
+ // module.exports.[|logWarning|] = message => { };
6
+
7
+ // === /bin/serverless.js ===
8
+ // /*FIND ALL REFS*/require('../lib/classes/Error').[|logWarning|](`CLI triage crashed with: ${error.stack}`);
9
+
10
+ [
11
+ {
12
+ "definition" : {
13
+ "containerKind" : " " ,
14
+ "containerName" : " " ,
15
+ "fileName" : " /lib/classes/Error.js" ,
16
+ "kind" : " property" ,
17
+ "name" : " (property) logWarning: (message: any) => void" ,
18
+ "textSpan" : {
19
+ "start" : 15 ,
20
+ "length" : 10
21
+ },
22
+ "displayParts" : [
23
+ {
24
+ "text" : " (" ,
25
+ "kind" : " punctuation"
26
+ },
27
+ {
28
+ "text" : " property" ,
29
+ "kind" : " text"
30
+ },
31
+ {
32
+ "text" : " )" ,
33
+ "kind" : " punctuation"
34
+ },
35
+ {
36
+ "text" : " " ,
37
+ "kind" : " space"
38
+ },
39
+ {
40
+ "text" : " logWarning" ,
41
+ "kind" : " propertyName"
42
+ },
43
+ {
44
+ "text" : " :" ,
45
+ "kind" : " punctuation"
46
+ },
47
+ {
48
+ "text" : " " ,
49
+ "kind" : " space"
50
+ },
51
+ {
52
+ "text" : " (" ,
53
+ "kind" : " punctuation"
54
+ },
55
+ {
56
+ "text" : " message" ,
57
+ "kind" : " parameterName"
58
+ },
59
+ {
60
+ "text" : " :" ,
61
+ "kind" : " punctuation"
62
+ },
63
+ {
64
+ "text" : " " ,
65
+ "kind" : " space"
66
+ },
67
+ {
68
+ "text" : " any" ,
69
+ "kind" : " keyword"
70
+ },
71
+ {
72
+ "text" : " )" ,
73
+ "kind" : " punctuation"
74
+ },
75
+ {
76
+ "text" : " " ,
77
+ "kind" : " space"
78
+ },
79
+ {
80
+ "text" : " =>" ,
81
+ "kind" : " punctuation"
82
+ },
83
+ {
84
+ "text" : " " ,
85
+ "kind" : " space"
86
+ },
87
+ {
88
+ "text" : " void" ,
89
+ "kind" : " keyword"
90
+ }
91
+ ],
92
+ "contextSpan" : {
93
+ "start" : 0 ,
94
+ "length" : 25
95
+ }
96
+ },
97
+ "references" : [
98
+ {
99
+ "textSpan" : {
100
+ "start" : 15 ,
101
+ "length" : 10
102
+ },
103
+ "fileName" : " /lib/classes/Error.js" ,
104
+ "contextSpan" : {
105
+ "start" : 0 ,
106
+ "length" : 43
107
+ },
108
+ "isWriteAccess" : true ,
109
+ "isDefinition" : true
110
+ },
111
+ {
112
+ "textSpan" : {
113
+ "start" : 32 ,
114
+ "length" : 10
115
+ },
116
+ "fileName" : " /bin/serverless.js" ,
117
+ "isWriteAccess" : false ,
118
+ "isDefinition" : false
119
+ },
120
+ {
121
+ "textSpan" : {
122
+ "start" : 8 ,
123
+ "length" : 10
124
+ },
125
+ "fileName" : " /lib/plugins/aws/package/compile/events/httpApi/index.js" ,
126
+ "contextSpan" : {
127
+ "start" : 0 ,
128
+ "length" : 66
129
+ },
130
+ "isWriteAccess" : true ,
131
+ "isDefinition" : true
132
+ }
133
+ ]
134
+ }
135
+ ]
Original file line number Diff line number Diff line change
1
+ /// <reference path="fourslash.ts" />
2
+
3
+ // @allowJs : true
4
+
5
+ // @Filename : /bin/serverless.js
6
+ //// require('../lib/classes/Error').log/**/Warning(`CLI triage crashed with: ${error.stack}`);
7
+
8
+ // @Filename : /lib/plugins/aws/package/compile/events/httpApi/index.js
9
+ //// const { logWarning } = require('../../../../../../classes/Error');
10
+
11
+ // @Filename : /lib/classes/Error.js
12
+ //// module.exports.logWarning = message => { };
13
+
14
+ goTo . marker ( ) ;
15
+ verify . baselineFindAllReferences ( "" ) ;
You can’t perform that action at this time.
0 commit comments