Supported excluded packages/classes in auto-import quick fix.

#KT-2413 in progress
This commit is contained in:
Evgeny Gerashchenko
2015-07-06 23:01:57 +03:00
parent 2a0817a4d1
commit 5c56bc455e
13 changed files with 89 additions and 1 deletions
@@ -16,6 +16,7 @@
package org.jetbrains.kotlin.idea.core
import com.intellij.codeInsight.CodeInsightSettings
import com.intellij.openapi.project.Project
import com.intellij.psi.search.GlobalSearchScope
import com.intellij.psi.stubs.StringStubIndexExtension
@@ -198,3 +199,10 @@ public class KotlinIndicesHelper(
.filter { it.getExtensionReceiverParameter() == null }
}
}
public fun isInExcludedPackage(descriptor: DeclarationDescriptor): Boolean {
val fqName = DescriptorUtils.getFqName(descriptor).asString()
return CodeInsightSettings.getInstance().EXCLUDED_PACKAGES
.any { excluded -> fqName == excluded || fqName.startsWith(excluded + ".") }
}