manifold-systems / manifold

Manifold is a Java compiler plugin, its features include Metaprogramming, Properties, Extension Methods, Operator Overloading, Templates, a Preprocessor, and more.
http://manifold.systems/
Apache License 2.0
2.43k stars 125 forks source link

Bug: java.lang.NoSuchFieldError: TEXT_BLOCK_TEMPLATE_BEGIN #507

Closed endorh closed 1 year ago

endorh commented 1 year ago

Describe the bug An IDE exception is thrown by the IJ Manifold plugin when opening any Java file in IJ IDEA within a project that does not use Manifold.

To Reproduce Steps to reproduce the behavior:

  1. Open a Java project without Manifold in IntelliJ IDEA, with the Manifold IJ plugin enabled.
  2. Open any Java file and observe how it fails to be opened.

Expected behavior No exception is thrown and the file can be opened in the editor.

Desktop (please complete the following information):

Additional context Happened after updating the IJ Manifold plugin to version 2023.2.3 (latest according to IJ plugin repository). For the record, I also just cleared all Gradle caches before opening the project. Could be related to the Code With Me plugin (which I'm not even using) (see stack trace).

Stack trace

Stack trace ``` Unhandled exception in [CoroutineName(ProjectImpl), com.intellij.codeWithMe.ClientIdElement@17a578bf, StandaloneCoroutine{Cancelling}@52867ec0, Dispatchers.EDT] java.lang.NoSuchFieldError: TEXT_BLOCK_TEMPLATE_BEGIN at manifold.ij.core.ManExpressionParser.parsePrimaryExpressionStart(ManExpressionParser.java:671) at manifold.ij.core.ManExpressionParser.parsePrimary(ManExpressionParser.java:489) at manifold.ij.core.ManExpressionParser.parsePostfix(ManExpressionParser.java:470) at manifold.ij.core.ManExpressionParser.parseUnary(ManExpressionParser.java:464) at manifold.ij.core.ManExpressionParser.parseExpression(ManExpressionParser.java:222) at manifold.ij.core.ManExpressionParser.parseBinary(ManExpressionParser.java:240) at manifold.ij.core.ManExpressionParser.parseBinary(ManExpressionParser.java:236) at manifold.ij.core.ManExpressionParser.parseExpression(ManExpressionParser.java:219) at manifold.ij.core.ManExpressionParser.parseBinary(ManExpressionParser.java:240) at manifold.ij.core.ManExpressionParser.parseBinary(ManExpressionParser.java:236) at manifold.ij.core.ManExpressionParser.parseExpression(ManExpressionParser.java:184) at manifold.ij.core.ManExpressionParser.parseBinary(ManExpressionParser.java:240) at manifold.ij.core.ManExpressionParser.parseBinary(ManExpressionParser.java:236) at manifold.ij.core.ManExpressionParser.parseExpression(ManExpressionParser.java:214) at manifold.ij.core.ManExpressionParser.parseBinary(ManExpressionParser.java:240) at manifold.ij.core.ManExpressionParser.parseBinary(ManExpressionParser.java:236) at manifold.ij.core.ManExpressionParser.parseExpression(ManExpressionParser.java:210) at manifold.ij.core.ManExpressionParser.parseRelational(ManExpressionParser.java:350) at manifold.ij.core.ManExpressionParser.parseExpression(ManExpressionParser.java:207) at manifold.ij.core.ManExpressionParser.parseBinary(ManExpressionParser.java:240) at manifold.ij.core.ManExpressionParser.parseBinary(ManExpressionParser.java:236) at manifold.ij.core.ManExpressionParser.parseExpression(ManExpressionParser.java:204) at manifold.ij.core.ManExpressionParser.parseBinary(ManExpressionParser.java:240) at manifold.ij.core.ManExpressionParser.parseBinary(ManExpressionParser.java:236) at manifold.ij.core.ManExpressionParser.parseExpression(ManExpressionParser.java:201) at manifold.ij.core.ManExpressionParser.parseBinary(ManExpressionParser.java:240) at manifold.ij.core.ManExpressionParser.parseBinary(ManExpressionParser.java:236) at manifold.ij.core.ManExpressionParser.parseExpression(ManExpressionParser.java:198) at manifold.ij.core.ManExpressionParser.parseBinary(ManExpressionParser.java:240) at manifold.ij.core.ManExpressionParser.parseBinary(ManExpressionParser.java:236) at manifold.ij.core.ManExpressionParser.parseExpression(ManExpressionParser.java:195) at manifold.ij.core.ManExpressionParser.parseBinary(ManExpressionParser.java:240) at manifold.ij.core.ManExpressionParser.parseBinary(ManExpressionParser.java:236) at manifold.ij.core.ManExpressionParser.parseExpression(ManExpressionParser.java:192) at manifold.ij.core.ManExpressionParser.parseBinary(ManExpressionParser.java:240) at manifold.ij.core.ManExpressionParser.parseBinary(ManExpressionParser.java:236) at manifold.ij.core.ManExpressionParser.parseExpression(ManExpressionParser.java:189) at manifold.ij.core.ManExpressionParser.parseConditional(ManExpressionParser.java:148) at manifold.ij.core.ManExpressionParser.parseAssignment(ManExpressionParser.java:119) at manifold.ij.core.ManExpressionParser.parseAssignment(ManExpressionParser.java:105) at manifold.ij.core.ManExpressionParser.parse(ManExpressionParser.java:94) at com.intellij.lang.java.parser.DeclarationParser.parseFieldOrLocalVariable(DeclarationParser.java:808) at com.intellij.lang.java.parser.DeclarationParser.parse(DeclarationParser.java:425) at com.intellij.lang.java.parser.DeclarationParser.parseClassBodyDeclarations(DeclarationParser.java:241) at com.intellij.lang.java.parser.DeclarationParser.parseClassBodyWithBraces(DeclarationParser.java:62) at com.intellij.lang.java.parser.DeclarationParser.parseClassFromKeyword(DeclarationParser.java:125) at com.intellij.lang.java.parser.DeclarationParser.parse(DeclarationParser.java:307) at com.intellij.lang.java.parser.FileParser.parseInitial(FileParser.java:100) at com.intellij.lang.java.parser.FileParser.parseFile(FileParser.java:56) at com.intellij.lang.java.parser.FileParser.parse(FileParser.java:35) at com.intellij.psi.impl.source.JavaFileElementType.doParse(JavaFileElementType.java:80) at com.intellij.psi.impl.source.JavaFileElementType.parseContents(JavaFileElementType.java:74) at com.intellij.psi.impl.source.tree.LazyParseableElement.lambda$ensureParsed$2(LazyParseableElement.java:183) at com.intellij.psi.impl.DebugUtil.performPsiModification(DebugUtil.java:481) at com.intellij.psi.impl.source.tree.LazyParseableElement.ensureParsed(LazyParseableElement.java:182) at com.intellij.psi.impl.source.tree.LazyParseableElement.getFirstChildNode(LazyParseableElement.java:234) at com.intellij.psi.impl.source.tree.LazyParseableElement.getFirstChildNode(LazyParseableElement.java:25) at com.intellij.psi.impl.source.tree.RecursiveTreeElementWalkingVisitor$ASTTreeGuide.getFirstChild(RecursiveTreeElementWalkingVisitor.java:47) at com.intellij.psi.impl.source.tree.RecursiveTreeElementWalkingVisitor$ASTTreeGuide.getFirstChild(RecursiveTreeElementWalkingVisitor.java:34) at com.intellij.util.WalkingState.next(WalkingState.java:72) at com.intellij.util.WalkingState.walkChildren(WalkingState.java:51) at com.intellij.util.WalkingState.elementStarted(WalkingState.java:42) at com.intellij.psi.impl.source.tree.RecursiveTreeElementWalkingVisitor.visitNode(RecursiveTreeElementWalkingVisitor.java:85) at com.intellij.psi.impl.source.tree.FileElement$1.visitComposite(FileElement.java:117) at com.intellij.psi.impl.source.tree.CompositeElement.acceptTree(CompositeElement.java:116) at com.intellij.psi.impl.source.tree.FileElement.calcStubbedDescendants(FileElement.java:104) at com.intellij.psi.impl.source.tree.FileElement.lambda$getStubbedSpine$0(FileElement.java:91) at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:110) at com.intellij.openapi.util.RecursionGuard.doPreventingRecursion(RecursionGuard.java:27) at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:65) at com.intellij.psi.impl.source.tree.FileElement.getStubbedSpine(FileElement.java:91) at com.intellij.psi.impl.source.FileTrees.reconcilePsi(FileTrees.java:169) at com.intellij.psi.impl.source.FileTrees.withAst(FileTrees.java:141) at com.intellij.psi.impl.source.PsiFileImpl.loadTreeElement(PsiFileImpl.java:214) at com.intellij.psi.impl.source.PsiFileImpl.calcTreeElement(PsiFileImpl.java:727) at com.intellij.extapi.psi.StubBasedPsiElementBase.getNode(StubBasedPsiElementBase.java:127) at com.intellij.psi.impl.source.PsiClassImpl.getNode(PsiClassImpl.java:103) at com.intellij.psi.impl.source.PsiClassImpl.getNode(PsiClassImpl.java:36) at com.intellij.psi.impl.source.JavaStubPsiElement.calcTreeElement(JavaStubPsiElement.java:47) at com.intellij.psi.impl.source.JavaStubPsiElement.getTextOffset(JavaStubPsiElement.java:43) at com.intellij.platform.backend.navigation.impl.NavigationRequestsImpl.psiNavigationRequest(NavigationRequestsImpl.kt:87) at com.intellij.psi.impl.PsiElementBase.navigationRequest(PsiElementBase.java:187) at com.intellij.ide.projectView.impl.nodes.AbstractPsiBasedNode.navigationRequest(AbstractPsiBasedNode.java:307) at com.intellij.platform.ide.navigation.impl.IdeNavigationService$navigate$6$request$1.invoke(IdeNavigationService.kt:81) at com.intellij.platform.ide.navigation.impl.IdeNavigationService$navigate$6$request$1.invoke(IdeNavigationService.kt:80) at com.intellij.openapi.application.rw.InternalReadAction.insideReadAction(InternalReadAction.kt:105) at com.intellij.openapi.application.rw.InternalReadAction.access$insideReadAction(InternalReadAction.kt:14) at com.intellij.openapi.application.rw.InternalReadAction$tryReadCancellable$2.invoke(InternalReadAction.kt:95) at com.intellij.openapi.application.rw.InternalReadAction$tryReadCancellable$2.invoke(InternalReadAction.kt:94) at com.intellij.openapi.application.rw.CancellableReadActionKt$cancellableReadActionInternal$1.invoke$lambda$1$lambda$0(cancellableReadAction.kt:41) at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1133) at com.intellij.openapi.application.rw.CancellableReadActionKt$cancellableReadActionInternal$1.invoke$lambda$1(cancellableReadAction.kt:39) at com.intellij.openapi.progress.util.ProgressIndicatorUtilService.runActionAndCancelBeforeWrite(ProgressIndicatorUtilService.java:63) at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:133) at com.intellij.openapi.application.rw.CancellableReadActionKt$cancellableReadActionInternal$1.invoke(cancellableReadAction.kt:37) at com.intellij.openapi.progress.CoroutinesKt.blockingContext(coroutines.kt:248) at com.intellij.openapi.application.rw.CancellableReadActionKt.cancellableReadActionInternal(cancellableReadAction.kt:34) at com.intellij.openapi.application.rw.InternalReadAction.tryReadCancellable(InternalReadAction.kt:94) at com.intellij.openapi.application.rw.InternalReadAction.tryReadAction(InternalReadAction.kt:76) at com.intellij.openapi.application.rw.InternalReadAction.readLoop(InternalReadAction.kt:63) at com.intellij.openapi.application.rw.InternalReadAction.access$readLoop(InternalReadAction.kt:14) at com.intellij.openapi.application.rw.InternalReadAction$runReadAction$4.invokeSuspend(InternalReadAction.kt:42) at com.intellij.openapi.application.rw.InternalReadAction$runReadAction$4.invoke(InternalReadAction.kt) at com.intellij.openapi.application.rw.InternalReadAction$runReadAction$4.invoke(InternalReadAction.kt) at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78) at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:167) at kotlinx.coroutines.BuildersKt.withContext(Unknown Source) at com.intellij.openapi.application.rw.InternalReadAction.runReadAction(InternalReadAction.kt:38) at com.intellij.openapi.application.rw.PlatformReadWriteActionSupport.executeReadAction(PlatformReadWriteActionSupport.kt:38) at com.intellij.openapi.application.ReadWriteActionSupport.executeReadAction$default(ReadWriteActionSupport.kt:15) at com.intellij.openapi.application.CoroutinesKt.constrainedReadAction(coroutines.kt:58) at com.intellij.openapi.application.CoroutinesKt.readAction(coroutines.kt:25) at com.intellij.platform.ide.navigation.impl.IdeNavigationService$navigate$6.invokeSuspend(IdeNavigationService.kt:80) at com.intellij.platform.ide.navigation.impl.IdeNavigationService$navigate$6.invoke(IdeNavigationService.kt) at com.intellij.platform.ide.navigation.impl.IdeNavigationService$navigate$6.invoke(IdeNavigationService.kt) at com.intellij.util.DropOldestSemaphoreBase$withPermit$2.invokeSuspend(OverflowSemaphore.kt:146) at com.intellij.util.DropOldestSemaphoreBase$withPermit$2.invoke(OverflowSemaphore.kt) at com.intellij.util.DropOldestSemaphoreBase$withPermit$2.invoke(OverflowSemaphore.kt) at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78) at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:264) at com.intellij.util.DropOldestSemaphoreBase.withPermit(OverflowSemaphore.kt:139) at com.intellij.platform.ide.navigation.impl.IdeNavigationService.navigate(IdeNavigationService.kt:79) at com.intellij.util.OpenSourceUtilKt$navigateToSource$1.invokeSuspend(OpenSourceUtil.kt:50) at com.intellij.util.OpenSourceUtilKt$navigateToSource$1.invoke(OpenSourceUtil.kt) at com.intellij.util.OpenSourceUtilKt$navigateToSource$1.invoke(OpenSourceUtil.kt) at com.intellij.openapi.progress.impl.PlatformTaskSupport$runWithModalProgressBlockingInternal$2$1$taskJob$1.invokeSuspend(PlatformTaskSupport.kt:142) 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:584) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684) Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [CoroutineName(ProjectImpl), com.intellij.codeWithMe.ClientIdElement@17a578bf, StandaloneCoroutine{Cancelled}@52867ec0, Dispatchers.EDT] ```
rsmckinney commented 1 year ago

Whoops! You are using the latest plugin, which works with IJ 2023.2.2 and later, but you are using an older version of IJ (IJ 2023.2). This is the fault of the manifold plugin; there is a typo in the older plugin's version range. For now you can get either the older plugin that supports IJ 2023.2, which is Manifold plugin version 2023.1.28. Or, update your IJ to at least version (IJ 2023.2.2), which works with the manifold plugin you have.

This will be fixed in tomorrow's plugin release. Thanks for reporting this!

endorh commented 1 year ago

Oh, I always forget I have disabled autoupdates in the JB Toolbox, and now the IDE doesn't tell me when there's an update. Forgot to check that 😅

Thanks for the quick fix, updating IJ solved it for me ^^