@@ -588,8 +588,22 @@ final class SemanticHighlightingTests extends GroovyEclipseTestSuite {
588
588
new HighlightedTypedPosition (contents. lastIndexOf(' something' ), ' something' . length(), STATIC_CALL ))
589
589
}
590
590
591
- @Test
591
+ @Test // https://github.com/groovy/groovy-eclipse/issues/1478
592
592
void testStaticMethods6 () {
593
+ String contents = ''' \
594
+ |import static java.net.URLEncoder.encode;
595
+ |encode('string','utf-8')
596
+ |encode('string')
597
+ |''' . stripMargin()
598
+
599
+ assertHighlighting(contents,
600
+ new HighlightedTypedPosition (contents. indexOf(' encode;' ), ' encode' . length(), STATIC_CALL ),
601
+ new HighlightedTypedPosition (contents. indexOf(' encode(' ), ' encode' . length(), STATIC_CALL ),
602
+ new HighlightedTypedPosition (contents. lastIndexOf(' encode' ), ' encode' . length(), DEPRECATED ))
603
+ }
604
+
605
+ @Test
606
+ void testStaticMethods7 () {
593
607
addGroovySource ''' \
594
608
|abstract class A {
595
609
| static foo() {}
@@ -2816,12 +2830,11 @@ final class SemanticHighlightingTests extends GroovyEclipseTestSuite {
2816
2830
@Test // https://github.com/groovy/groovy-eclipse/issues/511
2817
2831
void testGString4 () {
2818
2832
String contents = ''' \
2819
- |import static java.net.URLEncoder.encode
2833
+ |import static java.net.URLEncoder.*
2820
2834
|def url = "/${encode('head','UTF-8')}/tail"
2821
2835
|''' . stripMargin()
2822
2836
2823
2837
assertHighlighting(contents,
2824
- new HighlightedTypedPosition (contents. indexOf(' encode' ), ' encode' . length(), DEPRECATED ),
2825
2838
new HighlightedTypedPosition (contents. indexOf(' url' ), 3 , VARIABLE ),
2826
2839
new HighlightedTypedPosition (contents. indexOf(' /' ), ' /' . length(), STRING ),
2827
2840
new HighlightedTypedPosition (contents. lastIndexOf(' encode' ), ' encode' . length(), STATIC_CALL ),
@@ -2832,7 +2845,7 @@ final class SemanticHighlightingTests extends GroovyEclipseTestSuite {
2832
2845
@Test // https://github.com/groovy/groovy-eclipse/issues/511
2833
2846
void testGString5 () {
2834
2847
String contents = ''' \
2835
- |import static java.net.URLEncoder.encode
2848
+ |import static java.net.URLEncoder.*
2836
2849
|@groovy.transform.CompileStatic
2837
2850
|class X {
2838
2851
| def url = "/${encode('head','UTF-8')}/tail"
@@ -2841,7 +2854,6 @@ final class SemanticHighlightingTests extends GroovyEclipseTestSuite {
2841
2854
2842
2855
assertHighlighting(contents,
2843
2856
new HighlightedTypedPosition (contents. indexOf(' X' ), 1 , CLASS ),
2844
- new HighlightedTypedPosition (contents. indexOf(' encode' ), ' encode' . length(), DEPRECATED ),
2845
2857
new HighlightedTypedPosition (contents. indexOf(' url' ), 3 , FIELD ),
2846
2858
new HighlightedTypedPosition (contents. indexOf(' /' ), ' /' . length(), STRING ),
2847
2859
new HighlightedTypedPosition (contents. lastIndexOf(' encode' ), ' encode' . length(), STATIC_CALL ),
0 commit comments