https://kotlinlang.org logo
r

raulraja

06/24/2019, 12:01 AM
Seems like any calls to
replace
or
astReplace
in any psi element fails with similar errors. Is there a way with compiler plugins to modify the PsiElements to make adjustments and replacements before it goes into type checking and generation?
a

amanda.hinchman-dominguez

06/25/2019, 5:27 PM
What does your setup look like for the KotlinCoreEnvironment?
I don’t know if you can expect the java environment to look for PSI since that’s a Kotlin strict thing
r

raulraja

06/25/2019, 7:52 PM
Hi Amanda, I’m not touching that and supposedly it’s whatever compiler plugins get by default so I’m not in the context of an IDEA plugin. Though I figured out a better way to contribute the descriptor in the SyntheticResolver via generateSyntheticClasses for the package fragment round
this spot allows me to contribute descriptors before they are considered for resolution so I can wrap existing ones and override the bits I’m not interested as generated
And for the last resort there is always java reflection to hijack private fields wherever needed
5 Views