I'm interested in implementing coverage support for my plugin, but I'm not sure what the best way to proceed is. I've read the mega-thread here: https://intellij-support.jetbrains.com/hc/en-us/community/posts/206103879-Graphical-integration-of-running-tests-in-plugin?page=2, but I'm hoping to avoid implementing everything since my language (Clojure) is a JVM language. I looked at what Kotlin does, and it seems that they only need to register a JavaCoverageEngineExtension. I tried that and have breakpoints in my code and in JavaCoverageEngine, but they're not being hit. My extension is deemed applicable since my run configuration implements CommonJavaRunConfigurationParameters, and for example isSourceMapNeeded() is called.
I suspect that this problem is because Clojure is an unusual JVM language. It's not class-based, although obviously everything compiles to class files in the end. So my files don't implement PsiClassOwner, and my elements don't implement PsiClass. The names of the classes are also not deterministic from a particular source file, so I can't figure out for a particular PsiFile what the classes that will be produced are. It seems like the Java coverage stuff is all built around these assumptions. Many Clojure projects include code in Java or other JVM languages, so I'd like a coverage run to be able to annotate coverage from both Clojure and e.g. Java, so I don't want to reimplement all the coverage infrastructure as if it were a totally new language. Is there a way I can integrate Clojure without doing that?