Fork me on GitHub

I’m running Intellij 2019.3.5 and I’ve just upgraded Cursive to 1.10.1-eap2-2019.3. I’m not able to get a clojure repl running. The error message I’m getting is

Error running 'CLJ Local': class clojure.lang.PersistentVector cannot be cast to class [Lcom.intellij.openapi.actionSystem.AnAction; (clojure.lang.PersistentVector is in unnamed module of loader @7e26aea8; [Lcom.intellij.openapi.actionSystem.AnAction; is in unnamed module of loader com.intellij.util.lang.UrlClassLoader @5419f379)
I’ve tried deleting the .idea folder and the *.iml file and reimporting the project with no success. Any ideas what might be causing this? I’m on a Mac running 10.14.6 (Mojave) and my project is configured for Java SDK 13. Thanks!


Could you check your log (Help-&gt;Show log in Finder/Explorer) and see if the full stacktrace appears there?

👀 4

Here’s a stacktrace that corresponds to the time I got the error:


2021-02-10 17:22:44,449 [ 652404]   WARN - .impl.LineStatusTrackerManager - Tracker is being held on dispose by com.intellij.openapi.editor.impl.EditorImpl@b9bd544; file: /REPL.clj 
2021-02-10 17:22:44,456 [ 652411]  ERROR - api.util.objectTree.ObjectTree - Editor of class com.intellij.openapi.editor.impl.EditorImpl hasn't been released: 
com.intellij.openapi.util.TraceableDisposable.ObjectNotDisposedException: See stack trace responsible for creation of unreleased object below 
	at com.intellij.openapi.editor.impl.EditorImpl.<init>(
	at com.intellij.openapi.editor.impl.EditorFactoryImpl.createEditor(
	at com.intellij.openapi.editor.impl.EditorFactoryImpl.createEditor(
	at cursive.repl.ClojureConsole.<init>(
	at cursive.repl.toolwindow$create_repl_ui.invokeStatic(toolwindow.clj:593)
	at cursive.repl.toolwindow$create_repl_ui.invoke(toolwindow.clj:586)
	at cursive.repl.toolwindow$create_new_repl$
	at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(
	at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(
	at cursive.repl.toolwindow$create_new_repl.invokeStatic(toolwindow.clj:760)
	at cursive.repl.toolwindow$create_new_repl.invoke(toolwindow.clj:747)
	at cursive.repl.process_runner$run_nrepl_server.invokeStatic(process_runner.clj:163)
	at cursive.repl.process_runner$run_nrepl_server.invoke(process_runner.clj:148)
	at cursive.repl.process_runner$execute.invokeStatic(process_runner.clj:239)
	at cursive.repl.process_runner$execute.invoke(process_runner.clj:234)
	at clojure.lang.Var.invoke(
	at cursive.api.DelayedFn.invoke(
	at cursive.repl.runner.LocalConfiguration$getRunProfileState$2.execute(ReplRunConfigurations.kt:484)
	at com.intellij.execution.impl.DefaultJavaProgramRunner.doExecute(
	at com.intellij.execution.runners.GenericProgramRunner$execute$$inlined$runProfileStarter$1.executeAsync(GenericProgramRunner.kt:56)
	at com.intellij.execution.runners.GenericProgramRunnerKt$startRunProfile$$inlined$runProfileStarter$1.executeAsync(GenericProgramRunner.kt:56)
	at com.intellij.execution.impl.ExecutionManagerKtImpl$startRunProfile$startRunnable$
	at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(
	at com.intellij.openapi.application.TransactionGuardImpl.lambda$submitTransaction$1(
	at com.intellij.openapi.application.TransactionGuardImpl.submitTransaction(
	at com.intellij.openapi.application.TransactionGuard.submitTransaction(
	at com.intellij.execution.impl.ExecutionManagerKtImpl$startRunProfile$
	at com.intellij.execution.impl.ExecutionManagerImpl.compileAndRun(
	at com.intellij.execution.impl.ExecutionManagerKtImpl.startRunProfile(ExecutionManagerKtImpl.kt:121)
	at com.intellij.execution.runners.GenericProgramRunnerKt.startRunProfile(GenericProgramRunner.kt:50)
	at com.intellij.execution.runners.GenericProgramRunner.execute(GenericProgramRunner.kt:17)
	at cursive.runner.DeferredRunner.access$execute$s-282919921(Deferred.kt:59)
	at cursive.runner.DeferredRunner$execute$1$run$
	at com.intellij.openapi.application.TransactionGuardImpl$
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(
	at com.intellij.openapi.application.impl.LaterInvocator$
	at java.desktop/java.awt.event.InvocationEvent.dispatch(
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(
	at java.desktop/java.awt.EventQueue$
	at java.desktop/java.awt.EventQueue$
	at java.base/ Method)
	at java.base/$JavaSecurityAccessImpl.doIntersectionPrivilege(
	at java.desktop/java.awt.EventQueue.dispatchEvent(
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(
	at com.intellij.ide.IdeEventQueue._dispatchEvent(
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(
	at com.intellij.ide.IdeEventQueue.dispatchEvent(
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(
	at java.desktop/
2021-02-10 17:22:44,457 [ 652412]  ERROR - api.util.objectTree.ObjectTree - IntelliJ IDEA 2019.3.5  Build #IC-193.7288.26 
2021-02-10 17:22:44,457 [ 652412]  ERROR - api.util.objectTree.ObjectTree - JDK: 11.0.6; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o 
2021-02-10 17:22:44,457 [ 652412]  ERROR - api.util.objectTree.ObjectTree - OS: Mac OS X 


I don’t think that’s the same problem unfortunately. That one looks like some kind of object leak, probably caused by the original problem.


I’ll take a look higher up in the log… stand by. Many thanks for your help BTW Colin! 🙂


Maybe this is it?

2021-02-10 17:12:14,903 [  22858]   INFO - il.indexing.FileBasedIndexImpl - Rebuild requested for index ClojureSymbolMeta 
	at com.intellij.util.indexing.FileBasedIndex.requestRebuild(
	at cursive.stubs.ReplStubsNotifications$createNotification$1$whenDone$
	at cursive.stubs$generate_stubs$fn__15817$process__15818.invoke(stubs.clj:250)
	at cursive.stubs$generate_stubs$fn__15817.invoke(stubs.clj:325)
	at cursive.task$backgroundable$
	at com.intellij.openapi.progress.impl.CoreProgressManager$
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(
	at com.intellij.openapi.progress.impl.CoreProgressManager$4.lambda$run$0(
	at com.intellij.util.ConcurrencyUtil.runUnderThreadName(
	at com.intellij.openapi.progress.impl.CoreProgressManager$
	at com.intellij.openapi.application.impl.ApplicationImpl$
	at java.base/java.util.concurrent.Executors$
	at java.base/
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(
	at java.base/java.util.concurrent.ThreadPoolExecutor$
	at java.base/
2021-02-10 17:12:14,962 [  22917]   INFO - il.indexing.FileBasedIndexImpl - scheduleIndexRebuild, reason: checkRebuild 


No, that one’s not actually an error, just IntelliJ noting that something requested that the indexes get rebuilt. That’s an unusual thing to do (Cursive is one of the few plugins with a real use-case for it) so they log it to be sure.


Let me dig the code out and see what I can see.


Ok, please let me know if I can provide any other info (would you like the full log via email?).


Yeah, if you could send it that might be helpful - <mailto:[email protected]|[email protected]>


Also, could you send a screenshot of the run config you’re trying to run in case there’s anything unusual about it?


One other thing to note is that git in Intellij seems to be in a weird state. It’s not seeing my develop branch even though it’s fine on disk. I’m not sure if that would have any impact on running a repl but thought I would mention it.


Hi @U0567Q30W - I was going to delete the Intellij Preferences and Caches folders and start from a clean slate but wanted to check with you before doing that in case you needed anything from my config to track down this bug.

Jakub Holý (HolyJak)20:02:48

My IntelliJ also shows wrong branch but otherwise works OK.


After deleting the project directory and re-cloning from github, all my git branches are back. Unfortunately, I’m still getting the same error on launching the repl. FWIW - here’s a link to the project:


@U0G3C3USJ Thanks for the project link, I’ll try to reproduce with that.


BTW - I just tried setting my project SDK to 1.8 and I’m getting the same error. (it was Java 13).


@U0567Q30W More testing feedback: I tried running a remote nrepl server in the project with nrepl-0.8.3 and then connecting remotely to it and I’m getting the same error.


@U0G3C3USJ Just to let you know I’ve managed to reproduce this with your setup, so I’ll be able to debug it - thanks!

🎉 3

Ugh, I had also planned to improve the error logging, but that’s handled by IntelliJ. What it does is write out the exception at debug level, so you have to know which logger to set to debug level to see it. Yuk.


Ok, this will be fixed for the next build. This bug only affected 2019.3, which I guess is why no-one else hit it (an IntelliJ API accepts a List in recent versions, but in 2019.3 was a varargs call).


@U0567Q30W thanks for the update and good news regarding that bug!


Pathom - particularly Pathom3's smart maps - is figuring larger in my codebase. I'd love cursive to understand keywords that are "defined" as part of a Pathom resolver so I can hotlink to their definition


Can you show an example of how this works, or link to some doc/examples?


hello, Pathom author here 🙂 @U0567Q30W you can find docs for this here:


altough, I believe if we want to index resolvers we have a few open questions about what and how much to index


I think would be interest to index the presence of an attribute in an "output" as a definition of it (an output attribute means that this resolver can expose this data, this is what I think makes most sense to navigate to)


this would have to be open to many definition points, as the same attribute may appear in many different resolvers


the output may be explicit (::pco/output key in the configuration map of the resolver), or implicit (in case the last statement of the resolver definition is a map, this is documented on that same page)


Thanks @U066U8JQJ for stepping in 🙂 I agree that mapping an attribute to the resolvers that produce it would be a great first step


How do you sort your namespace require/imports with cursive?


manually or with idea's string manipulation plugin 😞


I think there is a gh issue about it

Shantanu Kumar20:02:12

I manually segregate the requires into 3 sections - 1. clojure.*, 2. third-party lib namespaces, 3. app namespaces. I maintain alphabetic order within each section, again manually. Any pointers to automate this would be great.


I install the ideavim plugin, select the requires and run :'<,'>!sort on it.


… not elegant, but it works

AJ Jaro20:02:32

I was also irritated by this so I created a The insides of the plugin aren’t great, but it works decently


Could possibly be done with babashka+clj-rewrite also I believe.

Shantanu Kumar06:02:42

@UGMAVSMUM I tried installing your plugin but it doesn’t turn up in plugin search. I’m on Ultimate 2020.3

Jordan Robinson09:02:17

I personally use which orders them for me, as a file watcher task


ooh file watcher task! can you share how you configure that?

Jordan Robinson09:02:13

yeah sure, one second...

Jordan Robinson09:02:48

it's the closest I've been able to get to prettier in js

Jordan Robinson09:02:46

I hope I explained how to set it up with that screenshot but let me know if not, I've been meaning to write a blog post on it really


Thank you! Does this not trigger the "file was modified extrnally" dialog?

Jordan Robinson09:02:22

it doesn't seem to for me, no


Great stuff thanks!. I'll give it a go

👍 3
AJ Jaro14:02:43

Oh this looks interesting @UC3B7UJF2! Thanks for sharing!

👍 3

@UGMAVSMUM i was able to use your plugin 🙂 do you have it on github?

AJ Jaro14:02:14

@U0AD3JSHL Yep, improvements to it would be fantastic! I know it’s not written the best


This is going to seem silly, but how does Tony kill to the end of the form here?


Something like kill-sexp-to-end perhaps, let me check which exact paraedit command it is


I think straight up "Kill"


I am not sure what the default binding for it is, but I think its this one:


Kill and Kill Sexp both work. Now how to paste like he did…


Yeah, I can’t figure out how to paste it into place like he does in that example. If any one can point me to the action…


@U3FKR3KDF I’m pretty sure that Tony is using a vim plugin with Intellij (I believe it’s IdeaVim) so it could be a vim command that he’s using…


@U0G3C3USJ I’m using IdeaVim. I’ll ask Tony directly.

👍 3

Straight up Kill should indeed work, and just normal paste should paste it back wherever you want it.


(however as reported in another thread, in the very latest build Kill seems to only kill to the end of the line, not the end of the form as it should).


That will be fixed in the next build.


Actually, I can’t reproduce that, never mind.