cursive

Issues at: https://git.io/cursive-issues
steveb8n 2020-12-30T01:58:35.485400Z

@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

ikitommi 2020-12-30T16:14:44.489900Z

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.

ikitommi 2020-12-30T16:16:51.490100Z

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.

ikitommi 2020-12-30T16:17:42.490300Z

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

ikitommi 2020-12-30T16:20:39.490500Z

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

cfleming 2020-12-30T20:22:08.493Z

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

ikitommi 2020-12-30T20:30:18.493500Z

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

ikitommi 2020-12-30T20:32:53.493900Z

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.

steveb8n 2020-12-30T21:38:10.494200Z

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

cfleming 2020-12-30T01:59:06.485500Z

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

steveb8n 2020-12-30T02:17:58.485700Z

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

steveb8n 2020-12-30T02:19:01.485900Z

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

steveb8n 2020-12-30T02:20:09.486100Z

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

steveb8n 2020-12-30T02:20:23.486300Z

happy to provide some samples if you need/want them

cfleming 2020-12-30T05:58:26.486500Z

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.

cfleming 2020-12-30T07:49:37.486700Z

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.

steveb8n 2020-12-30T07:50:48.486900Z

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

steveb8n 2020-12-30T07:51:15.487100Z

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

cfleming 2020-12-30T07:53:50.487300Z

I can’t do tonight but could do tomorrow.

emilaasa 2020-12-30T14:55:06.489500Z

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

🎉 7
acim1 2020-12-30T17:55:22.492Z

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

mike_ananev 2020-12-30T18:04:28.492700Z

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

acim1 2020-12-30T18:07:24.492800Z

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

cfleming 2020-12-30T20:23:29.493200Z

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