juxt

conan 2019-03-05T15:12:36.006400Z

Hi, I'm using Edge and would like to add spec instrumentation into my (go) function, where can I hook in? Any pointers much appreciated

p-himik 2019-03-05T15:17:08.006600Z

This function is defined in lib.app.dev/src/dev_extras.clj. You can probably just alter it directly, or require your own namespace instead of dev and create your own version of go that calls the original one.

conan 2019-03-05T15:39:09.006800Z

ah ok, so i'll wrap it. thanks!

dominicm 2019-03-05T16:10:45.007700Z

@conan not everyone will call (go) so I would guess that's the wrong place to do that. cider users & vim users will pretty much only call (reset), or these days suspend and resume.

dominicm 2019-03-05T16:12:19.008700Z

on top of that, you want to make sure this is only run once (go is idempotent and can be called multiple times). Don't have a good answer for you, but I think that's because that's how spec is supposed to work (based on Halloway's talks where he shared his flow).

dominicm 2019-03-05T16:12:46.009200Z

I can't remember what exactly, but I had bad experiences with having global spec instrumentation on, and turned it off in the end.

p-himik 2019-03-05T16:17:52.009300Z

It may be perceived as if reset is deprecated. But among all these functions, only reset actually calls repl/refresh.

conan 2019-03-05T16:28:31.009500Z

yep, and i need to instrument right after repl/refresh

conan 2019-03-05T16:28:57.009800Z

i love it very much

dominicm 2019-03-05T18:33:03.009900Z

@p-himik correct. But in emacs and vim (probably calva too) cider refresh can be used directly with suspend and resume. As of a week ago, projects are automatically configured that way in edge, so the cider-refresh binding is the easiest way for emacs users now. That is, vim, emacs and maybe vscode users never call repl/refresh.

p-himik 2019-03-05T18:37:07.010100Z

Ahh, gotcha!