How to perform analysis based on the entire project or module in K2 mode?

The k2 mode of the Kotlin plugin seems to focus on analyzing single files.
So how do we perform analysis based on the entire project?
For example, how do we find all methods or classes annotated with a specific annotation, or all sub-interfaces or implementations of a specific interface within the entire project?

Hi! There are helper functions to find all inheritors `org.jetbrains.kotlin.idea.searching.inheritors.KotlinSearchUtilKt#findAllInheritors(org.jetbrains.kotlin.psi.KtClass, com.intellij.psi.search.SearchScope)`, to find all annotated declarations you can use org.jetbrains.kotlin.idea.stubindex.KotlinAnnotationsIndex directly.

Here there is no big difference to the k1 plugin actually