From e693820fb41cbaff2190bf85ff7694fac0dd0151 Mon Sep 17 00:00:00 2001 From: "Pavel V. Talanov" Date: Mon, 30 Dec 2013 18:15:49 +0400 Subject: [PATCH] Auto-imports for operator calls and infix calls #KT-1613 Fixed #KT-4192 Fixed Enable auto-import fix for "unresolved reference with wrong receiver" diagnostic --- .../jet/lang/psi/JetSimpleNameExpression.java | 3 -- .../jet/plugin/caches/JetShortNamesCache.java | 20 ++++++++-- .../jet/plugin/quickfix/AutoImportFix.java | 10 ++++- .../jet/plugin/quickfix/QuickFixes.java | 1 + .../quickfix/autoImports/divOperator.after.kt | 10 +++++ .../autoImports/divOperator.before.Main.kt | 8 ++++ .../divOperator.before.data.Sample.kt | 3 ++ .../quickfix/autoImports/infixCall.after.kt | 10 +++++ .../autoImports/infixCall.before.Main.kt | 8 ++++ .../infixCall.before.data.Sample.kt | 3 ++ .../autoImports/minusOperator.after.kt | 15 +++++++ .../autoImports/minusOperator.before.Main.kt | 13 ++++++ .../minusOperator.before.data.Sample.kt | 3 ++ .../autoImports/plusOperator.after.kt | 10 +++++ .../autoImports/plusOperator.before.Main.kt | 8 ++++ .../plusOperator.before.data.Sample.kt | 3 ++ .../autoImports/postfixOperator.after.kt | 11 +++++ .../postfixOperator.before.Main.kt | 9 +++++ .../postfixOperator.before.data.Sample.kt | 4 ++ .../quickfix/autoImports/timesAssign.after.kt | 10 +++++ .../autoImports/timesAssign.before.Main.kt | 8 ++++ .../timesAssign.before.data.Sample.kt | 4 ++ .../autoImports/unaryMinusOperator.after.kt | 10 +++++ .../unaryMinusOperator.before.Main.kt | 8 ++++ .../unaryMinusOperator.before.data.Sample.kt | 3 ++ .../autoImports/unaryPlusOperator.after.kt | 14 +++++++ .../unaryPlusOperator.before.Main.kt | 12 ++++++ .../unaryPlusOperator.before.data.Sample.kt | 3 ++ .../QuickFixMultiFileTestGenerated.java | 40 +++++++++++++++++++ 29 files changed, 255 insertions(+), 9 deletions(-) create mode 100644 idea/testData/quickfix/autoImports/divOperator.after.kt create mode 100644 idea/testData/quickfix/autoImports/divOperator.before.Main.kt create mode 100644 idea/testData/quickfix/autoImports/divOperator.before.data.Sample.kt create mode 100644 idea/testData/quickfix/autoImports/infixCall.after.kt create mode 100644 idea/testData/quickfix/autoImports/infixCall.before.Main.kt create mode 100644 idea/testData/quickfix/autoImports/infixCall.before.data.Sample.kt create mode 100644 idea/testData/quickfix/autoImports/minusOperator.after.kt create mode 100644 idea/testData/quickfix/autoImports/minusOperator.before.Main.kt create mode 100644 idea/testData/quickfix/autoImports/minusOperator.before.data.Sample.kt create mode 100644 idea/testData/quickfix/autoImports/plusOperator.after.kt create mode 100644 idea/testData/quickfix/autoImports/plusOperator.before.Main.kt create mode 100644 idea/testData/quickfix/autoImports/plusOperator.before.data.Sample.kt create mode 100644 idea/testData/quickfix/autoImports/postfixOperator.after.kt create mode 100644 idea/testData/quickfix/autoImports/postfixOperator.before.Main.kt create mode 100644 idea/testData/quickfix/autoImports/postfixOperator.before.data.Sample.kt create mode 100644 idea/testData/quickfix/autoImports/timesAssign.after.kt create mode 100644 idea/testData/quickfix/autoImports/timesAssign.before.Main.kt create mode 100644 idea/testData/quickfix/autoImports/timesAssign.before.data.Sample.kt create mode 100644 idea/testData/quickfix/autoImports/unaryMinusOperator.after.kt create mode 100644 idea/testData/quickfix/autoImports/unaryMinusOperator.before.Main.kt create mode 100644 idea/testData/quickfix/autoImports/unaryMinusOperator.before.data.Sample.kt create mode 100644 idea/testData/quickfix/autoImports/unaryPlusOperator.after.kt create mode 100644 idea/testData/quickfix/autoImports/unaryPlusOperator.before.Main.kt create mode 100644 idea/testData/quickfix/autoImports/unaryPlusOperator.before.data.Sample.kt diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetSimpleNameExpression.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetSimpleNameExpression.java index e48f84c6920..ec7d236f7d0 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetSimpleNameExpression.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetSimpleNameExpression.java @@ -18,9 +18,6 @@ package org.jetbrains.jet.lang.psi; import com.intellij.lang.ASTNode; import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiReference; -import com.intellij.psi.PsiReferenceService; -import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry; import com.intellij.psi.tree.IElementType; import com.intellij.psi.tree.TokenSet; import org.jetbrains.annotations.NotNull; diff --git a/idea/src/org/jetbrains/jet/plugin/caches/JetShortNamesCache.java b/idea/src/org/jetbrains/jet/plugin/caches/JetShortNamesCache.java index 8c64c38a008..9bcf4cf1ccd 100644 --- a/idea/src/org/jetbrains/jet/plugin/caches/JetShortNamesCache.java +++ b/idea/src/org/jetbrains/jet/plugin/caches/JetShortNamesCache.java @@ -214,13 +214,13 @@ public class JetShortNamesCache extends PsiShortNamesCache { @NotNull public Collection getTopLevelFunctionDescriptorsByName( - @NotNull final String name, + @NotNull String name, @NotNull JetSimpleNameExpression expression, @NotNull CancelableResolveSession resolveSession, @NotNull GlobalSearchScope scope ) { // name parameter can differ from expression.getReferenceName() when expression contains completion suffix - Name referenceName = expression.getIdentifier() == null ? JetPsiUtil.getConventionName(expression) : Name.identifier(name); + final Name referenceName = expression.getIdentifier() == null ? JetPsiUtil.getConventionName(expression) : Name.identifier(name); if (referenceName == null || referenceName.toString().isEmpty()) { return Collections.emptyList(); } @@ -238,7 +238,7 @@ public class JetShortNamesCache extends PsiShortNamesCache { ContainerUtil.filter(getTopLevelFunctionFqNames(project, scope, false), new Condition() { @Override public boolean value(FqName fqName) { - return fqName.lastSegmentIs(Name.identifier(name)); + return fqName.lastSegmentIs(referenceName); } }); for (FqName fqName : topLevelFunctionFqNames) { @@ -292,7 +292,7 @@ public class JetShortNamesCache extends PsiShortNamesCache { @NotNull GlobalSearchScope searchScope ) { BindingContext context = resolveSession.resolveToElement(expression); - JetExpression receiverExpression = expression.getReceiverExpression(); + JetExpression receiverExpression = getReceiverForExtensionCall(expression); if (receiverExpression == null) { return Collections.emptyList(); @@ -325,6 +325,18 @@ public class JetShortNamesCache extends PsiShortNamesCache { return resultDescriptors; } + @Nullable + private static JetExpression getReceiverForExtensionCall(@NotNull JetSimpleNameExpression expression) { + PsiElement parent = expression.getParent(); + if (parent instanceof JetBinaryExpression && ((JetBinaryExpression) parent).getOperationReference() == expression) { + return ((JetBinaryExpression) parent).getLeft(); + } + else if (parent instanceof JetUnaryExpression && ((JetUnaryExpression) parent).getOperationReference() == expression) { + return ((JetUnaryExpression) parent).getBaseExpression(); + } + return expression.getReceiverExpression(); + } + @NotNull private Set extensionFunctionsFromSourceFqNames( @NotNull Condition acceptedNameCondition, diff --git a/idea/src/org/jetbrains/jet/plugin/quickfix/AutoImportFix.java b/idea/src/org/jetbrains/jet/plugin/quickfix/AutoImportFix.java index a44fee4f8a7..f1fb6bfb243 100644 --- a/idea/src/org/jetbrains/jet/plugin/quickfix/AutoImportFix.java +++ b/idea/src/org/jetbrains/jet/plugin/quickfix/AutoImportFix.java @@ -29,7 +29,6 @@ import com.intellij.openapi.command.CommandProcessor; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Condition; -import com.intellij.openapi.util.text.StringUtil; import com.intellij.psi.PsiClass; import com.intellij.psi.PsiFile; import com.intellij.psi.search.GlobalSearchScope; @@ -48,6 +47,7 @@ import org.jetbrains.jet.lang.resolve.DescriptorUtils; import org.jetbrains.jet.lang.resolve.ImportPath; import org.jetbrains.jet.lang.resolve.lazy.KotlinCodeAnalyzer; import org.jetbrains.jet.lang.resolve.name.FqName; +import org.jetbrains.jet.lang.resolve.name.Name; import org.jetbrains.jet.plugin.JetBundle; import org.jetbrains.jet.plugin.actions.JetAddImportAction; import org.jetbrains.jet.plugin.caches.JetShortNamesCache; @@ -81,8 +81,14 @@ public class AutoImportFix extends JetHintAction implem } String referenceName = element.getReferencedName(); + if (element.getIdentifier() == null) { + Name conventionName = JetPsiUtil.getConventionName(element); + if (conventionName != null) { + referenceName = conventionName.asString(); + } + } - if (!StringUtil.isNotEmpty(referenceName)) { + if (referenceName.isEmpty()) { return Collections.emptyList(); } diff --git a/idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixes.java b/idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixes.java index 2c7dc69ac0a..09b18bf0471 100644 --- a/idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixes.java +++ b/idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixes.java @@ -132,6 +132,7 @@ public class QuickFixes { JetSingleIntentionActionFactory unresolvedReferenceFactory = AutoImportFix.createFactory(); factories.put(UNRESOLVED_REFERENCE, unresolvedReferenceFactory); + factories.put(UNRESOLVED_REFERENCE_WRONG_RECEIVER, unresolvedReferenceFactory); JetSingleIntentionActionFactory removeImportFixFactory = RemovePsiElementSimpleFix.createRemoveImportFactory(); factories.put(USELESS_SIMPLE_IMPORT, removeImportFixFactory); diff --git a/idea/testData/quickfix/autoImports/divOperator.after.kt b/idea/testData/quickfix/autoImports/divOperator.after.kt new file mode 100644 index 00000000000..2f89d418e44 --- /dev/null +++ b/idea/testData/quickfix/autoImports/divOperator.after.kt @@ -0,0 +1,10 @@ +// "Import" "true" +// ERROR: Unresolved reference: / + +import util.div + +trait H + +fun f(h: H) { + h / 3 +} diff --git a/idea/testData/quickfix/autoImports/divOperator.before.Main.kt b/idea/testData/quickfix/autoImports/divOperator.before.Main.kt new file mode 100644 index 00000000000..66c033fcf11 --- /dev/null +++ b/idea/testData/quickfix/autoImports/divOperator.before.Main.kt @@ -0,0 +1,8 @@ +// "Import" "true" +// ERROR: Unresolved reference: / + +trait H + +fun f(h: H) { + h / 3 +} diff --git a/idea/testData/quickfix/autoImports/divOperator.before.data.Sample.kt b/idea/testData/quickfix/autoImports/divOperator.before.data.Sample.kt new file mode 100644 index 00000000000..dad0485091e --- /dev/null +++ b/idea/testData/quickfix/autoImports/divOperator.before.data.Sample.kt @@ -0,0 +1,3 @@ +package util + +fun H.div(i: Int) = 3 \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/infixCall.after.kt b/idea/testData/quickfix/autoImports/infixCall.after.kt new file mode 100644 index 00000000000..90bfb4bdaf0 --- /dev/null +++ b/idea/testData/quickfix/autoImports/infixCall.after.kt @@ -0,0 +1,10 @@ +// "Import" "true" +// ERROR: Unresolved reference: foo + +import util.foo + +trait H + +fun f(h: H) { + h foo h +} \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/infixCall.before.Main.kt b/idea/testData/quickfix/autoImports/infixCall.before.Main.kt new file mode 100644 index 00000000000..02a99243605 --- /dev/null +++ b/idea/testData/quickfix/autoImports/infixCall.before.Main.kt @@ -0,0 +1,8 @@ +// "Import" "true" +// ERROR: Unresolved reference: foo + +trait H + +fun f(h: H) { + h foo h +} \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/infixCall.before.data.Sample.kt b/idea/testData/quickfix/autoImports/infixCall.before.data.Sample.kt new file mode 100644 index 00000000000..a07e13b8e7a --- /dev/null +++ b/idea/testData/quickfix/autoImports/infixCall.before.data.Sample.kt @@ -0,0 +1,3 @@ +package util + +fun H.foo(other: H) = "" \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/minusOperator.after.kt b/idea/testData/quickfix/autoImports/minusOperator.after.kt new file mode 100644 index 00000000000..55f647f430e --- /dev/null +++ b/idea/testData/quickfix/autoImports/minusOperator.after.kt @@ -0,0 +1,15 @@ +// "Import" "true" +// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • internal fun jet.String.minus(str: jet.String): jet.String defined in root package
  • internal fun jet.String.minus(i: java.lang.Integer): jet.String defined in root package
