Code coverage not showing properly

Issue #143 on hold
Scott Wells repo owner created an issue

Conveyed from discussion with Craig Pemberton in Facebook:

Craig Pemberton I'm not seeing how to view the code coverage after running unit tests.

Illuminated Cloud Craig, you should just be able to go into Analyze>Show Coverage Data and choose the coverage suite associated with the connection for which you ran tests.

Craig Pemberton This gets me further. I have selected the suite and run tests. Nothing is showing in the gutter. I mainly use Sublime due to the historically poor IDE support for Salesforce and so am coming to IntelliJ without extensive knowledge of the IDE's idiosyncrasies. I imagine the same is true for the majority of Salesforce developers out there. I'm very excited to have a real IDE finally, but am still learning the ins and outs.

Illuminated Cloud This happened to another user in the past few days. Can you look in idea.log (Help>Show Log in Explorer/Finder) and see if there's anything obvious there? Also, simply restarting the IDE solved the problem for the other user (not even close to an ideal solution IMO). I'm wondering if perhaps something changed in the API as part of Winter '16. I'll look into it more. Let me know...

Craig Pemberton I have the following in the log 2015-10-27 15:37:14,505 [90574301] WARN - .intellij.psi.util.ApexPsiUtil - Attempting to add an invalid element as a cache dependency.

Illuminated Cloud Okay. Let's try this. Go into Settings>Illuminated Cloud (<connection-name>) and click the Rebuild button, then allow IntelliJ IDEA to restart. See if it works after that. Certainly something I need to address in there, but let's see if we can get you going properly.

Craig Pemberton For me that option is under File > Product Structure. Rebuilding made aggregate coverage show up (n out of m lines covered (n/m%)) but nothing in the gutter yet. Closer!

Illuminated Cloud You'll only see annotations in the gutter for non-test classes for which Salesforce has coverage data. Do you have any classes that have >0.00% coverage? What do you see in the gutter when you open those in the editor?

Craig Pemberton Yes. Currently the class I am looking at should have ~80% coverage according to the listing of files. Perhaps I have something configured incorrectly with respect to how things are colored or displayed in the cutter.

Illuminated Cloud I doubt that you've misconfigured anything. Let's look in idea.log again and see if there are any errors. The same coverage data that's used to compute those percentages is also used to annotate the lines. I'm surprised that one is working and the other isn't. We might take this into the issue tracker if we don't reach a resolution in the next exchange or two for better tracking.

