@@ -55,4 +55,55 @@ class DefinitionTest {
5555 .definition(m5 to m6, List (m1 to m2))
5656 }
5757
58+ @ Test def goToDefinitionRenamedImport : Unit = {
59+ withSources(
60+ code """ package a
61+ class ${m1}Foo ${m2}""" ,
62+ code """ package b
63+ import a.{ ${m3}Foo ${m4} => ${m5}Bar ${m6}}
64+ class C extends ${m7}Bar ${m8}"""
65+ ).definition(m1 to m2, List (m1 to m2))
66+ .definition(m3 to m4, List (m1 to m2))
67+ .definition(m5 to m6, List (m1 to m2))
68+ .definition(m7 to m8, List (m1 to m2))
69+ }
70+
71+ @ Test def goToDefinitionImportAlternatives : Unit = {
72+ withSources(
73+ code """ package a
74+ class ${m1}Foo ${m2}
75+ object ${m3}Foo ${m4}""" ,
76+ code """ package b
77+ import a. ${m5}Foo ${m6}
78+ class C extends ${m7}Foo ${m8} {
79+ val bar = ${m9}Foo ${m10}
80+ } """
81+ ).definition(m1 to m2, List (m1 to m2))
82+ .definition(m3 to m4, List (m3 to m4))
83+ .definition(m5 to m6, List (m1 to m2, m3 to m4))
84+ .definition(m7 to m8, List (m1 to m2))
85+ .definition(m9 to m10, List (m3 to m4))
86+ }
87+
88+ @ Test def goToDefinitionImportAlternativesWithRename : Unit = {
89+ val m11 = new util.embedded.CodeMarker (" m11" )
90+ val m12 = new util.embedded.CodeMarker (" m12" )
91+
92+ withSources(
93+ code """ package a
94+ class ${m1}Foo ${m2}
95+ object ${m3}Foo ${m4}""" ,
96+ code """ package b
97+ import a.{ ${m5}Foo ${m6} => ${m7}Bar ${m8}}
98+ class C extends ${m9}Bar ${m10} {
99+ val buzz = ${m11}Bar ${m12}
100+ } """
101+ ).definition(m1 to m2, List (m1 to m2))
102+ .definition(m3 to m4, List (m3 to m4))
103+ .definition(m5 to m6, List (m1 to m2, m3 to m4))
104+ .definition(m7 to m8, List (m1 to m2, m3 to m4))
105+ .definition(m9 to m10, List (m1 to m2))
106+ .definition(m11 to m12, List (m3 to m4))
107+ }
108+
58109}
0 commit comments