Hi Malli folk! For those of you using Cursive, after a productive plane journey the next version will allow you to return custom tree nodes from the REPL, which (among many other useful things) allows pretty, explorable Malli errors right in the seeker - edited to put the screenshots in the thread:
Iโm using both stdout/pretty and Seeker and trying to figure out ways in which Seeker can be better than the colorised pretty reporter. Looking forward to clarifying so I know if/when Seeker is the better option. Curious to know how you both would describe the difference/improvements when using Seeker. maybe a demo video when itโs good enough?
Yes, a demo video is definitely a great idea.
nice!
@ikitommi one thing that would help would be examples of ways to generate all the different types of exceptions. I have the obvious ones from the doc, I couldn't find examples of e.g. m/register-function-schema in the doc (or the tests ๐ )
@cfleming what if there was a intermediate step in prettifying: exception -> prepocessed data. And two different printers for that: malli.dev.pretty and Cursive? Could that work? Would it make any sense?
e.g. split the current pretty into 2 steps so the preprocessing could be reused (and always up-to-date for new exceptions for Cursive)
Could be, although there's not that much pre-processing on top of what pretty already does. Let me get a gist up of what this currently looks like.
https://gist.github.com/cursive-ide/6e71f45dca0b428d8de00fb70757f404
There's a little bit of duplication there, since in pretty things like -errors and -explain take a printer, but it's not much. A lot of that is just some helper functions and the test comments to exercise it. @ikitommi are you going to Heart of Clojure? We could take a look at it there if so.
Thinking about it, I think the best abstraction for these would be some kind of lightweight document format, as you suggest. Then those could be processed by Cursive or Pretty. I think that's the only way we could isolate them from future changes in the exception format.
I would love to be, but can't make it. Second โค๏ธ, second miss ๐. Bunch of metosin2 s coming thou. Would you be interested in doing the lightweight document format PR?
Definitely interested, but not sure how much time Iโll have in the next wee while. Iโll take a look when I have time though.
These are based on the existing dev pretty logic, I don't have them all done yet but most of the common ones.
wow. thatโs really cool. If there is something that can help your work on malli side, please share, happy to help!