Fork me on GitHub
#cursive
<
2020-06-02
>
kenny00:06:35

On this page in the Cursive docs https://cursive-ide.com/userguide/deps.html 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"

cfleming01:06:06

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

kenny15:06:40

81.0.4044.138 on Ubuntu

kenny15:06:39

Updated to 83.0.4103.61 and same issue.

joelsanchez10:06:38

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
katox12:06:41

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.

cfleming05:06:10

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.

katox07:06:15

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.

cfleming11:06:21

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

katox11:06:22

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.

katox12:06:26

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.

katox12:06:31

imported paths from deps.edn profiles

jaime14:06:00

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?

isak16:06:58

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

isak20:06:38

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.

cfleming05:06:23

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

cfleming05:06:50

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

cfleming05:06:45

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

cfleming05:06:37

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.

cfleming05:06:14

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

salam05:06:21

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

cfleming09:06:38

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.

isak14:06:00

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

isak16:06:06

By the way, the Clojuredocs integration is really cool

🍹 4
folcon17:06:47

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

isak17:06:55

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

salam20:06:46

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.

salam20:06:49

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

isak20:06:57

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

4
folcon17:06:53

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

4
tengstrand17:06:24

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.

tengstrand19:06:14

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

cfleming05:06:54

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

tengstrand09:06:20

I agree, computers are weird sometimes!

tengstrand05:06:18

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.

cfleming05:06:54

That’s https://github.com/cursive-ide/cursive/issues/2345, which is fixed in the latest EAP series but is not in a stable release yet.