Supported excluded packages/classes in auto-import quick fix.
#KT-2413 in progress
This commit is contained in:
@@ -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 + ".") }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user