segunfamisa
09/06/2025, 12:10 PMkt file/code, such that the rest of the content remains the same, and only specific mutations that I want to add get processed.
I want to update the code in-place, as a form of auto-correction, I would like this to happen using the Psi visitor.
I have tried using compiler embeddable & a PsiFactory to create an expression, and then call expression.replace(). in my visit*() function.
The code breaks in runtime with:
Missing extension point: org.jetbrains.kotlin.com.intellij.treeCopyHandler in container {}
I've seen comments about that error, and the seem to imply that the PSI tree is immutable, so I can't modify it (perhaps because I'm not in the IDE context).
My ideal case would be to run this piece of code, define the mutation I want to apply, and a target kotlin file, and it modifies the file in-place.
--
Is there any advise on how to approach this?segunfamisa
09/07/2025, 3:44 PM