Fork me on GitHub
#vim
<
2016-10-13
>
mx200010:10:05

Hello, I have figwheel server running with ‘lein fighweel’ and auto-reloading on filechanges works fine. But I can not use the REPL from VIM: org.mozilla.javascript.EcmaError: TypeError: Cannot call method "getStackTrace" of undefined (rhino.clj#41)^

dominicm10:10:29

@mx2000 Have you run the :Piggieback command?

mx200010:10:32

:Piggieback runs okay, but then when i want to eval anything I get this error always

mx200010:10:40

Yes it returns nothing

dominicm10:10:53

That error means that :Piggieback isn't working.

dominicm10:10:58

What is your full command?

mx200010:10:15

I have in project.clj : :figwheel {:nrepl-port 7888 :nrepl-middleware ["cemerick.piggieback/wrap-cljs-repl" "cider.nrepl/cider-middleware"]}

mx200010:10:35

And first I do :Connect <nrepl://localhost:7888>. Returns. Then :Piggieback

dominicm10:10:55

You need to provide :Piggieback with the repl-env

mx200010:10:01

The docs say: If {env} is a number, the piggieback repl-env will will use a cljs.repl.browser (rather than a Rhino) env with the port set to the number provided.

mx200010:10:24

I dont understand, should I just put a new port, or the figwheel browser REPL port?

dominicm10:10:04

:Piggieback (figwheel-sidecar.repl-api/repl-env)

dominicm10:10:17

This is the full command for figwheel

dominicm10:10:39

When you run it, it will block until you open the browser

mx200010:10:29

CompilerException java.lang.RuntimeException: No such var: figwheel-sidecar.repl-api/repl-env,

dominicm10:10:45

@mx2000 Are you on latest figwheel?

dominicm10:10:04

@markwoodhall Did you settle on anything awesome for your custom :Figwheel command?

dominicm10:10:37

@mx2000 let me know if upgrading figwheel works for you.

mx200010:10:08

Yes finally

dominicm10:10:47

@mx2000 Only figwheel 0.5.8+ has support for vim

markwoodhall10:10:46

@dominicm Just stuck with what I had for now, if I do have to tweak a bit more I will probably do as you suggested and make :Figwheel accept an optional list of builds to start.

dominicm10:10:21

@markwoodhall It would be nice to have that uber command on the figwheel wiki. Would look very pro 😛

markwoodhall11:10:43

Yeah, that would be cool.

dominicm11:10:40

I'll put some time into it later, can you show me where you're up to now?

markwoodhall12:10:03

This is all I have at the moment, it’s nothing fantastic. I’ve still got a separate function for running a cljsbuild named “devcards”. https://gist.github.com/markwoodhall/f5c97a93bd7f9d3bf291bad4cec5ac3d Like you said, if you could supply :Figwheel with a list of builds to start that would be cool. I’m not sure if you would still want it to start the default build implicitly as well.

dominicm12:10:47

Good question, I'd guess not.

dominicm12:10:31

I can do :Boot to run boot cider dev or :Boot repl to run boot cider repl. It's very handy.

dominicm12:10:24

Instead of join we'd need something a little more complex, but the idea is the same.

markwoodhall16:10:12

I might have a look later. How do you find boot? I've not looked at it yet!

dominicm18:10:07

@markwoodhall it's the bomb, plus a few contributors are vimmers which is why cljs has worked in boot since I used it

dominicm18:10:17

Also pods are great

dominicm20:10:02

@markwoodhall I just had a crazy idea, is there any way to get a list of builds in figwheel?

dominicm20:10:40

The completeopts argument is fairly simple, maybe we could get you completion on FigwheelDevcards, without having to hardcode it into the command 🙂

dominicm20:10:05

Fig<TAB><SPC>de<TAB> Not quite as short

dominicm20:10:10

Still good though

markwoodhall20:10:31

That would be nice!

markwoodhall20:10:22

Be good to hook up (clean-build) and (stop-autobuild) as well.

dominicm20:10:59

What you have is pretty good though, you'll realise that all vimscript feels like that, or it does for me

markwoodhall20:10:47

Yeah, it does. I wrote some stuff for a C# plugin that expands completions as snippets on the fly, it was hideous! https://camo.githubusercontent.com/8315b4a3d97cd2bf8e177826cd1be0206aa1fe7f/687474703a2f2f692e696d6775722e636f6d2f594f4153557a542e676966