Hi everybody! I have started writing custom Detekt...
# compiler
e
Hi everybody! I have started writing custom Detekt rules, but I’ve run into some difficulties. Could you please tell me where I can find the documentation for PSI? I need to understand what kind of nodes are visited in the visitXXX functions and how to correctly write some rules for them.
d
The easiest way is to check sources of
KtVisitor
e
To be more specific about my problem, I tried to find occurrences of the
SomeEnum.name
property using
visitDotQualifiedExpression
. I found them, but I need to ensure that the .name expression belongs only to an
Еnum
. I then tried to verify this using:
Copy code
val receiverKotlinTypeInfo: KotlinTypeInfo? =
  bindingContext[BindingContext.EXPRESSION_TYPE_INFO, receiverExpression]
However, it returns null. I suppose I am doing something wrong at this stage. This is why I need more information about
BindingContext
or other related concepts.
d
I don't know how detect works under the hood, so I can't help here
e
thanks anyway