Scala Code Analysis freezes

When I open some scala class it analyzes only part of file. I can see an eye in right top corner with messages: "Performing code analysis" and "No errors or warnings found so far" forever.
IDEA v11.1.2, Scala plugin v0.5.808

0
13 comments

It means exception during code analyses. Please attach idea log file, then I'll check it (http://devnet.jetbrains.net/docs/DOC-181).

Best regards,
Alexander Podkhalyuzin.

0

There are a lot of ClassCastException: com.intellij.psi.tree.IFileElementType cannot be cast to com.intellij.psi.tree.IStubFileElementType:

2012-06-28 14:37:47,345 [ 586548]  ERROR - aemon.impl.PassExecutorService - IntelliJ IDEA 11.1.2  Build #IU-117.418 2012-06-28 14:37:47,345 [ 586548]  ERROR - aemon.impl.PassExecutorService - JDK: 1.6.0_31 2012-06-28 14:37:47,345 [ 586548]  ERROR - aemon.impl.PassExecutorService - VM: Java HotSpot(TM) 64-Bit Server VM 2012-06-28 14:37:47,345 [ 586548]  ERROR - aemon.impl.PassExecutorService - Vendor: Apple Inc. 2012-06-28 14:37:47,345 [ 586548]  ERROR - aemon.impl.PassExecutorService - OS: Mac OS X 2012-06-28 14:37:47,345 [ 586548]  ERROR - aemon.impl.PassExecutorService - Last Action: MarkTestSourceRoot 2012-06-28 14:37:47,345 [ 586548]  ERROR - currency.PrioritizedFutureTask - java.lang.ClassCastException: com.intellij.psi.tree.IFileElementType cannot be cast to com.intellij.psi.tree.IStubFileElementType java.util.concurrent.ExecutionException: java.lang.ClassCastException: com.intellij.psi.tree.IFileElementType cannot be cast to com.intellij.psi.tree.IStubFileElementType      at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)      at java.util.concurrent.FutureTask.get(FutureTask.java:83)      at com.intellij.concurrency.PrioritizedFutureTask.access$301(PrioritizedFutureTask.java:31)      at com.intellij.concurrency.PrioritizedFutureTask$1.run(PrioritizedFutureTask.java:77)      at com.intellij.concurrency.PrioritizedFutureTask.run(PrioritizedFutureTask.java:113)      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)      at java.lang.Thread.run(Thread.java:680) Caused by: java.lang.ClassCastException: com.intellij.psi.tree.IFileElementType cannot be cast to com.intellij.psi.tree.IStubFileElementType      at com.intellij.psi.impl.source.PsiFileImpl.calcStubTree(PsiFileImpl.java:976)      at com.intellij.psi.stubs.StubIndexImpl$1.perform(StubIndexImpl.java:239)      at com.intellij.psi.stubs.StubIndexImpl$1.perform(StubIndexImpl.java:220)      at com.intellij.util.indexing.ValueContainer.forEach(ValueContainer.java:60)      at com.intellij.psi.stubs.StubIndexImpl.process(StubIndexImpl.java:220)      at com.intellij.psi.stubs.StubIndexImpl.get(StubIndexImpl.java:194)      at com.intellij.psi.stubs.AbstractStubIndex.get(AbstractStubIndex.java:33)      at com.intellij.psi.impl.java.stubs.index.JavaFullClassNameIndex.get(JavaFullClassNameIndex.java:47)      at com.intellij.psi.impl.file.impl.JavaFileManagerImpl.a(JavaFileManagerImpl.java:340)      at com.intellij.psi.impl.file.impl.JavaFileManagerImpl.findClass(JavaFileManagerImpl.java:227)      at com.intellij.psi.impl.JavaPsiFacadeImpl$PsiElementFinderImpl.findClass(JavaPsiFacadeImpl.java:276)      at com.intellij.psi.impl.JavaPsiFacadeImpl.findClass(JavaPsiFacadeImpl.java:112)      at com.intellij.spring.model.SpringUtils.getBeanClass(SpringUtils.java:1267)      at com.intellij.spring.impl.model.AbstractDomSpringBean.getBeanClass(AbstractDomSpringBean.java:66)      at com.intellij.spring.impl.model.beans.SpringBeanImpl.getBeanClass(SpringBeanImpl.java:128)      at com.intellij.spring.impl.model.AbstractDomSpringBean.getBeanClass(AbstractDomSpringBean.java:46)      at com.intellij.spring.contexts.model.LocalXmlModel$15.consume(LocalXmlModel.java:366)      at com.intellij.spring.contexts.model.LocalXmlModel$15.consume(LocalXmlModel.java:364)      at com.intellij.spring.contexts.model.LocalXmlModel$13.visitBean(LocalXmlModel.java:315)      at com.intellij.spring.model.SpringModelVisitor.visitBean(SpringModelVisitor.java:102)      at com.intellij.spring.model.SpringModelVisitor.visitBean(SpringModelVisitor.java:98)      at com.intellij.spring.model.SpringModelVisitor.visitElementsHolder(SpringModelVisitor.java:124)      at com.intellij.spring.model.SpringModelVisitor.visitValueHolder(SpringModelVisitor.java:119)      at com.intellij.spring.model.SpringModelVisitor.visitBean(SpringModelVisitor.java:111)      at com.intellij.spring.model.SpringModelVisitor.visitBean(SpringModelVisitor.java:98)      at com.intellij.spring.model.SpringModelVisitor.visitElementsHolder(SpringModelVisitor.java:124)      at com.intellij.spring.model.SpringModelVisitor.visitValueHolder(SpringModelVisitor.java:119)      at com.intellij.spring.model.SpringModelVisitor.visitBean(SpringModelVisitor.java:111)      at com.intellij.spring.model.SpringModelVisitor.visitBeans(SpringModelVisitor.java:71)      at com.intellij.spring.model.SpringModelVisitor.visitBeans(SpringModelVisitor.java:63)      at com.intellij.spring.contexts.model.LocalXmlModel.processAllBeans(LocalXmlModel.java:326)      at com.intellij.spring.contexts.model.LocalXmlModel.computeBeansByPsiClassWithInheritance(LocalXmlModel.java:379)      at com.intellij.spring.contexts.model.LocalXmlModel.access$200(LocalXmlModel.java:48)      at com.intellij.spring.contexts.model.LocalXmlModel$5.compute(LocalXmlModel.java:98)      at com.intellij.spring.contexts.model.LocalXmlModel$5.compute(LocalXmlModel.java:94)      at com.intellij.openapi.util.AtomicNotNullLazyValue.getValue(AtomicNotNullLazyValue.java:37)      at com.intellij.spring.contexts.model.LocalXmlModel.findBeansByPsiClassWithInheritance(LocalXmlModel.java:418)      at com.intellij.spring.contexts.model.SpringModel.findBeansByPsiClassWithInheritance(SpringModel.java:133)      at com.intellij.spring.contexts.model.SpringModel.findBeansByPsiClassWithInheritance(SpringModel.java:133)      at com.intellij.spring.java.SpringJavaClassInfo.getBeans(SpringJavaClassInfo.java:129)      at com.intellij.spring.java.SpringJavaClassInfo.access$100(SpringJavaClassInfo.java:37)      at com.intellij.spring.java.SpringJavaClassInfo$1.compute(SpringJavaClassInfo.java:55)      at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:47)      at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:200)      at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:37)      at com.intellij.spring.java.SpringJavaClassInfo.getMappedDomBeans(SpringJavaClassInfo.java:187)      at com.intellij.spring.gutter.SpringClassAnnotator.collectNavigationMarkers(SpringClassAnnotator.java:87)      at com.intellij.codeInsight.daemon.RelatedItemLineMarkerProvider.collectNavigationMarkers(RelatedItemLineMarkerProvider.java:46)      at com.intellij.codeInsight.daemon.RelatedItemLineMarkerProvider.collectSlowLineMarkers(RelatedItemLineMarkerProvider.java:39)      at com.intellij.codeInsight.daemon.impl.SlowLineMarkersPass.addLineMarkers(SlowLineMarkersPass.java:78)      at com.intellij.codeInsight.daemon.impl.SlowLineMarkersPass.doCollectInformation(SlowLineMarkersPass.java:65)      at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:61)      at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1$1.run(PassExecutorService.java:350)      at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1053)      at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1.run(PassExecutorService.java:342)      at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:218)      at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.a(PassExecutorService.java:340)      at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:316)      at com.intellij.concurrency.JobUtil$3.call(JobUtil.java:134)      at com.intellij.concurrency.JobUtil$3.call(JobUtil.java:131)      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)      at java.util.concurrent.FutureTask.run(FutureTask.java:138)      at com.intellij.concurrency.PrioritizedFutureTask.access$101(PrioritizedFutureTask.java:31)      at com.intellij.concurrency.PrioritizedFutureTask$1.run(PrioritizedFutureTask.java:70)      ... 4 more 2012-06-28 14:37:47,346 [ 586549]  ERROR - currency.PrioritizedFutureTask - IntelliJ IDEA 11.1.2  Build #IU-117.418 2012-06-28 14:37:47,346 [ 586549]  ERROR - currency.PrioritizedFutureTask - JDK: 1.6.0_31 2012-06-28 14:37:47,346 [ 586549]  ERROR - currency.PrioritizedFutureTask - VM: Java HotSpot(TM) 64-Bit Server VM 2012-06-28 14:37:47,346 [ 586549]  ERROR - currency.PrioritizedFutureTask - Vendor: Apple Inc. 2012-06-28 14:37:47,346 [ 586549]  ERROR - currency.PrioritizedFutureTask - OS: Mac OS X 2012-06-28 14:37:47,346 [ 586549]  ERROR - currency.PrioritizedFutureTask - Last Action: MarkTestSourceRoot 2012-06-28 14:37:47,346 [ 586549]  ERROR - currency.PrioritizedFutureTask - Original exception:   java.lang.ClassCastException: com.intellij.psi.tree.IFileElementType cannot be cast to com.intellij.psi.tree.IStubFileElementType      at com.intellij.psi.impl.source.PsiFileImpl.calcStubTree(PsiFileImpl.java:976)      at com.intellij.psi.stubs.StubIndexImpl$1.perform(StubIndexImpl.java:239)      at com.intellij.psi.stubs.StubIndexImpl$1.perform(StubIndexImpl.java:220)      at com.intellij.util.indexing.ValueContainer.forEach(ValueContainer.java:60)      at com.intellij.psi.stubs.StubIndexImpl.process(StubIndexImpl.java:220)      at com.intellij.psi.stubs.StubIndexImpl.get(StubIndexImpl.java:194)      at com.intellij.psi.stubs.AbstractStubIndex.get(AbstractStubIndex.java:33)      at com.intellij.psi.impl.java.stubs.index.JavaFullClassNameIndex.get(JavaFullClassNameIndex.java:47)      at com.intellij.psi.impl.file.impl.JavaFileManagerImpl.a(JavaFileManagerImpl.java:340)      at com.intellij.psi.impl.file.impl.JavaFileManagerImpl.findClass(JavaFileManagerImpl.java:227)      at com.intellij.psi.impl.JavaPsiFacadeImpl$PsiElementFinderImpl.findClass(JavaPsiFacadeImpl.java:276)      at com.intellij.psi.impl.JavaPsiFacadeImpl.findClass(JavaPsiFacadeImpl.java:112)      at com.intellij.spring.model.SpringUtils.getBeanClass(SpringUtils.java:1267)      at com.intellij.spring.impl.model.AbstractDomSpringBean.getBeanClass(AbstractDomSpringBean.java:66)      at com.intellij.spring.impl.model.beans.SpringBeanImpl.getBeanClass(SpringBeanImpl.java:128)      at com.intellij.spring.impl.model.AbstractDomSpringBean.getBeanClass(AbstractDomSpringBean.java:46)      at com.intellij.spring.contexts.model.LocalXmlModel$15.consume(LocalXmlModel.java:366)      at com.intellij.spring.contexts.model.LocalXmlModel$15.consume(LocalXmlModel.java:364)      at com.intellij.spring.contexts.model.LocalXmlModel$13.visitBean(LocalXmlModel.java:315)      at com.intellij.spring.model.SpringModelVisitor.visitBean(SpringModelVisitor.java:102)      at com.intellij.spring.model.SpringModelVisitor.visitBean(SpringModelVisitor.java:98)      at com.intellij.spring.model.SpringModelVisitor.visitElementsHolder(SpringModelVisitor.java:124)      at com.intellij.spring.model.SpringModelVisitor.visitValueHolder(SpringModelVisitor.java:119)      at com.intellij.spring.model.SpringModelVisitor.visitBean(SpringModelVisitor.java:111)      at com.intellij.spring.model.SpringModelVisitor.visitBean(SpringModelVisitor.java:98)      at com.intellij.spring.model.SpringModelVisitor.visitElementsHolder(SpringModelVisitor.java:124)      at com.intellij.spring.model.SpringModelVisitor.visitValueHolder(SpringModelVisitor.java:119)      at com.intellij.spring.model.SpringModelVisitor.visitBean(SpringModelVisitor.java:111)      at com.intellij.spring.model.SpringModelVisitor.visitBeans(SpringModelVisitor.java:71)      at com.intellij.spring.model.SpringModelVisitor.visitBeans(SpringModelVisitor.java:63)      at com.intellij.spring.contexts.model.LocalXmlModel.processAllBeans(LocalXmlModel.java:326)      at com.intellij.spring.contexts.model.LocalXmlModel.computeBeansByPsiClassWithInheritance(LocalXmlModel.java:379)      at com.intellij.spring.contexts.model.LocalXmlModel.access$200(LocalXmlModel.java:48)      at com.intellij.spring.contexts.model.LocalXmlModel$5.compute(LocalXmlModel.java:98)      at com.intellij.spring.contexts.model.LocalXmlModel$5.compute(LocalXmlModel.java:94)      at com.intellij.openapi.util.AtomicNotNullLazyValue.getValue(AtomicNotNullLazyValue.java:37)      at com.intellij.spring.contexts.model.LocalXmlModel.findBeansByPsiClassWithInheritance(LocalXmlModel.java:418)      at com.intellij.spring.contexts.model.SpringModel.findBeansByPsiClassWithInheritance(SpringModel.java:133)      at com.intellij.spring.contexts.model.SpringModel.findBeansByPsiClassWithInheritance(SpringModel.java:133)      at com.intellij.spring.java.SpringJavaClassInfo.getBeans(SpringJavaClassInfo.java:129)      at com.intellij.spring.java.SpringJavaClassInfo.access$100(SpringJavaClassInfo.java:37)      at com.intellij.spring.java.SpringJavaClassInfo$1.compute(SpringJavaClassInfo.java:55)      at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:47)      at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:200)      at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:37)      at com.intellij.spring.java.SpringJavaClassInfo.getMappedDomBeans(SpringJavaClassInfo.java:187)      at com.intellij.spring.gutter.SpringClassAnnotator.collectNavigationMarkers(SpringClassAnnotator.java:87)      at com.intellij.codeInsight.daemon.RelatedItemLineMarkerProvider.collectNavigationMarkers(RelatedItemLineMarkerProvider.java:46)      at com.intellij.codeInsight.daemon.RelatedItemLineMarkerProvider.collectSlowLineMarkers(RelatedItemLineMarkerProvider.java:39)      at com.intellij.codeInsight.daemon.impl.SlowLineMarkersPass.addLineMarkers(SlowLineMarkersPass.java:78)      at com.intellij.codeInsight.daemon.impl.SlowLineMarkersPass.doCollectInformation(SlowLineMarkersPass.java:65)      at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:61)      at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1$1.run(PassExecutorService.java:350)      at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1053)      at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1.run(PassExecutorService.java:342)      at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:218)      at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.a(PassExecutorService.java:340)      at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:316)      at com.intellij.concurrency.JobUtil$3.call(JobUtil.java:134)      at com.intellij.concurrency.JobUtil$3.call(JobUtil.java:131)      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)      at java.util.concurrent.FutureTask.run(FutureTask.java:138)      at com.intellij.concurrency.PrioritizedFutureTask.access$101(PrioritizedFutureTask.java:31)      at com.intellij.concurrency.PrioritizedFutureTask$1.run(PrioritizedFutureTask.java:70)      at com.intellij.concurrency.PrioritizedFutureTask.run(PrioritizedFutureTask.java:113)      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)      at java.lang.Thread.run(Thread.java:680)



