Suppressed inserting of package import from ImportInsertHelperImpl
This commit is contained in:
@@ -1,7 +1,5 @@
|
|||||||
import java.util
|
|
||||||
|
|
||||||
class SortedSet
|
class SortedSet
|
||||||
|
|
||||||
fun test(set: SortedSet) {
|
fun test(set: SortedSet) {
|
||||||
val a = util.SortedSet<caret>
|
val a = java.util.SortedSet
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,2 @@
|
|||||||
import java.lang.reflect
|
val x : java.lang.reflect.Array
|
||||||
|
|
||||||
val x : reflect.Array<caret>
|
|
||||||
val y: Array<String>
|
val y: Array<String>
|
||||||
@@ -121,9 +121,6 @@ public class ImportInsertHelperImpl(private val project: Project) : ImportInsert
|
|||||||
val classifier = topLevelScope.getClassifier(name, NoLookupLocation.FROM_IDE)
|
val classifier = topLevelScope.getClassifier(name, NoLookupLocation.FROM_IDE)
|
||||||
if (classifier?.importableFqName == targetFqName) return ImportDescriptorResult.ALREADY_IMPORTED
|
if (classifier?.importableFqName == targetFqName) return ImportDescriptorResult.ALREADY_IMPORTED
|
||||||
}
|
}
|
||||||
is PackageViewDescriptor -> {
|
|
||||||
if (topLevelScope.getPackage(name)?.importableFqName == targetFqName) return ImportDescriptorResult.ALREADY_IMPORTED
|
|
||||||
}
|
|
||||||
is FunctionDescriptor -> {
|
is FunctionDescriptor -> {
|
||||||
val functions = topLevelScope.getFunctions(name, NoLookupLocation.FROM_IDE)
|
val functions = topLevelScope.getFunctions(name, NoLookupLocation.FROM_IDE)
|
||||||
if (functions.map { it.importableFqName }.contains(targetFqName)) return ImportDescriptorResult.ALREADY_IMPORTED
|
if (functions.map { it.importableFqName }.contains(targetFqName)) return ImportDescriptorResult.ALREADY_IMPORTED
|
||||||
@@ -132,6 +129,12 @@ public class ImportInsertHelperImpl(private val project: Project) : ImportInsert
|
|||||||
val properties = topLevelScope.getProperties(name, NoLookupLocation.FROM_IDE)
|
val properties = topLevelScope.getProperties(name, NoLookupLocation.FROM_IDE)
|
||||||
if (properties.map { it.importableFqName }.contains(targetFqName)) return ImportDescriptorResult.ALREADY_IMPORTED
|
if (properties.map { it.importableFqName }.contains(targetFqName)) return ImportDescriptorResult.ALREADY_IMPORTED
|
||||||
}
|
}
|
||||||
|
// todo change this after adding special syntax for package import
|
||||||
|
// now impossible import package
|
||||||
|
//
|
||||||
|
// is PackageViewDescriptor -> {
|
||||||
|
// if (topLevelScope.getPackage(name)?.importableFqName == targetFqName) return ImportDescriptorResult.ALREADY_IMPORTED
|
||||||
|
// }
|
||||||
else -> {
|
else -> {
|
||||||
return ImportDescriptorResult.FAIL
|
return ImportDescriptorResult.FAIL
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user