@@ -588,8 +588,22 @@ final class SemanticHighlightingTests extends GroovyEclipseTestSuite {
588588 new HighlightedTypedPosition (contents. lastIndexOf(' something' ), ' something' . length(), STATIC_CALL ))
589589 }
590590
591- @Test
591+ @Test // https://github.com/groovy/groovy-eclipse/issues/1478
592592 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 () {
593607 addGroovySource ''' \
594608 |abstract class A {
595609 | static foo() {}
@@ -2816,12 +2830,11 @@ final class SemanticHighlightingTests extends GroovyEclipseTestSuite {
28162830 @Test // https://github.com/groovy/groovy-eclipse/issues/511
28172831 void testGString4 () {
28182832 String contents = ''' \
2819- |import static java.net.URLEncoder.encode
2833+ |import static java.net.URLEncoder.*
28202834 |def url = "/${encode('head','UTF-8')}/tail"
28212835 |''' . stripMargin()
28222836
28232837 assertHighlighting(contents,
2824- new HighlightedTypedPosition (contents. indexOf(' encode' ), ' encode' . length(), DEPRECATED ),
28252838 new HighlightedTypedPosition (contents. indexOf(' url' ), 3 , VARIABLE ),
28262839 new HighlightedTypedPosition (contents. indexOf(' /' ), ' /' . length(), STRING ),
28272840 new HighlightedTypedPosition (contents. lastIndexOf(' encode' ), ' encode' . length(), STATIC_CALL ),
@@ -2832,7 +2845,7 @@ final class SemanticHighlightingTests extends GroovyEclipseTestSuite {
28322845 @Test // https://github.com/groovy/groovy-eclipse/issues/511
28332846 void testGString5 () {
28342847 String contents = ''' \
2835- |import static java.net.URLEncoder.encode
2848+ |import static java.net.URLEncoder.*
28362849 |@groovy.transform.CompileStatic
28372850 |class X {
28382851 | def url = "/${encode('head','UTF-8')}/tail"
@@ -2841,7 +2854,6 @@ final class SemanticHighlightingTests extends GroovyEclipseTestSuite {
28412854
28422855 assertHighlighting(contents,
28432856 new HighlightedTypedPosition (contents. indexOf(' X' ), 1 , CLASS ),
2844- new HighlightedTypedPosition (contents. indexOf(' encode' ), ' encode' . length(), DEPRECATED ),
28452857 new HighlightedTypedPosition (contents. indexOf(' url' ), 3 , FIELD ),
28462858 new HighlightedTypedPosition (contents. indexOf(' /' ), ' /' . length(), STRING ),
28472859 new HighlightedTypedPosition (contents. lastIndexOf(' encode' ), ' encode' . length(), STATIC_CALL ),
0 commit comments