I've been trying to create a tool to perform class/methods/field name migrations for Kotlin files. I have tried using the
kotlin-compiler
package to parse the Kotlin files, perform PSI renaming transformations, and then write the transformed PSI as text. However, when I try to use the PSI
add
and
replace
methods, I get the following error:
Copy code
java.lang.IllegalArgumentException: Missing extension point: com.intellij.treeCopyHandler in area null
Is this the right way of going about this? If it is, how do I resolve this error?
r
raulraja
11/18/2019, 9:07 PM
The CLI compiler uses an immutable PSI tree
raulraja
11/18/2019, 9:08 PM
#arrow-meta works around it using a parallel representation when performing transformations on the AST and recreating the KtFile
f
Fudge
11/18/2019, 10:26 PM
Is it possible I can use this for my own project?
r
raulraja
11/21/2019, 6:34 PM
yes
raulraja
11/21/2019, 6:34 PM
you can copy the internals or rethink your plugin with Arrow Meta if you find it suits your problem.