Hannah-Sten / TeXiFy-IDEA

LaTeX support for the IntelliJ platform by JetBrains.
https://hannah-sten.github.io/TeXiFy-IDEA
MIT License
891 stars 87 forks source link

java.lang.Throwable: psiElement is not instance of requiredClass. #3291

Closed luca4protection closed 12 months ago

luca4protection commented 12 months ago

Type of JetBrains IDE (IntelliJ, PyCharm, etc.) and version

Writerside 2023.2 EAP (build WRS-232.10165)

Operating System

Windows 10.0 (amd64)

TeXiFy IDEA version

0.9.1

Description

Stacktrace

java.lang.Throwable: psiElement is not instance of requiredClass.
psiElement={CACHED_SMART_POINTER_KEY=java.lang.ref.SoftReference@658b8a03, com.intellij.model.psi.impl.PsiSymbolReferenceServiceImpl$$Lambda$2723/0x0000000801450fa8=PsiCachedValueImpl{com.intellij.model.psi.impl.PsiSymbolReferenceServiceImpl$$Lambda$2723/0x0000000801450fa8@2d4744d}}, psiElement.class=class nl.hannahsten.texifyidea.psi.impl.LatexEnvironmentImpl, requiredClass=interface nl.hannahsten.texifyidea.psi.LatexCommands.
ref: 50cf572587cf
com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: PSI and index do not match.
Please report the problem to JetBrains with the files attached
 file=LaTeX source file, file.class=class nl.hannahsten.texifyidea.file.LatexFile, file.lang=Language: Latex, modStamp=1
 AST INCONSISTENT, perhaps after incremental reparse; LaTeX source file
 stub debugInfo=created in calcStubTree; with backReference
 viewProvider=com.intellij.psi.SingleRootFileViewProvider{vFile=file://C:/Users/Luca Ernemann/WritersideProjects/SoftwareEngineering/Uebung.tex, vFileId=18, content=VirtualFileContent{size=7838}, eventSystemEnabled=true}
 viewProvider stamp: 0; file stamp: 0; file modCount: 1698307598361; file length: 7838
 doc saved: true; doc stamp: 0; doc size: 7592; committed: true
indexing info: indexing timestamp = 1698307010526, binary = false, byte size = 7718, char size = 7592
ref: 50cf572587cf
latestIndexedStub=StubTree{myDebugInfo='created from index; with backReference', myRoot=PsiFileStubImpl}876358157
   same size=false
   debugInfo=created from index; with backReference
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:370)
    at com.intellij.psi.stubs.StubProcessingHelperBase.inconsistencyDetected(StubProcessingHelperBase.java:164)
    at com.intellij.psi.stubs.StubProcessingHelperBase.checkType(StubProcessingHelperBase.java:99)
    at com.intellij.psi.stubs.StubProcessingHelperBase.processStubsInFile(StubProcessingHelperBase.java:72)
    at com.intellij.psi.stubs.StubIndexEx.lambda$processElements$4(StubIndexEx.java:150)
    at com.intellij.psi.stubs.StubIndexEx.processElements(StubIndexEx.java:214)
    at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:102)
    at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:90)
    at nl.hannahsten.texifyidea.index.IndexUtilBase$getItemsByName$1.invoke(IndexUtilBase.kt:140)
    at nl.hannahsten.texifyidea.index.IndexUtilBase$getItemsByName$1.invoke(IndexUtilBase.kt:140)
    at com.intellij.openapi.application.ActionsKt.runReadAction$lambda$3(actions.kt:31)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:909)
    at com.intellij.openapi.application.ActionsKt.runReadAction(actions.kt:31)
    at nl.hannahsten.texifyidea.index.IndexUtilBase.getItemsByName(IndexUtilBase.kt:140)
    at nl.hannahsten.texifyidea.index.IndexUtilBase.getItems(IndexUtilBase.kt:122)
    at nl.hannahsten.texifyidea.index.IndexUtilBase.getItems$default(IndexUtilBase.kt:118)
    at nl.hannahsten.texifyidea.index.IndexUtilBase.getItemsInFileSet(IndexUtilBase.kt:63)
    at nl.hannahsten.texifyidea.util.files.FileSetKt.commandsInFileSet(FileSet.kt:77)
    at nl.hannahsten.texifyidea.util.PackagesKt.includedPackages(Packages.kt:281)
    at nl.hannahsten.texifyidea.util.PackagesKt.includedPackages$default(Packages.kt:280)
    at nl.hannahsten.texifyidea.reference.InputFileReference.resolve(InputFileReference.kt:189)
    at nl.hannahsten.texifyidea.reference.InputFileReference.resolve$default(InputFileReference.kt:113)
    at nl.hannahsten.texifyidea.reference.InputFileReference.resolve(InputFileReference.kt:94)
    at nl.hannahsten.texifyidea.gutter.LatexNavigationGutter.collectNavigationMarkers(LatexNavigationGutter.kt:55)
    at com.intellij.codeInsight.daemon.RelatedItemLineMarkerProvider.collectNavigationMarkers(RelatedItemLineMarkerProvider.java:35)
    at com.intellij.codeInsight.daemon.RelatedItemLineMarkerProvider.collectSlowLineMarkers(RelatedItemLineMarkerProvider.java:27)
    at com.intellij.codeInsight.daemon.impl.LineMarkersPass.queryProviders(LineMarkersPass.java:225)
    at com.intellij.codeInsight.daemon.impl.LineMarkersPass.lambda$doCollectMarkers$2(LineMarkersPass.java:113)
    at com.intellij.codeInsight.daemon.impl.Divider.divideInsideAndOutsideInOneRoot(Divider.java:95)
    at com.intellij.codeInsight.daemon.impl.LineMarkersPass.doCollectMarkers(LineMarkersPass.java:103)
    at com.intellij.codeInsight.daemon.impl.LineMarkersPass.doCollectInformation(LineMarkersPass.java:76)
    at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:57)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$1(PassExecutorService.java:390)
    at com.intellij.platform.diagnostic.telemetry.helpers.TraceKt.runWithSpanIgnoreThrows(trace.kt:77)
    at com.intellij.platform.diagnostic.telemetry.helpers.TraceUtil.runWithSpanThrows(TraceUtil.java:24)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:386)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1133)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$3(PassExecutorService.java:377)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61)
    at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:376)
PHPirates commented 12 months ago

Thanks for reporting! Duplicate of https://youtrack.jetbrains.com/issue/IDEA-335140/psiElement-is-not-instance-of-requiredClass.psiElement-exception