cursive 2025-10-04

Hey all, I'm having an exception using Cursive that, looks like, is making the experience painfully slow. No idea how to work from here to find out what's wrong and get more data. This happened in the last stable release, wanted to try out the eap3, and the result is the same.

java.lang.IllegalStateException: This sequence can be consumed only once.
	at kotlin.sequences.ConstrainedOnceSequence.iterator(SequencesJVM.kt:23)
	at kotlin.sequences.FilteringSequence$iterator$1.<init>(Sequences.kt:197)
	at kotlin.sequences.FilteringSequence.iterator(Sequences.kt:196)
	at kotlin.sequences.TransformingSequence$iterator$1.<init>(Sequences.kt:241)
	at kotlin.sequences.TransformingSequence.iterator(Sequences.kt:240)
	at kotlin.sequences.FilteringSequence$iterator$1.<init>(Sequences.kt:197)
	at kotlin.sequences.FilteringSequence.iterator(Sequences.kt:196)
	at cursive.deps.DepsDependencyCompletionContributor.addMissingKeywords(DepsDependencyCompletionContributor.kt:231)
	at cursive.deps.DepsDependencyCompletionContributor.fillCompletionVariants(DepsDependencyCompletionContributor.kt:110)
	at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributor(CompletionService.java:87)
	at com.intellij.codeInsight.completion.impl.CompletionServiceImpl.getVariantsFromContributor(CompletionServiceImpl.kt:209)
	at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:75)
	at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:153)
	at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:145)
	at com.intellij.codeInsight.completion.CompletionResultSet.runRemainingContributors(CompletionResultSet.java:141)
	at com.intellij.codeInsight.template.impl.LiveTemplateCompletionContributor$1.addCompletions(LiveTemplateCompletionContributor.java:87)
	at com.intellij.codeInsight.completion.CompletionProvider.addCompletionVariants(CompletionProvider.java:23)
	at com.intellij.codeInsight.completion.CompletionContributor.fillCompletionVariants(CompletionContributor.java:158)
	at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributor(CompletionService.java:87)
	at com.intellij.codeInsight.completion.impl.CompletionServiceImpl.getVariantsFromContributor(CompletionServiceImpl.kt:209)
	at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:75)
	at com.intellij.codeInsight.completion.CompletionService.getVariantsFromContributors(CompletionService.java:57)
	at com.intellij.codeInsight.completion.CompletionService.performCompletion(CompletionService.java:137)
	at com.intellij.codeInsight.completion.BaseCompletionService.performCompletion(BaseCompletionService.java:48)
	at com.intellij.codeInsight.completion.impl.CompletionServiceImpl.performCompletion(CompletionServiceImpl.kt:224)
	at com.intellij.codeInsight.completion.CompletionProgressIndicator.lambda$calculateItems$12(CompletionProgressIndicator.java:964)
	at com.intellij.util.indexing.FileBasedIndex.lambda$ignoreDumbMode$0(FileBasedIndex.java:237)
	at com.intellij.openapi.util.RecursionManager$1.computePreventingRecursion(RecursionManager.java:113)
	at com.intellij.util.indexing.FileBasedIndexEx.ignoreDumbMode(FileBasedIndexEx.java:706)
	at com.intellij.util.indexing.FileBasedIndex.ignoreDumbMode(FileBasedIndex.java:236)
	at com.intellij.util.indexing.DumbModeAccessType.ignoreDumbMode(DumbModeAccessType.java:41)
	at com.intellij.codeInsight.completion.CompletionProgressIndicator.calculateItems(CompletionProgressIndicator.java:960)
	at com.intellij.codeInsight.completion.CompletionProgressIndicator.runContributors(CompletionProgressIndicator.java:948)
	at com.intellij.codeInsight.completion.CodeCompletionHandlerBase.lambda$startContributorThread$7(CodeCompletionHandlerBase.java:390)
	at io.opentelemetry.context.Context.lambda$wrap$1(Context.java:241)
	at com.intellij.codeInsight.completion.CompletionThreadingKt.tryReadOrCancel$lambda$0(CompletionThreading.kt:74)
	at com.intellij.platform.locking.impl.NestedLocksThreadingSupport.tryRunReadAction(NestedLocksThreadingSupport.kt:826)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1221)
	at com.intellij.codeInsight.completion.CompletionThreadingKt.tryReadOrCancel(CompletionThreading.kt:72)
	at com.intellij.codeInsight.completion.CodeCompletionHandlerBase.lambda$startContributorThread$8(CodeCompletionHandlerBase.java:382)
	at io.opentelemetry.context.Context.lambda$wrap$1(Context.java:241)
	at com.intellij.codeInsight.completion.AsyncCompletion.startThread$lambda$1$lambda$0(CompletionThreading.kt:96)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:229)
	at com.intellij.platform.diagnostic.telemetry.helpers.TraceKt.use(trace.kt:44)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:228)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$14(CoreProgressManager.java:681)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:756)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:712)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:680)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:78)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:209)
	at com.intellij.codeInsight.completion.AsyncCompletion.startThread$lambda$1(CompletionThreading.kt:91)
	at com.intellij.codeInsight.completion.AsyncCompletion$startThread$future$1.invokeSuspend(CompletionThreading.kt:104)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
	at kotlinx.coroutines.internal.SoftLimitedDispatcher$Worker.run(SoftLimitedDispatcher.kt:130)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:613)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:1183)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:778)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:765)