Thank you,
Libor
0

There is nothing from Scala plugin (according to this exception).
Also I think that File -> Invalidate Caches should help you. If not, please report this here: http://youtrack.jetbrains.com/issues/IDEA

Best regards,
Alexander Podkhalyuzin.

0

Thank you, it was because of those damn caches %)

0
Avatar
Permanently deleted user

I found same problem reported here http://youtrack.jetbrains.com/issue/SCL-4457.
Cleaning caches didn't resolve the problem.

0
Avatar
Permanently deleted user

I also have this problem in IntelliJ 12.1.4 for Play Framework with Scala. Here are some Thread dumps, log files, etc. I have done Invalidate Caches and it does NOT help.



Attachment(s):
IntelliJ_Code_Analysis_Problem.zip
0

Please try to put -Xss4096 to your IDEA settings, if it helps, then I'll fix it in October, we need just to reduce stack usage.

Best regards,
Aleksandr Podkhaliuzin.

0
Avatar
Permanently deleted user

Ok. I will try that and report back to you.

0
Avatar
Permanently deleted user

Here are some great news! It worked flawlessly! I also chose to use the idea64 binary instead of the regular idea application. It may not have made any difference but the -Xss4096 sure did!

0
Avatar
Permanently deleted user

Hi there,
Alas I also have this problem and I've tried both the -Xss4096 and invalidate caches tips but still the code completion fails to finish and the CPU goes through the roof. The log dir has thread dumps and I've attached one in the hope it helps. Also if it helps, it started happening after I upgraded to plugin version 0.19.299.

