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.IndexOutOfBoundsException: Index 0 out of bounds for length 0 #3651

Closed codefan-byte closed 1 month ago

codefan-byte commented 1 month ago

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

RustRover 2024.2.1 (build RR-242.21829.233)

Operating System

Linux 6.9.2-060902-generic (amd64)

TeXiFy IDEA version

0.9.7

Description

Stacktrace

java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
    at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:100)
    at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:106)
    at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:302)
    at java.base/java.util.Objects.checkIndex(Objects.java:385)
    at java.base/java.util.ArrayList.get(ArrayList.java:427)
    at nl.hannahsten.texifyidea.structure.latex.LatexSubSubSectionPresentation.<init>(LatexSubSubSectionPresentation.kt:20)
    at nl.hannahsten.texifyidea.structure.latex.LatexPresentationFactory.getPresentation(LatexPresentationFactory.kt:31)
    at nl.hannahsten.texifyidea.psi.impl.LatexCommandsImplMixin.getPresentation(LatexCommandsImplMixin.kt:123)
    at com.intellij.codeInsight.navigation.UtilKt.targetPresentation(util.kt:88)
    at com.intellij.lang.documentation.psi.PsiElementDocumentationTarget.computePresentation(PsiElementDocumentationTarget.kt:69)
    at com.intellij.platform.backend.documentation.impl.ImplKt.documentationRequest(impl.kt:18)
    at com.intellij.lang.documentation.ide.impl.DocumentationTargetHoverInfoKt$calcTargetDocumentationInfo$1$requests$1.invoke(DocumentationTargetHoverInfo.kt:41)
    at com.intellij.lang.documentation.ide.impl.DocumentationTargetHoverInfoKt$calcTargetDocumentationInfo$1$requests$1.invoke(DocumentationTargetHoverInfo.kt:36)
    at com.intellij.openapi.application.rw.InternalReadAction.insideReadAction(InternalReadAction.kt:104)
    at com.intellij.openapi.application.rw.InternalReadAction.access$insideReadAction(InternalReadAction.kt:15)
    at com.intellij.openapi.application.rw.InternalReadAction$tryReadCancellable$2.invoke(InternalReadAction.kt:94)
    at com.intellij.openapi.application.rw.InternalReadAction$tryReadCancellable$2.invoke(InternalReadAction.kt:93)
    at com.intellij.openapi.application.rw.CancellableReadActionKt.cancellableReadActionInternal$lambda$2$lambda$1$lambda$0(cancellableReadAction.kt:31)
    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.openapi.application.rw.CancellableReadActionKt.cancellableReadActionInternal$lambda$2$lambda$1(cancellableReadAction.kt:29)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtilService.runActionAndCancelBeforeWrite(ProgressIndicatorUtilService.java:66)
    at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:155)
    at com.intellij.openapi.application.rw.CancellableReadActionKt.cancellableReadActionInternal(cancellableReadAction.kt:27)
    at com.intellij.openapi.application.rw.InternalReadAction.tryReadCancellable(InternalReadAction.kt:93)
    at com.intellij.openapi.application.rw.InternalReadAction.tryReadAction(InternalReadAction.kt:77)
    at com.intellij.openapi.application.rw.InternalReadAction.readLoop(InternalReadAction.kt:64)
    at com.intellij.openapi.application.rw.InternalReadAction.access$readLoop(InternalReadAction.kt:15)
    at com.intellij.openapi.application.rw.InternalReadAction$runReadAction$4.invokeSuspend(InternalReadAction.kt:43)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:608)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:873)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:763)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:750)
jojo2357 commented 1 month ago

Duplicate of #3626