Imports, Code Navigation mysteriously stop working in scripts

Has anyone experienced this? I've got a perfectly fine Groovy script that I authored in JetGroovy that runs, works fine and is functioning normally. After some time and changes elsewhere in the system, suddenly the imports are greyed out (unused import warnings) and code navigation (cntl-click on variables) fails and Groovy can't find my variables even though my script hasn't changed.

Looking in the logs, I do see this exception:

2008-02-22 17:31:18,630 ERROR - lang.psi.impl.GroovyPsiManager - Type is invalid: PsiType:List
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:48)
at org.jetbrains.plugins.groovy.lang.psi.impl.GroovyPsiManager.getType(GroovyPsiManager.java:312)
at org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions.GrReferenceExpressionImpl.getType(GrReferenceExpressionImpl.java:313)
at org.jetbrains.plugins.groovy.annotator.GroovyAnnotator.checkReferenceExpression(GroovyAnnotator.java:684)
at org.jetbrains.plugins.groovy.annotator.GroovyAnnotator.annotate(GroovyAnnotator.java:102)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.visitElement(HighlightVisitorImpl.java:483)
at com.intellij.extapi.psi.PsiElementBase.accept(PsiElementBase.java:129)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.visit(HighlightVisitorImpl.java:149)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:196)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.access$600(GeneralHighlightingPass.java:107)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$1.run(GeneralHighlightingPass.java:22)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:123)
at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:9)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:50)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1$1.run(PassExecutorService.java:8)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:7)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1.run(PassExecutorService.java:1)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:13)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:10)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)





and also this one:



com.intellij.psi.PsiInvalidElementAccessException: Element: class org.jetbrains.plugins.groovy.lang.psi.impl.toplevel.imports.GrImportStatementImpl
at com.intellij.extapi.psi.PsiElementBase.getContainingFile(PsiElementBase.java:103)
at org.jetbrains.plugins.groovy.codeInspection.GroovyImportsTracker.registerImportUsed(GroovyImportsTracker.java:36)
at org.jetbrains.plugins.groovy.annotator.GroovyAnnotator.registerUsedImport(GroovyAnnotator.java:794)
at org.jetbrains.plugins.groovy.annotator.GroovyAnnotator.checkReferenceElement(GroovyAnnotator.java:832)
at org.jetbrains.plugins.groovy.annotator.GroovyAnnotator.annotate(GroovyAnnotator.java:100)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.visitElement(HighlightVisitorImpl.java:483)
at com.intellij.extapi.psi.PsiElementBase.accept(PsiElementBase.java:129)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.visit(HighlightVisitorImpl.java:149)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:196)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.access$600(GeneralHighlightingPass.java:107)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass$1.run(GeneralHighlightingPass.java:22)
at com.intellij.codeInsight.daemon.impl.RefCountHolder.analyzeAndStoreReferences(RefCountHolder.java:79)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:241)
at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:9)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:50)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1$1.run(PassExecutorService.java:8)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:7)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass$1.run(PassExecutorService.java:1)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:13)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:10)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)

2 comments
Comment actions Permalink

Just to be clear, the script still runs, it's just that much of the code highlighting and navigation stuff is inactive.

0
Comment actions Permalink

I just updated and restarted and the script is back to normal again. Dunno if it was the update or the restart.

0

Please sign in to leave a comment.