Fork me on GitHub
#vim
<
2019-07-24
>
dominicm06:07:40

@chase-lambert so the problem was before that if you typed clojure.core/ then coc.nvim wouldn't re-ask for completions, so I didn't get the chance to return everything that's in clojure.core. Now upon typing the / character, it will refresh.

samoleary14:07:47

does anyone use vim-fireplace along with vim-clojure-static and vim-clojure-highlight for syntax highlighting? either my eyes are playing up or some symbols aren't being coloured like they were before are there alternatives, for better or for worse?

dominicm14:07:30

I might have stopped using vim-clojure-highlight actually. I got a bit frustrated with the lock-up when I entered a buffer.

dominicm14:07:45

vim-clojure-highlight perhaps is using a changed fireplace api, it could probably use an update to be async too.

tpope15:07:21

it was relying on fireplace internals that changed https://github.com/tpope/vim-fireplace/issues/341

Chase15:07:15

@dominicm I was able to get coc.nvim updated and can confirm it's refreshing fine with /. Thanks again!

Chase15:07:49

So should I get rid of vim-clojure-static and vim-clojure-highlight then because I also use them with vim-fireplace? Or is this just a temporary breakage? If I should delete, what alternative do you folks suggest for good clojure syntax highlighting?

tpope15:07:52

the person that created that issue apparently has a working fork

tpope15:07:17

sending a pr to the original would make sense i think?

Chase16:07:46

when trying to connect to a running nrepl (started through shadow-cljs) I'm getting this error: Fireplace: invalid connection string '' as soon as I input :Connect<CR>

Chase16:07:30

any clues what I'm doing wrong? I was able to get this hooked in no problem a few months ago.

Chase16:07:29

I have cider-nrepl and cider/piggieback in my dependencies like I did last time. This is a reagent tutorial I'm going through.

Chase16:07:14

I actually have the same issue when just trying to connect to a running nrepl in a different project using lein repl. I don't have the problem if I start lein repl before going to my source file, then it just automatically connects but this isn't an option with shadow-cljs (that I know of) so I have to be able to manually connect.

tpope17:07:50

is there a .nrepl-port?

Chase17:07:31

my shadow-cljs.edn shows this, yes: :nrepl {:port 3333}

Chase17:07:26

but I'm having the same problem with just normal lein repl if trying to connect manually rather than having it automatically do it like I normally do. Both have the cider/cider-nrepl dependencies

tpope17:07:45

the error message is a little weird but :Connect isn't a mind reader, you need to give it an argument

tpope17:07:15

the automatic connection only works for .nrepl-port. i don't know anything about shadow-cljs.edn but we don't have an edn parser so there's probably not much we can do there

Chase17:07:34

hmmm. from memory, I used to hit :Connect it would ask me to choose something (I think it was choose host like "nrepl" or something) and then enter the the port number. let me find what I'm supposed to feed it as an argument.

tpope17:07:40

oh i did rip out the prompt, didn't realize anyone used it

tpope17:07:01

you can :Connect to a port or a host:port or a

tpope17:07:49

yeah the docs are out of date, good catch

Chase17:07:25

Yeah doing :Connect with the port # provided by lein repl works fine. Unfortunately it doesn't work like it used to for shadow-cljs anymore. With the prompt you had, we must have just gotten fortunate that it automatically worked fine for shadow-cljs (which is just using nrepl as far as I can tell). Unfortunately I bought a crazy expensive reagent and re-frame tutorial and shadow-cljs seems to be where the cljs folks are moving to so I have to find a different solution.

Chase17:07:55

It's unfortunate that we have to learn lein deps.edn and shadow-cljs (and maybe boot) these days.

Chase17:07:40

Clojure repl and tooling can be amazing but I swear I spend half my development time getting all the tooling working right together.

tpope17:07:44

can you just, like, :echo 3333 > .nrepl-port?

tpope17:07:58

or are you saying :Connect 3333 doesn't work?

Chase17:07:56

