rename JetClass.isTrait() to isInterface(); rename ClassKind.TRAIT to INTERACE

This commit is contained in:
Dmitry Jemerov
2015-04-27 14:04:19 +02:00
parent ee60ce8369
commit cce1be3892
62 changed files with 95 additions and 96 deletions
@@ -82,7 +82,7 @@ class AllClassesCompletion(val parameters: CompletionParameters,
if (psiClass!! !is KotlinLightClass) { // Kotlin class should have already been added as kotlin element before
val kind = when {
psiClass.isAnnotationType() -> ClassKind.ANNOTATION_CLASS
psiClass.isInterface() -> ClassKind.TRAIT
psiClass.isInterface() -> ClassKind.INTERFACE
psiClass.isEnum() -> ClassKind.ENUM_CLASS
else -> ClassKind.CLASS
}
@@ -153,7 +153,7 @@ class TypeInstantiationItems(
val insertHandler: InsertHandler<LookupElement>
val typeText = IdeDescriptorRenderers.SOURCE_CODE.renderClassifierName(classifier) + IdeDescriptorRenderers.SOURCE_CODE.renderTypeArguments(typeArgsToUse)
if (isAbstract) {
val constructorParenthesis = if (classifier.getKind() != ClassKind.TRAIT) "()" else ""
val constructorParenthesis = if (classifier.getKind() != ClassKind.INTERFACE) "()" else ""
itemText += constructorParenthesis
itemText = "object: " + itemText + "{...}"
lookupString = "object"
@@ -242,7 +242,7 @@ class TypeInstantiationItems(
}
private fun addSamConstructorItem(collection: MutableCollection<LookupElement>, `class`: ClassDescriptor, tail: Tail?) {
if (`class`.getKind() == ClassKind.TRAIT) {
if (`class`.getKind() == ClassKind.INTERFACE) {
val container = `class`.getContainingDeclaration()
val scope = when (container) {
is PackageFragmentDescriptor -> container.getMemberScope()