Fork me on GitHub

Hi guys, I just installed IntelliJ/Cursive on Windows (latest version), and when trying to "use tools.deps directly", the version is <none>, and after clicking on "Refresh" I'm finding this file inside .m2/repository/org/clojure/tools.deps/alpha, "", with the following content: #NOTE: This is an Aether internal implementation file, its format can be changed without prior notice. #Wed Feb 19 01:27:46 BRT 2020 maven-metadata-central.xml/@default-central-http\:<//> maven-metadata-central.xml.error=Could not transfer metadata org.clojure\:tools.deps.alpha/maven-metadata.xml from/to central (http\:<//>)\: status code\: 501, reason phrase\: HTTPS Required (501) Anyone has any ideas on how to fix this? Tried manually adding a profile with https repository in settings.xml without luck. 😞


Hi @U7JCZJR0W, this is a bug which is fixed in the latest EAP build but not in stable releases yet. Oops, I see you just found the solution 🙂


yup, i just saw the thread you replied above. thanks!


nvm, just found a thread above with workaround and its fixed on EAP.


interesting bug maybe


I disabled the "unknown symbol highlight in orange" setting


(i don't actually want it gone, but i want to figure out a visual indicator that doesn't murder my eyes when im using a library that cursive can't resolve any symbols in)


Just checking, do you know about customising symbol resolution? I know it doesn’t always work, but it might help if you’re not aware of it.


Is it possible to render a link (to a project-file) in the cursive terminal, just like the links in stacktrace?


Not that I’m aware of, but I don’t actually use the terminal much. There may be something that IntelliJ does which allows that.


I meant the repl, sorry for the confusion 😅 there's a plug-in for the terminal, haven't tried it yer


I downgraded Cursive to eap4 and most REPL related problems went away. It seems that some UI glue is not quite right in the latest version.


@U0KD0N5T5 Which REPL related problems were you seeing in the new version?


Uncloseable REPL window and few other quirks I don't have well documented


I can try to hunt for exceptions but I tried to send most of them via autosend on IDE error. One other frequent is:

idea.log:java.lang.AbstractMethodError: Receiver class cursive.repl.toolwindow$repl_listener$reify__11844 does not define or inherit an implementation of the resolved method 'abstract void selectionChanged(com.intellij.ui.content.ContentManagerEvent)' of interface com.intellij.ui.content.ContentManagerListener.
idea.log:	at cursive.repl.toolwindow$repl_listener$reify__11844.projectClosing(toolwindow.clj:218)
idea.log:	at cursive.repl.ClojureConsole.<init>(
idea.log:	at cursive.repl.toolwindow$create_repl_ui.invokeStatic(toolwindow.clj:593)
idea.log:	at cursive.repl.toolwindow$create_repl_ui.invoke(toolwindow.clj:586)
idea.log:	at cursive.repl.toolwindow$create_new_repl$
idea.log:	at cursive.repl.toolwindow$create_new_repl.invokeStatic(toolwindow.clj:757)
idea.log:	at cursive.repl.toolwindow$create_new_repl.invoke(toolwindow.clj:745)
idea.log:	at cursive.repl.process_runner$run_clojure_main.invokeStatic(process_runner.clj:205)
idea.log:	at cursive.repl.process_runner$run_clojure_main.invoke(process_runner.clj:193)
idea.log:	at cursive.repl.process_runner$execute.invokeStatic(process_runner.clj:234)
idea.log:	at cursive.repl.process_runner$execute.invoke(process_runner.clj:230)
idea.log:	at cursive.api.DelayedFn.invoke(
idea.log:	at cursive.repl.runner.LocalConfiguration$getRunProfileState$2.execute(ReplRunConfigurations.kt:366)
idea.log:	at cursive.runner.DeferredRunner.access$execute$s-282919921(Deferred.kt:58)
idea.log:	at cursive.runner.DeferredRunner$execute$1$run$


idea.log:2020-02-18 14:26:43,007 [   5678]   INFO -    #cursive.repl.IdeReplServer - IDE REPL server bound to localhost/ on 36941 
idea.log:com.intellij.diagnostic.PluginException: Cannot create listener cursive.notifications.LeiningenProjectNotificationProvider$Listener [Plugin: com.cursiveclojure.cursive]
idea.log:	at$onChange$


Ok, thanks. Some of those are definitely fixed in the next build, but the AbstractMethodError I can’t reprodce, it’s a really weird one.


I’ve also gone through the error tracker, thanks for filing those.


I'll try to focus on reproducing some of those problems if they persist. But it looked like most of them are just manifestations of a different error


No, they’re mostly manifestations of the fact that I’ve been trying to fix up a lot of uses of deprecated APIs to get 2020.1 working properly, and it’s made the release pretty complicated. But I do wonder if the AbstractMethodError one is some kind of build error since I can’t come up with a plausible explanation for it.


I can't think of the AbstractMethod issue is a standalone thing. It always popped up after a different error. But it could be some kind of code branch that is mostly unused.


@cfleming so I’ve most often gotten that error in the JVM when the classpath has two of the “same thing” on it, which can result in an ordering issue: if the right one is found by the classloader first, then it works. Otherwise, it fails because the other version doesn’t have some method that is defined on the interface. Say Interface A is in some updated lib and you have two things that implement the interface, but one was compiled against the old version (where some method in A didn’t exist) and an instance of that gets into the code flow. Some new code based on the new version of A that has the method tries to call it and you get that error.


@U0CKQ19AQ Thanks, I’d considered something like that, but I can’t come up with a plausible way it could happen. My go-to reason for things like this is some AOT crud lying around, but I always do a clean build as part of my release process. I also can’t figure out why I can never reproduce it.


@cfleming I got a stack trace this time:


2020-02-19 12:00:11,864 [ 261079]  ERROR - roject.impl.ProjectManagerImpl - Plugin to blame: Cursive version: 1.9.1-eap6-2019.3 
2020-02-19 12:00:11,964 [ 261179]  ERROR - .impl.MessageBusConnectionImpl - Method cursive/repl/toolwindow$repl_listener$reify__11845.contentRemoved(Lcom/intellij/ui/content/ContentManagerEvent;)V is abstract 
java.lang.AbstractMethodError: Method cursive/repl/toolwindow$repl_listener$reify__11845.contentRemoved(Lcom/intellij/ui/content/ContentManagerEvent;)V is abstract
	at cursive.repl.toolwindow$repl_listener$reify__11845.contentRemoved(toolwindow.clj)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.base/java.lang.reflect.Method.invoke(
	at com.intellij.util.EventDispatcher.dispatchVoidMethod(
	at com.intellij.util.EventDispatcher.access$000(
	at com.intellij.util.EventDispatcher$1.invoke(
	at com.sun.proxy.$Proxy105.contentRemoved(Unknown Source)
	at com.intellij.ui.content.impl.ContentManagerImpl.fireContentRemoved(
	at com.intellij.ui.content.impl.ContentManagerImpl.doRemoveContent(
	at com.intellij.ui.content.impl.ContentManagerImpl.removeContent(
	at com.intellij.ui.content.impl.ContentManagerImpl.removeContent(
	at cursive.repl.toolwindow$repl_listener$reify__11845.projectClosing(toolwindow.clj:218)
	at com.intellij.openapi.project.impl.ProjectManagerImpl$1.projectClosing(
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.base/java.lang.reflect.Method.invoke(
	at com.intellij.util.messages.impl.MessageBusImpl.invokeListener(
	at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(
	at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(
	at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(
	at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(
	at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(
	at com.intellij.util.messages.impl.MessageBusImpl.lambda$createTopicHandler$1(
	at com.sun.proxy.$Proxy80.projectClosing(Unknown Source)
	at com.intellij.openapi.project.impl.ProjectManagerImpl.fireProjectClosing(
	at com.intellij.openapi.project.impl.ProjectManagerImpl.closeProject(
	at com.intellij.openapi.project.impl.ProjectManagerImpl.closeAndDisposeAllProjects(
	at com.intellij.openapi.application.impl.ApplicationImpl.disposeSelf(
	at com.intellij.openapi.application.impl.ApplicationImpl.doExit(
	at com.intellij.openapi.application.impl.ApplicationImpl.exit(
	at com.intellij.openapi.application.impl.ApplicationImpl.exit(
	at com.intellij.openapi.application.impl.ApplicationImpl.exit(
	at com.intellij.openapi.application.impl.ApplicationImpl.exit(
	at com.intellij.openapi.application.impl.ApplicationImpl.exit(
	at com.intellij.ui.mac.MacOSApplicationProvider$Worker.lambda$null$3(
	at com.intellij.ui.mac.MacOSApplicationProvider$Worker.lambda$submit$7(
	at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(
	at com.intellij.openapi.application.TransactionGuardImpl.lambda$pollQueueLater$0(
	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/


According to ps here’s the classpath IntelliJ itself is using:


/Applications/IntelliJ  -Djava.awt.headless=true -Dmaven.defaultProjectBuilder.disableGlobalModelCache=true -Xmx768m -Didea.maven.embedder.version=3.6.1 -Dmaven.ext.class.path=/Applications/IntelliJ  -Dfile.encoding=UTF-8 -classpath /Applications/IntelliJ                                                                org.jetbrains.idea.maven.server.RemoteMavenServer36


@U0CKQ19AQ Thanks, I’m going to download the archive of the version you’re using and make sure there’s nothing funky about it.


oh, sorry, that CP above is wrong


I downgraded the plugin


let me know if I can find any more info for you


Thanks, I will do.


eap7 is out now, fixing this problem.


@cfleming Would it be possible to get seperate histories for CLJS and CLJ repls?


Hmm, interesting idea. Cursive mostly knows which REPL is being used as which, so in theory that should be possible. It might change how the history has to be stored though, which might be tricky. I’ll investigate.


On a similar note, is it possible to have separate repls visible at the same time?


This is a bit tricky from a UI point of view. I actually investigated using the debugger UI framework for this which might be possible. Apparently there are improvements coming in upcoming IntelliJ versions which might make this much easier.


Are you thinking for side-by-side clj/cljs REPLs?


Yeah, that would be my main use case - I don't think I would ever use 2 of the same kind.


What about an integrated one in the same pane? I was considering one in which you could switch the input pane to go to one or the other, and the output would be marked as coming from one or the other.


I’m not sure if it would be terribly confusing, though.


That would probably be fine - though it might get weird when looking through the history. My ideal (I think) setup would be to have one monitor with all my CLJ stuff and the other with all the CLJS - so I could have REBL, CLJ editor windows, and the CLJ repl on one side and the browser, CLJS editor windows, and CLJS repl on the other.


Unfortunately, IntelliJ doesn’t offer that much flexibility in its windowing.


Yeah, too bad the repl window doesn't work the same as the other ones - everything else works great. Most of the time the only thing I'm checking for on the repl output is to make sure that I'm not getting an error, which would be totally fine with the combined output.


When you say “the other ones”, do you mean standard editor tabs?


So, I have actually considered allowing that. The issue is what to do when you use “Send x to REPL…” type actions. How do you determine which is the REPL you want to send it to? I guess I could just prompt if it were ambiguous, but that would get annoying pretty quickly.


Would it be possible to have .cljs files send to only repl windows defined as cljs? For my workflow it would probably be fine if it sent to all repls at the same time (if that's possible), but I don't know if that would cause massive issues otherwise. Not knowing what is possible in intellij, maybe the prompt could occur when you try to split the repl windows, and then have an active window for each type of file.


but then what to do with .cljc files?


@U086D6TBN I don’t think I’ve had any situations where it would be an issue if it sent cljc forms to both repls, and it would be great to be able to compare the two at the same time. Maybe have a toggle on the repl window so that it could be turned off?


i tried to use terminal tabs in the editor area, but when i switch to another editor, i can't switch back to the terminal afterwards. all references are just gone to it. (i set Editor Tabs / Tabs limit to 1, though)


@U054BUGT4 i was just exploring how these things are done in emacs/cider. it takes forever to learn that ecosystem, but it also teaches u about the possible workflows. maybe some of those ideas could be funnelled back to cursive too...


That would be great. It definitely seems like there are a lot of intellij specific tricks though.


Yes, I think that CIDER does that, if you have a combined CLJ/CLJS REPL open it will send files and forms to the corresponding REPL, and CLJC to both.


I’m definitely very open to hearing about good ideas Cursive should take inspiration from.

👍 4

Does anyone have any thoughts on using LSP vs File Watchers for incorporating clj-kondo?

Janne Sauvala21:02:42

I tried both approaches and LSP might be faster. However, you need to download the kondo LSP-jar release manually to keep kondo updated. File watcher can be used with the one distributed via brew. And the LSP-plugin from Iltellij marketplace was broken and I had to install it from GitHub. So, both are ok options, I settled with LSP 🙂


I just updated to 1.9.1-eap6-2019.3 and now I’m getting this error when I try to run a remote repl that connects to my shadow-cljs server:

12:58 PM	Error running 'nREPL 9000': Receiver class cursive.repl.toolwindow$repl_listener$reify__11845 does not define or inherit an implementation of the resolved method 'abstract void contentAdded(com.intellij.ui.content.ContentManagerEvent)' of interface com.intellij.ui.content.ContentManagerListener.
Downgraded to 1.9.0-2019.3 and it works


Yes, eap5 and eap6 have this problem, I’m working on it now.

👍 4

This problem is fixed in eap7, out now.

🙌 8