Hannah-Sten / TeXiFy-IDEA

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

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

Closed Inmoresentum closed 9 months ago

Inmoresentum commented 10 months ago

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

IntelliJ IDEA 2023.3.2 (build IU-233.13135.103)

Operating System

Linux 6.6.6-76060606-generic (amd64)

TeXiFy IDEA version

0.9.3

Description

Stacktrace

java.lang.Throwable: psiElement is not instance of requiredClass.
psiElement=null, requiredClass=interface nl.hannahsten.texifyidea.psi.LatexCommands, operation=Looking for \bibliography in nl.hannahsten.texifyidea.includes, stubIdList=[538].
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=952
 AST INCONSISTENT, perhaps after incremental reparse; LaTeX source file
 stub debugInfo=created in calcStubTree; with backReference
 viewProvider=com.intellij.psi.SingleRootFileViewProvider{vFile=file:///home/denuvo-drm/Academic/Thesis/expert_system_with_application/main.tex, vFileId=424029, content=VirtualFileContent{size=45452}, eventSystemEnabled=true}
 viewProvider stamp: 14377; file stamp: 14377; file modCount: 1705760742894; file length: 45452
 doc saved: true; doc stamp: 14377; doc size: 45452; committed: true
indexing info: indexing timestamp = 1705760725970, binary = false, byte size = 45504, char size = 45452
ref: 50cf572587cf
latestIndexedStub=StubTree{myDebugInfo='created from index; with backReference', myRoot=PsiFileStubImpl}11953415
   same size=false
   debugInfo=created from index; with backReference
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:376)
    at com.intellij.psi.stubs.StubProcessingHelperBase.inconsistencyDetected(StubProcessingHelperBase.java:156)
    at com.intellij.psi.stubs.StubProcessingHelperBase.checkType(StubProcessingHelperBase.java:90)
    at com.intellij.psi.stubs.StubProcessingHelperBase.processStubsInFile(StubProcessingHelperBase.java:61)
    at com.intellij.psi.stubs.StubIndexEx.lambda$processElements$5(StubIndexEx.java:152)
    at com.intellij.psi.stubs.StubIndexEx.processElements(StubIndexEx.java:202)
    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:141)
    at nl.hannahsten.texifyidea.index.IndexUtilBase$getItemsByName$1.invoke(IndexUtilBase.kt:141)
    at com.intellij.openapi.application.ActionsKt.runReadAction$lambda$3(actions.kt:31)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:894)
    at com.intellij.openapi.application.ActionsKt.runReadAction(actions.kt:31)
    at nl.hannahsten.texifyidea.index.IndexUtilBase.getItemsByName(IndexUtilBase.kt:141)
    at nl.hannahsten.texifyidea.index.IndexUtilBase.getItems(IndexUtilBase.kt:123)
    at nl.hannahsten.texifyidea.index.IndexUtilBase.getItems$default(IndexUtilBase.kt:119)
    at nl.hannahsten.texifyidea.index.IndexUtilBase.getItems(IndexUtilBase.kt:109)
    at nl.hannahsten.texifyidea.util.files.ReferencedFileSetCache$getSetFromCache$1.invokeSuspend(ReferencedFileSetCache.kt:110)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
    at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:280)
    at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
    at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
    at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
    at nl.hannahsten.texifyidea.util.files.ReferencedFileSetCache.getSetFromCache(ReferencedFileSetCache.kt:105)
    at nl.hannahsten.texifyidea.util.files.ReferencedFileSetCache.fileSetFor(ReferencedFileSetCache.kt:60)
    at nl.hannahsten.texifyidea.util.files.impl.ReferencedFileSetServiceImpl.referencedFileSetOf(ReferencedFileSetServiceImpl.kt:15)
    at nl.hannahsten.texifyidea.util.files.FileSetKt.referencedFileSet(FileSet.kt:66)
    at nl.hannahsten.texifyidea.index.IndexUtilBase.getItemsInFileSet(IndexUtilBase.kt:48)
    at nl.hannahsten.texifyidea.util.files.FileSetKt.commandsInFileSet(FileSet.kt:77)
    at nl.hannahsten.texifyidea.util.labels.LabelsKt.findLatexLabelStringsInFileSetAsSequence(Labels.kt:29)
    at nl.hannahsten.texifyidea.util.labels.LabelsKt.findLatexAndBibtexLabelStringsInFileSet(Labels.kt:20)
    at nl.hannahsten.texifyidea.inspections.latex.probablebugs.LatexUnresolvedReferenceInspection.inspectFile(LatexUnresolvedReferenceInspection.kt:37)
    at nl.hannahsten.texifyidea.inspections.TexifyInspectionBase.checkFile(TexifyInspectionBase.kt:137)
    at com.intellij.codeInspection.LocalInspectionTool$PsiFileElementVisitor.visitFile(LocalInspectionTool.java:150)
    at com.intellij.extapi.psi.PsiFileBase.accept(PsiFileBase.java:59)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$processInOrder$10(InspectionRunner.java:336)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1075)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$processInOrder$11(InspectionRunner.java:379)
    at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:200)
    at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:184)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$processInOrder$12(InspectionRunner.java:385)
    at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:158)
    at com.intellij.util.AstLoadingFilter.forceAllowTreeLoading(AstLoadingFilter.java:150)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$processInOrder$13(InspectionRunner.java:325)
    at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:129)
    at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:118)
    at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$processInOrder$14(InspectionRunner.
slideclimb commented 9 months ago

Thanks for reporting! Duplicate of #3291