Fork me on GitHub

On this page in the Cursive docs I cannot seem to be able to click the copy link button next to "Create a new project with Deps". Same goes for a lot of the other headers. I'm only able to click the first two: "Configuring Deps" and "macOS and Linux"


Which browser are you using? I’ve just tested that with FF, Chrome and Safari on OSX and it works fine.


81.0.4044.138 on Ubuntu


Updated to 83.0.4103.61 and same issue.


just a heads up - if you use the "Load File in REPL" action while the index is being updated you'll get Error evaluating - class com.intellij.openapi.project.IndexNotReadyException: Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation in the repl I guess most of us can interpret the error anyway

💯 4

Is there a way how to hint Cursive types of paths added through deps.edn? It seems to choose a type using some heuristics but the result is less than optimal.


I’d have to go back to the code to check, but IIRC, anything in the test alias becomes a test root, and everything else becomes a source root. However, since this is a bit crap and there really isn’t a better way to do that with deps, you can manually mark particular roots as test roots and Cursive will leave that when syncing later.


Thanks, it seems that everything in test paths ends up being marked as test sources. If I manually mark them as regular sources this info is reset on re-import. I will try to rework the deps structure so I can mark sources as test manually instead of regular. But maybe it'd be better if it didn't reset anything manually set.


One question is: why would you want something under the test alias not marked as a test source?


Right now the reason is there is an overlap between aliases. But now that I know what is the system for marking some paths as test sources I can rework it. Basically there were aliases for many little things but tests ran just with clj -A:test ... instead of combining all those.


It works! It needed a manual mark-as source dirs for the first time but then it no longer changes it to test sources. Thank you.


imported paths from deps.edn profiles


When I'm using Intellij 2019, I can get autocompletion of the available version for the library {:mvn/version ""} in deps.edn file. After upgrading to Intellij 2020.1, I don't get autocompletion anymore. How to enable it back?


I think I remember hearing about some kind of java-like dot notation completion in Cursive for methods/props. Is that a thing? How do I use it?

Alex Miller (Clojure team)19:06:12

if you type (. and optionally some more chars, then hit ctrl-space it will give you autocomplete options

Alex Miller (Clojure team)19:06:11

If you have an object whose type can be determined in the first arg position, then it will be contextual to that

Alex Miller (Clojure team)19:06:44

so if cursor after . in (. (java.util.Date.)) - will give you method completions from Date


Thanks, I use that one, but I heard there was a faster option that lets you type the subject first and then tab (without threading too). Maybe I'm wrong.


Actually, Cursive does lots of magic here but not for the dot form - that’s on my to-do list.


All examples assuming Cursive knows the type of my-obj:


(.| my-obj) completing here will give you the context sensitive completions.


You can also do (my-obj .|) and you’ll get the context-sensitive method/field completions, and when you auto complete the method and receiver will be switched.


This also works with other forms where Cursive knows the type, like (-> my-obj .|)


interesting, i’ve been using cursive for years but never known it supports the 2nd from of code completion.


Yes, I really need to document this, it’s one of the coolest features in Cursive and I’ve talked about it on the mailing list etc but have never properly put it in the doc.


@U0567Q30W Nice! That second one is what I was thinking of


By the way, the Clojuredocs integration is really cool

🍹 4

Do you mean .., (class. ) and .- interop forms?


@folcon I'm not sure - I think there is supposed to be something where you type with dot notation like you would in Java, then press tab when done, and it is converted to the normal clojure interop notation (have tried, but doesn't work, I think I'm missing something)


i think what you're describing is called Postfix Completion in intellij idea. as you can see from the screenshot attached, cursive doesn't seem to provide any postfix completion template for clojure.


that said, cursive does provide a bunch of live templates for clojure.


Ah, neat. Maybe that's it, thanks @UDCGPTV9R :thumbsup::skin-tone-2:


Nope, sorry, not seen anything like that :(…


I can't see all variables when I stop at a break point. The most current frame is selected, but I can only see variables that belongs to the namespace where I started the execution. Very strange and annoying, because now I can't evaluate variables in the function that I put the break point either. I run Cursive 1.9.1.-2019.3, Java 1.8.0_241 and IDEA Community 2019.3,5.


I upgraded to IDEA 2020.1 and Cursive 1.9.1-2020.1 and now it works!


Great! Although very weird that that didn’t work previously…


I agree, computers are weird sometimes!


The old problem still exists though, that I can't evaluate anything when I'm at a breakpoint, except numbers like 123 but not expressions or anything with a variable, e.g.: (+ 1 2 3) - I get the error message: Invalid expression : ). I have clojure selected as language in the evaluation window popup.


That’s, which is fixed in the latest EAP series but is not in a stable release yet.