This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-07
Channels
- # announcements (2)
- # babashka (24)
- # beginners (15)
- # calva (27)
- # clara (3)
- # clj-kondo (6)
- # cljs-dev (2)
- # clojure (83)
- # clojure-dev (35)
- # clojure-europe (82)
- # clojure-germany (2)
- # clojure-greece (1)
- # clojure-nl (5)
- # clojure-spec (52)
- # clojure-uk (14)
- # clojurescript (43)
- # conjure (16)
- # cursive (29)
- # data-science (1)
- # datalog (5)
- # datomic (1)
- # deps-new (8)
- # depstar (4)
- # emacs (6)
- # events (1)
- # fulcro (24)
- # jobs (4)
- # malli (12)
- # off-topic (46)
- # rewrite-clj (14)
- # shadow-cljs (53)
- # spacemacs (8)
- # specter (2)
- # sql (21)
- # tools-deps (62)
- # vrac (1)
- # xtdb (2)
Did something break in the latest EAP builds to do with protocols? I’m getting some very weird behaviour now (`1.9.4-eap3-2020.2` ) - namely cursive tries to import
protocols instead of requiring them.
thank for sanity check @U083D6HK9
With the protocol issue, what does the protocol reference look like in your code when Cursive is trying to import it?
There’s actually an additional problem where Cursive tries to resolve the symbol at the protocol definition itself, I think that’s an IntelliJ 2020 problem.
Doesn't appear to happen in the 3 cljs namespaces I tested (though, they're all from the same IntelliJ module)
Right, that’s at the definition - that I think is new in IntelliJ 2020, I had to fix a bunch of similar cases for vars.
Hmm, yeah, protocols are treated differently by Cursive in clj and cljs, since in clj they create an interface and in cljs they’re more like a var.
I got the impression that @U3ZUC5M0R was talking about referring to them from another namespace, though.
Oh, okay. That's the issue I've had. Not sure if @U3ZUC5M0R's issue is different.
Just noticed this one too @U0567Q30W
Yeah, I think that’s all the same case. I’ve just fixed it, it is indeed new in the new EAP, I can’t blame IntelliJ 2020 for this one.
however, when imported like this, intelliJ does provide gutter hints, which doesn’t happen with require
So in that case, you would normally either :require
/`:refer` that protocol, or refer to it qualified with an alias, like component/Lifecycle
. Protocols are tricky in Clojure because they actually do define an interface, and in this case it’s probably what you want, although there are probably subtleties there that I’m not aware of.