continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
19.43k stars 1.69k forks source link

java.lang.IndexOutOfBoundsException: Wrong line: -1. Available lines count: 1 #3020

Open danny-su opened 1 day ago

danny-su commented 1 day ago

Before submitting your bug report

Relevant environment info

- OS: macOS 15.1.1
- Continue version: 0.0.75
- IDE version: Clion 2024.3
- Model:
- config.json:

Description

java.lang.IndexOutOfBoundsException: Wrong line: -1. Available lines count: 1 at com.intellij.openapi.editor.impl.LineSet.checkLineIndex(LineSet.java:197) at com.intellij.openapi.editor.impl.LineSet.getLineEnd(LineSet.java:191) at com.intellij.openapi.editor.impl.DocumentImpl.getLineEndOffset(DocumentImpl.java:1051) at com.github.continuedev.continueintellijextension.listeners.ContinuePluginSelectionListener.getSelectionInfo(ContinuePluginSelectionListener.kt:86) at com.github.continuedev.continueintellijextension.listeners.ContinuePluginSelectionListener.access$getSelectionInfo(ContinuePluginSelectionListener.kt:20) at com.github.continuedev.continueintellijextension.listeners.ContinuePluginSelectionListener$updateTooltip$1.invoke$lambda$0(ContinuePluginSelectionListener.kt:68) at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:236) at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:25) at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:198) at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runIntendedWriteActionOnCurrentThread$lambda$2(AnyThreadWriteThreadingSupport.kt:217) at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:128) at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runIntendedWriteActionOnCurrentThread(AnyThreadWriteThreadingSupport.kt:216) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:842) at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:421) at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:101) at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:101) at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:107) at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:101) at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27) at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:117) at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:43) 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:675) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:573) at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$18$lambda$17$lambda$16$lambda$15(IdeEventQueue.kt:355) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:857) at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$18$lambda$17$lambda$16(IdeEventQueue.kt:354) at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$2$lambda$1(IdeEventQueue.kt:1045) at com.intellij.openapi.application.WriteIntentReadAction.lambda$run$0(WriteIntentReadAction.java:24) at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:128) at com.intellij.openapi.application.impl.ApplicationImpl.runWriteIntentReadAction(ApplicationImpl.java:916) 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$lambda$2(IdeEventQueue.kt:1045) at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$3(IdeEventQueue.kt:1054) at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:109) at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1054) at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$18(IdeEventQueue.kt:349) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:395) 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

No response

Log output

No response

LeskoIam commented 5 hours ago

Same here:

java.lang.IndexOutOfBoundsException: Wrong line: -1. Available lines count: 1
    at com.intellij.openapi.editor.impl.LineSet.checkLineIndex(LineSet.java:197)
    at com.intellij.openapi.editor.impl.LineSet.getLineEnd(LineSet.java:191)
    at com.intellij.openapi.editor.impl.DocumentImpl.getLineEndOffset(DocumentImpl.java:1051)
    at com.github.continuedev.continueintellijextension.listeners.ContinuePluginSelectionListener.getSelectionInfo(ContinuePluginSelectionListener.kt:86)
    at com.github.continuedev.continueintellijextension.listeners.ContinuePluginSelectionListener.access$getSelectionInfo(ContinuePluginSelectionListener.kt:20)
    at com.github.continuedev.continueintellijextension.listeners.ContinuePluginSelectionListener$updateTooltip$1.invoke$lambda$0(ContinuePluginSelectionListener.kt:68)
    at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:236)
    at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:25)
    at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:198)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runIntendedWriteActionOnCurrentThread$lambda$2(AnyThreadWriteThreadingSupport.kt:217)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:128)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runIntendedWriteActionOnCurrentThread(AnyThreadWriteThreadingSupport.kt:216)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:842)
    at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:421)
    at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:101)
    at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:101)
    at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:107)
    at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:101)
    at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)
    at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:117)
    at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:43)
    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:675)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:573)
    at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$18$lambda$17$lambda$16$lambda$15(IdeEventQueue.kt:355)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:857)
    at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$18$lambda$17$lambda$16(IdeEventQueue.kt:354)
    at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$2$lambda$1(IdeEventQueue.kt:1045)
    at com.intellij.openapi.application.WriteIntentReadAction.lambda$run$0(WriteIntentReadAction.java:24)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:128)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteIntentReadAction(ApplicationImpl.java:916)
    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$lambda$2(IdeEventQueue.kt:1045)
    at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$3(IdeEventQueue.kt:1054)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:109)
    at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1054)
    at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$18(IdeEventQueue.kt:349)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:395)
    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)
java.lang.IndexOutOfBoundsException: Wrong line: -1. Available lines count: 205
    at com.intellij.openapi.editor.impl.LineSet.checkLineIndex(LineSet.java:197)
    at com.intellij.openapi.editor.impl.LineSet.getLineEnd(LineSet.java:191)
    at com.intellij.openapi.editor.impl.DocumentImpl.getLineEndOffset(DocumentImpl.java:1051)
    at com.github.continuedev.continueintellijextension.listeners.ContinuePluginSelectionListener.getSelectionInfo(ContinuePluginSelectionListener.kt:86)
    at com.github.continuedev.continueintellijextension.listeners.ContinuePluginSelectionListener.access$getSelectionInfo(ContinuePluginSelectionListener.kt:20)
    at com.github.continuedev.continueintellijextension.listeners.ContinuePluginSelectionListener$updateTooltip$1.invoke$lambda$0(ContinuePluginSelectionListener.kt:68)
    at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:236)
    at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:25)
    at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:198)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runIntendedWriteActionOnCurrentThread$lambda$2(AnyThreadWriteThreadingSupport.kt:217)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:128)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runIntendedWriteActionOnCurrentThread(AnyThreadWriteThreadingSupport.kt:216)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:842)
    at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:421)
    at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:101)
    at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:101)
    at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:107)
    at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:101)
    at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)
    at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:117)
    at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:43)
    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:675)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:573)
    at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$18$lambda$17$lambda$16$lambda$15(IdeEventQueue.kt:355)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:857)
    at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$18$lambda$17$lambda$16(IdeEventQueue.kt:354)
    at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$2$lambda$1(IdeEventQueue.kt:1045)
    at com.intellij.openapi.application.WriteIntentReadAction.lambda$run$0(WriteIntentReadAction.java:24)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:128)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteIntentReadAction(ApplicationImpl.java:916)
    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$lambda$2(IdeEventQueue.kt:1045)
    at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$3(IdeEventQueue.kt:1054)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:109)
    at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1054)
    at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$18(IdeEventQueue.kt:349)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:395)
    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)