diff --git a/idea/src/org/jetbrains/jet/plugin/codeInsight/ShortenReferences.kt b/idea/src/org/jetbrains/jet/plugin/codeInsight/ShortenReferences.kt index 1fb56e7a8a9..429105b111e 100644 --- a/idea/src/org/jetbrains/jet/plugin/codeInsight/ShortenReferences.kt +++ b/idea/src/org/jetbrains/jet/plugin/codeInsight/ShortenReferences.kt @@ -16,6 +16,10 @@ import java.util.HashSet; import com.intellij.psi.util.PsiTreeUtil import com.intellij.util.containers.HashMap import java.util.ArrayList +import org.jetbrains.jet.lang.psi.psiUtil.getParentByType +import org.jetbrains.jet.lang.resolve.java.descriptor.JavaPropertyDescriptor +import org.jetbrains.jet.lang.resolve.java.lazy.descriptors.LazyPackageFragmentForJavaClass +import org.jetbrains.jet.lang.resolve.java.descriptor.JavaMethodDescriptor public object ShortenReferences { public fun process(element: JetElement) { @@ -101,16 +105,18 @@ public object ShortenReferences { val referenceExpression = userType.getReferenceExpression() if (referenceExpression == null) return false - val target = bindingContext(referenceExpression).get(BindingContext.REFERENCE_TARGET, referenceExpression) + val target = bindingContext(referenceExpression).get(BindingContext.REFERENCE_TARGET, referenceExpression)?.let { desc -> + if (desc is ConstructorDescriptor) desc.getContainingDeclaration() else desc + } if (target == null) return false - // references to nested classes should be shortened when visiting qualifier - if (target.getContainingDeclaration() is ClassDescriptor) return false val typeReference = PsiTreeUtil.getParentOfType(userType, javaClass())!! val scope = resolveSession.resolveToElement(typeReference).get(BindingContext.TYPE_RESOLUTION_SCOPE, typeReference)!! val name = target.getName() val targetByName = scope.getClassifier(name) if (targetByName == null) { + if (target.getContainingDeclaration() is ClassDescriptor) return false + addImportIfNeeded(target, file) return true } @@ -147,21 +153,41 @@ public object ShortenReferences { private fun processDotQualifiedExpression(qualifiedExpression: JetDotQualifiedExpression): PsiElement { val selectorExpression = qualifiedExpression.getSelectorExpression() + if (selectorExpression is JetCallExpression) { val calleeExpression = selectorExpression.getCalleeExpression() if (calleeExpression is JetReferenceExpression) { + val bindingContext = bindingContext(calleeExpression) + val targetClass = instantiatedClass(calleeExpression) - if (targetClass != null) { - return shortenIfPossible(qualifiedExpression, targetClass, bindingContext(calleeExpression)) - } + if (targetClass != null) return shortenIfPossibleByDescriptor(qualifiedExpression, targetClass, bindingContext) + + return shortenIfPossible(qualifiedExpression, calleeExpression, bindingContext) } } else if (selectorExpression is JetReferenceExpression) { - val bindingContext = bindingContext(selectorExpression) - val target = bindingContext.get(BindingContext.REFERENCE_TARGET, selectorExpression) - if (target is ClassDescriptor || target is PackageViewDescriptor) { //TODO: should we ever add imports to real packages? - return shortenIfPossible(qualifiedExpression, target, bindingContext) + return shortenIfPossible(qualifiedExpression, selectorExpression, bindingContext(selectorExpression)) + } + + return qualifiedExpression + } + + private fun shortenIfPossible( + qualifiedExpression: JetDotQualifiedExpression, + refExpression: JetReferenceExpression, + bindingContext: BindingContext + ): PsiElement { + val receiverExpression = qualifiedExpression.getReceiverExpression() + val target = bindingContext.get(BindingContext.REFERENCE_TARGET, refExpression) + if (target != null) { + if ((target is JavaPropertyDescriptor || target is JavaMethodDescriptor) && receiverExpression is JetDotQualifiedExpression) { + val containingDescriptor = target.getContainingDeclaration() + if (containingDescriptor is LazyPackageFragmentForJavaClass) { + return shortenIfPossibleByDescriptor(receiverExpression, containingDescriptor.getCorrespondingClass(), bindingContext) + } } + + return shortenIfPossibleByDescriptor(qualifiedExpression, target, bindingContext) } return qualifiedExpression } @@ -194,9 +220,10 @@ public object ShortenReferences { return null } - private fun shortenIfPossible(qualifiedExpression: JetDotQualifiedExpression, targetClassOrPackage: DeclarationDescriptor, bindingContext: BindingContext): PsiElement { - // references to nested classes should be shortened when visiting qualifier - if (targetClassOrPackage.getContainingDeclaration() is ClassDescriptor) return qualifiedExpression + private fun shortenIfPossibleByDescriptor(qualifiedExpression: JetDotQualifiedExpression, targetDescriptor: DeclarationDescriptor, bindingContext: BindingContext): PsiElement { + val isClassMember = targetDescriptor.getContainingDeclaration() is ClassDescriptor + val isUsageInImport = qualifiedExpression.getParentByType(javaClass()) != null + val isClassOrPackage = targetDescriptor is ClassDescriptor || targetDescriptor is PackageViewDescriptor val referenceExpression = referenceExpression(qualifiedExpression.getSelectorExpression())!! val resolveBefore = resolveState(referenceExpression, bindingContext) @@ -214,7 +241,9 @@ public object ShortenReferences { return newExpression.replace(copy) // revert shortening } - addImportIfNeeded(targetClassOrPackage, file) + if (isUsageInImport || isClassMember || !isClassOrPackage) return newExpression.replace(copy) // revert shortening + + addImportIfNeeded(targetDescriptor, file) return newExpression } diff --git a/idea/testData/shortenRefs/constructor/NestedClassWithImport.dependency.java b/idea/testData/shortenRefs/constructor/NestedClassWithImport.dependency.java new file mode 100644 index 00000000000..f3bd9f19951 --- /dev/null +++ b/idea/testData/shortenRefs/constructor/NestedClassWithImport.dependency.java @@ -0,0 +1,7 @@ +class A { + static class B { + static void foo() { + + } + } +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/constructor/NestedClassWithImport.kt b/idea/testData/shortenRefs/constructor/NestedClassWithImport.kt new file mode 100644 index 00000000000..67b2f3b596e --- /dev/null +++ b/idea/testData/shortenRefs/constructor/NestedClassWithImport.kt @@ -0,0 +1,5 @@ +import A.* + +fun bar() { + A.B.foo() +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/constructor/NestedClassWithImport.kt.after b/idea/testData/shortenRefs/constructor/NestedClassWithImport.kt.after new file mode 100644 index 00000000000..c2fa7c879e7 --- /dev/null +++ b/idea/testData/shortenRefs/constructor/NestedClassWithImport.kt.after @@ -0,0 +1,5 @@ +import A.* + +fun bar() { + B.foo() +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/java/innerClassNoImports.dependency.java b/idea/testData/shortenRefs/java/innerClassNoImports.dependency.java new file mode 100644 index 00000000000..25d0970c22e --- /dev/null +++ b/idea/testData/shortenRefs/java/innerClassNoImports.dependency.java @@ -0,0 +1,7 @@ +class A { + public class B { + public B(String s) { + + } + } +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/java/innerClassNoImports.kt b/idea/testData/shortenRefs/java/innerClassNoImports.kt new file mode 100644 index 00000000000..e10f42d9d9e --- /dev/null +++ b/idea/testData/shortenRefs/java/innerClassNoImports.kt @@ -0,0 +1,3 @@ +fun bar(s: String) { + val t: A.B = A().B(s) +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/java/innerClassNoImports.kt.after b/idea/testData/shortenRefs/java/innerClassNoImports.kt.after new file mode 100644 index 00000000000..1a1e8f48fc6 --- /dev/null +++ b/idea/testData/shortenRefs/java/innerClassNoImports.kt.after @@ -0,0 +1,3 @@ +fun bar(s: String) { + val t: A.B = A().B(s) +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/java/innerClassOnDemandImport.dependency.java b/idea/testData/shortenRefs/java/innerClassOnDemandImport.dependency.java new file mode 100644 index 00000000000..25d0970c22e --- /dev/null +++ b/idea/testData/shortenRefs/java/innerClassOnDemandImport.dependency.java @@ -0,0 +1,7 @@ +class A { + public class B { + public B(String s) { + + } + } +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/java/innerClassOnDemandImport.kt b/idea/testData/shortenRefs/java/innerClassOnDemandImport.kt new file mode 100644 index 00000000000..ba491542184 --- /dev/null +++ b/idea/testData/shortenRefs/java/innerClassOnDemandImport.kt @@ -0,0 +1,5 @@ +import A.* + +fun bar(s: String) { + val t: A.B = A().B(s) +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/java/innerClassOnDemandImport.kt.after b/idea/testData/shortenRefs/java/innerClassOnDemandImport.kt.after new file mode 100644 index 00000000000..683839657cd --- /dev/null +++ b/idea/testData/shortenRefs/java/innerClassOnDemandImport.kt.after @@ -0,0 +1,5 @@ +import A.* + +fun bar(s: String) { + val t: B = A().B(s) +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/java/staticClassNoImports.dependency.java b/idea/testData/shortenRefs/java/staticClassNoImports.dependency.java new file mode 100644 index 00000000000..49563f642c9 --- /dev/null +++ b/idea/testData/shortenRefs/java/staticClassNoImports.dependency.java @@ -0,0 +1,7 @@ +class A { + public static class B { + public B(String s) { + + } + } +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/java/staticClassNoImports.kt b/idea/testData/shortenRefs/java/staticClassNoImports.kt new file mode 100644 index 00000000000..89aa9ba3b90 --- /dev/null +++ b/idea/testData/shortenRefs/java/staticClassNoImports.kt @@ -0,0 +1,3 @@ +fun bar(s: String) { + val t: A.B = A.B(s) +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/java/staticClassNoImports.kt.after b/idea/testData/shortenRefs/java/staticClassNoImports.kt.after new file mode 100644 index 00000000000..69866330326 --- /dev/null +++ b/idea/testData/shortenRefs/java/staticClassNoImports.kt.after @@ -0,0 +1,3 @@ +fun bar(s: String) { + val t: A.B = A.B(s) +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/java/staticClassOnDemandImport.dependency.java b/idea/testData/shortenRefs/java/staticClassOnDemandImport.dependency.java new file mode 100644 index 00000000000..49563f642c9 --- /dev/null +++ b/idea/testData/shortenRefs/java/staticClassOnDemandImport.dependency.java @@ -0,0 +1,7 @@ +class A { + public static class B { + public B(String s) { + + } + } +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/java/staticClassOnDemandImport.kt b/idea/testData/shortenRefs/java/staticClassOnDemandImport.kt new file mode 100644 index 00000000000..7460d8b17dc --- /dev/null +++ b/idea/testData/shortenRefs/java/staticClassOnDemandImport.kt @@ -0,0 +1,5 @@ +import A.* + +fun bar(s: String) { + val t: A.B = A.B(s) +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/java/staticClassOnDemandImport.kt.after b/idea/testData/shortenRefs/java/staticClassOnDemandImport.kt.after new file mode 100644 index 00000000000..1637e631472 --- /dev/null +++ b/idea/testData/shortenRefs/java/staticClassOnDemandImport.kt.after @@ -0,0 +1,5 @@ +import A.* + +fun bar(s: String) { + val t: B = B(s) +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/java/staticFieldNoImports.dependency.java b/idea/testData/shortenRefs/java/staticFieldNoImports.dependency.java new file mode 100644 index 00000000000..a2faf6cde21 --- /dev/null +++ b/idea/testData/shortenRefs/java/staticFieldNoImports.dependency.java @@ -0,0 +1,3 @@ +class A { + public static int X = 10; +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/java/staticFieldNoImports.kt b/idea/testData/shortenRefs/java/staticFieldNoImports.kt new file mode 100644 index 00000000000..5c6bdef79b5 --- /dev/null +++ b/idea/testData/shortenRefs/java/staticFieldNoImports.kt @@ -0,0 +1,3 @@ +fun bar() { + A.X = 100 +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/java/staticFieldNoImports.kt.after b/idea/testData/shortenRefs/java/staticFieldNoImports.kt.after new file mode 100644 index 00000000000..d26481a0d51 --- /dev/null +++ b/idea/testData/shortenRefs/java/staticFieldNoImports.kt.after @@ -0,0 +1,3 @@ +fun bar() { + A.X = 100 +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/java/staticFieldOnDemandImport.dependency.java b/idea/testData/shortenRefs/java/staticFieldOnDemandImport.dependency.java new file mode 100644 index 00000000000..a2faf6cde21 --- /dev/null +++ b/idea/testData/shortenRefs/java/staticFieldOnDemandImport.dependency.java @@ -0,0 +1,3 @@ +class A { + public static int X = 10; +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/java/staticFieldOnDemandImport.kt b/idea/testData/shortenRefs/java/staticFieldOnDemandImport.kt new file mode 100644 index 00000000000..de1157026eb --- /dev/null +++ b/idea/testData/shortenRefs/java/staticFieldOnDemandImport.kt @@ -0,0 +1,5 @@ +import A.* + +fun bar() { + A.X = 100 +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/java/staticFieldOnDemandImport.kt.after b/idea/testData/shortenRefs/java/staticFieldOnDemandImport.kt.after new file mode 100644 index 00000000000..405e61723c4 --- /dev/null +++ b/idea/testData/shortenRefs/java/staticFieldOnDemandImport.kt.after @@ -0,0 +1,5 @@ +import A.* + +fun bar() { + X = 100 +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/java/staticMethodNoImports.dependency.java b/idea/testData/shortenRefs/java/staticMethodNoImports.dependency.java new file mode 100644 index 00000000000..e416fab4706 --- /dev/null +++ b/idea/testData/shortenRefs/java/staticMethodNoImports.dependency.java @@ -0,0 +1,5 @@ +class A { + public static void foo(String s) { + + } +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/java/staticMethodNoImports.kt b/idea/testData/shortenRefs/java/staticMethodNoImports.kt new file mode 100644 index 00000000000..7428b5a36a9 --- /dev/null +++ b/idea/testData/shortenRefs/java/staticMethodNoImports.kt @@ -0,0 +1,3 @@ +fun bar(s: String) { + A.foo(s) +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/java/staticMethodNoImports.kt.after b/idea/testData/shortenRefs/java/staticMethodNoImports.kt.after new file mode 100644 index 00000000000..637277334f8 --- /dev/null +++ b/idea/testData/shortenRefs/java/staticMethodNoImports.kt.after @@ -0,0 +1,3 @@ +fun bar(s: String) { + A.foo(s) +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/java/staticMethodOnDemandImport.dependency.java b/idea/testData/shortenRefs/java/staticMethodOnDemandImport.dependency.java new file mode 100644 index 00000000000..e416fab4706 --- /dev/null +++ b/idea/testData/shortenRefs/java/staticMethodOnDemandImport.dependency.java @@ -0,0 +1,5 @@ +class A { + public static void foo(String s) { + + } +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/java/staticMethodOnDemandImport.kt b/idea/testData/shortenRefs/java/staticMethodOnDemandImport.kt new file mode 100644 index 00000000000..5a40f8df442 --- /dev/null +++ b/idea/testData/shortenRefs/java/staticMethodOnDemandImport.kt @@ -0,0 +1,5 @@ +import A.* + +fun bar(s: String) { + A.foo(s) +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/java/staticMethodOnDemandImport.kt.after b/idea/testData/shortenRefs/java/staticMethodOnDemandImport.kt.after new file mode 100644 index 00000000000..ba053a3026d --- /dev/null +++ b/idea/testData/shortenRefs/java/staticMethodOnDemandImport.kt.after @@ -0,0 +1,5 @@ +import A.* + +fun bar(s: String) { + foo(s) +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/type/NestedClassRefInImport.kt b/idea/testData/shortenRefs/type/NestedClassRefInImport.kt new file mode 100644 index 00000000000..3f880241e52 --- /dev/null +++ b/idea/testData/shortenRefs/type/NestedClassRefInImport.kt @@ -0,0 +1 @@ +class A : java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock diff --git a/idea/testData/shortenRefs/type/NestedClassRefInImport.kt.after b/idea/testData/shortenRefs/type/NestedClassRefInImport.kt.after new file mode 100644 index 00000000000..f2d92222f13 --- /dev/null +++ b/idea/testData/shortenRefs/type/NestedClassRefInImport.kt.after @@ -0,0 +1,3 @@ +import java.util.concurrent.locks.ReentrantReadWriteLock + +class A : ReentrantReadWriteLock.WriteLock diff --git a/idea/testData/shortenRefs/type/delegationSpecifier.kt b/idea/testData/shortenRefs/type/delegationSpecifier.kt new file mode 100644 index 00000000000..29508cf4141 --- /dev/null +++ b/idea/testData/shortenRefs/type/delegationSpecifier.kt @@ -0,0 +1,9 @@ +package test + +open class A { + +} + +class B: test.A() { + +} \ No newline at end of file diff --git a/idea/testData/shortenRefs/type/delegationSpecifier.kt.after b/idea/testData/shortenRefs/type/delegationSpecifier.kt.after new file mode 100644 index 00000000000..f786595e6aa --- /dev/null +++ b/idea/testData/shortenRefs/type/delegationSpecifier.kt.after @@ -0,0 +1,9 @@ +package test + +open class A { + +} + +class B: A() { + +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/jet/shortenRefs/AbstractShortenRefsTest.kt b/idea/tests/org/jetbrains/jet/shortenRefs/AbstractShortenRefsTest.kt index 3efb43a91f1..90d0208cdf1 100644 --- a/idea/tests/org/jetbrains/jet/shortenRefs/AbstractShortenRefsTest.kt +++ b/idea/tests/org/jetbrains/jet/shortenRefs/AbstractShortenRefsTest.kt @@ -36,6 +36,10 @@ abstract class AbstractShortenRefsTest : LightCodeInsightFixtureTestCase() { if (File(dependencyPath).exists()) { fixture.configureByFile(dependencyPath) } + val javaDependencyPath = testPath.replace(".kt", ".dependency.java") + if (File(javaDependencyPath).exists()) { + fixture.configureByFile(javaDependencyPath) + } fixture.configureByFile(testPath) diff --git a/idea/tests/org/jetbrains/jet/shortenRefs/ShortenRefsTestGenerated.java b/idea/tests/org/jetbrains/jet/shortenRefs/ShortenRefsTestGenerated.java index 9453331986e..a228c7a80ac 100644 --- a/idea/tests/org/jetbrains/jet/shortenRefs/ShortenRefsTestGenerated.java +++ b/idea/tests/org/jetbrains/jet/shortenRefs/ShortenRefsTestGenerated.java @@ -31,7 +31,7 @@ import org.jetbrains.jet.shortenRefs.AbstractShortenRefsTest; /** This class is generated by {@link org.jetbrains.jet.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") @TestMetadata("idea/testData/shortenRefs") -@InnerTestClasses({ShortenRefsTestGenerated.Constructor.class, ShortenRefsTestGenerated.Type.class}) +@InnerTestClasses({ShortenRefsTestGenerated.Constructor.class, ShortenRefsTestGenerated.Java.class, ShortenRefsTestGenerated.Type.class}) public class ShortenRefsTestGenerated extends AbstractShortenRefsTest { public void testAllFilesPresentInShortenRefs() throws Exception { JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/shortenRefs"), Pattern.compile("^([^\\.]+)\\.kt$"), true); @@ -88,6 +88,11 @@ public class ShortenRefsTestGenerated extends AbstractShortenRefsTest { doTest("idea/testData/shortenRefs/constructor/NestedClass.kt"); } + @TestMetadata("NestedClassWithImport.kt") + public void testNestedClassWithImport() throws Exception { + doTest("idea/testData/shortenRefs/constructor/NestedClassWithImport.kt"); + } + @TestMetadata("NoImportNeeded.kt") public void testNoImportNeeded() throws Exception { doTest("idea/testData/shortenRefs/constructor/NoImportNeeded.kt"); @@ -105,6 +110,54 @@ public class ShortenRefsTestGenerated extends AbstractShortenRefsTest { } + @TestMetadata("idea/testData/shortenRefs/java") + public static class Java extends AbstractShortenRefsTest { + public void testAllFilesPresentInJava() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/shortenRefs/java"), Pattern.compile("^([^\\.]+)\\.kt$"), true); + } + + @TestMetadata("innerClassNoImports.kt") + public void testInnerClassNoImports() throws Exception { + doTest("idea/testData/shortenRefs/java/innerClassNoImports.kt"); + } + + @TestMetadata("innerClassOnDemandImport.kt") + public void testInnerClassOnDemandImport() throws Exception { + doTest("idea/testData/shortenRefs/java/innerClassOnDemandImport.kt"); + } + + @TestMetadata("staticClassNoImports.kt") + public void testStaticClassNoImports() throws Exception { + doTest("idea/testData/shortenRefs/java/staticClassNoImports.kt"); + } + + @TestMetadata("staticClassOnDemandImport.kt") + public void testStaticClassOnDemandImport() throws Exception { + doTest("idea/testData/shortenRefs/java/staticClassOnDemandImport.kt"); + } + + @TestMetadata("staticFieldNoImports.kt") + public void testStaticFieldNoImports() throws Exception { + doTest("idea/testData/shortenRefs/java/staticFieldNoImports.kt"); + } + + @TestMetadata("staticFieldOnDemandImport.kt") + public void testStaticFieldOnDemandImport() throws Exception { + doTest("idea/testData/shortenRefs/java/staticFieldOnDemandImport.kt"); + } + + @TestMetadata("staticMethodNoImports.kt") + public void testStaticMethodNoImports() throws Exception { + doTest("idea/testData/shortenRefs/java/staticMethodNoImports.kt"); + } + + @TestMetadata("staticMethodOnDemandImport.kt") + public void testStaticMethodOnDemandImport() throws Exception { + doTest("idea/testData/shortenRefs/java/staticMethodOnDemandImport.kt"); + } + + } + @TestMetadata("idea/testData/shortenRefs/type") public static class Type extends AbstractShortenRefsTest { public void testAllFilesPresentInType() throws Exception { @@ -116,6 +169,11 @@ public class ShortenRefsTestGenerated extends AbstractShortenRefsTest { doTest("idea/testData/shortenRefs/type/ClassSameNameAsPackage.kt"); } + @TestMetadata("delegationSpecifier.kt") + public void testDelegationSpecifier() throws Exception { + doTest("idea/testData/shortenRefs/type/delegationSpecifier.kt"); + } + @TestMetadata("FunctionType.kt") public void testFunctionType() throws Exception { doTest("idea/testData/shortenRefs/type/FunctionType.kt"); @@ -146,6 +204,11 @@ public class ShortenRefsTestGenerated extends AbstractShortenRefsTest { doTest("idea/testData/shortenRefs/type/NestedClass.kt"); } + @TestMetadata("NestedClassRefInImport.kt") + public void testNestedClassRefInImport() throws Exception { + doTest("idea/testData/shortenRefs/type/NestedClassRefInImport.kt"); + } + @TestMetadata("NoImportNeeded.kt") public void testNoImportNeeded() throws Exception { doTest("idea/testData/shortenRefs/type/NoImportNeeded.kt"); @@ -182,6 +245,7 @@ public class ShortenRefsTestGenerated extends AbstractShortenRefsTest { TestSuite suite = new TestSuite("ShortenRefsTestGenerated"); suite.addTestSuite(ShortenRefsTestGenerated.class); suite.addTestSuite(Constructor.class); + suite.addTestSuite(Java.class); suite.addTestSuite(Type.class); return suite; }