This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # babashka (7)
- # beginners (218)
- # boot (1)
- # chlorine (2)
- # cider (36)
- # cljsrn (8)
- # clojure (71)
- # clojure-dev (9)
- # clojure-europe (11)
- # clojure-france (1)
- # clojure-italy (5)
- # clojure-nl (5)
- # clojure-uk (24)
- # clojurescript (9)
- # conjure (16)
- # crux (16)
- # cursive (65)
- # datomic (76)
- # devcards (21)
- # emacs (1)
- # etaoin (1)
- # figwheel-main (47)
- # fulcro (37)
- # hyperfiddle (9)
- # java (2)
- # kaocha (1)
- # malli (11)
- # music (14)
- # observability (8)
- # off-topic (32)
- # re-frame (13)
- # reagent (2)
- # reitit (5)
- # ring (3)
- # shadow-cljs (40)
- # slack-help (17)
- # spacemacs (15)
- # tools-deps (5)
I'm wondering whether I have inadvertently activated a feature of Cursive, or whether the default has changed. When I hover over a word in the editor pane for more than a couple of seconds, the documentation pane opens, which hides my repl. This is quite irritating. I'm used to hitting ctrl-q to get documentation when I want it. Is there a way to turn the hover-doc-mode off @cfleming? I had a look in settings, but I cannot see anything obvious.
I wonder if it is this? > 0.1.54 (Apr 19) > Notable changes: > ... > Hovering over a symbol shows the evaluation of the symbol in a tooltip. (from https://cursive-ide.com/eap.html) I'm not getting a tooltip though
Okay, I think I have worked out how to fix this, but you might want to tweak this a bit @cfleming. I had my doc configured to open as a Tool Window. When I changed back to "open as Popup" (see gif 1) then I can hover to get a doc tooltip, then the menu on that tooltip has an option to uncheck "Show on mouse move" (see gif 2)
To reproduce the irritating world I was living in, ctrl-q once then tick "Show on mouse move" in the tooltip elipsis menu, then ctrl-q twice to open the documentation as a tool window. Now you can open the repl tool window, then hover over things in the editor tab and watch the documentation tool window take over the repl.
Hmm, I see. Unfortunately none of that is actually Cursive, that’s just standard IntelliJ features.
Hi, I've got a bit of a problem with my cursive plugin.. I collapsed the REPL input field and I can't seem to figure how to get it uncollapsed. Any tips?
turns out, you can also just double-click on the divider to reset the height of the editor pane.
I've tried the drag up from the bottom but haven't succeeded in it. Double tap worked out nicely tho, Thanks!
I think that my problem with the draggin might have been the fact that I had the file tabs under the REPL window and that's why the drag up didn't register correctly.
does anyone know how to tell Cursive to package Clojure source files into whatever JAR gets made when you “build” a project? My project uses Maven, and this works fine w/ clojure-maven-plugin when I build on the command line, but when I build via IntelliJ, the application blows up at startup when trying to load Clojure files only from my project (finds e.g. clojure.core just fine) with a message that it can’t find the right .class / .cljc / .clj files
Ive tried telling IntelliJ that this directory is a “resource” directory instead of a “source” directory as well, but that doesn’t seem to help
pom.xml, I’m able to achieve this via these
clojure-maven-plugin options -
<temporaryOutputDirectory>true</temporaryOutputDirectory> <copiedNamespaces> <namespace>project.*</namespace> </copiedNamespaces> <copyDeclaredNamespaceOnly>true</copyDeclaredNamespaceOnly>
i'm not 100% sure but i don't think cursive works with maven. is there any particular reason you're using maven instead of other clojure-native options?
I don’t have much of a choice - most of the repo is Java, and maven is the build tool the whole org uses
so if you execute
mvn package or something alike it builds the right ubjerjar but if you "build" from within intellij idea it doesn't?
Cursive has an option to compile (or not / or only some) Clojure namespaces, hence why I started with Cursive
the Build menu has always been a source of confusion for me. when working with a maven project, i'm not quite certain what it means to execute "Build -> (Re)build Project". is it
so i would go ahead and try one of those goals in the Maven tool window (whichever you're using on the command line)
Right, so compiling within IntelliJ is normally distinct from building with whatever build tool you’re using. The Gradle integration has an option to use the Gradle commands whenever invoking the IntelliJ build, but I don’t know if that’s available for Maven too.
@ When you build your project in IntelliJ, are you sure a jar is produced, or are the artifacts normally built using Maven?
> The Gradle integration has an option to use the Gradle commands whenever invoking the IntelliJ build, but I don’t know if that’s available for Maven too. that just reminded me of an intellij idea feature where you can let intellij idea delegate build actions to maven. https://www.jetbrains.com/help/idea/delegate-build-and-run-actions-to-maven.html#delegate_to_maven
If IntelliJ is actually producing jars for you, it will be done using Artifacts: https://www.jetbrains.com/help/idea/working-with-artifacts.html. You can then configure the artifact to include your Clojure source.
awesome, I think telling IntelliJ to defer to maven is the way to go here. Unfortunately, maven is definitely slower than IntelliJ 😅
urgh, now of course it doesn’t let me defer only build, so now I have to mess around with the run config because that’s not working properly
> You can then configure the artifact to include your Clojure source.
Yes, I’ve tried telling IntelliJ that
src/clj is a Resource folder, but that doesn’t seem to work
i've never seen/heard such a thing exists. out-of-the-box, hassle-free, native java inter-op support is one of the important reasons for me to use intellij idea and cursive exclusively for clojure (and any other jvm languages.) i believe cursive relies on (delegates to) the intellij platform when it involves java inter-op and we know the intellij platform has the best support for java therefore i doubt there is, if exists, any other solution that beats what the intellij platform has to offer (for now.)
Would you say cursive gives you everything intelliji can offer when it comes to java when your doing interopt? or are their limitations because your in clojure?
i would say almost everything. in situations where cursive can figure out the type of the thing you’re working with, you get most of those nice things that you get from intellij idea when you’re working with pure java (method signatures, code completion, searching for usages and whatnot)
@ This isn’t explicitly documented anywhere, no, although it should be - it’s on my list to document. Basically Cursive understands Java types (via IntelliJ) and it also performs more or less the same type inference in the editor as the Clojure compiler does. This means that you can get type-sensitive completions in cases like these:
(let [x (MyType.)] (.meth| x)) Here Cursive uses type inference and knows the type of x.
Here Cursive knows the type of x and y, and you’ll get the completions for
.hasNext in this case) here.
(In all those examples above,
| is where the caret is, and you’ll only get the completions for the relevant type there)
Prefix notation is actually a pain here, since you often type the method before the receiver. Cursive can help with this. If you type
(myObj .meth|) and Cursive knows the type of myObj, you’ll get the context sensitive completions there and when you choose the completion the forms will be swapped, and you’ll end up with:
(.method myObj |).
It’s been pointed out to me that it would make more sense to use the
. form for this:
(. myObj meth|) and then on completion convert to the same form above, but that doesn’t work right now.
As well as this, the Java stuff is just nicely integrated - getting doc on an interop form shows the right doc with no setup, navigation to Java source etc, you can rename things in Java and the corresponding Clojure gets updated and vice versa - that all just works. The fancier Java refactorings don’t work automatically for the interop code, e.g. remove parameter etc.
> This isn’t explicitly documented anywhere, no, although it should be - it’s on my list to document. this would be really helpful in showcasing cursive’s java inter-op features to attract developers who are familiar with intellij idea. i converted a few clojure developers from vscode to intellij idea just by showing how seamless its integration with intellij idea is and how you can leverage almost all of your intellij idea knowledge when writing clojure code. of course, i did it manually so it’s totally possible i missed some. it would be great if i could just point them at some kind of animated demos (like the paredit/parinfer gifs.) on the cursive site.
BTW one other major thing I forgot to mention here is debugging - since it’s all JVM, you can debug from Clojure through Java and back again, which is a lot of peoples’ main motivation for using Cursive I believe.