+ +import util.minus + +trait H + +fun f(h: H?) { + h - "other" +} + + +fun String.minus(str: String) = "" + +fun String.minus(i: Integer) = "" \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/minusOperator.before.Main.kt b/idea/testData/quickfix/autoImports/minusOperator.before.Main.kt new file mode 100644 index 00000000000..bc69cfe76aa --- /dev/null +++ b/idea/testData/quickfix/autoImports/minusOperator.before.Main.kt @@ -0,0 +1,13 @@ +// "Import" "true" +// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • internal fun jet.String.minus(str: jet.String): jet.String defined in root package
  • internal fun jet.String.minus(i: java.lang.Integer): jet.String defined in root package
+ +trait H + +fun f(h: H?) { + h - "other" +} + + +fun String.minus(str: String) = "" + +fun String.minus(i: Integer) = "" \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/minusOperator.before.data.Sample.kt b/idea/testData/quickfix/autoImports/minusOperator.before.data.Sample.kt new file mode 100644 index 00000000000..a885949583e --- /dev/null +++ b/idea/testData/quickfix/autoImports/minusOperator.before.data.Sample.kt @@ -0,0 +1,3 @@ +package util + +fun H?.minus(s: String) = "" \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/plusOperator.after.kt b/idea/testData/quickfix/autoImports/plusOperator.after.kt new file mode 100644 index 00000000000..010b6e9720e --- /dev/null +++ b/idea/testData/quickfix/autoImports/plusOperator.after.kt @@ -0,0 +1,10 @@ +// "Import" "true" +// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • public fun jet.String?.plus(other: jet.Any?): jet.String defined in jet
+ +import util.plus + +trait H + +fun f(h: H?) { + h + "other" +} \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/plusOperator.before.Main.kt b/idea/testData/quickfix/autoImports/plusOperator.before.Main.kt new file mode 100644 index 00000000000..d2812f53956 --- /dev/null +++ b/idea/testData/quickfix/autoImports/plusOperator.before.Main.kt @@ -0,0 +1,8 @@ +// "Import" "true" +// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • public fun jet.String?.plus(other: jet.Any?): jet.String defined in jet
+ +trait H + +fun f(h: H?) { + h + "other" +} \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/plusOperator.before.data.Sample.kt b/idea/testData/quickfix/autoImports/plusOperator.before.data.Sample.kt new file mode 100644 index 00000000000..4c575cdd8e2 --- /dev/null +++ b/idea/testData/quickfix/autoImports/plusOperator.before.data.Sample.kt @@ -0,0 +1,3 @@ +package util + +fun H?.plus(s: String) = "" \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/postfixOperator.after.kt b/idea/testData/quickfix/autoImports/postfixOperator.after.kt new file mode 100644 index 00000000000..6aff9e317dd --- /dev/null +++ b/idea/testData/quickfix/autoImports/postfixOperator.after.kt @@ -0,0 +1,11 @@ +// "Import" "true" +// ERROR: Unresolved reference: ++ + +import util.inc + +trait H + +fun f(h: H?) { + var h1 = h + h1++ +} \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/postfixOperator.before.Main.kt b/idea/testData/quickfix/autoImports/postfixOperator.before.Main.kt new file mode 100644 index 00000000000..0b31c90d0d6 --- /dev/null +++ b/idea/testData/quickfix/autoImports/postfixOperator.before.Main.kt @@ -0,0 +1,9 @@ +// "Import" "true" +// ERROR: Unresolved reference: ++ + +trait H + +fun f(h: H?) { + var h1 = h + h1++ +} \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/postfixOperator.before.data.Sample.kt b/idea/testData/quickfix/autoImports/postfixOperator.before.data.Sample.kt new file mode 100644 index 00000000000..71f7baaccb4 --- /dev/null +++ b/idea/testData/quickfix/autoImports/postfixOperator.before.data.Sample.kt @@ -0,0 +1,4 @@ +package util + +fun H.inc(): H { +} \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/timesAssign.after.kt b/idea/testData/quickfix/autoImports/timesAssign.after.kt new file mode 100644 index 00000000000..982cd4ad81c --- /dev/null +++ b/idea/testData/quickfix/autoImports/timesAssign.after.kt @@ -0,0 +1,10 @@ +// "Import" "true" +// ERROR: Unresolved reference: *= + +import util.timesAssign + +trait H + +fun f(h: H) { + h *= 3 +} diff --git a/idea/testData/quickfix/autoImports/timesAssign.before.Main.kt b/idea/testData/quickfix/autoImports/timesAssign.before.Main.kt new file mode 100644 index 00000000000..ce9d24e23fa --- /dev/null +++ b/idea/testData/quickfix/autoImports/timesAssign.before.Main.kt @@ -0,0 +1,8 @@ +// "Import" "true" +// ERROR: Unresolved reference: *= + +trait H + +fun f(h: H) { + h *= 3 +} diff --git a/idea/testData/quickfix/autoImports/timesAssign.before.data.Sample.kt b/idea/testData/quickfix/autoImports/timesAssign.before.data.Sample.kt new file mode 100644 index 00000000000..601c7802d9b --- /dev/null +++ b/idea/testData/quickfix/autoImports/timesAssign.before.data.Sample.kt @@ -0,0 +1,4 @@ +package util + +fun H.div(i: Int) = 3 +fun H.timesAssign(i: Int) {} \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/unaryMinusOperator.after.kt b/idea/testData/quickfix/autoImports/unaryMinusOperator.after.kt new file mode 100644 index 00000000000..195999026d0 --- /dev/null +++ b/idea/testData/quickfix/autoImports/unaryMinusOperator.after.kt @@ -0,0 +1,10 @@ +// "Import" "true" +// ERROR: Unresolved reference: - + +import util.minus + +trait H + +fun f(h: H?) { + -h +} \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/unaryMinusOperator.before.Main.kt b/idea/testData/quickfix/autoImports/unaryMinusOperator.before.Main.kt new file mode 100644 index 00000000000..74b574ae1dc --- /dev/null +++ b/idea/testData/quickfix/autoImports/unaryMinusOperator.before.Main.kt @@ -0,0 +1,8 @@ +// "Import" "true" +// ERROR: Unresolved reference: - + +trait H + +fun f(h: H?) { + -h +} \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/unaryMinusOperator.before.data.Sample.kt b/idea/testData/quickfix/autoImports/unaryMinusOperator.before.data.Sample.kt new file mode 100644 index 00000000000..818830a1541 --- /dev/null +++ b/idea/testData/quickfix/autoImports/unaryMinusOperator.before.data.Sample.kt @@ -0,0 +1,3 @@ +package util + +fun H?.minus() = "" \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/unaryPlusOperator.after.kt b/idea/testData/quickfix/autoImports/unaryPlusOperator.after.kt new file mode 100644 index 00000000000..d7e09f592d7 --- /dev/null +++ b/idea/testData/quickfix/autoImports/unaryPlusOperator.after.kt @@ -0,0 +1,14 @@ +// "Import" "true" +// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • internal fun A.plus(): jet.Int defined in root package
  • public fun jet.String?.plus(other: jet.Any?): jet.String defined in jet
