mbolotov / intellij-cypress

IntelliJ-Cypress plugin: https://plugins.jetbrains.com/plugin/13819-intellij-cypress Pro version: https://plugins.jetbrains.com/plugin/13987-cypress-support-pro
MIT License
35 stars 5 forks source link

Must be executed under progress indicator: com.intellij.openapi.progress.EmptyProgressIndicator #100

Open VolodymyrLykhachov opened 1 year ago

VolodymyrLykhachov commented 1 year ago

Idea v.2022.1.2 Cypress Support Pro plugin v.3.2.2 This issue was reported previously as https://github.com/mbolotov/intellij-cypress/issues/77 and https://github.com/mbolotov/intellij-cypress/issues/84

I face with such exception time-to-time. Don't know exact steps to reproduce.

Here is what I googled for similar problem: "there's a general suggestion that all the reference resolution logic should be moved to doAnnotate method as apply is supposed to be fast and simple"

Exception text: java.lang.Throwable: Must be executed under progress indicator: com.intellij.openapi.progress.EmptyProgressIndicator@7c79c771. Please see e.g. ProgressManager.runProcess() at com.intellij.openapi.diagnostic.Logger.error(Logger.java:182) at com.intellij.openapi.progress.impl.CoreProgressManager.assertUnderProgress(CoreProgressManager.java:996) at com.intellij.psi.impl.search.PsiSearchHelperImpl.processFilesConcurrentlyDespiteWriteActions(PsiSearchHelperImpl.java:428) at com.intellij.psi.impl.search.PsiSearchHelperImpl.lambda$processPsiFileRoots$8(PsiSearchHelperImpl.java:397) at com.intellij.psi.impl.PsiManagerImpl.runInBatchFilesMode(PsiManagerImpl.java:451) at com.intellij.psi.impl.search.PsiSearchHelperImpl.processPsiFileRoots(PsiSearchHelperImpl.java:393) at com.intellij.psi.impl.search.PsiSearchHelperImpl.processElementsWithTextInGlobalScope(PsiSearchHelperImpl.java:314) at com.intellij.psi.impl.search.PsiSearchHelperImpl.bulkProcessElementsWithWord(PsiSearchHelperImpl.java:223) at com.intellij.psi.impl.search.PsiSearchHelperImpl.processElementsWithWord(PsiSearchHelperImpl.java:202) at com.intellij.psi.impl.search.PsiSearchHelperImpl.processElementsWithWord(PsiSearchHelperImpl.java:159) at com.intellij.psi.impl.search.PsiSearchHelperImpl.processElementsWithWord(PsiSearchHelperImpl.java:147) at me.mbolotov.cypress.completion.CyReferenceContributorKt.A(Unknown Source) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:623) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60) at me.mbolotov.cypress.completion.CyReferenceContributorKt.getCyCustomCommands(Unknown Source) at me.mbolotov.cypress.completion.CyCommandsContributor$_A$1.getReferencesByElement(Unknown Source) at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.getReferences(ReferenceProvidersRegistryImpl.java:199) at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.mapNotEmptyReferencesFromProviders(ReferenceProvidersRegistryImpl.java:162) at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistryImpl.doGetReferencesFromProviders(ReferenceProvidersRegistryImpl.java:141) at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.lambda$getReferencesFromProviders$0(ReferenceProvidersRegistry.java:39) at com.intellij.psi.util.CachedValuesManager$1.compute(CachedValuesManager.java:158) at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:39) at com.intellij.util.CachedValueBase.lambda$getValueWithLock$3(CachedValueBase.java:227) at com.intellij.util.CachedValueBase.computeData(CachedValueBase.java:42) at com.intellij.util.CachedValueBase.lambda$getValueWithLock$4(CachedValueBase.java:227) at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:114) at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:44) at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:68) at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:228) at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:28) at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:72) at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:155) at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:121) at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.getReferencesFromProviders(ReferenceProvidersRegistry.java:38) at com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry.getReferencesFromProviders(ReferenceProvidersRegistry.java:31) at com.intellij.lang.javascript.psi.resolve.JSReferenceExpressionResolver.resolveFromProviders(JSReferenceExpressionResolver.java:252) at com.intellij.lang.javascript.psi.resolve.JSReferenceExpressionResolver.resolve(JSReferenceExpressionResolver.java:80) at com.intellij.lang.javascript.psi.resolve.JSReferenceExpressionResolver.resolve(JSReferenceExpressionResolver.java:39) at com.intellij.lang.javascript.psi.resolve.JSResolveUtil$5.get(JSResolveUtil.java:1635) at com.intellij.lang.javascript.psi.resolve.JSResolveUtil$5.get(JSResolveUtil.java:1632) at com.intellij.lang.javascript.psi.resolve.JSEvaluatorComplexityTracker.runTask(JSEvaluatorComplexityTracker.java:72) at com.intellij.lang.javascript.psi.resolve.JSComplexityAwareRecursionGuard.lambda$getCachedValue$0(JSComplexityAwareRecursionGuard.java:71) at com.intellij.lang.javascript.psi.resolve.JSResolveUtil$4.lambda$calculateWithCaching$0(JSResolveUtil.java:1648) at com.intellij.psi.impl.source.resolve.ResolveCache.lambda$resolve$1(ResolveCache.java:154) at com.intellij.openapi.util.Computable.get(Computable.java:16) at com.intellij.psi.impl.source.resolve.ResolveCache.lambda$loggingResolver$4(ResolveCache.java:260) at com.intellij.openapi.util.Computable.get(Computable.java:16) at com.intellij.psi.impl.source.resolve.ResolveCache.resolve(ResolveCache.java:238) at com.intellij.psi.impl.source.resolve.ResolveCache.resolve(ResolveCache.java:154) at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:289) at com.intellij.lang.javascript.psi.resolve.JSResolveUtil$4.calculateWithCaching(JSResolveUtil.java:1646) at com.intellij.lang.javascript.psi.resolve.JSComplexityAwareRecursionGuard.getCachedValue(JSComplexityAwareRecursionGuard.java:74) at com.intellij.lang.javascript.psi.resolve.JSResolveUtil.resolve(JSResolveUtil.java:1630) at com.intellij.lang.javascript.psi.impl.JSReferenceExpressionImpl.multiResolve(JSReferenceExpressionImpl.java:527) at com.intellij.lang.javascript.psi.ExpectedTypeEvaluator.resolveFunctionCall(ExpectedTypeEvaluator.java:898) at com.intellij.lang.javascript.psi.ExpectedTypeEvaluator.handleFunctionCallType(ExpectedTypeEvaluator.java:766) at com.intellij.lang.javascript.psi.types.JSFunctionParameterExpectedTypeImpl.substituteImpl(JSFunctionParameterExpectedTypeImpl.java:42) at com.intellij.lang.javascript.psi.types.JSTypeBaseImpl.substituteNoCache(JSTypeBaseImpl.java:652) at com.intellij.lang.javascript.psi.types.JSTypeBaseImpl.substituteAndOptimizeNoCache(JSTypeBaseImpl.java:644) at com.intellij.lang.javascript.psi.types.JSTypeBaseImpl.lambda$substitute$1(JSTypeBaseImpl.java:633) at com.intellij.lang.javascript.psi.types.JSResolvedTypeIdCache.lambda$getLocalCachedValue$2(JSResolvedTypeIdCache.java:66) at com.intellij.lang.javascript.psi.resolve.JSComplexityAwareRecursionGuard$1.lambda$get$0(JSComplexityAwareRecursionGuard.java:43) at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:114) at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:44) at com.intellij.lang.javascript.psi.resolve.JSComplexityAwareRecursionGuard.doPreventingRecursion(JSComplexityAwareRecursionGuard.java:94) at com.intellij.lang.javascript.psi.resolve.JSComplexityAwareRecursionGuard$1.get(JSComplexityAwareRecursionGuard.java:43) at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:114) at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:44) at com.intellij.lang.javascript.psi.resolve.JSEvaluatorComplexityTracker.runTask(JSEvaluatorComplexityTracker.java:72) at com.intellij.lang.javascript.psi.resolve.JSComplexityAwareRecursionGuard.getCachedValue(JSComplexityAwareRecursionGuard.java:40) at com.intellij.lang.javascript.psi.types.JSResolvedTypeIdCache.getLocalCachedValue(JSResolvedTypeIdCache.java:60) at com.intellij.lang.javascript.psi.types.JSTypeBaseImpl$JSResolvedTypeIdImpl.getLocalCachedValue(JSTypeBaseImpl.java:846) at com.intellij.lang.javascript.psi.types.JSTypeBaseImpl.substitute(JSTypeBaseImpl.java:632) at com.intellij.lang.javascript.psi.types.JSTypeBaseImpl.substitute(JSTypeBaseImpl.java:621) at com.intellij.lang.javascript.psi.types.guard.TypeScriptTypeRelations.expandAndOptimizeTypeRecursive(TypeScriptTypeRelations.java:267) at com.intellij.lang.javascript.psi.ExpectedTypeEvaluator.convertToContextual(ExpectedTypeEvaluator.java:115) at com.intellij.lang.javascript.psi.ExpectedTypeEvaluator.findExpectedType(ExpectedTypeEvaluator.java:106) at com.intellij.lang.javascript.dialects.JSDialectSpecificHandlersFactory.findExpectedType(JSDialectSpecificHandlersFactory.java:66) at com.intellij.lang.javascript.psi.JSContextTypeEvaluator.getParameterParentExpectedType(JSContextTypeEvaluator.java:146) at com.intellij.lang.javascript.psi.JSContextTypeEvaluator.processParameterExpectedTypeInCallExpression(JSContextTypeEvaluator.java:178) at com.intellij.lang.javascript.psi.JSContextTypeEvaluator.getParameterTypeByExpectedTypes(JSContextTypeEvaluator.java:161) at com.intellij.lang.javascript.psi.JSContextTypeEvaluator.getParameterType(JSContextTypeEvaluator.java:86) at com.intellij.lang.javascript.actions.JSShowTypeInfoAction.getTypeForDocumentation(JSShowTypeInfoAction.java:83) at com.intellij.lang.javascript.documentation.JSQuickNavigateBuilder.getVariableOrFieldType(JSQuickNavigateBuilder.java:832) at com.intellij.lang.javascript.documentation.JSQuickNavigateBuilder.createForVariableOrField(JSQuickNavigateBuilder.java:483) at com.intellij.lang.javascript.documentation.JSQuickNavigateBuilder.getQuickNavigateInfoForNavigationElement(JSQuickNavigateBuilder.java:170) at com.intellij.lang.javascript.documentation.JavaScriptQuickNavigateBuilder.getQuickNavigateInfoForNavigationElement(JavaScriptQuickNavigateBuilder.java:62) at com.intellij.lang.javascript.documentation.FlowQuickNavigateBuilder.getQuickNavigateInfoForNavigationElement(FlowQuickNavigateBuilder.java:26) at com.intellij.lang.javascript.documentation.JSQuickNavigateBuilder.getQuickNavigateInfo(JSQuickNavigateBuilder.java:196) at com.intellij.lang.javascript.documentation.JSDocumentationProvider.getQuickNavigateInfo(JSDocumentationProvider.java:124) at com.intellij.lang.documentation.CompositeDocumentationProvider.getQuickNavigateInfo(CompositeDocumentationProvider.java:117) at com.intellij.codeInsight.navigation.SingleTargetElementInfo.generateInfo(SingleTargetElementInfo.java:62) at com.intellij.lang.documentation.psi.PsiElementDocumentationTarget.computeDocumentationHint(PsiElementDocumentationTarget.kt:69) at com.intellij.codeInsight.navigation.CtrlMouseDataKt.targetCtrlMouseData(CtrlMouseData.kt:88) at com.intellij.codeInsight.navigation.CtrlMouseDataKt.psiCtrlMouseData(CtrlMouseData.kt:74) at com.intellij.codeInsight.navigation.impl.GTDProviderData.ctrlMouseData(gtdProviders.kt:66) at com.intellij.codeInsight.navigation.impl.GtduKt$toGTDUActionData$1.ctrlMouseData(gtdu.kt:70) at com.intellij.codeInsight.navigation.actions.GotoDeclarationOrUsageHandler2.getCtrlMouseData(GotoDeclarationOrUsageHandler2.kt:41) at com.intellij.codeInsight.navigation.actions.GotoDeclarationAction.getCtrlMouseData(GotoDeclarationAction.java:95) at com.intellij.codeInsight.navigation.CtrlMouseHandler2$computeInReadAction$1.invoke(CtrlMouseHandler.kt:235) at com.intellij.codeInsight.navigation.CtrlMouseHandler2$computeInReadAction$1.invoke(CtrlMouseHandler.kt:77) at com.intellij.lang.documentation.ide.impl.DocumentationTargetHoverInfoKt.injectedThenHost(DocumentationTargetHoverInfo.kt:76) at com.intellij.codeInsight.navigation.CtrlMouseHandler2.computeInReadAction(CtrlMouseHandler.kt:234) at com.intellij.codeInsight.navigation.CtrlMouseHandler2.access$computeInReadAction(CtrlMouseHandler.kt:77) at com.intellij.codeInsight.navigation.CtrlMouseHandler2$compute$2$1.invoke(CtrlMouseHandler.kt:222) at com.intellij.codeInsight.navigation.CtrlMouseHandler2$compute$2$1.invoke(CtrlMouseHandler.kt:77) at com.intellij.openapi.application.rw.InternalReadAction.insideReadAction(InternalReadAction.kt:96) at com.intellij.openapi.application.rw.InternalReadAction.access$insideReadAction(InternalReadAction.kt:13) at com.intellij.openapi.application.rw.InternalReadAction$tryReadCancellable$1.invoke(InternalReadAction.kt:81) at com.intellij.openapi.application.rw.InternalReadAction$tryReadCancellable$1.invoke(InternalReadAction.kt:13) at com.intellij.openapi.progress.CancellationKt$sam$com_intellij_openapi_util_ThrowableComputable$0.compute(cancellation.kt) at com.intellij.openapi.progress.Cancellation.withJob(Cancellation.java:60) at com.intellij.openapi.progress.CancellationKt.withJob(cancellation.kt:14) at com.intellij.openapi.progress.CancellationKt.executeWithJobAndCompleteIt(cancellation.kt:111) at com.intellij.openapi.application.rw.CancellableReadActionKt$cancellableReadActionInternal$2$1.run(cancellableReadAction.kt:34) at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1152) at com.intellij.openapi.application.rw.CancellableReadActionKt$cancellableReadActionInternal$2.run(cancellableReadAction.kt:32) at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:158) at com.intellij.openapi.application.rw.CancellableReadActionKt.cancellableReadActionInternal(cancellableReadAction.kt:30) at com.intellij.openapi.application.rw.InternalReadAction.tryReadCancellable(InternalReadAction.kt:80) at com.intellij.openapi.application.rw.InternalReadAction.access$tryReadCancellable(InternalReadAction.kt:13) at com.intellij.openapi.application.rw.InternalReadAction$tryReadAction$2.invoke(InternalReadAction.kt:66) at com.intellij.openapi.application.rw.InternalReadAction$tryReadAction$2.invoke(InternalReadAction.kt:13) at com.intellij.openapi.progress.CancellationKt$sam$com_intellij_openapi_util_ThrowableComputable$0.compute(cancellation.kt) at com.intellij.openapi.progress.Cancellation.withJob(Cancellation.java:60) at com.intellij.openapi.progress.CancellationKt.withJob(cancellation.kt:14) at com.intellij.openapi.progress.CoroutinesKt.blockingContext(coroutines.kt:138) at com.intellij.openapi.application.rw.InternalReadAction.tryReadAction(InternalReadAction.kt:61) at com.intellij.openapi.application.rw.InternalReadAction.readLoop(InternalReadAction.kt:53) at com.intellij.openapi.application.rw.InternalReadAction.access$readLoop(InternalReadAction.kt:13) at com.intellij.openapi.application.rw.InternalReadAction$runReadAction$4.invokeSuspend(InternalReadAction.kt:33) at com.intellij.openapi.application.rw.InternalReadAction$runReadAction$4.invoke(InternalReadAction.kt) at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89) at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:264) at com.intellij.openapi.application.rw.InternalReadAction.runReadAction(InternalReadAction.kt:32) at com.intellij.openapi.application.rw.PlatformReadActionSupport.executeReadAction(PlatformReadActionSupport.kt:24) at com.intellij.openapi.application.CoroutinesKt.constrainedReadAction(coroutines.kt:50) at com.intellij.codeInsight.navigation.CtrlMouseHandler2$compute$2.invokeSuspend(CtrlMouseHandler.kt:221) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)