Describe the bug
Given a stack trace when attempting to commit
java.lang.IndexOutOfBoundsException: Wrong line: 404. Available lines count: 403
at com.intellij.openapi.editor.impl.LineSet.checkLineIndex(LineSet.java:197)
at com.intellij.openapi.editor.impl.LineSet.getLineStart(LineSet.java:178)
at com.intellij.openapi.editor.impl.DocumentImpl.getLineStartOffset(DocumentImpl.java:1022)
at com.intellij.python.scientific.cells.PlyCellLinesListener.isCellStart(PlyCellLinesListener.kt:85)
at com.intellij.python.scientific.cells.PlyCellLinesListener.findCurrentCellLines(PlyCellLinesListener.kt:105)
at com.intellij.python.scientific.cells.PlyCellLinesListener.updateHighlighting(PlyCellLinesListener.kt:59)
at com.intellij.python.scientific.cells.PlyCellLinesListener.update(PlyCellLinesListener.kt:55)
at com.intellij.python.scientific.cells.PlyCellLinesListener.documentChanged(PlyCellLinesListener.kt:49)
at com.intellij.openapi.editor.impl.DocumentImpl.lambda$changedUpdate$1(DocumentImpl.java:923)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeNonCancelableSection$3(CoreProgressManager.java:269)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$computeInNonCancelableSection$4(CoreProgressManager.java:277)
at com.intellij.openapi.progress.Cancellation.computeInNonCancelableSection(Cancellation.java:62)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeInNonCancelableSection(CoreProgressManager.java:277)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeNonCancelableSection(CoreProgressManager.java:268)
at com.intellij.openapi.editor.impl.DocumentImpl.changedUpdate(DocumentImpl.java:920)
at com.intellij.openapi.editor.impl.DocumentImpl.updateText(DocumentImpl.java:824)
at com.intellij.openapi.editor.impl.DocumentImpl.replaceString(DocumentImpl.java:664)
at com.intellij.openapi.editor.impl.DocumentImpl.lambda$setText$3(DocumentImpl.java:1086)
at com.intellij.openapi.editor.impl.DocumentImpl.setText(DocumentImpl.java:1088)
at com.koxudaxi.ruff.RuffApplyService$write$1$1.invoke$lambda$0(RuffApplyService.kt:32)
at com.intellij.openapi.command.impl.CoreCommandProcessor.runUndoTransparentAction(CoreCommandProcessor.java:383)
at com.koxudaxi.ruff.RuffApplyService$write$1$1.invoke(RuffApplyService.kt:30)
at com.koxudaxi.ruff.RuffApplyService$write$1$1.invoke(RuffApplyService.kt:29)
at com.intellij.openapi.application.ActionsKt.runWriteAction$lambda$0(actions.kt:16)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction$lambda$5(AnyThreadWriteThreadingSupport.kt:320)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:328)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:320)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:895)
at com.intellij.openapi.application.ActionsKt.runWriteAction(actions.kt:16)
at com.koxudaxi.ruff.RuffApplyService$write$1.invoke(RuffApplyService.kt:29)
at com.koxudaxi.ruff.RuffApplyService$write$1.invoke(RuffApplyService.kt:28)
at com.intellij.openapi.application.ActionsKt.runInEdt(actions.kt:56)
at com.intellij.openapi.application.ActionsKt.runInEdt$default(actions.kt:53)
at com.koxudaxi.ruff.RuffApplyService.write(RuffApplyService.kt:28)
at com.koxudaxi.ruff.RuffApplyService.apply(RuffApplyService.kt:66)
at com.koxudaxi.ruff.RuffFileDocumentManagerListener.beforeDocumentSaving(RuffFileDocumentManagerListener.kt:20)
at com.intellij.util.messages.impl.MessageBusImplKt.invokeMethod(MessageBusImpl.kt:722)
at com.intellij.util.messages.impl.MessageBusImplKt.invokeListener(MessageBusImpl.kt:682)
at com.intellij.util.messages.impl.MessageBusImplKt.executeOrAddToQueue(MessageBusImpl.kt:514)
at com.intellij.util.messages.impl.ToDirectChildrenMessagePublisher.publish$intellij_platform_core(CompositeMessageBus.kt:310)
at com.intellij.util.messages.impl.MessagePublisher.invoke(MessageBusImpl.kt:471)
at jdk.proxy2/jdk.proxy2.$Proxy23.beforeDocumentSaving(Unknown Source)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.multiCast(FileDocumentManagerImpl.java:174)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.lambda$new$0(FileDocumentManagerImpl.java:130)
at jdk.proxy2/jdk.proxy2.$Proxy23.beforeDocumentSaving(Unknown Source)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.lambda$doSaveDocumentInWriteAction$3(FileDocumentManagerImpl.java:423)
at com.intellij.pom.core.impl.PomModelImpl.guardPsiModificationsIn(PomModelImpl.java:321)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.doSaveDocumentInWriteAction(FileDocumentManagerImpl.java:422)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.lambda$doSaveDocument$2(FileDocumentManagerImpl.java:375)
at com.intellij.openapi.application.WriteAction.lambda$run$1(WriteAction.java:85)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:328)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:322)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:900)
at com.intellij.openapi.application.WriteAction.run(WriteAction.java:84)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.doSaveDocument(FileDocumentManagerImpl.java:375)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveDocuments(FileDocumentManagerImpl.java:292)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:267)
at com.intellij.openapi.fileEditor.impl.FileDocumentManagerImpl.saveAllDocuments(FileDocumentManagerImpl.java:260)
at com.intellij.vcs.commit.AbstractCommitWorkflowHandler.executeSession(AbstractCommitWorkflowHandler.kt:145)
at com.intellij.vcs.commit.AbstractCommitWorkflowHandler.access$executeSession(AbstractCommitWorkflowHandler.kt:51)
at com.intellij.vcs.commit.AbstractCommitWorkflowHandler$executeSession$1.invokeSuspend(AbstractCommitWorkflowHandler.kt)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.internal.ScopeCoroutine.afterResume(Scopes.kt:29)
at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:99)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
at kotlinx.coroutines.UndispatchedCoroutine.afterResume(CoroutineContext.kt:277)
at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:99)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
at kotlinx.coroutines.UndispatchedCoroutine.afterResume(CoroutineContext.kt:277)
at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:99)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
at com.intellij.openapi.application.impl.DispatchedRunnable.run(DispatchedRunnable.kt:44)
at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:229)
at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:22)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:211)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWithImplicitRead(AnyThreadWriteThreadingSupport.kt:122)
at com.intellij.openapi.application.impl.ApplicationImpl.runWithImplicitRead(ApplicationImpl.java:1162)
at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:78)
at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:119)
at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:41)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:728)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:750)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:696)
at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$16(IdeEventQueue.kt:590)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWithoutImplicitRead(AnyThreadWriteThreadingSupport.kt:117)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:590)
at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:73)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1$1.compute(IdeEventQueue.kt:357)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1$1.compute(IdeEventQueue.kt:356)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:843)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.invoke(IdeEventQueue.kt:356)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.invoke(IdeEventQueue.kt:351)
at com.intellij.ide.IdeEventQueueKt$performActivity$runnableWithWIL$1.invoke$lambda$0(IdeEventQueue.kt:1035)
at com.intellij.openapi.application.WriteIntentReadAction.lambda$run$0(WriteIntentReadAction.java:24)
at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:84)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteIntentReadAction(ApplicationImpl.java:910)
at com.intellij.openapi.application.WriteIntentReadAction.compute(WriteIntentReadAction.java:55)
at com.intellij.openapi.application.WriteIntentReadAction.run(WriteIntentReadAction.java:23)
at com.intellij.ide.IdeEventQueueKt$performActivity$runnableWithWIL$1.invoke(IdeEventQueue.kt:1035)
at com.intellij.ide.IdeEventQueueKt$performActivity$runnableWithWIL$1.invoke(IdeEventQueue.kt:1035)
at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1036)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1036)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$10(IdeEventQueue.kt:351)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:397)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No error should occur
Environments (please complete the following information):
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too