Fork me on GitHub
#cursive
<
2020-12-30
>
steveb8n01:12:35

@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

cfleming01:12:06

I would definitely add support now for Malli. What’s required?

steveb8n02:12:58

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

steveb8n02:12:01

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

steveb8n02:12:09

I’d defer to Tommi for the official answer to this. I’m pretty sure he uses Cursive too. Is that correct? @ikitommi

steveb8n02:12:23

happy to provide some samples if you need/want them

cfleming05:12:26

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.

cfleming07:12:37

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.

steveb8n07:12:48

sure. it’s probably fastest to look at some of my code so we can derive a few samples together. that work for you?

steveb8n07:12:15

and should/would @ikitommi like to join? I think he might be on holiday atm

cfleming07:12:50

I can’t do tonight but could do tomorrow.

ikitommi16:12:44

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.

ikitommi16:12:51

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.

ikitommi16:12:42

but, if you can cook up something for the goto-definition, I'm all ears :)

ikitommi16:12:39

Also, happy to help with anything that could help, add stuff to malli to Make it easy to integrate to etc.

cfleming20:12:08

Does just resolving the custom def as s/def work?

ikitommi20:12:18

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

ikitommi20:12:53

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.

steveb8n21:12:10

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

emilaasa14:12:06

My yearly appreciation post cfleming - you're great, the product is great, enjoy your holidays!

🎉 21
cfleming20:12:29

Thanks Emil, it’s much appreciated! I hope everyone has a good holiday season too.

acim117:12:22

Does anyone know if there is a way to eliminate "cannot be resolved" warnings for mount defstate declarations (and their usages)?

mike_ananev18:12:28

@mkeller02 right click on defstate. select reslove as... select def.

acim118:12:24

Perfect! I had been trying to get some option by right-clicking where the warning showed on the name...whoops.