This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-12-30
Channels
- # adventofcode (1)
- # announcements (1)
- # babashka (5)
- # beginners (344)
- # bristol-clojurians (1)
- # calva (18)
- # cljfx (6)
- # clojure (85)
- # clojure-europe (37)
- # clojure-finland (1)
- # clojure-france (2)
- # clojure-nl (2)
- # clojure-taiwan (3)
- # clojure-uk (17)
- # clojurescript (13)
- # conjure (23)
- # cursive (25)
- # datomic (7)
- # fulcro (62)
- # java (7)
- # jobs-discuss (8)
- # malli (3)
- # off-topic (22)
- # portal (18)
- # reagent (34)
- # reitit (8)
- # releases (3)
- # shadow-cljs (18)
- # tools-deps (1)
@cfleming I’m starting to use Malli in place of spec because it’s better in many ways. I miss the navigation on keywords that is supported for spec keywords. How do you decide when there’s enough adoption to provide navigation for Malli keywords? cc @ikitommi
awesome. initially just having the static analyzer understand when a keyword is defined in a Malli registry somewhere would allow you to provide the navigation that I desire
that said, registries in Malli are not global (one of the benefits) so it will need to handle multiple nav locations (much like “show usages”)
I’d defer to Tommi for the official answer to this. I’m pretty sure he uses Cursive too. Is that correct? @ikitommi
I’ll check the Malli docs and let you know if I need more examples. If @ikitommi has worked around it using Resolve As… then it should be pretty easy to add.
I’d be interested in seeing some examples of where you’d like to see the navigation work. I’ve looked at the registry doc and it seems pretty open, so I’m not clear where the hooks for navigation should be.
sure. it’s probably fastest to look at some of my code so we can derive a few samples together. that work for you?
Great to hear that Cursive could support malli! In current version, there is no global schema definition, like there is s/def
in spec. Instead, there can be multiple registries that are merged together, and one can build custom def
for registering schemas. So, atm, not sure where to goto.
there Will be a new ns with Plumatic style def
, defn
and fn.
Would be great if Cursive would handle those out-of-the-box, like the Plumatic ones. I'll ping @cfleming when the ns ships.
Also, happy to help with anything that could help, add stuff to malli to Make it easy to integrate to etc.
the plumatic def is not about registering key->schema like the spec s/def,
but to define a value and the schema it represents, with eager validation: https://github.com/plumatic/schema/blob/master/src/cljx/schema/core.cljx#L1386-L1408
I think the goto would require a single global registry and a. custom def
to register key->schema into it. No such thing in malli right now.
I have some ideas for the goto nav. Not sure how sophisticated Cursive can be but there are signals in the AST that a keyword is part of a Malli schema e.g. {:registry foo} could be the start of a walk back to :map keywords
also https://github.com/metosin/malli/blob/master/test/malli/core_test.cljc#L1392-L1470
My yearly appreciation post cfleming - you're great, the product is great, enjoy your holidays!
Does anyone know if there is a way to eliminate "cannot be resolved" warnings for mount defstate
declarations (and their usages)?
@mkeller02 right click on defstate. select reslove as... select def.