https://kotlinlang.org logo
#intellij-plugins
Title
# intellij-plugins
w

Will Shelor

07/16/2019, 9:04 PM
Hey team! I'm trying to run a command that runs on Kotlin code to identify if a method call is operating on a platform type and display a warning that the developer should consider using null safety. I was having a hard time identifying whether an object was a platform type, so I'm using some code that gets the callee expresion, resolves references, then gets the containing class's language and considers it a platform type if that type is in Java. So, QualifiedExpression -> Receiver -> Expression -> References -> ContainingClass -> Language. I’m using this to try to identify Platform Type. Could any of you think of any better way to get this? It’s my first plugin, so I’m fumbling my way around to try and get this together- wanted some advice from the pros here to see if there was an easier way to get whether the object was platform type or not.