How to deal with two packages of classes from import com.intellij.psi.* vs import org.jetbrains.kotlin.com.intellij.psi.*

Planned

Background: I am trying to create my own version of kotlin-android-extensions's compiler plugin and intelliJ-plugin in the same way how it is originally created. 

When I run my kotlin-android-extension compiler plugin it gives an error when invoking any Psi related apis because there are 2 different packages psi apis

1. com.intellij.psi.*
2.  import org.jetbrains.kotlin.com.intellij.psi.*

So the my-kotlin-compiler-plugin is  invoking all apis from org.jetbrains.kotlin.com.intellij.psi.* which is fine (maybe not), but this apis api is from kotlin-embeddable library but in original kotlin-compiler plugin the psi apis used is from this package: com.intellij.psi. 

Now even though I try to use kotlin compiler library and remove kotlin-embeddable, then it still invokes psi apis from  this package org.jetbrains.kotlin.com.intellij.psi.*. So to make things work I have to use kotlin-embeddable library and replace all psi apis from org.jetbrains.kotlin.com.intellij.psi.*. to com.intellij.psi.*

Now, I am able to compile my android code successfully (means synthetic code are getting converted into right binary code even with using org.jetbrains.kotlin.com.intellij.psi.* apis

Problem statement: 
Now when I am trying to build the kotlin-android-extensions-intellij-plugin, it uses com.intellij.psi apis internally. This is where I am stuck now, the kotlin-android-extensions-intellij-plugin depends on its  kotlin-android-extensions's compiler plugin but the kotlin-android-extensions-intellij-plugin uses psi apis from com.intellij.psi.*. So these 2 libraries are not able to communicate. 

Please guide

0

Please sign in to leave a comment.