Hey guys, I'm writing a compiler plugin for fun and I'm generating additional functions in a class. Is there any way to include (in bytecode) generated things in for example the ide (intellij) completion? I mean without writing a custom intellij plugin? I want the ide to use the build for class compilation and the compilation output for Code completion somehow O:-)
➕ 3
r
raulraja
06/12/2019, 1:16 PM
Same issue here, @AdrianRaFo is helping us investigate
h
Hanno
06/12/2019, 7:46 PM
Has sth similar been done before? I mean using class files (probably from the build) for completion info in intellij?
i
Ilmir Usmanov [JB]
06/13/2019, 2:37 PM
Well, I did something like this before. Short answer is: "AFAIK, there is no way to extend scopes without creating another extension point in the compiler itself". Current support is limited for SamWithReceiver's needs.
And this is how I wanted to do this: https://github.com/JetBrains/kotlin/compare/rr/androidCompatCompilerPlugin
Unfortunately, the changes have not been merged.
h
Hanno
06/13/2019, 7:37 PM
Wow, now that's a lot of code! Very impressive. Looks like it is the missing link, although i just understand half of the code. Why is this Not merged and open since 2017? At least the extension point for scope additions for synthetic stuff should be accepted, this would open so many possibilities
s
sandwwraith
06/14/2019, 12:07 PM
You should add such synthesised declarations to compiler's descriptors. Take a look at
SyntheticResolveExtension
and classes implementing it, it may help
☝️ 2
h
Hanno
06/16/2019, 12:53 PM
Thanks, will take a look at it soon!
Hanno
06/17/2019, 4:12 PM
As soon as i implement generateSyntheticMethods (tbp as soon as i add things to result), my example project throws gc overhead error 🤔🤔