New J2K: Use IDEA analyzers on kotlin properties & functions
This commit is contained in:
committed by
Ilya Kirillov
parent
cc2f27f9cd
commit
ad58772453
@@ -27,7 +27,9 @@ class FieldToPropertyConversion : RecursiveApplicableConversionBase() {
|
||||
element.visibility,
|
||||
Modality.FINAL,
|
||||
mutability
|
||||
)
|
||||
).also {
|
||||
it.psi = element.psi
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
+4
-1
@@ -22,6 +22,7 @@ import org.jetbrains.kotlin.j2k.throwAnnotation
|
||||
import org.jetbrains.kotlin.j2k.tree.*
|
||||
import org.jetbrains.kotlin.j2k.tree.impl.JKKtFunctionImpl
|
||||
import org.jetbrains.kotlin.j2k.tree.impl.JKTypeElementImpl
|
||||
import org.jetbrains.kotlin.j2k.tree.impl.psi
|
||||
|
||||
class JavaMethodToKotlinFunctionConversion(private val context: ConversionContext) : TransformerBasedConversion() {
|
||||
override fun visitTreeElement(element: JKTreeElement) {
|
||||
@@ -57,7 +58,9 @@ class JavaMethodToKotlinFunctionConversion(private val context: ConversionContex
|
||||
declaration.extraModifiers,
|
||||
declaration.visibility,
|
||||
declaration.modality
|
||||
)
|
||||
).also {
|
||||
it.psi = declaration.psi
|
||||
}
|
||||
} else {
|
||||
declaration
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ class JKKtPropertyImpl(
|
||||
override var visibility: Visibility,
|
||||
override var modality: Modality,
|
||||
override var mutability: Mutability
|
||||
) : JKBranchElementBase(), JKKtProperty {
|
||||
) : JKBranchElementBase(), JKKtProperty, PsiOwner by PsiOwnerImpl() {
|
||||
override fun <R, D> accept(visitor: JKVisitor<R, D>, data: D): R = visitor.visitKtProperty(this, data)
|
||||
|
||||
override var annotationList: JKAnnotationList by child(annotationList)
|
||||
@@ -57,7 +57,7 @@ class JKKtFunctionImpl(
|
||||
override var extraModifiers: List<ExtraModifier>,
|
||||
override var visibility: Visibility,
|
||||
override var modality: Modality
|
||||
) : JKBranchElementBase(), JKKtFunction {
|
||||
) : JKBranchElementBase(), JKKtFunction, PsiOwner by PsiOwnerImpl() {
|
||||
override fun <R, D> accept(visitor: JKVisitor<R, D>, data: D): R = visitor.visitKtFunction(this, data)
|
||||
|
||||
override var returnType: JKTypeElement by child(returnType)
|
||||
|
||||
@@ -29,14 +29,13 @@ interface JKKtGetterOrSetter : JKTreeElement, JKVisibilityOwner, JKBranchElement
|
||||
|
||||
interface JKKtEmptyGetterOrSetter : JKKtGetterOrSetter
|
||||
|
||||
interface JKKtProperty : JKField {
|
||||
interface JKKtProperty : JKField, PsiOwner {
|
||||
var getter: JKKtGetterOrSetter
|
||||
var setter: JKKtGetterOrSetter
|
||||
}
|
||||
|
||||
|
||||
|
||||
interface JKKtFunction : JKMethod {
|
||||
interface JKKtFunction : JKMethod, PsiOwner {
|
||||
}
|
||||
|
||||
interface JKKtConstructor : JKDeclaration, JKExtraModifiersOwner, JKMethod, JKBranchElement {
|
||||
|
||||
Reference in New Issue
Block a user