@@ -42,6 +42,18 @@ public void locatesColorCtor() throws Exception {
42
42
});
43
43
}
44
44
45
+ @ Test
46
+ public void locatesColorCtor_digitSeparators () throws Exception {
47
+ run (() -> {
48
+ final PsiElement testIdentifier = setUpDartElement ("main() { Color(0xFF_E3_F2_FD); }" , "Color" , LeafPsiElement .class );
49
+ final Color color = new FlutterColorProvider ().getColorFrom (testIdentifier );
50
+ assertNotNull (color );
51
+ final DartCallExpression element = DartSyntax .findEnclosingFunctionCall (testIdentifier , "Color" );
52
+ assertNotNull (element );
53
+ });
54
+ }
55
+
56
+
45
57
@ Test
46
58
public void locatesConstColorCtor () throws Exception {
47
59
run (() -> {
@@ -53,6 +65,17 @@ public void locatesConstColorCtor() throws Exception {
53
65
});
54
66
}
55
67
68
+ @ Test
69
+ public void locatesConstColorCtor_digitSeparators () throws Exception {
70
+ run (() -> {
71
+ final PsiElement testIdentifier = setUpDartElement ("main() { const Color(0xFF_E3_F2_FD); }" , "Color" , LeafPsiElement .class );
72
+ final Color color = new FlutterColorProvider ().getColorFrom (testIdentifier );
73
+ assertNotNull (color );
74
+ final DartNewExpression element = DartSyntax .findEnclosingNewExpression (testIdentifier );
75
+ assertNotNull (element );
76
+ });
77
+ }
78
+
56
79
@ Test
57
80
public void locatesConstColorArray () throws Exception {
58
81
run (() -> {
@@ -144,7 +167,8 @@ public void locatesColorArrayReference() throws Exception {
144
167
@ Test
145
168
public void locatesCuppertinoColorReference () throws Exception {
146
169
run (() -> {
147
- final PsiElement testIdentifier = setUpDartElement ("main() { CupertinoColors.systemGreen; }" , "CupertinoColors" , LeafPsiElement .class );
170
+ final PsiElement testIdentifier =
171
+ setUpDartElement ("main() { CupertinoColors.systemGreen; }" , "CupertinoColors" , LeafPsiElement .class );
148
172
final Color color = new FlutterColorProvider ().getColorFrom (testIdentifier );
149
173
assertNotNull (color );
150
174
final DartReferenceExpression element = DartSyntax .findEnclosingReferenceExpression (testIdentifier );
@@ -155,7 +179,8 @@ public void locatesCuppertinoColorReference() throws Exception {
155
179
@ Test
156
180
public void locatesColorReferenceWithComment () throws Exception {
157
181
run (() -> {
158
- final PsiElement testIdentifier = setUpDartElement ("main() { Colors . blue . /* darkish */ shade700; }" , "shade700" , LeafPsiElement .class );
182
+ final PsiElement testIdentifier =
183
+ setUpDartElement ("main() { Colors . blue . /* darkish */ shade700; }" , "shade700" , LeafPsiElement .class );
159
184
final Color color = new FlutterColorProvider ().getColorFrom (testIdentifier );
160
185
assertNotNull (color );
161
186
final DartReferenceExpression element = DartSyntax .findEnclosingReferenceExpression (testIdentifier );
@@ -166,7 +191,8 @@ public void locatesColorReferenceWithComment() throws Exception {
166
191
@ Test
167
192
public void locatesCuppertinoColorReferenceWithWitespace () throws Exception {
168
193
run (() -> {
169
- final PsiElement testIdentifier = setUpDartElement ("main() { CupertinoColors . systemGreen; }" , "CupertinoColors" , LeafPsiElement .class );
194
+ final PsiElement testIdentifier =
195
+ setUpDartElement ("main() { CupertinoColors . systemGreen; }" , "CupertinoColors" , LeafPsiElement .class );
170
196
final Color color = new FlutterColorProvider ().getColorFrom (testIdentifier );
171
197
assertNotNull (color );
172
198
final DartReferenceExpression element = DartSyntax .findEnclosingReferenceExpression (testIdentifier );
@@ -177,12 +203,12 @@ public void locatesCuppertinoColorReferenceWithWitespace() throws Exception {
177
203
@ Test
178
204
public void locatesCuppertinoColorReferenceWithLineEndComment () throws Exception {
179
205
run (() -> {
180
- final PsiElement testIdentifier = setUpDartElement ("main() { CupertinoColors . // comment\n systemGreen; }" , "CupertinoColors" , LeafPsiElement .class );
206
+ final PsiElement testIdentifier =
207
+ setUpDartElement ("main() { CupertinoColors . // comment\n systemGreen; }" , "CupertinoColors" , LeafPsiElement .class );
181
208
final Color color = new FlutterColorProvider ().getColorFrom (testIdentifier );
182
209
assertNotNull (color );
183
210
final DartReferenceExpression element = DartSyntax .findEnclosingReferenceExpression (testIdentifier );
184
211
assertNotNull (element );
185
212
});
186
213
}
187
-
188
214
}
0 commit comments