Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
MrMatch246 opened this issue Dec 2, 2024 · 1 comment
Closed
Labels
crash-report Reports of crashes that popped up in IDEA. duplicate Another issue exists addressing the same problem.

Comments

@MrMatch246
Copy link

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

Writerside 2024.3 EAP (build WRS-243.21565.432)

Operating System

Windows 11.0 (amd64)

TeXiFy IDEA version

0.9.8

Description

Stacktrace

java.lang.Throwable: psiElement is not instance of requiredClass.
psiElement=null, requiredClass=interface nl.hannahsten.texifyidea.psi.LatexCommands, operation=Looking for \item in nl.hannahsten.texifyidea.commands, stubIdList=[27, 28, 29, 41, 43, 45, 47, 49, 52, 59, 62, 63, 64, 65, 68, 69, 70, 71, 74, 75, 76, 77, 80, 81, 82, 83, 86, 87, 88, 89, 92, 93, 94, 95, 98, 99, 100, 101, 104, 105, 106]@9.
ref: 20240717
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=3
 AST INCONSISTENT, perhaps after incremental reparse; LaTeX source file
 stub debugInfo=created in calcStubTree; with backReference
 viewProvider=com.intellij.psi.SingleRootFileViewProvider{vFile=Chapter_4_Implementation.tex, vFileId=19, content=VirtualFileContent{size=8255}, eventSystemEnabled=true}
 viewProvider stamp: 0; file stamp: 0; file modCount: 1733135374076; file length: 8255
 doc saved: true; doc stamp: 0; doc size: 8120; committed: true
indexing info: indexing timestamp = 1732551739309, binary = false, byte size = 12525, char size = 8120
ref: 50cf572587cf
latestIndexedStub=StubTree{myDebugInfo='created from index; with backReference', myRoot=PsiFileStubImpl}509000817
   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:171)
	at com.intellij.psi.stubs.StubProcessingHelperBase.checkType(StubProcessingHelperBase.java:103)
	at com.intellij.psi.stubs.StubProcessingHelperBase.processStubsInFile(StubProcessingHelperBase.java:72)
	at com.intellij.psi.stubs.StubIndexEx.lambda$processElements$6(StubIndexEx.java:160)
	at com.intellij.psi.stubs.StubIndexEx.processElements(StubIndexEx.java:211)
	at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:107)
	at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:95)
	at nl.hannahsten.texifyidea.index.IndexUtilBase.getItemsByName$lambda$10(IndexUtilBase.kt:142)
	at com.intellij.openapi.application.ActionsKt.runReadAction$lambda$3(actions.kt:28)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runReadAction$lambda$4(AnyThreadWriteThreadingSupport.kt:260)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runReadAction(AnyThreadWriteThreadingSupport.kt:272)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runReadAction(AnyThreadWriteThreadingSupport.kt:260)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:858)
	at com.intellij.openapi.application.ActionsKt.runReadAction(actions.kt:28)
	at nl.hannahsten.texifyidea.index.IndexUtilBase.getItemsByName(IndexUtilBase.kt:142)
	at nl.hannahsten.texifyidea.index.IndexUtilBase.getItems(IndexUtilBase.kt:124)
	at nl.hannahsten.texifyidea.index.IndexCommandsUtilBase.getCommandsByNames(IndexCommandsUtilBase.kt:21)
	at nl.hannahsten.texifyidea.index.IndexCommandsUtilBase.getCommandsByNames(IndexCommandsUtilBase.kt:44)
	at nl.hannahsten.texifyidea.inspections.latex.typesetting.LatexIncorrectSectionNestingInspection.inspectFile(LatexIncorrectSectionNestingInspection.kt:40)
	at nl.hannahsten.texifyidea.inspections.TexifyInspectionBase.checkFile(TexifyInspectionBase.kt:137)
	at com.intellij.codeInspection.LocalInspectionTool$PsiFileElementVisitor.visitFile(LocalInspectionTool.java:165)
	at com.intellij.extapi.psi.PsiFileBase.accept(PsiFileBase.java:59)
	at com.intellij.codeInsight.daemon.impl.InspectionRunner$InspectionProblemHolder.visitElement(InspectionRunner.java:577)
	at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$processContext$18(InspectionRunner.java:404)
	at com.intellij.codeInsight.daemon.impl.InspectionVisitorOptimizer.acceptElements(InspectionVisitorOptimizer.java:210)
	at com.intellij.codeInsight.daemon.impl.InspectionRunner.processContext(InspectionRunner.java:402)
	at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$inspect$7(InspectionRunner.java:178)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.tryRunReadAction(AnyThreadWriteThreadingSupport.kt:333)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:971)
	at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$executeInImpatientReadAction$15(InspectionRunner.java:383)
	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$executeInImpatientReadAction$16(InspectionRunner.java:374)
	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.executeInImpatientReadAction(InspectionRunner.java:374)
	at com.intellij.codeInsight.daemon.impl.InspectionRunner.lambda$inspect$8(InspectionRunner.java:171)
	at com.intellij.concurrency.ApplierCompleter.processArrayItem(ApplierCompleter.java:126)
	at com.intellij.concurrency.ApplierCompleter.processArray(ApplierCompleter.java:207)
	at com.intellij.concurrency.ApplierCompleter.execAll(ApplierCompleter.java:176)
	at com.intellij.concurrency.JobLauncherImpl.lambda$invokeConcurrentlyUnderProgressAsync$3(JobLauncherImpl.java:108)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.tryRunReadAction(AnyThreadWriteThreadingSupport.kt:333)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction
@MrMatch246 MrMatch246 added crash-report Reports of crashes that popped up in IDEA. untriaged Issue type still needs to be triaged or verified. labels Dec 2, 2024
@PHPirates
Copy link
Collaborator

Thanks for reporting! This is a duplicate of #3291 and is a known issue in IntelliJ: https://youtrack.jetbrains.com/issue/IDEA-335140/psiElement-is-not-instance-of-requiredClass.psiElement-exception

@PHPirates PHPirates closed this as not planned Won't fix, can't repro, duplicate, stale Dec 2, 2024
@PHPirates PHPirates added duplicate Another issue exists addressing the same problem. and removed untriaged Issue type still needs to be triaged or verified. labels Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash-report Reports of crashes that popped up in IDEA. duplicate Another issue exists addressing the same problem.
Projects
None yet
Development

No branches or pull requests

2 participants