Tkx Alex



Attachment(s):
threadDump-20130926-215755.txt.zip
0
Avatar
Permanently deleted user

Ok so the reference I made to this freezing starting after the latest plugin update is (I think) purely coincidence, so pls disregard.

I've narrowed this problem down in my case to having multiple assignments within a for-comprehension. Specifically I'm performing a series of regular expression checks, so something like :

          val regexMatchResult = for {
            elem <- anArrayOfNamesAndRegexStrings
            strRegex = elem.regexString

            regexMatchA: Boolean = (regexAString.r findFirstIn strRegex).size > 0
            regexMatchB: Boolean = (regexBString.r findFirstIn strRegex).size > 0
            regexMatchC: Boolean = (regexCString.r findFirstIn strRegex).size > 0
            regexMatchD: Boolean = (regexDString.r findFirstIn strRegex).size > 0
            regexMatchE: Boolean = (regexEString.r findFirstIn strRegex).size > 0
            regexMatchF: Boolean = (regexFString.r findFirstIn strRegex).size > 0
            regexMatchG: Boolean = (regexGString.r findFirstIn strRegex).size > 0
            regexMatchH: Boolean = (regexHString.r findFirstIn strRegex).size > 0

            regexMatchAll: Boolean = regexMatchA && regexMatchB && regexMatchC && regexMatchD && regexMatchE && regexMatchF && regexMatchG && regexMatchH

            // Some more assignments and comparisons based on the individual match results....

            if (someVariousCombinationsAreMatched)

          } yield (elem.name)


In IDEA the syntax checking takes progressively longer as I add more and more regex checks. Finally as I add some comparisons on the various regex match combinations, it freezes all together.

So, this might all just be highlighting my inefficient code ; but I am able to reproduce the freezing of IDEA (even after -Xss4096'ing it).

HTH,
Alex

0

Your attached threaddump is not about Scala plugin.
It would be really helpful to take a look for full example of your for comprehension. Or probably just to take a look at CPU snapshot.

Best regards,
Alexander Podkhalyuzin.

0
Avatar
Permanently deleted user

-Xss4096 does not work for me.

0

Please sign in to leave a comment.