I’m writing a plugin and trying to resolve the target of a Kotlin function call in IntelliJ and have a reference to a KtCallExpression
which seems like a good start. However examining other places in IntelliJ platform code it looks like I need to get a BindingContext
to be able to resolve the target.
Looks like I can use the KtElement.safeAnalyzeNonSourceRootCode
extension function but I’m stuck trying to get access to this from my code – I can’t find anywhere the dependency I need to add to my plugin project to be able to access the package org.jetbrains.kotlin.idea.caches
.
I’m using the Plugin gradle template from GitHub.
What do I need to add to my build file to move forward? Or is there any better route to finding the call target?