Fork me on GitHub
#juxt
<
2019-03-05
>
conan15:03:36

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-himik15:03:08

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.

conan15:03:09

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

dominicm16:03:45

@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.

p-himik16:03:52

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

conan16:03:31

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

dominicm18:03:03

@U2FRKM4TW 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-himik18:03:07

Ahh, gotcha!

dominicm16:03:19

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

dominicm16:03:46

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

conan16:03:57

i love it very much