Problems with M14 plugin


#1

Today IDEA (EAP) updated my Kotlin plugin to 0.14.489. Since then, I've been getting this error:

org.jetbrains.kotlin.psi.JetImportDirective cannot be cast to org.jetbrains.kotlin.psi.JetClassOrObject java.lang.ClassCastException: org.jetbrains.kotlin.psi.JetImportDirective cannot be cast to org.jetbrains.kotlin.psi.JetClassOrObject      at org.jetbrains.kotlin.idea.stubindex.resolve.StubBasedPackageMemberDeclarationProvider.getClassOrObjectDeclarations(StubBasedPackageMemberDeclarationProvider.kt:95)      at org.jetbrains.kotlin.resolve.lazy.descriptors.AbstractLazyMemberScope.resolveClassDescriptor(AbstractLazyMemberScope.kt:57)      at org.jetbrains.kotlin.resolve.lazy.descriptors.AbstractLazyMemberScope.access$resolveClassDescriptor$0(AbstractLazyMemberScope.kt:43)      at org.jetbrains.kotlin.resolve.lazy.descriptors.AbstractLazyMemberScope$classDescriptors$1.invoke(AbstractLazyMemberScope.kt:52)      at org.jetbrains.kotlin.resolve.lazy.descriptors.AbstractLazyMemberScope$classDescriptors$1.invoke(AbstractLazyMemberScope.kt:43)      at org.jetbrains.kotlin.storage.LockBasedStorageManager$MapBasedMemoizedFunction.invoke(LockBasedStorageManager.java:389)      at org.jetbrains.kotlin.storage.LockBasedStorageManager$MapBasedMemoizedFunctionToNotNull.invoke(LockBasedStorageManager.java:453)      at org.jetbrains.kotlin.resolve.lazy.descriptors.AbstractLazyMemberScope.getClassifier(AbstractLazyMemberScope.kt:70)      at org.jetbrains.kotlin.resolve.lazy.descriptors.AbstractLazyMemberScope.getClassifier(AbstractLazyMemberScope.kt:43)      at org.jetbrains.kotlin.resolve.scopes.ChainedScope.getClassifier(ChainedScope.kt:37)      at org.jetbrains.kotlin.resolve.scopes.AbstractScopeAdapter.getClassifier(AbstractScopeAdapter.kt:50)      at org.jetbrains.kotlin.resolve.QualifiedExpressionResolver.processImportReference(QualifiedExpressionResolver.kt:151)      at org.jetbrains.kotlin.resolve.lazy.LazyImportResolver$importedScopesProvider$1.invoke(LazyImportScope.kt:79)      at org.jetbrains.kotlin.resolve.lazy.LazyImportResolver$importedScopesProvider$1.invoke(LazyImportScope.kt:69)      at org.jetbrains.kotlin.storage.LockBasedStorageManager$MapBasedMemoizedFunction.invoke(LockBasedStorageManager.java:389)      at org.jetbrains.kotlin.resolve.lazy.LazyImportResolver.getImportScope(LazyImportScope.kt:156)      at org.jetbrains.kotlin.resolve.lazy.LazyImportResolver.forceResolveImportDirective(LazyImportScope.kt:119)      at org.jetbrains.kotlin.resolve.lazy.LazyImportResolver.forceResolveAllContents(LazyImportScope.kt:93)      at org.jetbrains.kotlin.resolve.lazy.LazyFileScope.forceResolveAllImports(LazyFileScope.kt:50)      at org.jetbrains.kotlin.idea.project.ResolveElementCache.performElementAdditionalResolve(ResolveElementCache.kt:274)      at org.jetbrains.kotlin.idea.project.ResolveElementCache.getElementAdditionalResolve(ResolveElementCache.kt:131)      at org.jetbrains.kotlin.idea.project.ResolveElementCache.getElementAdditionalResolve(ResolveElementCache.kt:138)      at org.jetbrains.kotlin.idea.project.ResolveElementCache.resolveToElement(ResolveElementCache.kt:188)      at org.jetbrains.kotlin.idea.caches.resolve.ResolutionFacadeImpl.analyze(ProjectResolutionFacade.kt:102)      at org.jetbrains.kotlin.idea.caches.resolve.ResolutionUtils.analyze(resolutionApi.kt:57)      at org.jetbrains.kotlin.idea.references.AbstractJetReference.resolveToPsiElements(JetReference.kt:74)      at org.jetbrains.kotlin.idea.references.AbstractJetReference.multiResolve(JetReference.kt:46)      at org.jetbrains.kotlin.idea.references.ReferenceUtilKt.getUnwrappedTargets(referenceUtil.kt:54)      at org.jetbrains.kotlin.idea.references.ReferenceUtilKt.matchesTarget(referenceUtil.kt:81)      at org.jetbrains.kotlin.idea.references.AbstractJetReference.isReferenceTo(JetReference.kt:58)      at com.intellij.psi.search.SingleTargetRequestResultProcessor.processTextOccurrence(SingleTargetRequestResultProcessor.java:52)      at com.intellij.psi.impl.search.PsiSearchHelperImpl$14.execute(PsiSearchHelperImpl.java:739)      at com.intellij.psi.impl.search.LowLevelSearchUtil.a(LowLevelSearchUtil.java:129)      at com.intellij.psi.impl.search.LowLevelSearchUtil.access$000(LowLevelSearchUtil.java:42)      at com.intellij.psi.impl.search.LowLevelSearchUtil$1.execute(LowLevelSearchUtil.java:199)      at com.intellij.psi.impl.search.LowLevelSearchUtil.processTextOccurrences(LowLevelSearchUtil.java:242)      at com.intellij.psi.impl.search.LowLevelSearchUtil.processElementsContainingWordInElement(LowLevelSearchUtil.java:195)      at com.intellij.psi.impl.search.PsiSearchHelperImpl$2$1.compute(PsiSearchHelperImpl.java:211)      at com.intellij.psi.impl.search.PsiSearchHelperImpl$2$1.compute(PsiSearchHelperImpl.java:208)      at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:949)      at com.intellij.psi.impl.search.PsiSearchHelperImpl$2.process(PsiSearchHelperImpl.java:208)      at com.intellij.psi.impl.search.PsiSearchHelperImpl$2.process(PsiSearchHelperImpl.java:205)      at com.intellij.psi.impl.search.PsiSearchHelperImpl$13.process(PsiSearchHelperImpl.java:703)      at com.intellij.psi.impl.search.PsiSearchHelperImpl$13.process(PsiSearchHelperImpl.java:697)      at com.intellij.psi.impl.search.PsiSearchHelperImpl$5.compute(PsiSearchHelperImpl.java:366)      at com.intellij.psi.impl.search.PsiSearchHelperImpl$5.compute(PsiSearchHelperImpl.java:348)      at com.intellij.openapi.application.ex.ApplicationUtil$1.run(ApplicationUtil.java:37)      at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1155)      at com.intellij.openapi.application.ex.ApplicationUtil.tryRunReadAction(ApplicationUtil.java:34)      at com.intellij.psi.impl.search.PsiSearchHelperImpl.a(PsiSearchHelperImpl.java:348)      at com.intellij.psi.impl.search.PsiSearchHelperImpl.access$000(PsiSearchHelperImpl.java:67)      at com.intellij.psi.impl.search.PsiSearchHelperImpl$3.process(PsiSearchHelperImpl.java:295)      at com.intellij.psi.impl.search.PsiSearchHelperImpl$3.process(PsiSearchHelperImpl.java:290)      at com.intellij.concurrency.ApplierCompleter.a(ApplierCompleter.java:122)      at com.intellij.concurrency.ApplierCompleter.access$000(ApplierCompleter.java:44)      at com.intellij.concurrency.ApplierCompleter$1.run(ApplierCompleter.java:85)      at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:446)      at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:443)      at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:443)      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.concurrency.ApplierCompleter.a(ApplierCompleter.java:106)      at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:82)      at jsr166e.CountedCompleter.exec(CountedCompleter.java:684)      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)

