Fork me on GitHub
#cursive
<
2021-02-11
>
alex-eberts01:02:44

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 com.intellij.ide.plugins.cl.PluginClassLoader @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!

cfleming01:02:43

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

👀 4
alex-eberts01:02:30

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

alex-eberts01:02:30

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>(EditorImpl.java:148)
	at com.intellij.openapi.editor.impl.EditorFactoryImpl.createEditor(EditorFactoryImpl.java:200)
	at com.intellij.openapi.editor.impl.EditorFactoryImpl.createEditor(EditorFactoryImpl.java:160)
	at cursive.repl.ClojureConsole.<init>(ClojureConsole.java:89)
	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$reify__12629.run(toolwindow.clj:761)
	at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:519)
	at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:532)
	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(Var.java:406)
	at cursive.api.DelayedFn.invoke(DelayedFn.java:51)
	at cursive.repl.runner.LocalConfiguration$getRunProfileState$2.execute(ReplRunConfigurations.kt:484)
	at com.intellij.execution.impl.DefaultJavaProgramRunner.doExecute(DefaultJavaProgramRunner.java:111)
	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$1.run(ExecutionManagerKtImpl.kt:66)
	at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:83)
	at com.intellij.openapi.application.TransactionGuardImpl.lambda$submitTransaction$1(TransactionGuardImpl.java:107)
	at com.intellij.openapi.application.TransactionGuardImpl.submitTransaction(TransactionGuardImpl.java:116)
	at com.intellij.openapi.application.TransactionGuard.submitTransaction(TransactionGuard.java:121)
	at com.intellij.execution.impl.ExecutionManagerKtImpl$startRunProfile$2.run(ExecutionManagerKtImpl.kt:121)
	at com.intellij.execution.impl.ExecutionManagerImpl.compileAndRun(ExecutionManagerImpl.java:279)
	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$1.run(Deferred.kt:92)
	at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:309)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:441)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:424)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:407)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:908)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:781)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:424)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:698)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:423)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
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 

cfleming01:02:07

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.

alex-eberts01:02:06

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

alex-eberts01:02:30

Maybe this is it?

2021-02-10 17:12:14,903 [  22858]   INFO - il.indexing.FileBasedIndexImpl - Rebuild requested for index ClojureSymbolMeta 
java.lang.Throwable
	at com.intellij.util.indexing.FileBasedIndex.requestRebuild(FileBasedIndex.java:64)
	at cursive.stubs.ReplStubsNotifications$createNotification$1$whenDone$1.run(Stubs.kt:240)
	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$reify__15747.run(task.clj:12)
	at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:888)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:163)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:585)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:531)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:150)
	at com.intellij.openapi.progress.impl.CoreProgressManager$4.lambda$run$0(CoreProgressManager.java:402)
	at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:221)
	at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:402)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:238)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
2021-02-10 17:12:14,962 [  22917]   INFO - il.indexing.FileBasedIndexImpl - scheduleIndexRebuild, reason: checkRebuild 

cfleming01:02:38

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.

cfleming01:02:55

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

alex-eberts01:02:14

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

cfleming01:02:42

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

cfleming01:02:11

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

alex-eberts01:02:36

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.

alex-eberts18:02:30

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.

alex-eberts21:02:32

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: https://github.com/aeberts/fulcro-rad-demo

cfleming21:02:06

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

alex-eberts21:02:05

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

alex-eberts21:02:28

@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.

cfleming04:02:01

@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
cfleming04:02:19

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.

cfleming05:02:51

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).

alex-eberts06:02:52

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

markaddleman14:02:35

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

cfleming23:02:33

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

wilkerlucio03:02:20

hello, Pathom author here 🙂 @U0567Q30W you can find docs for this here: https://pathom3.wsscode.com/docs/resolvers

wilkerlucio03:02:40

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

wilkerlucio03:02:16

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)

wilkerlucio03:02:34

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

wilkerlucio03:02:57

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)

markaddleman15:02:45

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

helios15:02:57

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

imre16:02:36

manually or with idea's string manipulation plugin 😞

imre16:02:46

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.

danieroux20:02:16

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

danieroux20:02:33

… not elegant, but it works

AJ Jaro20:02:32

I was also irritated by this so I created a https://plugins.jetbrains.com/plugin/13222-clojure-namespace-sort The insides of the plugin aren’t great, but it works decently

verma21:02:43

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

3
Jordan Robinson09:02:17

I personally use https://github.com/greglook/cljstyle which orders them for me, as a file watcher task

imre09:02:54

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

imre09:02:35

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

Jordan Robinson09:02:22

it doesn't seem to for me, no

imre09:02:17

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

👍 3
AJ Jaro14:02:43

Oh this looks interesting @UC3B7UJF2! Thanks for sharing!

👍 3
helios14:02:34

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

AJ Jaro14:02:14

@U0AD3JSHL Yep, https://github.com/mustangJaro/antandreAny improvements to it would be fantastic! I know it’s not written the best

stuartrexking22:02:07

This is going to seem silly, but how does Tony kill to the end of the form here? https://youtu.be/3dZK5seIaVI?t=1238

verma22:02:27

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

verma22:02:15

I think straight up "Kill"

verma22:02:48

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

stuartrexking22:02:51

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

stuartrexking22:02:48

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…

alex-eberts23:02:13

@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…

stuartrexking23:02:24

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

👍 3
cfleming23:02:16

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

cfleming23:02:21

(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).

cfleming23:02:30

That will be fixed in the next build.

cfleming05:02:47

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