Fork me on GitHub
#cursive
<
2019-01-21
>
WhoNeedszZz03:01:42

Is it a known issue that JS method calls such as (.getElementById js/document "app") reports that .getElementById cannot be resolved? Another one I've noticed is the use of underscores in destructuring.

joelsanchez11:01:08

(a record using a protocol, and cursive not knowing about the usage)

joelsanchez11:01:57

I can resolve from the record to the protocol but not the inverse

WhoNeedszZz18:01:36

Any Cursive devs around?

cfleming22:01:04

@gphilipp Yes, I’m afraid the answer is “don’t do that” for the reasons that boris points out. It’s a tricky one though, since Clojure doesn’t really have a spec to speak of. The reader page is pretty clear on that issue though. Unfortunately the Clojure reader accepts all kinds of garbage 😞

cfleming22:01:55

@kenny that’s weird - I’ll take a look but it’s unlikely to be something I can fix, that’s probably at the IntelliJ level I think.

cfleming22:01:53

@whoneedszzz Yes, JS resolution doesn’t work very well, mostly because JS. I’m actually in the process of upgrading this somewhat so it’ll soon get better, but I’m also going to reduce the level of that warning since it’s basically impossible to do correctly.

WhoNeedszZz23:01:14

Ok that makes sense and not a big deal. I've just been ignoring the warnings, but it does unfortunately cause a ton of false warnings that when trying to eliminate those so I don't miss actual warnings and errors in my commits it is more difficult. So that explains that, but what about the underscores in destructuring?

cfleming00:01:04

Can you give me an example of that?

WhoNeedszZz20:01:23

(re-frame/reg-event-db
 ::initialize-db
 (fn-traced [_ _]
   db/default-db))

WhoNeedszZz21:01:33

I tested and the issue is with fn-traced being a macro. If I change it to fn the warning goes away.

cfleming22:01:01

You can fix that using the Resolve as… functionality, see: https://cursive-ide.com/userguide/macros.html. The screenshots are out of date, there’s now a Specify… option where you can resolve fn-traced as fn.

WhoNeedszZz04:01:08

Ok that worked, thanks. Now just have the JS issues

cfleming22:01:12

@joelsanchez Not known to me, no - an issue would be great, thanks.