Fork me on GitHub
#vim
<
2019-02-23
>
rgm05:02:10

so with huge thanks to @dominicm I seem to have a working fireplace + tools.deps + figwheel connection via piggieback … I made a bunch of notes on the github issue and hope this is helpful … it’d be better if it didn’t require patching fireplace, but, well, it does work for me: https://github.com/rgm/reframe-template/issues/1#issuecomment-466619263

👍 5
rgm05:02:51

of course so now I’m reading https://figwheel.org/docs/vim.html a bit more closely

rgm05:02:48

and it seems that yep, it says right there that I should be starting a terminal cljs-repl first, and then connecting Piggieback

rgm05:02:44

maybe it’s just me but fireplace’s :Piggieback command seems a bit … suprising. Straight :Piggieback will start Nashorn on its own and :Piggieback 9000 will start a stock CLJS browser repl, whereas :Connect doesn’t start anything; it just connects to an existing nrepl server.

rgm06:02:38

Where I think I got confused was extrapolating and assuming that :Piggieback (figwheel.main.api/cljs-repl "dev") would start a Figwheel repl, and it doesn’t. It seems to behave more like :Connect

rgm06:02:21

(which seems to be the interplay between figwheel and fireplace; it doesn’t seem like anyone set out to make this inconsistent).

dominicm06:02:38

Personally, I'm happy it works like :Connect. CIDER doesn't behave that way, and it breaks edge.

dominicm06:02:58

I'll try dig a little deeper today if I get time.

rgm14:02:31

Yeah, I agree. I find the fallback behaviour of starting a completely separate headless JS engine with (usually) different compiler options to be very confusing. I’d rather it fail fast and then I know it’s not connecting properly, versus getting odd messages around eg. js/alert missing (because headless), or not being able to find a foreign lib (because not using the right compiler opts).

rgm14:02:20

I’ll probably just leave my hacked-up fireplace.vim the way it is.

rgm14:02:33

I don’t get why :Piggieback ignored the repl-env I gave it, but that’s just curiosity now; I know how to force it to do what I want.

dominicm14:02:59

@rgm I'm not having to make modifications to fireplace to have things work, fwiw.

dominicm14:02:16

If you're ending up in empty(a:args), that would imply you're running :Piggieback, rather than :Piggieback foo

rgm15:02:58

That was my read of the docs too. But ... with that eval(“nil”) and swapping in Figwheel for nashorn it works on my machine, and without both. It doesn’t. Something screwy with my machine I guess.

rgm15:02:46

It’s on my “no wait let’s really understand this” pile for next week :)

johnj19:02:04

Can fireplace be used with just an nrepl server started from tool.deps/clj ?

johnj19:02:34

fireplace readme says you need cider-nrepl, is nrepl alone enough?

dominicm19:02:50

It does work with tdeps&nrepl, nrepl alone is enough, but has reduced functionality. I would highly recommend using cider

johnj19:02:00

`Execution error (FileNotFoundException) at user/eval5301 (REPL:1). Could not locate dev__init.class, dev.clj or dev.cljc on classpath. Error detected while processing function <SNR>32_Doc[1]..fireplace#info[39]..fireplace#evalparse: line 12: E605: Exception not caught: Clojure: class java.io.FileNotFoundException`

johnj19:02:44

What could be causing that?

johnj19:02:50

I'm not using lein, maybe it needs the classpath file lein creates?

dominicm19:02:21

It doesn't, no.

dominicm19:02:45

I use fireplace with both tdeps and boot, it works perfectly.

dominicm19:02:19

This usually happens if you're in dev.clj, but haven't saved yet. Or if you haven't started with the dev alias.

johnj19:02:59

Ok, let me try, I started with clj -Sdeps '{:deps {cider/cider-nrepl {:mvn/version "0.21.1"} }}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["cider.nrepl/cider-middleware"])'

johnj19:02:07

for trying it out quickly

dominicm19:02:26

Where are you evaluating things from? What file? What does your deps.edn look like?

johnj19:02:23

had a typo adding dev.clj to the classpath, thanks!

johnj19:02:42

when I type cpp on some forms and keep typing, characters start being replaced, why is that?

johnj19:02:20

like its expecting more input

dominicm20:02:27

I would guess you've only pressed cp which can take a text object

johnj20:02:32

yeah good guess, thought that too, I'll keep checking

johnj20:02:19

what happens is I keep pressing p after cpp on some, sometimes it works, sometimes it doesn't https://asciinema.org/a/Q8EVFHTLC3hbGFyOgRzXnwUDu

johnj20:02:55

I have to control-c my way out