We added the support for running test with coverage in our Buck plugin in IntelliJ called ideabuck. It's basically running a test with generation of coverage report and display it in IDE. We added our coverage runner, coverage program runner, coverage suite, coverage engine, coverage annotator, coverage project view class decorator and coverage enabled configuration. Every time we run a test with coverage, an entry of <component name="com.intellij.coverage.CoverageDataManagerImpl"> is added to workspace.xml. Then if we index the project again, it says this component <component name="com.intellij.coverage.CoverageDataManagerImpl"> is changed externally and isn't reloadable and asks us to reload the project, as illustrated in the attached screenshot. Otherwise indexing won't go through. The reason this window is popped up is that in the class com.intellij.configurationStore.StoreReloadManagerImpl.reloadStore, com.intellij.configurationStore.ComponentStoreImpl.isNotReloadable determines "com.intellij.coverage.CoverageDataManagerImpl" to be not reloadable, because the class CoverageDataManagerImpl doesn't implement PersistenStateComponent interface.
I also tried to run a test with coverage in IntelliJ with Jacoco or IDEA test coverage runner. I found exactly the same thing was added to workspace.xml, except we used our customized coverage runner. I don't know if this matters. Theoretically, if I reindex the project, then it should reload those components again. But in fact, after I invalidated the cache and restart the IDE, it didn't enter the block of code for reloading the project. Looks like it doesn't reload components when restarted.
My question is in what cases does the method of reloading components get called? Any suggestions about how can we avoid running into the failure of reloading components that are not reloadable? Can we just not write those components into workspace.xml?
Any assistance would be greatly appreciated!