Clojurians
#cursive
<
2016-08-24
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

potetm20:08:15

Anyone else getting a constant "Your project requires namespaces which need stubs to be generated"?

potetm20:08:17

I did that last week at some point. Worked fine. Today it's just showing up non-stop. Clicking once gives me an NPE. Clicking again makes it do something for a short time (like ~10s), and then the message shows up again.

kenny21:08:30

@potetm Did you try Invalidate caches and restart?

potetm21:08:11

No. Good idea.

potetm21:08:51

No luck. :disappointed:

madarauchiha21:08:16

I'm just getting started with Clojure and following the "Clojure for the Brave and True" book

madarauchiha21:08:55

One of the examples shows the use of (Integer. some-string) which I understand sort of translates into the Java new Integer(someString)

madarauchiha21:08:18

But the IDE marks Integer. as unresolved

madarauchiha21:08:34

Is this a known thing? Or am I doing something wrong?

madarauchiha21:08:48

It does work in the REPL and when I run the script file itself.

bfabry22:08:13

@madarauchiha what's the error message the ide is giving you?

danielcompton22:08:42

@madarauchiha if you look at Parameter Info you’ll see

danielcompton22:08:07

Notice there’s arities with the same number of args

danielcompton22:08:25

Java can distinguish this by the type of the args, but Clojure as a dynamically typed language can't

danielcompton22:08:37

It will figure it out from reflection at runtime

danielcompton22:08:36

To fix this, add a type hint, either to your def, or in the call

cfleming23:08:57

@potetm: Yes, that’s new in the latest EAP, see https://cursive-ide.com/archive/2129.html

cfleming23:08:15

The problem is the error you’re receiving trying to generate the stubs.

cfleming23:08:49

@danielcompton: Cursive actually already does flow that info, but currently models what Clojure does, and Clojure doesn’t automatically add a tag to def based on the type of a simple expression.

cfleming23:08:13

Cursive could retain that info and prompt to add a hint, as you suggest.

danielcompton23:08:29

I think the reagent thing is a subtly different issue again

danielcompton23:08:50

as type hinting Clojure expressions when dereffing won’t mean anything?