From 37f25f2ee1325662c606e8d302b03ce7673a9720 Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Wed, 17 Apr 2013 21:21:54 +0400 Subject: [PATCH] KT-2258 Plugin does not suggest to import objects #KT-2258 Fixed --- idea/testData/quickfix/autoImports/objectImport.after.kt | 8 ++++++++ .../quickfix/autoImports/objectImport.before.Main.kt | 6 ++++++ .../autoImports/objectImport.before.data.Sample.kt | 3 +++ .../plugin/quickfix/QuickFixMultiFileTestGenerated.java | 5 +++++ 4 files changed, 22 insertions(+) create mode 100644 idea/testData/quickfix/autoImports/objectImport.after.kt create mode 100644 idea/testData/quickfix/autoImports/objectImport.before.Main.kt create mode 100644 idea/testData/quickfix/autoImports/objectImport.before.data.Sample.kt diff --git a/idea/testData/quickfix/autoImports/objectImport.after.kt b/idea/testData/quickfix/autoImports/objectImport.after.kt new file mode 100644 index 00000000000..13729948866 --- /dev/null +++ b/idea/testData/quickfix/autoImports/objectImport.after.kt @@ -0,0 +1,8 @@ +// "Import" "true" +// ERROR: Unresolved reference: TestObject + +package ccc + +import bbb.TestObject + +val x = TestObject \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/objectImport.before.Main.kt b/idea/testData/quickfix/autoImports/objectImport.before.Main.kt new file mode 100644 index 00000000000..4dd70c42a45 --- /dev/null +++ b/idea/testData/quickfix/autoImports/objectImport.before.Main.kt @@ -0,0 +1,6 @@ +// "Import" "true" +// ERROR: Unresolved reference: TestObject + +package ccc + +val x = TestObject \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/objectImport.before.data.Sample.kt b/idea/testData/quickfix/autoImports/objectImport.before.data.Sample.kt new file mode 100644 index 00000000000..4b6b4352ac3 --- /dev/null +++ b/idea/testData/quickfix/autoImports/objectImport.before.data.Sample.kt @@ -0,0 +1,3 @@ +package bbb + +object TestObject \ 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 60469ae4551..f9a9c089610 100644 --- a/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixMultiFileTestGenerated.java +++ b/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixMultiFileTestGenerated.java @@ -117,6 +117,11 @@ public class QuickFixMultiFileTestGenerated extends AbstractQuickFixMultiFileTes doTestWithExtraFile("idea/testData/quickfix/autoImports/noImportInSafeQualifiedExpressionNotFirst.before.Main.kt"); } + @TestMetadata("objectImport.before.Main.kt") + public void testObjectImport() throws Exception { + doTestWithExtraFile("idea/testData/quickfix/autoImports/objectImport.before.Main.kt"); + } + @TestMetadata("packageClass.before.Main.kt") public void testPackageClass() throws Exception { doTestWithExtraFile("idea/testData/quickfix/autoImports/packageClass.before.Main.kt");