The latter. That method worked fine with manually connecting to a lein repl (which your hunch is correct, I would never really do)

Chase17:07:20

With this shadow-cljs project when I run that command my repl shows this error:

[2019-07-24 12:37:11 - SEVERE] Unhandled REPL handler exception processing message {:id ae40bfe8-e180-4ad0-33de-ceb5d15054f3, :op classpath}
java.lang.IllegalArgumentException: No implementation of method: :send of protocol: #'nrepl.transport/Transport found for class: clojure.tools.nrepl.transport.FnTransport

Chase17:07:37

with some more stack trace goodness

Chase17:07:47

and vim locks up until I manually unfreeze it

dave17:07:51

re: vim-clojure-highlight: FWIW, i removed this plugin from my vimrc ages ago and i haven't noticed any impact whatsoever. i think enough of it is baked into vim itself that i'm not sure what the plugin actually provides beyond that anymore

tpope17:07:43

vim-clojure-static provides the regular highlighting and is baked into vim now. vim-clojure-highlight would query nrepl for the methods available in your namespace and highlight all of them

dave17:07:35

ah, yeah, that rings a bell

samoleary07:07:38

which theme do you use for vim, dave?

tpope17:07:10

@chase-lambert does it work on an older version of fireplace? if it does i can probably figure out what went wrong

tpope17:07:20

you might want to try 66b738b4978885d4d673ac50d660e6bc2ae42b4f (the first commit with async support) and the commit right before it

Chase17:07:36

yeah, it worked a few months ago but I'm not sure how to do older versions. but what if something has changed with shadow-cljs too though?

tpope17:07:56

my guess would be something changed with shadow-cljs, but it's just a guess

tpope17:07:21

if you installed fireplace as a git repo, you can git checkout an old commit

Chase17:07:34

ahhh. I'm a vim-plug guy myself. should I maybe ask the shadow-cljs channel if anyone there is a vim/fireplace user?

tpope17:07:06

i think vim-plug uses git repos under the hood?

Chase17:07:48

yeah I think I can tag (?) a version. I'm looking into it now.

Chase17:07:55

does this look like an example of what I should try?

" Plugin options
Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' }

Chase17:07:17

not sure if it lets me use that commit number instead of a version number

tpope17:07:59

yes something like that

tpope17:07:06

you can start with v1.2

dave17:07:24

you can just navigate into ~/.vim/bundle/name-of-plugin and check out a different commit

dave17:07:28

(i use vim-plug)

dave17:07:46

then re-check out master or whatever when you're done

Chase18:07:38

oh sweet. so i'm in .vim/plugged/vim-fireplace now I go git checkout ... what?

Chase18:07:50

thanks so much for helping me here folks. I know I need a lot of hand holding

tpope18:07:47

the sha i gave you

tpope18:07:01

then the sha i gave you plus ^ to try the ancestor

Chase18:07:51

yup, just tried the first one. no luck. let me try this ancestor.

Chase18:07:11

ok, you guys are going to kill me. turns out cider nrepl has changed their whole dependency thing so the github I was using was wrong. They use this now: https://clojars.org/nrepl/versions/0.6.0

Chase18:07:25

Now manually connecting to the repl using :Connect 3333 works

Chase18:07:32

I love clojure for it's stability! I didn't think to recheck all these things after being gone for only a few months.

Chase18:07:13

Now I can't get the cljs repl connected with piggieback. I swear if you help me with that I will leave you alone for a long, long time!

Chase18:07:52

I used to do :Piggieback :app and it just connected for me. It gives me this error though:

ClassNotFoundException cider.piggieback  java.net.URLClassLoader.f
indClass (URLClassLoader.java:471)

Chase18:07:30

This is the info the shadow-cljs repl tells me as far as ports and such:

shadow-cljs - HTTP server for :app available at 
shadow-cljs - server version: 2.3.30
shadow-cljs - server running at 
shadow-cljs - socket repl running at localhost:37547
shadow-cljs - nREPL server started on port 3333
shadow-cljs - watching build :app

