Hi there :wave: Likely noob question here but I ma...
# arrow-meta
t
Hi there đź‘‹ Likely noob question here but I managed to built a compiler plugin that generates code and when I run it, it behaves as expected; however, IntelliJ highlights the injected code as an
Unresolved reference
. Is that normal and if so, how does one go about fixing these reference errors? I am using
Transform.replace(..)
To be specific in case it is needed, my plugin generates a companion object for abstract classes annotated with
@TableName
and creates the same named properties in the companion object with the value being what is passed inside the
@ColumnName
annotation. The code runs fine but IntelliJ highlights it as an error:
r
Hi @Tatum Alenko Yes, this is the problem why we have not pushed and used arrow meta more extensively. Compiler plugins that are not built by JB and that are not bundled alongside the Kotlin plugin won’t be properly highlighted in IDEA which makes compiler plugins that depend on tree mutation useless until the Kotlin IDEA plugin properly supports compiler plugins. We hope around 1.7 this is addressed and the IDEA plugin is able to recognise new expansions provided by compiler plugin apis.
In the meantime you will have better results if you generate new sources and don’t depend on companions or expansion of members in the same files the original code is.
t
Makes sense! Thank you!