Comments (40)

  1. Craig Pemberton

    No errors in idea.log, other than the following which seems to be more related to running tests

    2015-10-27 16:14:53,722 [  49737]   WARN - inatedcloud.client.ApexLogUtil - Found old TraceFlags that cannot be updated. Deleting them and creating a new one. 
    
  2. Scott Wells reporter

    Yeah, that's not an error, just a message saying it's resetting one of the Tooling API management objects for capturing log data. Okay, do you mind taking a screen shot of the IDE with the Project View and Coverage View showing as well as the editor window for one of the classes that does show as having coverage? If there's sensitive info that you'd prefer not to expose here in the public issue tracker, you can email me, or if it's too sensitive to send even that way, perhaps you could obscure those parts so that I can see the coverage metrics and gutter area in the editor.

    What I may need to do is add some diagnostic logging to the code that adds the gutter annotation info and provide a test build for you with that so that we can see what's happening internally.

    Let me know how you'd like to proceed.

  3. Craig Pemberton

    blurred.png

    I'm going to have to reprioritize and focus on my commitments today, but would be happy to test a beta version.

  4. Scott Wells reporter

    I totally understand! Work comes first. Let me do some work on my side to get more useful diagnostic info and I'll send you a link to a test build that you can install at your leisure with more logging. That should help us get to whatever is going on here. Thanks for the image!

  5. Scott Wells reporter

    Now that I've released the pending work for 1.6.5.0, let me see if I can instrument this feature with additional debug logging and provide you a test build to help diagnose the issue. More to come in the next day or so.

  6. Scott Wells reporter

    Hi, Craig. The release of IntelliJ IDEA 15 derailed me temporarily as I verified compatibility and addressed one item around how the OST gets generated that had been sitting out there for a while. If you're still evaluating Illuminated Cloud and still having this issue, I'll be happy to put together a test build for you to use to help us understand why it's happening.

  7. Craig Pemberton

    Not evaluating -- our team is starting to adopt Intellij because of your plugin and several of us have licenses.

    I'm looking forward to your test build.

  8. Scott Wells reporter

    Sounds good, Craig. I'll get you a test build with additional logging this afternoon. Based on what comes out that, it's possible I might need to have a screen share with you to see the problem occurring, but let's see what the logging info shows before we jump to that step.

  9. Scott Wells reporter

    Craig, a test build is now available here:

    https://drive.google.com/file/d/0B2eoK6ID4_FeWDEtQjVyTmtvbmc/view?usp=sharing

    It's the exact same build that's available through the plugin repository with the exception of additional logging in the Apex code coverage suite.

    Once you download the archive, you can install it into IntelliJ IDEA using File>Settings>Plugins>Install plugin from disk... After the IDE restart, open Help>Configure Debug Log Settings... and add the following line:

    #com.illuminatedcloud.intellij.coverage.ApexCoverageSuite

    Then run Apex unit tests if necessary to create coverage data in Force.com, and finally show code coverage using Analyze>Show Coverage Data... selecting the suite associated with your connection.

    Your idea.log should now contain information like the following:

    2015-11-11 12:22:14,103 [  18316]  DEBUG - lij.coverage.ApexCoverageSuite - Loading coverage data for connection DF15 
    2015-11-11 12:22:29,643 [  33856]  DEBUG - lij.coverage.ApexCoverageSuite - Querying ApexCodeCoverageAggregate rows using the Tooling API 
    2015-11-11 12:22:30,030 [  34243]  DEBUG - lij.coverage.ApexCoverageSuite - Adding 4 ApexCodeCoverageAggregate rows 
    2015-11-11 12:22:30,031 [  34244]  DEBUG - lij.coverage.ApexCoverageSuite - Processing coverage information for YetAnotherClass 
    2015-11-11 12:22:30,032 [  34245]  DEBUG - lij.coverage.ApexCoverageSuite -   Lines covered = 0; lines uncovered = 0 
    2015-11-11 12:22:30,032 [  34245]  DEBUG - lij.coverage.ApexCoverageSuite - Processing coverage information for ShoppingListMobileViewController 
    2015-11-11 12:22:30,032 [  34245]  DEBUG - lij.coverage.ApexCoverageSuite -   Lines covered = 33; lines uncovered = 0 
    2015-11-11 12:22:30,034 [  34247]  DEBUG - lij.coverage.ApexCoverageSuite -   Covered lines = { 16, 18, 20, 21, 23, 24, 32, 35, 39, 47, 49, 66, 69, 71, 74, 75, 76, 77, 79, 81, 88, 90, 91, 93, 94, 95, 97, 98, 103, 111, 113, 114, 115 } 
    2015-11-11 12:22:30,034 [  34247]  DEBUG - lij.coverage.ApexCoverageSuite - Processing coverage information for ShoppingListMobileListController 
    2015-11-11 12:22:30,034 [  34247]  DEBUG - lij.coverage.ApexCoverageSuite -   Lines covered = 10; lines uncovered = 0 
    2015-11-11 12:22:30,034 [  34247]  DEBUG - lij.coverage.ApexCoverageSuite -   Covered lines = { 12, 14, 15, 26, 28, 35, 37, 38, 40, 42 } 
    2015-11-11 12:22:30,035 [  34248]  DEBUG - lij.coverage.ApexCoverageSuite - Processing coverage information for SomeOtherClass 
    2015-11-11 12:22:30,035 [  34248]  DEBUG - lij.coverage.ApexCoverageSuite -   Lines covered = 0; lines uncovered = 0 
    2015-11-11 12:22:30,035 [  34248]  DEBUG - lij.coverage.ApexCoverageSuite - Total lines covered = 43; total lines uncovered = 0 
    2015-11-11 12:22:30,035 [  34248]  DEBUG - lij.coverage.ApexCoverageSuite - Processing line data for ShoppingListMobileListController 
    2015-11-11 12:22:30,036 [  34249]  DEBUG - lij.coverage.ApexCoverageSuite -   Getting or creating class data 
    2015-11-11 12:22:30,042 [  34255]  DEBUG - lij.coverage.ApexCoverageSuite -   Getting the line count 
    2015-11-11 12:22:30,084 [  34297]  DEBUG - lij.coverage.ApexCoverageSuite -   Line count = 45 
    2015-11-11 12:22:30,085 [  34298]  DEBUG - lij.coverage.ApexCoverageSuite -   Added line data: { 12 covered, 14 covered, 15 covered, 26 covered, 28 covered, 35 covered, 37 covered, 38 covered, 40 covered, 42 covered } 
    2015-11-11 12:22:30,085 [  34298]  DEBUG - lij.coverage.ApexCoverageSuite - Processing line data for ShoppingListMobileViewController 
    2015-11-11 12:22:30,085 [  34298]  DEBUG - lij.coverage.ApexCoverageSuite -   Getting or creating class data 
    2015-11-11 12:22:30,085 [  34298]  DEBUG - lij.coverage.ApexCoverageSuite -   Getting the line count 
    2015-11-11 12:22:30,087 [  34300]  DEBUG - lij.coverage.ApexCoverageSuite -   Line count = 118 
    2015-11-11 12:22:30,088 [  34301]  DEBUG - lij.coverage.ApexCoverageSuite -   Added line data: { 16 covered, 18 covered, 20 covered, 21 covered, 23 covered, 24 covered, 32 covered, 35 covered, 39 covered, 47 covered, 49 covered, 66 covered, 69 covered, 71 covered, 74 covered, 75 covered, 76 covered, 77 covered, 79 covered, 81 covered, 88 covered, 90 covered, 91 covered, 93 covered, 94 covered, 95 covered, 97 covered, 98 covered, 103 covered, 111 covered, 113 covered, 114 covered, 115 covered } 
    

    Please send me that log information and hopefully I can help get to the bottom of this for you.

  10. Scott Wells reporter

    Also, is this happening to others on your team who are using Illuminated Cloud or just you? Trying to find a pattern here if possible...

  11. Craig Pemberton

    Hi Scott! Sorry about the delay. I was busy with sprint ceremonies over the last few work days. I'm sitting down now to install your test build and will let you know what happens.

    Also, is this happening to others on your team who are using Illuminated Cloud or just you?

    Nobody else on my team has tried. I will try on one of their environments if this test build doesn't turn up anything useful.

  12. Craig Pemberton

    I uninstalled IlluminatedCloud and then installed your version from disk. IntelliJ then asked me to update Illuminated cloud from 1.6.5.5-idea14 to 1.6.6.1-idea14 which I ignored. Then I opened an Apex class and edited it to verify that changes were syncing properly to my developer sandbox. I also verified that I could see code coverage correctly through the Salesforce Developer Console.

    I then ran some tests through an IntelliJ run configuration. I then went to Analyze>Show Coverage Data... and selected my test results. I clicked through the dialogs and waited for it to finish processing. Nothing showed up in my tail of idea.log. Nothing appeared in the gutter of my file either.

  13. Scott Wells reporter

    Thanks, Craig. Did you happen to update the debug log settings in IntelliJ IDEA to include the following line?

    #com.illuminatedcloud.intellij.coverage.ApexCoverageSuite

    Without that you won't see any additional diagnostic info. There are more details about how to set things up for logging and what to expect in idea.log about four comments above this one.

  14. Scott Wells reporter

    Oh, and it's completely safe to take the 1.6.6.1 update. I've kept the additional debug logging in the released product.

  15. Craig Pemberton

    This may be interesting. I moved on to other things and IntelliJ locked up with the following appearing in the log

    "AWT-EventQueue-0 14.1.5#IC-141.2735.5, eap:false" prio=0 tid=0x0 nid=0x0 blocked
         java.lang.Thread.State: BLOCKED
     on java.awt.Component$AWTTreeLock@800ba17 owned by "Alarm pool(own)" Id=263
        at java.awt.Component.getLocationOnScreen(Component.java:2021)
        at javax.swing.SwingUtilities.convertPointToScreen(SwingUtilities.java:381)
        at javax.swing.SwingUtilities.convertPoint(SwingUtilities.java:180)
        at javax.swing.SwingUtilities.convertMouseEvent(SwingUtilities.java:304)
        at com.intellij.openapi.ui.ThreeComponentsSplitter$Divider.getTargetEvent(ThreeComponentsSplitter.java:528)
        at com.intellij.openapi.ui.ThreeComponentsSplitter$Divider.access$100(ThreeComponentsSplitter.java:460)
        at com.intellij.openapi.ui.ThreeComponentsSplitter$Divider$MyMouseAdapter._processMouseEvent(ThreeComponentsSplitter.java:511)
        at com.intellij.openapi.ui.ThreeComponentsSplitter$Divider$MyMouseAdapter.mousePressed(ThreeComponentsSplitter.java:476)
        at com.intellij.openapi.wm.impl.IdeGlassPaneImpl.fireMouseEvent(IdeGlassPaneImpl.java:416)
        at com.intellij.openapi.wm.impl.IdeGlassPaneImpl.preprocess(IdeGlassPaneImpl.java:301)
        at com.intellij.openapi.wm.impl.IdeGlassPaneImpl.dispatch(IdeGlassPaneImpl.java:143)
        at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:524)
        at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:382)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
    
    "Alarm pool(own)" prio=0 tid=0x0 nid=0x0 runnable
         java.lang.Thread.State: RUNNABLE
    
        at sun.management.ThreadImpl.dumpThreads0(Native Method)
        at sun.management.ThreadImpl.dumpAllThreads(ThreadImpl.java:446)
        at com.intellij.diagnostic.ThreadDumper.dumpThreadsToFile(ThreadDumper.java:49)
        at com.intellij.diagnostic.ThreadDumper.dumpThreadsToString(ThreadDumper.java:39)
        at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:1030)
        at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:1020)
        at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:1012)
        at com.intellij.openapi.wm.impl.FocusManagerImpl.assertDispatchThread(FocusManagerImpl.java:1195)
        at com.intellij.openapi.wm.impl.FocusManagerImpl.invalidateFocusRequestsQueue(FocusManagerImpl.java:693)
        at com.intellij.openapi.wm.impl.FocusManagerImpl.isFocusTransferReady(FocusManagerImpl.java:684)
        at com.intellij.openapi.wm.impl.FocusManagerImpl.isFocusBeingTransferred(FocusManagerImpl.java:1148)
        at com.intellij.openapi.wm.impl.FocusManagerImpl.getFocusOwner(FocusManagerImpl.java:934)
        at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.getFocusOwner(IdeFocusManagerImpl.java:119)
        at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.isEditorComponentActive(ToolWindowManagerImpl.java:1552)
        at com.intellij.openapi.wm.impl.ToolWindowImpl.isActive(ToolWindowImpl.java:163)
        at com.intellij.openapi.wm.impl.content.BaseLabel.paintComponent(BaseLabel.java:74)
        at com.intellij.openapi.wm.impl.content.ContentTabLabel.paintComponent(ContentTabLabel.java:89)
        at javax.swing.JComponent.paint(JComponent.java:1055)
        at javax.swing.JComponent.paintChildren(JComponent.java:888)
        at com.intellij.openapi.wm.impl.content.ToolWindowContentUi.paintChildren(ToolWindowContentUi.java:216)
        at javax.swing.JComponent.paint(JComponent.java:1064)
        at javax.swing.JComponent.paintChildren(JComponent.java:888)
        at javax.swing.JComponent.paint(JComponent.java:1064)
        at javax.swing.JComponent.paintChildren(JComponent.java:888)
        at com.intellij.openapi.wm.impl.ToolWindowHeader.paintChildren(ToolWindowHeader.java:411)
        at javax.swing.JComponent.paint(JComponent.java:1064)
        at javax.swing.JComponent.paintChildren(JComponent.java:888)
        at javax.swing.JComponent.paint(JComponent.java:1064)
        at javax.swing.JComponent.paintChildren(JComponent.java:888)
        at javax.swing.JComponent.paint(JComponent.java:1064)
        at javax.swing.JComponent.paintChildren(JComponent.java:888)
        at javax.swing.JComponent.paint(JComponent.java:1064)
        at javax.swing.JComponent.paintChildren(JComponent.java:888)
        at javax.swing.JComponent.paint(JComponent.java:1064)
        at javax.swing.JComponent.paintChildren(JComponent.java:888)
        at javax.swing.JComponent.paint(JComponent.java:1064)
        at javax.swing.JLayeredPane.paint(JLayeredPane.java:585)
        at javax.swing.JComponent.paintChildren(JComponent.java:888)
        at com.intellij.openapi.wm.impl.ToolWindowsPane.paintChildren(ToolWindowsPane.java:191)
        at javax.swing.JComponent.paint(JComponent.java:1064)
        at javax.swing.JLayeredPane.paint(JLayeredPane.java:585)
        at javax.swing.JComponent.paintChildren(JComponent.java:888)
        at javax.swing.JComponent.paint(JComponent.java:1064)
        at javax.swing.JComponent.paintChildren(JComponent.java:888)
        at javax.swing.JComponent.paint(JComponent.java:1064)
        at javax.swing.JLayeredPane.paint(JLayeredPane.java:585)
        at javax.swing.JComponent.paintChildren(JComponent.java:888)
        at javax.swing.JComponent.paintToOffscreen(JComponent.java:5239)
        at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1529)
        at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1452)
        at javax.swing.RepaintManager.paint(RepaintManager.java:1249)
        at javax.swing.JComponent.paint(JComponent.java:1041)
        at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:39)
        at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:78)
        at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:115)
        at java.awt.Container.paint(Container.java:1967)
        at java.awt.Window.paint(Window.java:3877)
        at com.intellij.openapi.wm.impl.IdeFrameImpl.paint(IdeFrameImpl.java:510)
        at javax.swing.RepaintManager$3.run(RepaintManager.java:819)
        at javax.swing.RepaintManager$3.run(RepaintManager.java:796)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:796)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:769)
        at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:718)
        at javax.swing.RepaintManager.access$1100(RepaintManager.java:62)
        at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1677)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:745)
        at java.awt.EventQueue.access$300(EventQueue.java:103)
        at java.awt.EventQueue$3.run(EventQueue.java:706)
        at java.awt.EventQueue$3.run(EventQueue.java:704)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:715)
        at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:734)
        at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:569)
        at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:382)
        at com.intellij.ide.IdeEventQueue.pumpEventsForHierarchy(IdeEventQueue.java:818)
        at com.intellij.openapi.progress.util.ProgressWindow.startBlocking(ProgressWindow.java:197)
        at com.intellij.openapi.application.impl.ApplicationImpl.runProcessWithProgressSynchronously(ApplicationImpl.java:633)
        at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:363)
        at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcessWithProgressSynchronously(ProgressManagerImpl.java:76)
        at com.intellij.openapi.progress.impl.CoreProgressManager.run(CoreProgressManager.java:293)
        at com.illuminatedcloud.intellij.coverage.ApexCoverageSuite$1.run(SourceFile:123)
        at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:872)
        at com.illuminatedcloud.intellij.coverage.ApexCoverageSuite.getCoverageData(SourceFile:118)
        at com.intellij.coverage.BaseCoverageSuite.getCoverageData(BaseCoverageSuite.java:213)
        at com.intellij.coverage.CoverageSuitesBundle.getCoverageData(CoverageSuitesBundle.java:92)
        at com.intellij.coverage.SrcFileAnnotator.showCoverageInformation(SrcFileAnnotator.java:291)
        at com.intellij.coverage.CoverageDataManagerImpl$CoverageEditorFactoryListener$2.run(CoverageDataManagerImpl.java:681)
        at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
        at com.intellij.util.Alarm$Request$1.run(Alarm.java:351)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
    
    "ApplicationImpl pooled thread 20" prio=0 tid=0x0 nid=0x0 runnable
         java.lang.Thread.State: RUNNABLE
    
        at com.intellij.psi.search.PsiElementProcessor$CollectFilteredElements.execute(PsiElementProcessor.java:88)
        at com.intellij.psi.util.PsiTreeUtil$4.visitElement(PsiTreeUtil.java:677)
        at com.intellij.psi.impl.PsiElementBase.accept(PsiElementBase.java:274)
        at com.illuminatedcloud.intellij.psi.impl.ApexExpressionImpl.accept(SourceFile:22)
        at com.illuminatedcloud.intellij.psi.impl.ApexLiteralExpressionImpl.accept(SourceFile:21)
        at com.intellij.psi.PsiWalkingState.visit(PsiWalkingState.java:64)
        at com.intellij.psi.PsiWalkingState.visit(PsiWalkingState.java:26)
        at com.intellij.util.WalkingState.walkChildren(WalkingState.java:65)
        at com.intellij.util.WalkingState.elementStarted(WalkingState.java:52)
        at com.intellij.psi.PsiWalkingState.elementStarted(PsiWalkingState.java:73)
        at com.intellij.psi.PsiRecursiveElementWalkingVisitor.visitElement(PsiRecursiveElementWalkingVisitor.java:48)
        at com.intellij.psi.util.PsiTreeUtil$4.visitElement(PsiTreeUtil.java:678)
        at com.intellij.psi.PsiElementVisitor.visitFile(PsiElementVisitor.java:34)
        at com.intellij.psi.PsiRecursiveElementWalkingVisitor.visitFile(PsiRecursiveElementWalkingVisitor.java:70)
        at com.intellij.extapi.psi.PsiFileBase.accept(PsiFileBase.java:70)
        at com.intellij.psi.util.PsiTreeUtil.processElements(PsiTreeUtil.java:673)
        at com.intellij.psi.util.PsiTreeUtil.collectElementsOfType(PsiTreeUtil.java:657)
        at com.illuminatedcloud.intellij.index.ApexTypeDeclarationShortNameIndex$1.compute(SourceFile:83)
        at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:49)
        at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:200)
        at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:38)
        at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:83)
        at com.illuminatedcloud.intellij.index.ApexTypeDeclarationShortNameIndex.getTypeDeclarations(SourceFile:64)
        at com.illuminatedcloud.intellij.psi.util.ApexDeclarationUtil.fastFindTypeDeclaration(SourceFile:273)
        at com.illuminatedcloud.intellij.psi.util.ApexDeclarationUtil.findTypeDeclaration(SourceFile:234)
        at com.illuminatedcloud.intellij.psi.impl.ApexClassDeclarationMixin$1.compute(SourceFile:204)
        at com.intellij.psi.util.CachedValuesManager$1.compute(CachedValuesManager.java:131)
        at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:49)
        at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:200)
        at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:38)
        at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:83)
        at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:127)
        at com.illuminatedcloud.intellij.psi.impl.ApexClassDeclarationMixin.getBaseClassDeclaration(SourceFile:195)
        at com.illuminatedcloud.intellij.psi.stub.ApexClassDeclarationStub.<init>(SourceFile:39)
        at com.illuminatedcloud.intellij.psi.stub.ApexClassDeclarationElementType.doCreateStub(SourceFile:38)
        at com.illuminatedcloud.intellij.psi.stub.ApexClassDeclarationElementType.doCreateStub(SourceFile:22)
        at com.illuminatedcloud.intellij.psi.stub.ApexDeclarationStubElementType.createStub(SourceFile:164)
        at com.illuminatedcloud.intellij.psi.stub.ApexDeclarationStubElementType.createStub(SourceFile:32)
        at com.intellij.psi.stubs.DefaultStubBuilder.buildStubTreeFor(DefaultStubBuilder.java:60)
        at com.intellij.psi.stubs.DefaultStubBuilder.buildStubTree(DefaultStubBuilder.java:36)
        at com.intellij.psi.impl.source.PsiFileImpl.calcStubTree(PsiFileImpl.java:997)
        at com.intellij.psi.stubs.StubProcessingHelperBase.processStubsInFile(StubProcessingHelperBase.java:77)
        at com.intellij.psi.stubs.StubProcessingHelperBase.processStubsInFile(StubProcessingHelperBase.java:54)
        at com.intellij.psi.stubs.StubIndexImpl$2.perform(StubIndexImpl.java:274)
        at com.intellij.psi.stubs.StubIndexImpl$2.perform(StubIndexImpl.java:265)
        at com.intellij.util.indexing.ValueContainer.forEach(ValueContainer.java:81)
        at com.intellij.psi.stubs.StubIndexImpl.processElements(StubIndexImpl.java:265)
        at com.intellij.psi.stubs.StubIndexImpl.processElements(StubIndexImpl.java:238)
        at com.intellij.psi.stubs.StubIndex.process(StubIndex.java:76)
        at com.intellij.psi.stubs.StubIndex.process(StubIndex.java:95)
        at com.intellij.psi.stubs.StubIndexImpl.get(StubIndexImpl.java:227)
        at com.intellij.psi.stubs.StubIndexImpl.get(StubIndexImpl.java:217)
        at com.intellij.psi.stubs.AbstractStubIndex.get(AbstractStubIndex.java:39)
        at com.illuminatedcloud.intellij.index.AbstractApexDeclarationStubIndex.get(SourceFile:28)
        at com.illuminatedcloud.intellij.coverage.ApexCoverageSuite$5.compute(SourceFile:552)
        at com.illuminatedcloud.intellij.coverage.ApexCoverageSuite$5.compute(SourceFile:541)
        at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:888)
        at com.illuminatedcloud.intellij.coverage.ApexCoverageSuite.getLineCount(SourceFile:540)
        at com.illuminatedcloud.intellij.coverage.ApexCoverageSuite.loadCoverageData(SourceFile:451)
        at com.illuminatedcloud.intellij.coverage.ApexCoverageSuite.access$000(SourceFile:69)
        at com.illuminatedcloud.intellij.coverage.ApexCoverageSuite$1$1.run(SourceFile:128)
        at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:563)
        at com.intellij.openapi.progress.impl.CoreProgressManager$8.run(CoreProgressManager.java:367)
        at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:152)
        at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:452)
        at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:402)
        at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
        at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:137)
        at com.intellij.openapi.application.impl.ApplicationImpl$10$1.run(ApplicationImpl.java:617)
        at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:400)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
        at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:56)
    
  16. Scott Wells reporter

    Whether that's a contributing factor or not, it's definitely not good. I'll take a look and try to understand how/why it would get into that state. Thanks for providing the info!

  17. Craig Pemberton

    Okay. I restarted IntelliJ and took the update.

    I did miss the step to set the logging level in your instructions. I added the line and got this in the log

    2015-11-17 11:02:10,396 [ 111343]   INFO - lij.diagnostic.DebugLogManager - Set DEBUG for the following categories: [#com.illuminatedcloud.intellij.coverage.ApexCoverageSuite] 
    

    Then I went to Analyze>Show Code Coverage and got a ton of info in the log of the following forms

      Added line data = { ... } 
      Covered lines = { ... }
      Getting or creating class data 
      Getting the line count 
      Line count = ...
      Lines covered = ...; lines uncovered = ... 
      Uncovered lines = { ... } 
    Adding ... ApexCodeCoverageAggregate rows 
    Processing coverage information for ...
    Querying ApexCodeCoverageAggregate rows using the Tooling API 
    Total lines covered = ...; total lines uncovered = ... 
    

    So it looks like the coverage data is coming through, just not showing in the UI. Could this be an issue with my configuration of the IntelliJ UI? Is the above stack trace related?

  18. Scott Wells reporter

    Did you see the stack trace above again when you produced this log? My guess is no which would make me think it's unrelated (but no less bad!). Okay, so it looks like I'm loading up the appropriate information for IntelliJ IDEA itself (the line data and class data). Let me see if I can track down any reasons that this information might not be shown visibly in IntelliJ's UI. Hopefully it's something as simple as a configuration option somewhere.

    Along those lines, do you mind opening up IntelliJ's settings and looking under Editor>Colors & Fonts>General and seeing what colors are used for Line coverage>Full and Line coverage>Uncovered? You should see a selected setting for Foreground color on the righthand side of that window for each. For me Full is a light green and Uncovered is a light red. These are the colors that will be shown in the gutter area beside each covered and uncovered executable line.

  19. Craig Pemberton

    Did you see the stack trace above again when you produced this log?

    I am seeing the errors being logged again below the coverage messages, although they appeared 14 minutes later.

    Along those lines, do you mind opening up IntelliJ's settings and looking under Editor>Colors & Fonts>General and seeing what colors are used for Line coverage>Full and Line coverage>Uncovered?

    The colors are as you described.

    For me the options are listed as Uncovered line, Partial line coverage, and Full line coverage. Perhaps I am not on the latest version of IntelliJ. I am on 14.1.5. The install came with the name idea-IC-141.2735.5. Do I need to upgrade IntelliJ?

  20. Scott Wells reporter

    I'm on IntelliJ IDEA 15, but those are just label differences. I also have Line coverage>Partial. I just didn't include it in my description because I don't support partial coverage right now.

    Honestly it may be worth updating to IDEA 15 just to see if it helps, but I developed the coverage feature using IDEA 14 so I don't suspect is related to the version of the IDE. It's either a misconfiguration somewhere, a bug in IC, or a bug in IDEA. I'd say let's get you moved to IDEA 15 and see if that changes behavior, then assuming it doesn't I can ping the support community at JetBrains and see if they have any thoughts on why the coverage data wouldn't show up given that I'm definitely adding it based on the debug logging you provided.

  21. Craig Pemberton

    I'd say let's get you moved to IDEA 15 and see if that changes behavior

    Reattempted in IDEA 15 and saw the coverage data downloading in the logs. I haven't seen the exception be thrown yet, but it has only been a few minutes. Still nothing in the UI.

  22. Scott Wells reporter

    Okay. I found another place I wanted to instrument with some additional debug logging. I'm going to spin another test build for you and will send you a link shortly. I want to get the info from that log before posting to the support forums so that I have as much information as possible to get you to a resolution of this problem.

  23. Scott Wells reporter

    Okay, here's a new build with more diagnostic logging around the way that the code coverage engine resolves files opened in the editor to coverage info:

    https://drive.google.com/file/d/0B2eoK6ID4_FeaE5KNEEwRTJ2U0k/view?usp=sharing

    Once you've installed that one, you'll want to add the following class for debug logging:

    #com.illuminatedcloud.intellij.coverage.ApexCoverageEngine

    When you show the coverage suite, you should now see log info like the following:

    2015-11-17 13:35:36,239 [  41108]  DEBUG - ij.coverage.ApexCoverageEngine - Getting qualified names for C:/Users/Scott/dev/projects/df15/default/src/classes/ShoppingListMobileViewController.cls. 
    2015-11-17 13:35:36,239 [  41108]  DEBUG - ij.coverage.ApexCoverageEngine -   Processing as an Apex class file. 
    2015-11-17 13:35:36,242 [  41111]  DEBUG - ij.coverage.ApexCoverageEngine -   Added qualified name for type declaration ShoppingListMobileViewController. 
    2015-11-17 13:35:36,242 [  41111]  DEBUG - ij.coverage.ApexCoverageEngine -   Returning the following qualified names: { ShoppingListMobileViewController }. 
    2015-11-17 13:35:36,242 [  41111]  DEBUG - ij.coverage.ApexCoverageEngine - Getting qualified names for C:/Users/Scott/dev/projects/df15/default/src/classes/ShoppingListMobileViewController.cls. 
    2015-11-17 13:35:36,242 [  41111]  DEBUG - ij.coverage.ApexCoverageEngine -   Processing as an Apex class file. 
    2015-11-17 13:35:36,245 [  41114]  DEBUG - ij.coverage.ApexCoverageEngine -   Added qualified name for type declaration ShoppingListMobileViewController. 
    2015-11-17 13:35:36,245 [  41114]  DEBUG - ij.coverage.ApexCoverageEngine -   Returning the following qualified names: { ShoppingListMobileViewController }. 
    2015-11-17 13:35:36,245 [  41114]  DEBUG - ij.coverage.ApexCoverageEngine - The qualified name for C:/Users/Scott/dev/projects/df15/default/src/classes/ShoppingListMobileViewController.cls is ShoppingListMobileViewController. 
    

    What we'll be looking for is proper correlation between the class names in entries like:

    2015-11-17 13:35:36,149 [ 41018] DEBUG - lij.coverage.ApexCoverageSuite - Processing coverage information for ShoppingListMobileViewController

    and entries like:

    2015-11-17 13:35:36,245 [ 41114] DEBUG - ij.coverage.ApexCoverageEngine - The qualified name for C:/Users/Scott/dev/projects/df15/default/src/classes/ShoppingListMobileViewController.cls is ShoppingListMobileViewController.

    Please send that information over once you have it.

  24. Craig Pemberton

    I'm getting the following:

    2015-11-17 13:30:45,865 [ 893895]  ERROR - til.concurrency.QueueProcessor - Access is allowed from event dispatch thread only. 
    com.intellij.diagnostic.LogEventException: Access is allowed from event dispatch thread only.
        at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:1106)
        at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:1090)
        at com.intellij.openapi.application.impl.ApplicationImpl.assertIsDispatchThread(ApplicationImpl.java:1082)
        at com.intellij.openapi.application.impl.ApplicationImpl.runProcessWithProgressSynchronously(ApplicationImpl.java:593)
        at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:354)
        at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcessWithProgressSynchronously(ProgressManagerImpl.java:76)
        at com.intellij.openapi.progress.impl.CoreProgressManager.run(CoreProgressManager.java:283)
        at com.illuminatedcloud.intellij.coverage.ApexCoverageSuite$1.run(SourceFile:123)
        at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:943)
        at com.illuminatedcloud.intellij.coverage.ApexCoverageSuite.getCoverageData(SourceFile:118)
        at com.intellij.coverage.BaseCoverageSuite.getCoverageData(BaseCoverageSuite.java:213)
        at com.intellij.coverage.CoverageSuitesBundle.getCoverageData(CoverageSuitesBundle.java:92)
        at com.intellij.coverage.SrcFileAnnotator.showCoverageInformation(SrcFileAnnotator.java:291)
        at com.intellij.coverage.CoverageDataManagerImpl$CoverageEditorFactoryListener$2.run(CoverageDataManagerImpl.java:681)
        at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
        at com.intellij.util.Alarm$Request$1.run(Alarm.java:352)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
    [ 893896]  ERROR - til.concurrency.QueueProcessor - IntelliJ IDEA 15.0.1  Build #IC-143.382.35 
    2015-11-17 13:30:45,866 [ 893896]  ERROR - til.concurrency.QueueProcessor - IntelliJ IDEA 15.0.1  Build #IC-143.382.35 
    [ 893896]  ERROR - til.concurrency.QueueProcessor - JDK: 1.7.0_79 
    [ 893896]  ERROR - til.concurrency.QueueProcessor - VM: Java HotSpot(TM) 64-Bit Server VM 
    2015-11-17 13:30:45,866 [ 893896]  ERROR - til.concurrency.QueueProcessor - JDK: 1.7.0_79 
    2015-11-17 13:30:45,866 [ 893896]  ERROR - til.concurrency.QueueProcessor - VM: Java HotSpot(TM) 64-Bit Server VM 
    [ 893896]  ERROR - til.concurrency.QueueProcessor - Vendor: Oracle Corporation 
    [ 893896]  ERROR - til.concurrency.QueueProcessor - OS: Linux 
    2015-11-17 13:30:45,866 [ 893896]  ERROR - til.concurrency.QueueProcessor - Vendor: Oracle Corporation 
    2015-11-17 13:30:45,866 [ 893896]  ERROR - til.concurrency.QueueProcessor - OS: Linux 
    [ 985724]   WARN - ConfigurableExtensionPointUtil - ignore deprecated groupId: editor for id: editor.preferences.import 
    2015-11-17 13:32:17,694 [ 985724]   WARN - ConfigurableExtensionPointUtil - ignore deprecated groupId: editor for id: editor.preferences.import 
    [ 985724]   WARN - ConfigurableExtensionPointUtil - ignore deprecated groupId: build for id: gradle.compiler 
    2015-11-17 13:32:17,694 [ 985724]   WARN - ConfigurableExtensionPointUtil - ignore deprecated groupId: build for id: gradle.compiler 
    [1028900]   WARN - ConfigurableExtensionPointUtil - ignore deprecated groupId: editor for id: editor.preferences.import 
    2015-11-17 13:33:00,870 [1028900]   WARN - ConfigurableExtensionPointUtil - ignore deprecated groupId: editor for id: editor.preferences.import 
    [1028900]   WARN - ConfigurableExtensionPointUtil - ignore deprecated groupId: build for id: gradle.compiler 
    2015-11-17 13:33:00,870 [1028900]   WARN - ConfigurableExtensionPointUtil - ignore deprecated groupId: build for id: gradle.compiler 
    
  25. Scott Wells reporter

    The error you posted above is relatively benign. I'll definitely address it, but it doesn't stop the operation. Sometimes execution flow changes from one version of IntelliJ IDEA's plugin SDK to the next causing operations that were running inside of read actions or on the EDT previously not to do so in the new version or vice-versa. Those assertions are logged to make it clear that the operation should explicitly run in such a context, but like I said, it generally doesn't stop the operation.

    UPDATE: Hmmm...that one might actually stop the operation after all. Assertions on read actions don't, but that one just might. Let me know how it goes with the more recent build and I'll see if I can address that issue just to get it out of the way.

  26. Craig Pemberton
    2015-11-17 13:56:59,293 [ 182362]  DEBUG - lij.coverage.ApexCoverageSuite - Processing coverage information for BatchController 
    2015-11-17 13:56:59,293 [ 182362]  DEBUG - lij.coverage.ApexCoverageSuite -   Lines covered = 0; lines uncovered = 1826 
    ...
    2015-11-17 13:57:41,778 [ 224847]  DEBUG - ij.coverage.ApexCoverageEngine - Getting qualified names for /opt/lcrm/src/classes/BatchController.cls. 
    2015-11-17 13:57:41,778 [ 224847]  DEBUG - ij.coverage.ApexCoverageEngine -   Processing as an Apex class file. 
    2015-11-17 13:57:41,882 [ 224951]  DEBUG - ij.coverage.ApexCoverageEngine -   Added qualified name for type declaration BatchController. 
    2015-11-17 13:57:41,882 [ 224951]  DEBUG - ij.coverage.ApexCoverageEngine -   Added qualified name for type declaration FieldRetVal. 
    2015-11-17 13:57:41,882 [ 224951]  DEBUG - ij.coverage.ApexCoverageEngine -   Added qualified name for type declaration BatchFieldWrapper. 
    2015-11-17 13:57:41,882 [ 224951]  DEBUG - ij.coverage.ApexCoverageEngine -   Added qualified name for type declaration FieldItem. 
    2015-11-17 13:57:41,882 [ 224951]  DEBUG - ij.coverage.ApexCoverageEngine -   Added qualified name for type declaration ExternalDonorItemWrapper. 
    2015-11-17 13:57:41,882 [ 224951]  DEBUG - ij.coverage.ApexCoverageEngine -   Added qualified name for type declaration SaveWrapper. 
    2015-11-17 13:57:41,882 [ 224951]  DEBUG - ij.coverage.ApexCoverageEngine -   Added qualified name for type declaration DesignationInfo. 
    2015-11-17 13:57:41,883 [ 224952]  DEBUG - ij.coverage.ApexCoverageEngine -   Added qualified name for type declaration OpenDonationInfo. 
    2015-11-17 13:57:41,883 [ 224952]  DEBUG - ij.coverage.ApexCoverageEngine -   Added qualified name for type declaration PaymentInfo. 
    2015-11-17 13:57:41,883 [ 224952]  DEBUG - ij.coverage.ApexCoverageEngine -   Added qualified name for type declaration BatchEntries. 
    2015-11-17 13:57:41,883 [ 224952]  DEBUG - ij.coverage.ApexCoverageEngine -   Added qualified name for type declaration PledgeWrapper. 
    2015-11-17 13:57:41,883 [ 224952]  DEBUG - ij.coverage.ApexCoverageEngine -   Returning the following qualified names: { BatchController, FieldRetVal, BatchFieldWrapper, FieldItem, ExternalDonorItemWrapper, SaveWrapper, DesignationInfo, OpenDonationInfo, PaymentInfo, BatchEntries, PledgeWrapper }. 
    2015-11-17 13:57:41,884 [ 224953]  DEBUG - ij.coverage.ApexCoverageEngine - Getting qualified names for /opt/lcrm/src/classes/BatchController.cls. 
    2015-11-17 13:57:41,884 [ 224953]  DEBUG - ij.coverage.ApexCoverageEngine -   Processing as an Apex class file. 
    2015-11-17 13:57:41,895 [ 224964]  DEBUG - ij.coverage.ApexCoverageEngine -   Added qualified name for type declaration BatchController. 
    2015-11-17 13:57:41,895 [ 224964]  DEBUG - ij.coverage.ApexCoverageEngine -   Added qualified name for type declaration FieldRetVal. 
    2015-11-17 13:57:41,895 [ 224964]  DEBUG - ij.coverage.ApexCoverageEngine -   Added qualified name for type declaration BatchFieldWrapper. 
    2015-11-17 13:57:41,895 [ 224964]  DEBUG - ij.coverage.ApexCoverageEngine -   Added qualified name for type declaration FieldItem. 
    2015-11-17 13:57:41,895 [ 224964]  DEBUG - ij.coverage.ApexCoverageEngine -   Added qualified name for type declaration ExternalDonorItemWrapper. 
    2015-11-17 13:57:41,895 [ 224964]  DEBUG - ij.coverage.ApexCoverageEngine -   Added qualified name for type declaration SaveWrapper. 
    2015-11-17 13:57:41,895 [ 224964]  DEBUG - ij.coverage.ApexCoverageEngine -   Added qualified name for type declaration DesignationInfo. 
    2015-11-17 13:57:41,895 [ 224964]  DEBUG - ij.coverage.ApexCoverageEngine -   Added qualified name for type declaration OpenDonationInfo. 
    2015-11-17 13:57:41,895 [ 224964]  DEBUG - ij.coverage.ApexCoverageEngine -   Added qualified name for type declaration PaymentInfo. 
    2015-11-17 13:57:41,895 [ 224964]  DEBUG - ij.coverage.ApexCoverageEngine -   Added qualified name for type declaration BatchEntries. 
    2015-11-17 13:57:41,895 [ 224964]  DEBUG - ij.coverage.ApexCoverageEngine -   Added qualified name for type declaration PledgeWrapper. 
    2015-11-17 13:57:41,895 [ 224964]  DEBUG - ij.coverage.ApexCoverageEngine -   Returning the following qualified names: { BatchController, FieldRetVal, BatchFieldWrapper, FieldItem, ExternalDonorItemWrapper, SaveWrapper, DesignationInfo, OpenDonationInfo, PaymentInfo, BatchEntries, PledgeWrapper }. 
    2015-11-17 13:57:41,895 [ 224964]  DEBUG - ij.coverage.ApexCoverageEngine - The qualified name for /opt/lcrm/src/classes/BatchController.cls is BatchController. 
    2015-11-17 13:58:13,854 [ 256923]   INFO - agnostic.FrequentEventDetector - Too many events posted, #1
    java.lang.Throwable
        at com.intellij.openapi.diagnostic.FrequentEventDetector.eventHappened(FrequentEventDetector.java:70)
        at com.intellij.ide.IdeEventQueue.postEvent(IdeEventQueue.java:1159)
        at java.awt.EventQueue.invokeLater(EventQueue.java:1233)
        at javax.swing.SwingUtilities.invokeLater(SwingUtilities.java:1288)
        at com.intellij.util.containers.TransferToEDTQueue.schedule(TransferToEDTQueue.java:148)
        at com.intellij.util.containers.TransferToEDTQueue.scheduleUpdate(TransferToEDTQueue.java:142)
        at com.intellij.util.containers.TransferToEDTQueue.offer(TransferToEDTQueue.java:116)
        at com.intellij.codeInsight.daemon.impl.HighlightingSessionImpl.queueHighlightInfo(HighlightingSessionImpl.java:156)
        at com.intellij.codeInsight.daemon.impl.DefaultHighlightInfoProcessor.infoIsAvailable(DefaultHighlightInfoProcessor.java:150)
        at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.runVisitors(GeneralHighlightingPass.java:396)
        at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.access$100(GeneralHighlightingPass.java:65)
        at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$3.run(GeneralHighlightingPass.java:288)
        at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:308)
        at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.access$200(GeneralHighlightingPass.java:65)
        at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$4.run(GeneralHighlightingPass.java:314)
        at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:87)
        at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:311)
        at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectHighlights(GeneralHighlightingPass.java:280)
        at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:219)
        at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:82)
        at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:67)
        at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1$1.run(PassExecutorService.java:444)
        at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1169)
        at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1.run(PassExecutorService.java:435)
        at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:446)
        at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:392)
        at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
        at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:432)
        at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:408)
        at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:206)
        at jsr166e.ForkJoinTask.doExec(ForkJoinTask.java:260)
        at jsr166e.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:858)
        at jsr166e.ForkJoinPool.scan(ForkJoinPool.java:1687)
        at jsr166e.ForkJoinPool.runWorker(ForkJoinPool.java:1642)
        at jsr166e.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:108)
    

    BatchController was the one Apex file I had open at the time.

  27. Craig Pemberton

    Seeing the following as well

     628871]  ERROR - openapi.options.ConfigurableEP - Assertion failed: Bundle missed for com.illuminatedcloud.intellij.settings.project.IlluminatedCloudProjectConfigurable 
    java.lang.Throwable
        at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:144)
        at com.intellij.openapi.options.ConfigurableEP.getDisplayName(ConfigurableEP.java:71)
        at com.intellij.openapi.options.ConfigurableEP.toString(ConfigurableEP.java:285)
        at java.lang.String.valueOf(String.java:2849)
        at java.lang.StringBuilder.append(StringBuilder.java:128)
        at com.intellij.openapi.options.ex.ConfigurableWrapper.getConfigurable(ConfigurableWrapper.java:121)
        at com.intellij.openapi.options.ex.ConfigurableWrapper.cast(ConfigurableWrapper.java:102)
        at com.intellij.openapi.options.ex.ConfigurableWrapper.getDisplayName(ConfigurableWrapper.java:140)
        at com.intellij.openapi.options.ex.Weighted$1.compare(Weighted.java:37)
        at com.intellij.openapi.options.ex.Weighted$1.compare(Weighted.java:29)
        at java.util.TimSort.binarySort(TimSort.java:265)
        at java.util.TimSort.sort(TimSort.java:190)
        at java.util.TimSort.sort(TimSort.java:173)
        at java.util.Arrays.sort(Arrays.java:659)
        at java.util.Collections.sort(Collections.java:217)
        at com.intellij.openapi.options.ex.SortedConfigurableGroup.buildConfigurables(SortedConfigurableGroup.java:53)
        at com.intellij.openapi.options.SearchableConfigurable$Parent$Abstract.getConfigurables(SearchableConfigurable.java:100)
        at com.intellij.ide.actions.SearchEverywhereAction.fillConfigurablesIds(SearchEverywhereAction.java:2406)
        at com.intellij.ide.actions.SearchEverywhereAction.access$6700(SearchEverywhereAction.java:132)
        at com.intellij.ide.actions.SearchEverywhereAction$CalcThread.checkModelsUpToDate(SearchEverywhereAction.java:2040)
        at com.intellij.ide.actions.SearchEverywhereAction$CalcThread.run(SearchEverywhereAction.java:1378)
        at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:365)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
        at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:55)
    [ 628872]  ERROR - openapi.options.ConfigurableEP - IntelliJ IDEA 15.0.1  Build #IC-143.382.35 
    [ 628872]  ERROR - openapi.options.ConfigurableEP - JDK: 1.7.0_79 
    [ 628872]  ERROR - openapi.options.ConfigurableEP - VM: Java HotSpot(TM) 64-Bit Server VM 
    [ 628872]  ERROR - openapi.options.ConfigurableEP - Vendor: Oracle Corporation 
    [ 628872]  ERROR - openapi.options.ConfigurableEP - OS: Linux 
    [ 628872]  ERROR - openapi.options.ConfigurableEP - Last Action: SearchEverywhere 
    [ 628872]  ERROR - actions.SearchEverywhereAction - Argument for @NotNull parameter 'pathToBundle' of com/intellij/AbstractBundle.getResourceBundle must not be null 
    java.lang.IllegalArgumentException: Argument for @NotNull parameter 'pathToBundle' of com/intellij/AbstractBundle.getResourceBundle must not be null
        at com.intellij.AbstractBundle.getResourceBundle(AbstractBundle.java)
        at com.intellij.openapi.options.ConfigurableEP.getDisplayName(ConfigurableEP.java:72)
        at com.intellij.openapi.options.ConfigurableEP.toString(ConfigurableEP.java:285)
        at java.lang.String.valueOf(String.java:2849)
        at java.lang.StringBuilder.append(StringBuilder.java:128)
        at com.intellij.openapi.options.ex.ConfigurableWrapper.getConfigurable(ConfigurableWrapper.java:121)
        at com.intellij.openapi.options.ex.ConfigurableWrapper.cast(ConfigurableWrapper.java:102)
        at com.intellij.openapi.options.ex.ConfigurableWrapper.getDisplayName(ConfigurableWrapper.java:140)
        at com.intellij.openapi.options.ex.Weighted$1.compare(Weighted.java:37)
        at com.intellij.openapi.options.ex.Weighted$1.compare(Weighted.java:29)
        at java.util.TimSort.binarySort(TimSort.java:265)
        at java.util.TimSort.sort(TimSort.java:190)
        at java.util.TimSort.sort(TimSort.java:173)
        at java.util.Arrays.sort(Arrays.java:659)
        at java.util.Collections.sort(Collections.java:217)
        at com.intellij.openapi.options.ex.SortedConfigurableGroup.buildConfigurables(SortedConfigurableGroup.java:53)
        at com.intellij.openapi.options.SearchableConfigurable$Parent$Abstract.getConfigurables(SearchableConfigurable.java:100)
        at com.intellij.ide.actions.SearchEverywhereAction.fillConfigurablesIds(SearchEverywhereAction.java:2406)
        at com.intellij.ide.actions.SearchEverywhereAction.access$6700(SearchEverywhereAction.java:132)
        at com.intellij.ide.actions.SearchEverywhereAction$CalcThread.checkModelsUpToDate(SearchEverywhereAction.java:2040)
        at com.intellij.ide.actions.SearchEverywhereAction$CalcThread.run(SearchEverywhereAction.java:1378)
        at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:365)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
        at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:55)
    
  28. Scott Wells reporter

    Okay, that issue occurs when the plugin isn't properly deployed by IntelliJ IDEA. This is only the third time I've seen this issue. I know this is starting to seem kind of silly, but let's get to the other side of it. With IDEA stopped, can you go into your user directory and find .IdeaIC15/config/plugins and remove the IlluminatedCloud directory, then start IDEA and install the test build again?

  29. Craig Pemberton

    Reinstalled the plugin by first deleting it from my plugins folder and restarting the IDE and installing your package. I reran tests and selected the coverage. I'm getting things like the following in the log:

    2015-11-17 14:04:43,752 [ 646821]  DEBUG - lij.coverage.ApexCoverageSuite - Processing coverage information for TargetAnalyticsImportJob 
    2015-11-17 14:04:43,752 [ 646821]  DEBUG - lij.coverage.ApexCoverageSuite -   Lines covered = 77; lines uncovered = 31 
    2015-11-17 14:04:43,752 [ 646821]  DEBUG - lij.coverage.ApexCoverageSuite -   Covered lines = { 4, 48, 49, 50, 51, 54, 55, 57, 60, 61, 65, 66, 67, 68, 70, 71, 76, 77, 78, 79, 81, 82, 83, 88, 89, 90, 91, 93, 94, 96, 97, 101, 102, 103, 104, 105, 106, 107, 113, 117, 118, 119, 120, 121, 122, 123, 125, 129, 130, 131, 132, 134, 135, 136, 137, 138, 140, 142, 143, 144, 146, 150, 151, 152, 159, 161, 168, 169, 170, 178, 179, 180, 181, 182, 183, 187, 188 } 
    2015-11-17 14:04:43,752 [ 646821]  DEBUG - lij.coverage.ApexCoverageSuite -   Uncovered lines = { 6, 7, 8, 9, 10, 11, 13, 14, 17, 18, 20, 21, 24, 25, 26, 30, 31, 32, 35, 39, 40, 41, 42, 44, 52, 109, 110, 162, 163, 172, 173 }
    ...
    2015-11-17 14:50:18,500 [ 180219]  DEBUG - ij.coverage.ApexCoverageEngine - Getting qualified names for /opt/lcrm/src/classes/TargetAnalyticsImportJob.cls. 
    2015-11-17 14:50:18,500 [ 180219]  DEBUG - ij.coverage.ApexCoverageEngine -   Processing as an Apex class file. 
    2015-11-17 14:50:18,514 [ 180233]  DEBUG - ij.coverage.ApexCoverageEngine -   Added qualified name for type declaration TargetAnalyticsImportJob. 
    2015-11-17 14:50:18,514 [ 180233]  DEBUG - ij.coverage.ApexCoverageEngine -   Added qualified name for type declaration SabotenChunkException. 
    2015-11-17 14:50:18,514 [ 180233]  DEBUG - ij.coverage.ApexCoverageEngine -   Returning the following qualified names: { TargetAnalyticsImportJob, SabotenChunkException }. 
    

    The ApexCoverageEngine only produces logs for files that are currently open.

    There is nothing showing up in the UI to indicate which lines are covered.

  30. Scott Wells reporter

    Thanks, Craig. I have a thought. Do you see a difference in behavior between classes that do and do not have inner class declarations? I'm wondering if perhaps in the example above, the coverage for both TargetAnalyticsImportJob and its SabotenChunkException was added under the key TargetAnalyticsImportJob but is being looked up later for presentation under SabotenChunkException. Do you have a tested class with no inner classes that you can try?

  31. Scott Wells reporter

    Craig, I pinged JetBrains about this and there's a possibility that the source is being recognized by the coverage subsystem as being in a library. I've added diagnostic logging around that as well. However, the developer of the coverage subsystem for IntelliJ IDEA did say that there's a bug that will evidence this exact behavior even for Java coverage. Basically all the right data structures are set up, but the editor window doesn't show coverage info while the other views (Project and Coverage views) do. That's exactly what you're seeing. The developer said that they haven't had a reproducible test case to track down the bug, though.

    I certainly understand that I can't connect directly to the org in which you're seeing this occur, but is there any way I could ask you to try to put together a standalone reproduction of it in another org to which I could connect and debug this? I'm happy to supply the org if you need. I apologize for putting the onus on you for this, but now knowing that there's a bug in the underlying subsystem, I'm afraid we may be running out of options for debugging it this way.

  32. Scott Wells reporter

    Okay, that's definitely useful. What are the differences between your environments? OS? IntelliJ IDEA version? host Java version? path to the project? ??? There must be something different between the environment where coverage is being shown and where it's not.

  33. Craig Pemberton

    Coverage works for a third teammate as well.

    We are both on IntelliJ 15.0.1

    OS: Mine is: ​Linux 4.2.0-18-generic #22-Ubuntu SMP Fri Nov 6 18:25:50 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux Hers is: Linux 3.19.0-33-generic #38-Ubuntu SMP Fri Nov 6 18:18:12 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

    Java version: Mine is: 1.8.0.45 Hers is: 1.8.0.66

    Path to the project: I don't know what hers is but mine is in /opt/lcrm

    I've pretty gratuitously blown through the timebox I planned for this task for the sprint. If I need coverage then I can just use the web version. I'm happy to keep running tests occasionally but I am going to need to shift my focus tomorrow.

    Thank you so much for all of your help.

  34. Scott Wells reporter

    Totally understood, Craig, and I appreciate all of your time as well. I just wish we'd figured out a resolution for you! On the one hand, I'm glad that it's not a widespread issue and that others on your team aren't seeing it, but of course on the other hand, I hate that it's not working for you. The best recommendation that I have at this point is to try to eliminate the differences between the environment with the issue and ones without, obviously when it's something you can return to in the future. Don't hesitate to reach back out at any point about this or anything else about the plugin.

  35. Scott Wells reporter

    Craig, I'm going to move this from open to on hold for now. You can move it back to open anytime you'd like.

  36. Log in to comment