ast icon indicating copy to clipboard operation
ast copied to clipboard

Properties from companion object are not parsed as KlassDeclaration instances

Open mbolotov opened this issue 4 years ago • 1 comments

Given the following code:


class MyClass {
    val myClassProp = "myClassProp"
    companion object {
        const val myCompanionConst = "myCompanionConst"
        val myCompanionProp = "myCompanionProp"
    }
}

the parser returns myConst and myClassProp as a KlassDeclaration instances, but the myCompanionProp is parsed as a tree of DefaultAstNode/DefaultAstTerminal which are hard to analyze: image

Is this the expected behavior?

mbolotov avatar May 11 '21 16:05 mbolotov

Hi @mbolotov,

thank you for reporting! The recursive tree parsing call for companion objects was missing, it should be working now.

Please try version 6e557bc3ba

drieks avatar May 11 '21 20:05 drieks