+ +import util.plus + +trait H + +fun f(h: H?) { + +h +} + +class A() + +fun A.plus(): Int = 3 \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/unaryPlusOperator.before.Main.kt b/idea/testData/quickfix/autoImports/unaryPlusOperator.before.Main.kt new file mode 100644 index 00000000000..67f41c87e1b --- /dev/null +++ b/idea/testData/quickfix/autoImports/unaryPlusOperator.before.Main.kt @@ -0,0 +1,12 @@ +// "Import" "true" +// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • internal fun A.plus(): jet.Int defined in root package
  • public fun jet.String?.plus(other: jet.Any?): jet.String defined in jet
+ +trait H + +fun f(h: H?) { + +h +} + +class A() + +fun A.plus(): Int = 3 \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/unaryPlusOperator.before.data.Sample.kt b/idea/testData/quickfix/autoImports/unaryPlusOperator.before.data.Sample.kt new file mode 100644 index 00000000000..fdc33392a43 --- /dev/null +++ b/idea/testData/quickfix/autoImports/unaryPlusOperator.before.data.Sample.kt @@ -0,0 +1,3 @@ +package util + +fun H.plus() = "" \ No newline at end of file diff --git a/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixMultiFileTestGenerated.java b/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixMultiFileTestGenerated.java index 7e8db21ee88..d616797b404 100644 --- a/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixMultiFileTestGenerated.java +++ b/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixMultiFileTestGenerated.java @@ -62,6 +62,11 @@ public class QuickFixMultiFileTestGenerated extends AbstractQuickFixMultiFileTes doTestWithExtraFile("idea/testData/quickfix/autoImports/classImport.before.Main.kt"); } + @TestMetadata("divOperator.before.Main.kt") + public void testDivOperator() throws Exception { + doTestWithExtraFile("idea/testData/quickfix/autoImports/divOperator.before.Main.kt"); + } + @TestMetadata("extensionFunctionImport.before.Main.kt") public void testExtensionFunctionImport() throws Exception { doTestWithExtraFile("idea/testData/quickfix/autoImports/extensionFunctionImport.before.Main.kt"); @@ -87,6 +92,16 @@ public class QuickFixMultiFileTestGenerated extends AbstractQuickFixMultiFileTes doTestWithExtraFile("idea/testData/quickfix/autoImports/importTrait.before.Main.kt"); } + @TestMetadata("infixCall.before.Main.kt") + public void testInfixCall() throws Exception { + doTestWithExtraFile("idea/testData/quickfix/autoImports/infixCall.before.Main.kt"); + } + + @TestMetadata("minusOperator.before.Main.kt") + public void testMinusOperator() throws Exception { + doTestWithExtraFile("idea/testData/quickfix/autoImports/minusOperator.before.Main.kt"); + } + @TestMetadata("noImportForFunInQualifiedNotFirst.before.Main.kt") public void testNoImportForFunInQualifiedNotFirst() throws Exception { doTestWithExtraFile("idea/testData/quickfix/autoImports/noImportForFunInQualifiedNotFirst.before.Main.kt"); @@ -127,6 +142,31 @@ public class QuickFixMultiFileTestGenerated extends AbstractQuickFixMultiFileTes doTestWithExtraFile("idea/testData/quickfix/autoImports/packageClass.before.Main.kt"); } + @TestMetadata("plusOperator.before.Main.kt") + public void testPlusOperator() throws Exception { + doTestWithExtraFile("idea/testData/quickfix/autoImports/plusOperator.before.Main.kt"); + } + + @TestMetadata("postfixOperator.before.Main.kt") + public void testPostfixOperator() throws Exception { + doTestWithExtraFile("idea/testData/quickfix/autoImports/postfixOperator.before.Main.kt"); + } + + @TestMetadata("timesAssign.before.Main.kt") + public void testTimesAssign() throws Exception { + doTestWithExtraFile("idea/testData/quickfix/autoImports/timesAssign.before.Main.kt"); + } + + @TestMetadata("unaryMinusOperator.before.Main.kt") + public void testUnaryMinusOperator() throws Exception { + doTestWithExtraFile("idea/testData/quickfix/autoImports/unaryMinusOperator.before.Main.kt"); + } + + @TestMetadata("unaryPlusOperator.before.Main.kt") + public void testUnaryPlusOperator() throws Exception { + doTestWithExtraFile("idea/testData/quickfix/autoImports/unaryPlusOperator.before.Main.kt"); + } + } @TestMetadata("idea/testData/quickfix/createFromUsage")