Fork me on GitHub
#cursive
<
2020-02-19
>
fbgava04:02:03

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, "resolver-status.properties", 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\:<//repo1.maven.org/maven2/.lastUpdated=1582086466312> maven-metadata-central.xml.error=Could not transfer metadata org.clojure\:tools.deps.alpha/maven-metadata.xml from/to central (http\:<//repo1.maven.org/maven2/>)\: 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. šŸ˜ž

cfleming04:02:31

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 šŸ™‚

fbgava04:02:19

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

fbgava04:02:14

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

emccue05:02:57

interesting bug maybe

emccue05:02:18

I disabled the "unknown symbol highlight in orange" setting

emccue05:02:36

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

cfleming22:02:17

Just checking, do you know about customising symbol resolution? https://cursive-ide.com/userguide/macros.html. I know it doesnā€™t always work, but it might help if youā€™re not aware of it.

thumbnail07:02:57

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

cfleming22:02:06

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.

thumbnail19:02:32

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

katox08:02:37

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.

cfleming08:02:01

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

katox09:02:52

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

katox09:02:30

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>(ClojureConsole.java:89)
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$reify__12085.run(toolwindow.clj:758)
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(DelayedFn.java:51)
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$1.run(Deferred.kt:91)

katox09:02:55

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

cfleming09:02:03

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.

cfleming09:02:22

Iā€™ve also gone through the error tracker, thanks for filing those.

katox09:02:25

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

cfleming09:02:17

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.

katox11:02:51

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.

tony.kay20:02:51

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

cfleming20:02:57

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

tony.kay20:02:17

@cfleming I got a stack trace this time:

tony.kay20:02:17

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(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at com.intellij.util.EventDispatcher.dispatchVoidMethod(EventDispatcher.java:130)
	at com.intellij.util.EventDispatcher.access$000(EventDispatcher.java:24)
	at com.intellij.util.EventDispatcher$1.invoke(EventDispatcher.java:88)
	at com.sun.proxy.$Proxy105.contentRemoved(Unknown Source)
	at com.intellij.ui.content.impl.ContentManagerImpl.fireContentRemoved(ContentManagerImpl.java:551)
	at com.intellij.ui.content.impl.ContentManagerImpl.doRemoveContent(ContentManagerImpl.java:229)
	at com.intellij.ui.content.impl.ContentManagerImpl.removeContent(ContentManagerImpl.java:171)
	at com.intellij.ui.content.impl.ContentManagerImpl.removeContent(ContentManagerImpl.java:164)
	at cursive.repl.toolwindow$repl_listener$reify__11845.projectClosing(toolwindow.clj:218)
	at com.intellij.openapi.project.impl.ProjectManagerImpl$1.projectClosing(ProjectManagerImpl.java:126)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at com.intellij.util.messages.impl.MessageBusImpl.invokeListener(MessageBusImpl.java:513)
	at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:138)
	at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:438)
	at com.intellij.util.messages.impl.MessageBusImpl.pumpWaitingBuses(MessageBusImpl.java:398)
	at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:388)
	at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:372)
	at com.intellij.util.messages.impl.MessageBusImpl.lambda$createTopicHandler$1(MessageBusImpl.java:241)
	at com.sun.proxy.$Proxy80.projectClosing(Unknown Source)
	at com.intellij.openapi.project.impl.ProjectManagerImpl.fireProjectClosing(ProjectManagerImpl.java:789)
	at com.intellij.openapi.project.impl.ProjectManagerImpl.closeProject(ProjectManagerImpl.java:748)
	at com.intellij.openapi.project.impl.ProjectManagerImpl.closeAndDisposeAllProjects(ProjectManagerImpl.java:688)
	at com.intellij.openapi.application.impl.ApplicationImpl.disposeSelf(ApplicationImpl.java:170)
	at com.intellij.openapi.application.impl.ApplicationImpl.doExit(ApplicationImpl.java:655)
	at com.intellij.openapi.application.impl.ApplicationImpl.exit(ApplicationImpl.java:628)
	at com.intellij.openapi.application.impl.ApplicationImpl.exit(ApplicationImpl.java:617)
	at com.intellij.openapi.application.impl.ApplicationImpl.exit(ApplicationImpl.java:613)
	at com.intellij.openapi.application.impl.ApplicationImpl.exit(ApplicationImpl.java:584)
	at com.intellij.openapi.application.impl.ApplicationImpl.exit(ApplicationImpl.java:579)
	at com.intellij.ui.mac.MacOSApplicationProvider$Worker.lambda$null$3(MacOSApplicationProvider.java:72)
	at com.intellij.ui.mac.MacOSApplicationProvider$Worker.lambda$submit$7(MacOSApplicationProvider.java:162)
	at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:83)
	at com.intellij.openapi.application.TransactionGuardImpl.lambda$pollQueueLater$0(TransactionGuardImpl.java:68)
	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)

tony.kay20:02:27

According to ps hereā€™s the classpath IntelliJ itself is using:

tony.kay20:02:31

/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

cfleming20:02:55

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

tony.kay20:02:09

oh, sorry, that CP above is wrong

tony.kay20:02:13

I downgraded the plugin

tony.kay20:02:30

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

cfleming20:02:39

Thanks, I will do.

cfleming00:02:16

eap7 is out now, fixing this problem.

royalaid20:02:11

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

cfleming22:02:24

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.

shaun-mahood20:02:15

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

cfleming22:02:16

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.

cfleming22:02:26

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

shaun-mahood22:02:58

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

cfleming22:02:57

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.

cfleming22:02:08

Iā€™m not sure if it would be terribly confusing, though.

shaun-mahood22:02:03

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.

cfleming22:02:53

Unfortunately, IntelliJ doesnā€™t offer that much flexibility in its windowing.

shaun-mahood22:02:00

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.

cfleming22:02:32

When you say ā€œthe other onesā€, do you mean standard editor tabs?

cfleming22:02:52

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.

shaun-mahood22:02:27

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.

onetom02:02:41

but then what to do with .cljc files?

shaun-mahood02:02:00

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

onetom02:02:42

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)

onetom02:02:21

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

shaun-mahood02:02:51

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

cfleming02:02:56

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.

cfleming02:02:42

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

šŸ‘ 4
Matthew Davidson (kingmob)20:02:32

Does anyone have any thoughts on using LSP vs File Watchers for incorporating clj-kondo? https://github.com/borkdude/clj-kondo/blob/master/doc/editor-integration.md#intellij-idea

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 šŸ™‚

thosmos21:02:12

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

cfleming21:02:10

Yes, eap5 and eap6 have this problem, Iā€™m working on it now.

šŸ‘ 4
cfleming00:02:27

This problem is fixed in eap7, out now.

šŸ™Œ 8