can u describe the steps to reproduce this exception? what action is "painfully slow"?

Painfully slow -> guesstimate 500 ms to select a word by using extend selection (Option+Up arrow in macos). How to reproduce: TBH, no idea. It's been since the last cursive update (I used some 2024 version, updated to same 2025) that've had this issue, I'm not sure how to debug or work my way through to a more detailed answer to point you in the right direction.

start by sharing precise version numbers of your environment. which version of OS, jetbrains ide & cursive are u using on what hardware specs? what's the baseline memory and cpu utilization before u start the jetbrains ide? i never experienced such radical slow downs in the ~10 years im using intellij ultimate/ce & cursive

try to some other clojure project, e.g. https://github.com/clojure/clojure/ itself, so others can repro the same initial conditions too.

Makes sense, before going that way, I'd strongly guess that is my PC setup, plus a history of experimental plugins I've tried. I've heard other people describing the same behavior that since Cursive 2025 it's become really slow. So, I'd like to take my personal setup history out of the picture. Just uninstalling cursive and intellij looks like doesn't make the cut, because when I install it again I still have some things I configured, do you know what should I do to completely remove anything Intellij related from the PC?

i guess u can delete some of these directories, if u don't mind losing your settings and keybinding customizations:

❯ ls -1 ~/Library/Application\ Support/JetBrains/
bl
consentOptions
crl
Idea
IntelliJ
IntelliJIdea2024.3-backup
IntelliJIdea2025.1
IntelliJIdea2025.2
IntelliJIdea2025.3
PrivacyPolicy
Toolbox

if u have a jetbrains account and u have enabled syncing your settings there, those settings will come back after reinstalling one of the ides

Nice, thanks a lot

i would also try to disable every plugin and turn the back on one by one as the need arise for using them

🫡 1

there is also a Help / Diagnostic Tools / Activity Monitor ... which shows me:

%CPU  Subsystem

 29.2  <Process total CPU usage>
  5.8  <unidentified: DefaultDispatcher-worker->
  4.9  <JIT compiler>
  4.1  <unidentified: UI thread>
  3.1  <Activity Monitor>
  2.8  <infrastructure: AppKit Thread>
  1.6  <unidentified: Java2D Queue Flusher>
maybe in your case u might get the CPU hog code running on its own thread, which has a proper name, which maybe be a clue to which plugin causes the problem. the cursive exception might have nothing to do with the slow down.

I agree that that exception shouldn't cause the slowdown, and something else is likely going on. That said, I'll try to fix that anyway.