code cleanup: light-classes module
This commit is contained in:
+1
-1
@@ -97,7 +97,7 @@ public class KotlinCodeBlockModificationListener(modificationTracker: PsiModific
|
|||||||
var child = element.getFirstChild()
|
var child = element.getFirstChild()
|
||||||
while (child != null) {
|
while (child != null) {
|
||||||
if (containsClassesInside(child)) return true
|
if (containsClassesInside(child)) return true
|
||||||
child = child!!.getNextSibling()
|
child = child.getNextSibling()
|
||||||
}
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -20,6 +20,6 @@ import com.intellij.psi.PsiClass;
|
|||||||
import org.jetbrains.kotlin.name.FqName;
|
import org.jetbrains.kotlin.name.FqName;
|
||||||
import org.jetbrains.kotlin.psi.JetClassOrObject
|
import org.jetbrains.kotlin.psi.JetClassOrObject
|
||||||
|
|
||||||
public trait KotlinLightClass : PsiClass, KotlinLightElement<JetClassOrObject, PsiClass> {
|
public interface KotlinLightClass : PsiClass, KotlinLightElement<JetClassOrObject, PsiClass> {
|
||||||
public fun getFqName(): FqName
|
public fun getFqName(): FqName
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ package org.jetbrains.kotlin.asJava
|
|||||||
import org.jetbrains.kotlin.psi.JetDeclaration
|
import org.jetbrains.kotlin.psi.JetDeclaration
|
||||||
import com.intellij.psi.PsiElement
|
import com.intellij.psi.PsiElement
|
||||||
|
|
||||||
public trait KotlinLightElement<T : JetDeclaration, D : PsiElement> {
|
public interface KotlinLightElement<T : JetDeclaration, D : PsiElement> {
|
||||||
public fun getOrigin(): T?
|
public fun getOrigin(): T?
|
||||||
|
|
||||||
public fun getDelegate(): D
|
public fun getDelegate(): D
|
||||||
|
|||||||
@@ -19,4 +19,4 @@ package org.jetbrains.kotlin.asJava
|
|||||||
import com.intellij.psi.PsiMethod
|
import com.intellij.psi.PsiMethod
|
||||||
import org.jetbrains.kotlin.psi.JetDeclaration
|
import org.jetbrains.kotlin.psi.JetDeclaration
|
||||||
|
|
||||||
public trait KotlinLightMethod: PsiMethod, KotlinLightElement<JetDeclaration, PsiMethod>
|
public interface KotlinLightMethod: PsiMethod, KotlinLightElement<JetDeclaration, PsiMethod>
|
||||||
|
|||||||
@@ -22,14 +22,14 @@ import org.jetbrains.kotlin.psi.JetClassOrObject
|
|||||||
import org.jetbrains.kotlin.resolve.diagnostics.Diagnostics
|
import org.jetbrains.kotlin.resolve.diagnostics.Diagnostics
|
||||||
import org.jetbrains.kotlin.name.FqName
|
import org.jetbrains.kotlin.name.FqName
|
||||||
|
|
||||||
trait LightClassData
|
interface LightClassData
|
||||||
|
|
||||||
trait WithFileStubAndExtraDiagnostics {
|
interface WithFileStubAndExtraDiagnostics {
|
||||||
val javaFileStub: PsiJavaFileStub
|
val javaFileStub: PsiJavaFileStub
|
||||||
val extraDiagnostics: Diagnostics
|
val extraDiagnostics: Diagnostics
|
||||||
}
|
}
|
||||||
|
|
||||||
trait LightClassDataForKotlinClass: LightClassData {
|
interface LightClassDataForKotlinClass: LightClassData {
|
||||||
val classOrObject: JetClassOrObject
|
val classOrObject: JetClassOrObject
|
||||||
val descriptor: ClassDescriptor?
|
val descriptor: ClassDescriptor?
|
||||||
val jvmQualifiedName: FqName
|
val jvmQualifiedName: FqName
|
||||||
|
|||||||
@@ -57,10 +57,10 @@ public fun getJvmSignatureDiagnostics(element: PsiElement, otherDiagnostics: Dia
|
|||||||
|
|
||||||
when (parent) {
|
when (parent) {
|
||||||
is JetFile -> {
|
is JetFile -> {
|
||||||
return getDiagnosticsForPackage(parent as JetFile)
|
return getDiagnosticsForPackage(parent)
|
||||||
}
|
}
|
||||||
is JetClassBody -> {
|
is JetClassBody -> {
|
||||||
val parentsParent = parent?.getParent()
|
val parentsParent = parent.getParent()
|
||||||
|
|
||||||
if (parentsParent is JetClassOrObject) {
|
if (parentsParent is JetClassOrObject) {
|
||||||
return getDiagnosticsForClass(parentsParent)
|
return getDiagnosticsForClass(parentsParent)
|
||||||
|
|||||||
Reference in New Issue
Block a user