Is this the best place to get started making a plu...
# arrow-meta
p
Is this the best place to get started making a plugin? https://github.com/arrow-kt/arrow-meta-examples
r
Yep that is the basic hello world but depending of what you are trying to build you may have other options.
Some plugins can be built just in codegen with IR and some others may require low level apis meta like the meta compiler dsl
But many can be built with just quotes
p
I was getting around to converting this https://github.com/pardom/purity
r
We are building purity checks in meta that transitively check functions in the local module do not perform effects but they are not annotated with '@Pure'. Not sure if you are interested in joining efforts or rather keep this separate. In whatever case what you have can be done either in quotes with PSI similar to what you have or if you wanted type information for checking the call resolved types to ensure none return unit you can do that on analysisCompleted
👍 1
We are interested in this design space and we'be happy to help
p
I’ll probably keep exploring the purity plugin because 1) I want to write a meta plugin 😄 and 2) I want to explore the purity validation rules I’m envisioning.
I wouldn’t mind contributing to what you’re doing after learning from that, though.
r
sounds great. I’m interested in learning more about the Validation Rules etc whenever something is there. In the meantime if we can help i any way let us know. If you are gonna have an IDE plugin too some of the checks you won’t be able to use
analysysCompleted
as that is CLI only. In the IDE you can use
resolveToDescriptorIfAny
or similar resolution API’s to get descriptors out of the PSI org.jetbrains.kotlin.idea.caches.resolve.ResolutionUtils#resolveToDescriptorIfAny(org.jetbrains.kotlin.psi.KtNamedFunction, org.jetbrains.kotlin.resolve.lazy.BodyResolveMode)
🙏 1