I have another question, about code generation. -...
# k2-adopters
j
I have another question, about code generation. • With KSP, you can only create new top-level declarations, and it happens only on compilation. • With K2, you can alter the IR to add/remove/edit all declarations. If I create a new declaration inside a K2 plugin compiler, would it be available for IntelliJ's autocompletion without triggering any compilation?
j
I doubt this info will be available for IJ even after compilation, as your sources will not be altered, only the compiled bytecode will. You will need your own IJ plugin to support this stuff.
j
OK, I was wondering if the altered IR was given back to IntelliJ for further analysis.
nono 1
j
You need to use FIR for that
j
Oh! So it is possible?
j
Not with only IR, first you need to add those new members with FIR, later fill the body of those new members in IR
j
that would be perfect 🙂
j
And FIR is not still stable and usable on normal IDEs, you need to compile IDEA in order to try it and so on.
But if your project is not for right now, then give it a try
j
wow, I was not ready for that haha which version of IntelliJ do you have to compile? Is there a dedicated branch?
I know documentation is scarce ATM, but do you have any resources to provide?
j
master branch running the k2 configuration
There are messages about this in the #compiler channel
j
perfect
thank you so much 🙇‍♂️
🤟 1
(and yes, at the moment I'm only looking to experiment things)
j
if you don’t need to check results in the IDE, you can use the test framework as it is an easier setup
j
interesting, thanks