AzureMarker / intellij-lalrpop

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

Inline-renaming a rust type referenced inside a typeref injection fails assertion #41

Closed dnbln closed 3 years ago

dnbln commented 3 years ago

https://github.com/Mcat12/intellij-lalrpop/blob/f53452229620969030116b03868607e1913b2a75/src/main/kotlin/com/mdrobnak/lalrpop/psi/ext/LpTypeRef.kt#L26

Stack trace
java.lang.AssertionError: Assertion failed
    at com.mdrobnak.lalrpop.psi.ext.LpTypeRefMixin.updateText(LpTypeRef.kt:26)
    at com.intellij.psi.impl.source.tree.injected.InjectedFileViewProvider.rootChangedImpl(InjectedFileViewProvider.java:43)
    at com.intellij.psi.impl.source.tree.injected.SingleRootInjectedFileViewProvider.rootChanged(SingleRootInjectedFileViewProvider.java:63)
    at com.intellij.psi.impl.source.PsiFileImpl.subtreeChanged(PsiFileImpl.java:365)
    at com.intellij.psi.impl.source.tree.CompositeElement.subtreeChanged(CompositeElement.java:77)
    at com.intellij.psi.impl.source.tree.TreeElement.invalidate(TreeElement.java:325)
    at com.intellij.psi.impl.source.tree.TreeElement.rawRemove(TreeElement.java:312)
    at com.intellij.psi.impl.source.tree.TreeElement.rawReplaceWithList(TreeElement.java:319)
    at com.intellij.psi.impl.source.tree.CompositeElement.replace(CompositeElement.java:786)
    at com.intellij.psi.impl.source.tree.CompositeElement.lambda$replaceChild$1(CompositeElement.java:626)
    at com.intellij.psi.impl.source.tree.ChangeUtil$1.runInner(ChangeUtil.java:147)
    at com.intellij.pom.impl.PomTransactionBase.run(PomTransactionBase.java:28)
    at com.intellij.pom.core.impl.PomModelImpl.lambda$runTransaction$1(PomModelImpl.java:111)
    at com.intellij.psi.impl.DebugUtil.performPsiModification(DebugUtil.java:567)
    at com.intellij.pom.core.impl.PomModelImpl.lambda$runTransaction$2(PomModelImpl.java:104)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:658)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:610)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:65)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeNonCancelableSection(CoreProgressManager.java:218)
    at com.intellij.pom.core.impl.PomModelImpl.runTransaction(PomModelImpl.java:93)
    at com.intellij.psi.impl.source.tree.ChangeUtil.prepareAndRunChangeAction(ChangeUtil.java:142)
    at com.intellij.psi.impl.source.tree.CompositeElement.replaceChild(CompositeElement.java:625)
    at com.intellij.psi.impl.source.codeStyle.CodeEditUtil.replaceChild(CodeEditUtil.java:162)
    at com.intellij.psi.impl.source.tree.CompositeElement.replaceChildInternal(CompositeElement.java:455)
    at com.intellij.psi.impl.source.tree.SharedImplUtil.doReplace(SharedImplUtil.java:196)
    at com.intellij.psi.impl.source.tree.LeafPsiElement.replace(LeafPsiElement.java:198)
    at org.rust.lang.core.resolve.ref.RsReferenceBase$Companion.doRename(RsReferenceBase.kt:72)
    at org.rust.lang.core.resolve.ref.RsReferenceBase.handleElementRename(RsReferenceBase.kt:46)
    at com.intellij.refactoring.rename.RenameUtilBase.rename(RenameUtilBase.java:90)
    at com.intellij.refactoring.rename.RenameUtilBase.doRenameGenericNamedElement(RenameUtilBase.java:46)
    at com.intellij.refactoring.rename.RenameUtil.doRenameGenericNamedElement(RenameUtil.java:270)
    at com.intellij.refactoring.rename.RenamePsiElementProcessor.renameElement(RenamePsiElementProcessor.java:57)
    at org.rust.ide.refactoring.RsRenameProcessor.renameElement(RsRenameProcessor.kt:106)
    at com.intellij.refactoring.rename.RenameProcessor.doPerformRefactoring(RenameProcessor.java:428)
    at com.intellij.refactoring.rename.RenameProcessor.performRefactoring(RenameProcessor.java:372)
    at com.intellij.refactoring.BaseRefactoringProcessor.lambda$doRefactoring$9(BaseRefactoringProcessor.java:515)
    at com.intellij.refactoring.BaseRefactoringProcessor.callPerformRefactoring(BaseRefactoringProcessor.java:568)
    at com.intellij.refactoring.BaseRefactoringProcessor.lambda$doRefactoring$10(BaseRefactoringProcessor.java:514)
    at com.intellij.openapi.application.impl.ApplicationImpl.lambda$runEdtProgressWriteAction$12(ApplicationImpl.java:964)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:178)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:658)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:610)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:65)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:165)
    at com.intellij.openapi.progress.util.PotemkinProgress.runInSwingThread(PotemkinProgress.java:191)
    at com.intellij.openapi.application.impl.ApplicationImpl.lambda$runEdtProgressWriteAction$13(ApplicationImpl.java:964)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithClass(ApplicationImpl.java:988)
    at com.intellij.openapi.application.impl.ApplicationImpl.runEdtProgressWriteAction(ApplicationImpl.java:962)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteActionWithNonCancellableProgressInDispatchThread(ApplicationImpl.java:943)
    at com.intellij.refactoring.BaseRefactoringProcessor.doRefactoring(BaseRefactoringProcessor.java:513)
    at com.intellij.refactoring.BaseRefactoringProcessor.lambda$execute$2(BaseRefactoringProcessor.java:330)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:211)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:177)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:167)
    at com.intellij.refactoring.BaseRefactoringProcessor.execute(BaseRefactoringProcessor.java:328)
    at com.intellij.refactoring.BaseRefactoringProcessor.doRun(BaseRefactoringProcessor.java:251)
    at com.intellij.refactoring.rename.RenameProcessor.doRun(RenameProcessor.java:125)
    at com.intellij.refactoring.rename.inplace.MemberInplaceRenamer$MyRenameProcessor.doRun(MemberInplaceRenamer.java:379)
    at com.intellij.refactoring.BaseRefactoringProcessor.run(BaseRefactoringProcessor.java:643)
    at com.intellij.refactoring.rename.inplace.MemberInplaceRenamer.performRenameInner(MemberInplaceRenamer.java:267)
    at com.intellij.refactoring.rename.inplace.MemberInplaceRenamer.lambda$performRefactoringRename$0(MemberInplaceRenamer.java:236)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:220)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:177)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:167)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:153)
    at com.intellij.refactoring.rename.inplace.MemberInplaceRenamer.lambda$performRefactoringRename$1(MemberInplaceRenamer.java:235)
    at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:216)
    at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:24)
    at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:199)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:822)
    at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:324)
    at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:85)
    at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:134)
    at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:47)
    at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:190)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:976)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:843)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:454)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:773)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:453)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:822)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:501)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)