... repeteadly, multiple times per second.

Also, “println” doesn’t seem to be recognized anymore, or “@Throws”, or some other constructs.

Is there anything I can do? Is this a known problem? Should I try with one of the latest builds for the plugin?

Compiling with gradle with the same version works completely fine…


#2

Tried with the latest successful plugin build (0.14.499, although I didn't change the kotlin stdlib or gradle plugin versions) with the same result...


#3

Could you try to Invalidate caches in your IDE? (File -> Invalidate Caches/Restart -> Invalidate and Restart)


#4

I've updated my dependencies to kotlin-plugin 0.14.450 (which is tagged in TeamCity as M14) for IDEA 142.5047.6 (15 EAP), and kotlin-stdlib 0.14.449 (from Maven central). The IDEA editor, compilation in IDEA and compilation with Gradle all work fine.


#5

Hi,

I tried that already, with no results. I even tried in another computer which, while not throwing those errors to me, still didn’t manage to found any references to “println”, “@Throws” or anything coming from stdlib, it seems (and yes, it’s been referenced from the gradle files, as compiling with the command line works fine)

Also Benjamin is right, for Gradle I used 0.14.449 instead of 0.14.489, but the plugin is definitely 0.14.489.

Moving back to 0.13.1514 works fine.

So, tl;dr; 0.13.1514 seems to work fine, 0.14.489 and 0.14.499 doesn’t… (tried multiple computers with the same project, and invalidating caches and restarting)


#6

I justsaw that there is a download for 0.14.449 on https://plugins.jetbrains.com/plugin/6954?pr=

That one seems to work fine :slight_smile:


#7

Note that version of koltin-plugin in IDE should be the same as the version in gradle, because different versions of Standart library and Compiler could be incompatible, as a result any symbol from library will be unresolved.