This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-21
Channels
- # announcements (3)
- # architecture (5)
- # babashka (19)
- # beginners (145)
- # calva (1)
- # chlorine-clover (18)
- # cider (10)
- # clj-kondo (5)
- # cljsrn (3)
- # clojure (56)
- # clojure-berlin (19)
- # clojure-czech (2)
- # clojure-europe (32)
- # clojure-finland (2)
- # clojure-nl (3)
- # clojure-portugal (2)
- # clojure-spec (8)
- # clojure-uk (48)
- # clojurescript (48)
- # conjure (50)
- # cryogen (1)
- # cursive (28)
- # datomic (54)
- # depstar (12)
- # emacs (1)
- # events (8)
- # figwheel-main (6)
- # fulcro (4)
- # helix (4)
- # java (2)
- # jobs (2)
- # leiningen (1)
- # off-topic (29)
- # parinfer (4)
- # pathom (6)
- # portkey (3)
- # reagent (1)
- # remote-jobs (3)
- # reveal (16)
- # shadow-cljs (42)
- # sql (20)
- # tools-deps (11)
- # vim (4)
- # vrac (2)
Can I use conjure with multiple projects at once? Like connect to one thing in one terminal and another in another? I was trying to connect and it kept talking about the other 🙂
If it's one neovim instance you'll need to set the state key as you :cd
between projects or maybe even as you open different files. This means you set up an autocmd on directory change or on file open that works out which project you're in and runs :ConjureClientState my-project-name
where the project name can be any string really
Basically by running :ConjureClientState SOMESTRING
you can hop into an alternate reality of Conjure where you're connected to something else
It's up to you to set up autocmds / key mappings to hop between client state strings, so you can tailor it to your needs. It's more of a building block than anything.
You could just have two like "a" and "b" and set up a mapping to hop to a and one to b
I use this at work with nvim-local-fennel
(module redacted
{require {nvim aniseed.nvim}})
(set nvim.g.conjure#relative_file_root "./")
(nvim.ex.augroup :redacted-lnvim)
(nvim.ex.autocmd_)
(nvim.ex.autocmd :DirChanged :* :execute "'ConjureClientState ' . fnamemodify(getcwd(), ':t')")
(nvim.ex.augroup :END)
so as I :cd module/some-module
I get an isolated environment for that separate clojure project.
No problem! The client state stuff basically lets you simulate two entirely separate conjure instances
But two terminals is simpler to do, :ConjureClientState ...
is there for when you want to get creative and have things just connect and do what you want in monorepo style projects
I guess the same applies to two nREPLs (e.g. clj and cljs) in the same project. Either you use something like Piggieback or you wrangle :ConjureClientState
. Is that right?
Seems like the problem is going to be something WSL related. I opened a completely new terminal and it still tells me that watch for the build is not running and when I want to connect it mentions the other project's namespace
@U0DTSCAUU kinda although CLJS + CLJ in one nREPL actually works well through sessions.
That sounds like your CWD isn't being updated @U0VQ4N5EE?
Also if you have two nREPLs with two ports just using :ConjureConnect ...
with just the port number for each nREPL in each terminal.
I think it's that, the port was the same, so it didn't start, had probably nothing to do with conjure, sorry for the bother 😞 But at least I learned about ConjureClientState
Not a problem! And yeah, I'd consider client state extremely useful in some cases with some upfront thinking / autocmds but an advanced feature most don't need.
The error printer in Conjure seems rather sparse — no stacktrace, no ex-data… I end up evaluating *e
in the editor to figure things out. Is this something pluggable via say an nrepl middleware?
I tend to just use *e
too, you could rig up a mapping that evaluated *e
with whatever wrapper you're interested in at the time via :ConjureEval ...
. I would imagine nREPL middleware would give you some good hooks into it too! Although I've never tried that myself
I didn't do anything special with the errors because the default seemed pretty good already and I didn't want to step on the toes of middleware / custom setups / environmental differences (cljs / clj etc).
BTW one thing that I realised might influence the floating window delay that I’m seeing is wrapping. I usually tend to wrap my logs (set wrap) so floating window might have to do a lot of work to show the wrapped results?
I always kind-of expected that the floating window will only show the last evaluation result, not the whole log. But that’s just me 🙂
The current route just means "there's only ever one buffer and we get a little view of it" which is sometimes bad, sometimes good when you want to see a glimpse into your previous evals as the latest one comes back
It took me a bit to get used to the error reporting in conjure. Now I'm used to the terse default and use ,ve
to show the whole stack trace. I think it's a good balance.
I rarely run my REPL inside nvim but when I do I use https://github.com/clojure-vim/vim-jack-in
Opens a terminal buffer/window/tab in nvim and runs lein/clj etc within it. That's all! It also injects all the magic cider nrepl middleware stuff which can be handy for off the cuff evals