@@ -42,6 +42,18 @@ public void locatesColorCtor() throws Exception {
4242 });
4343 }
4444
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+
4557 @ Test
4658 public void locatesConstColorCtor () throws Exception {
4759 run (() -> {
@@ -53,6 +65,17 @@ public void locatesConstColorCtor() throws Exception {
5365 });
5466 }
5567
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+
5679 @ Test
5780 public void locatesConstColorArray () throws Exception {
5881 run (() -> {
@@ -144,7 +167,8 @@ public void locatesColorArrayReference() throws Exception {
144167 @ Test
145168 public void locatesCuppertinoColorReference () throws Exception {
146169 run (() -> {
147- final PsiElement testIdentifier = setUpDartElement ("main() { CupertinoColors.systemGreen; }" , "CupertinoColors" , LeafPsiElement .class );
170+ final PsiElement testIdentifier =
171+ setUpDartElement ("main() { CupertinoColors.systemGreen; }" , "CupertinoColors" , LeafPsiElement .class );
148172 final Color color = new FlutterColorProvider ().getColorFrom (testIdentifier );
149173 assertNotNull (color );
150174 final DartReferenceExpression element = DartSyntax .findEnclosingReferenceExpression (testIdentifier );
@@ -155,7 +179,8 @@ public void locatesCuppertinoColorReference() throws Exception {
155179 @ Test
156180 public void locatesColorReferenceWithComment () throws Exception {
157181 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 );
159184 final Color color = new FlutterColorProvider ().getColorFrom (testIdentifier );
160185 assertNotNull (color );
161186 final DartReferenceExpression element = DartSyntax .findEnclosingReferenceExpression (testIdentifier );
@@ -166,7 +191,8 @@ public void locatesColorReferenceWithComment() throws Exception {
166191 @ Test
167192 public void locatesCuppertinoColorReferenceWithWitespace () throws Exception {
168193 run (() -> {
169- final PsiElement testIdentifier = setUpDartElement ("main() { CupertinoColors . systemGreen; }" , "CupertinoColors" , LeafPsiElement .class );
194+ final PsiElement testIdentifier =
195+ setUpDartElement ("main() { CupertinoColors . systemGreen; }" , "CupertinoColors" , LeafPsiElement .class );
170196 final Color color = new FlutterColorProvider ().getColorFrom (testIdentifier );
171197 assertNotNull (color );
172198 final DartReferenceExpression element = DartSyntax .findEnclosingReferenceExpression (testIdentifier );
@@ -177,12 +203,12 @@ public void locatesCuppertinoColorReferenceWithWitespace() throws Exception {
177203 @ Test
178204 public void locatesCuppertinoColorReferenceWithLineEndComment () throws Exception {
179205 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 );
181208 final Color color = new FlutterColorProvider ().getColorFrom (testIdentifier );
182209 assertNotNull (color );
183210 final DartReferenceExpression element = DartSyntax .findEnclosingReferenceExpression (testIdentifier );
184211 assertNotNull (element );
185212 });
186213 }
187-
188214}
0 commit comments