AzureMarker / intellij-lalrpop

Jetbrains plugin for the LALRPOP parser-generator
MIT License
16 stars 2 forks source link

0.2.14: Error occurs while analyzing grammar with quantifier macros `*` `+` `?`. #58

Open jellyterra opened 2 weeks ago

jellyterra commented 2 weeks ago
use std::str::FromStr;
use crate::parser::ast::*;

grammar;

pub MatchExpr: MatchExpr = "(" "match" <expr: Expr> <patterns: Case*> ")" => MatchExpr{expr, patterns};

Environment:

LALRPOP plugin 0.2.14
IntelliJ IDEA 2024.2.4 (Ultimate Edition)
Build #IU-242.23726.103, built on October 23, 2024
Fedora Linux

Any quantifier after Case would cause the error below:

java.lang.NoSuchMethodError: 'com.intellij.psi.tree.IElementType org.rust.lang.core.psi.ext.PsiElementKt.getElementType(com.intellij.psi.PsiElement)'
    at com.mdrobnak.lalrpop.psi.ext.LpRepeatOpKt.switch(LpRepeatOp.kt:9)
    at com.mdrobnak.lalrpop.psi.ext.LpSymbol0Mixin.resolveType(LpSymbol0.kt:12)
    at com.mdrobnak.lalrpop.psi.ext.LpSymbolMixin.resolveType(LpSymbol.kt:42)
    at com.mdrobnak.lalrpop.psi.ext.LpSymbolKt.getSelectedType(LpSymbol.kt:28)
    at com.mdrobnak.lalrpop.psi.ext.LpAlternativeKt.selectedTypesInContext(LpAlternative.kt:28)
    at com.mdrobnak.lalrpop.psi.ext.LpAlternativeKt.selectedTypesInContext$default(LpAlternative.kt:24)
    at com.mdrobnak.lalrpop.psi.ext.LpActionKt.actionCodeFunctionHeader(LpAction.kt:42)
    at com.mdrobnak.lalrpop.injectors.LpRustActionCodeInjector.getLanguagesToInject(LpRustActionCodeInjector.kt:23)
    at com.intellij.psi.impl.source.tree.injected.InjectedLanguageManagerImpl.processInPlaceInjectorsFor(InjectedLanguageManagerImpl.java:498)
    at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.probeElementsUpInner(InjectedLanguageUtilBase.java:237)
    at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.lambda$probeElementsUp$0(InjectedLanguageUtilBase.java:217)
    at com.intellij.openapi.application.impl.ReadActionCacheImpl$allowInWriteAction$1.invoke(ReadActionCacheImpl.kt:41)
    at com.intellij.openapi.application.impl.ReadActionCacheImpl$allowInWriteAction$1.invoke(ReadActionCacheImpl.kt:41)
    at com.intellij.openapi.application.impl.ReadActionCacheImpl.allowInWriteAction(ReadActionCacheImpl.kt:29)
    at com.intellij.openapi.application.impl.ReadActionCacheImpl.allowInWriteAction(ReadActionCacheImpl.kt:41)
    at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.probeElementsUp(InjectedLanguageUtilBase.java:216)
    at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.enumerate(InjectedLanguageUtilBase.java:159)
    at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtilBase.enumerate(InjectedLanguageUtilBase.java:129)
    at com.intellij.psi.impl.source.tree.injected.InjectedLanguageManagerImpl.enumerate(InjectedLanguageManagerImpl.java:375)
    at com.intellij.psi.impl.source.tree.injected.InjectedLanguageManagerImpl.getInjectedPsiFiles(InjectedLanguageManagerImpl.java:512)
    at com.intellij.psi.impl.search.LowLevelSearchUtil.processInjectedFile(LowLevelSearchUtil.java:49)
    at com.intellij.psi.impl.search.LowLevelSearchUtil.processTreeUp(LowLevelSearchUtil.java:85)
    at com.intellij.psi.impl.search.LowLevelSearchUtil.lambda$processElementsAtOffsets$0(LowLevelSearchUtil.java:181)
    at com.intellij.psi.impl.search.LowLevelSearchUtil.processOffsets(LowLevelSearchUtil.java:210)
    at com.intellij.psi.impl.search.LowLevelSearchUtil.processElementsAtOffsets(LowLevelSearchUtil.java:180)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl$6.execute(PsiSearchHelperImpl.java:1094)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl$5.processInReadAction(PsiSearchHelperImpl.java:879)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl$5.processInReadAction(PsiSearchHelperImpl.java:869)
    at com.intellij.openapi.application.ReadActionProcessor.lambda$process$0(ReadActionProcessor.java:11)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runReadAction(AnyThreadWriteThreadingSupport.kt:228)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runReadAction(AnyThreadWriteThreadingSupport.kt:221)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:857)
    at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:66)
    at com.intellij.openapi.application.ReadActionProcessor.process(ReadActionProcessor.java:11)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.lambda$processCandidates$19(PsiSearchHelperImpl.java:976)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.lambda$processVirtualFile$12(PsiSearchHelperImpl.java:651)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.tryRunReadAction(AnyThreadWriteThreadingSupport.kt:279)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:965)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.processVirtualFile(PsiSearchHelperImpl.java:616)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.lambda$processPsiFileRoots$8(PsiSearchHelperImpl.java:477)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.lambda$processFilesConcurrentlyDespiteWriteActions$10(PsiSearchHelperImpl.java:558)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.executeByImpatientReader(AnyThreadWriteThreadingSupport.kt:486)
    at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:178)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.lambda$processFilesConcurrentlyDespiteWriteActions$11(PsiSearchHelperImpl.java:557)
    at com.intellij.concurrency.JobLauncherImpl.lambda$processImmediatelyIfTooFew$6(JobLauncherImpl.java:215)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:660)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:659)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79)
    at com.intellij.concurrency.JobLauncherImpl.lambda$processImmediatelyIfTooFew$7(JobLauncherImpl.java:211)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runReadAction$lambda$2(AnyThreadWriteThreadingSupport.kt:217)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runReadAction(AnyThreadWriteThreadingSupport.kt:228)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runReadAction(AnyThreadWriteThreadingSupport.kt:217)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:847)
    at com.intellij.concurrency.JobLauncherImpl.processImmediatelyIfTooFew(JobLauncherImpl.java:222)
    at com.intellij.concurrency.JobLauncherImpl.invokeConcurrentlyUnderProgressAsync(JobLauncherImpl.java:61)
    at com.intellij.concurrency.JobLauncherImpl.invokeConcurrentlyUnderProgress(JobLauncherImpl.java:48)
    at com.intellij.concurrency.JobLauncher.invokeConcurrentlyUnderProgress(JobLauncher.java:51)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.processFilesConcurrentlyDespiteWriteActions(PsiSearchHelperImpl.java:574)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.lambda$processPsiFileRoots$9(PsiSearchHelperImpl.java:474)
    at com.intellij.psi.impl.PsiManagerImpl.runInBatchFilesMode(PsiManagerImpl.java:462)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.processPsiFileRoots(PsiSearchHelperImpl.java:467)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.processCandidates(PsiSearchHelperImpl.java:968)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.processGlobalRequests(PsiSearchHelperImpl.java:943)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.processGlobalRequestsOptimized(PsiSearchHelperImpl.java:904)
    at com.intellij.psi.impl.search.PsiSearchHelperImpl.processRequests(PsiSearchHelperImpl.java:829)
    at com.intellij.psi.search.SearchRequestQuery.processResults(SearchRequestQuery.java:21)
    at com.intellij.util.AbstractQuery.doProcessResults(AbstractQuery.java:83)
    at com.intellij.util.AbstractQuery.delegateProcessResults(AbstractQuery.java:100)
    at com.intellij.util.MergeQuery.processResults(MergeQuery.java:22)
    at com.intellij.util.AbstractQuery.doProcessResults(AbstractQuery.java:83)
    at com.intellij.util.AbstractQuery.delegateProcessResults(AbstractQuery.java:100)
    at com.intellij.util.UniqueResultsQuery.processResults(UniqueResultsQuery.java:37)
    at com.intellij.util.AbstractQuery.doProcessResults(AbstractQuery.java:83)
    at com.intellij.util.AbstractQuery.forEach(AbstractQuery.java:75)
    at com.intellij.util.AbstractQuery.findAll(AbstractQuery.java:24)
    at com.intellij.util.Query.iterator(Query.java:127)
    at com.intellij.util.AbstractQuery.iterator(AbstractQuery.java:34)
    at kotlin.collections.CollectionsKt___CollectionsKt.count(_Collections.kt:1758)
    at org.rust.ide.hints.codeVision.RsReferenceCodeVisionProvider.getHint(RsReferenceCodeVisionProvider.kt:72)
    at com.intellij.codeInsight.hints.codeVision.CodeVisionProviderBase.computeForEditor(CodeVisionProviderBase.kt:68)
    at com.intellij.codeInsight.hints.codeVision.CodeVisionPass$Companion.collect$lambda$3$lambda$2(CodeVisionPass.kt:73)
    at com.intellij.concurrency.ApplierCompleter.processArrayItem(ApplierCompleter.java:116)
    at com.intellij.concurrency.ApplierCompleter.processArray(ApplierCompleter.java:196)
    at com.intellij.concurrency.ApplierCompleter.execAll(ApplierCompleter.java:166)
    at com.intellij.concurrency.JobLauncherImpl.lambda$invokeConcurrentlyUnderProgressAsync$3(JobLauncherImpl.java:103)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.tryRunReadAction(AnyThreadWriteThreadingSupport.kt:279)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:965)
    at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$2(ApplierCompleter.java:148)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:660)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:659)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79)
    at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:159)
    at com.intellij.concurrency.ApplierCompleter.lambda$wrapAndRun$1(ApplierCompleter.java:140)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.executeByImpatientReader(AnyThreadWriteThreadingSupport.kt:486)
    at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:178)
    at com.intellij.concurrency.ApplierCompleter.wrapAndRun(ApplierCompleter.java:140)
    at com.intellij.concurrency.JobLauncherImpl.lambda$invokeConcurrentlyUnderProgressAsync$4(JobLauncherImpl.java:103)
    at com.intellij.concurrency.JobLauncherImpl.safeIterate(JobLauncherImpl.java:168)
    at com.intellij.concurrency.JobLauncherImpl.invokeConcurrentlyUnderProgressAsync(JobLauncherImpl.java:100)
    at com.intellij.concurrency.JobLauncherImpl.invokeConcurrentlyUnderProgress(JobLauncherImpl.java:48)
    at com.intellij.concurrency.JobLauncher.invokeConcurrentlyUnderProgress(JobLauncher.java:51)
    at com.intellij.codeInsight.hints.codeVision.CodeVisionPass$Companion.collect(CodeVisionPass.kt:69)
    at com.intellij.codeInsight.hints.codeVision.CodeVisionPass$Companion.access$collect(CodeVisionPass.kt:42)
    at com.intellij.codeInsight.hints.codeVision.CodeVisionPass.doCollectInformation(CodeVisionPass.kt:110)
    at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:67)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:431)
    at com.intellij.platform.diagnostic.telemetry.helpers.TraceKt.runWithSpanIgnoreThrows(trace.kt:118)
    at com.intellij.platform.diagnostic.telemetry.helpers.TraceUtil.runWithSpanThrows(TraceUtil.java:36)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$3(PassExecutorService.java:426)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.tryRunReadAction(AnyThreadWriteThreadingSupport.kt:291)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:965)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$4(PassExecutorService.java:417)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:660)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:659)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:416)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:392)
    at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.cacheFileTypesInside(FileTypeManagerImpl.java:802)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$1(PassExecutorService.java:392)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.executeByImpatientReader(AnyThreadWriteThreadingSupport.kt:486)
    at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:178)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:390)
    at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:259)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:507)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1491)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:2073)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2035)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:187)