tpope19:07:48

cider.piggieback is generally installed as a project dependency

Chase19:07:24

Yup I have that in there.

tpope19:07:37

maybe you need to require it?

Chase19:07:01

If I input :Piggiebackit tells me no default clojurescript repl

Chase19:07:43

if I do :Piggieback :app like I used to to connect to this project it tells me that classnotfound exception

tpope19:07:06

try requiring it?

tpope19:07:21

(require 'cider.piggieback)

Chase19:07:38

I don't actually know where I can do that. shadow-cljs doesn't give me a repl when I start it. I start it with npm run dev. It starts the nrepl and such and watches for changes for hot reloading.

Chase19:07:59

ugh. sorry about all this. all this shit just worked last time. not sure what I've done to get it all convoluted.

tpope19:07:23

create a scratch.clj inside your project directory and try to :Eval it there maybe?

Chase19:07:06

well I do get something different now:

IllegalStateException Can't change/establish root binding of: *cljs-repl-env* with set  cl
ojure.lang.Var.set (Var.java:223)

tpope19:07:02

that's after requiring?

Chase19:07:33

I did get a nil after requiring it I think so usually that means it worked?

tpope19:07:44

yes sounds like it worked

tpope19:07:24

i have no idea what that means

tpope19:07:53

but I also don't know what (cider.piggieback/cljs-repl :app) would do. usually you pass a function

Chase19:07:37

ok. I appreciate all your help. Not sure what changed. Unfortunately the tutorial starts by cloning a decently large repo. Last time all I changed was his proto repl dependency (I'm not using Atom dammit!) to cider nrepl and piggieback and it all worked. I'm going to have to go a different route. It's a freaking $250 tutorial too...smh

Chase19:07:45

What exactly should I feed the :Piggieback command?

tpope19:07:43

for nashorn it would be (cljs.repl.nashorn/repl-env)

tpope19:07:56

I don't know the first thing about shadow-cljs

Chase19:07:32

I mean as I used to put :Piggieback :app but now what should I be putting? Was that command changed?

tpope19:07:02

it was changed but afaik it should handle :app the same

tpope19:07:06

try an old version!

Chase19:07:03

well, now I get this:

λ ~/.vim/plugged/vim-fireplace : git checkout 66b738b4978885d4d673ac50d660e6bc2ae42b4f
fatal: reference is not a tree: 66b738b4978885d4d673ac50d660e6bc2ae42b4f

Chase19:07:42

I'm going to throw my computer out the window. This is getting silly, going to take a step back. I've spent 4 hours on this. I really do appreciate all your time. Clojure tooling is just too f'ing brittle for me sometimes (yet it's probably all my fault)

tpope19:07:05

this issue mentions passing :id-of-build to piggieback which sounds like your :app thing https://github.com/thheller/shadow-cljs/issues/62

Chase19:07:41

but shadow-cljs is telling me: shadow-cljs - watching build :app

Chase19:07:06

so I think in my case the :id-of-build is :app which is probably why it used to work.

tpope20:07:56

this comment implies you get that error if the piggieback middleware isn't available https://github.com/duct-framework/duct/issues/21#issuecomment-160036385

Chase20:07:19

I don't know what else to do besides add the dependencies

Chase20:07:08

this is what I'm trying to get set up. All I did was delete out the Atom proto repl dependency and put in the cider-nrepl and piggieback one's in.

tpope20:07:23

(shadow.cljs.devtools.api/nrepl-selectfrom https://github.com/thheller/shadow-cljs/wiki/Cider seems to work

tpope20:07:27

or at least get it further along

Chase22:07:53

I just get Fireplace: no default ClojureScript REPL when I invoke that

Chase22:07:13

I tried it with various keywords like :app :build :id-of-build

Chase22:07:08

I'm wondering if I'm missing something obvious in my config. https://pastebin.com/K7dDqBxh

tpope22:07:39

invoke it with :Piggieback