Fork me on GitHub
#cider
<
2021-01-21
>
richiardiandrea04:01:03

Hi there, let's say I want to embed my nrepl in the app. Then I want to be able to connect to it from either Calva or Cider (depending on the developer). Do they both support .nrepl.port?

richiardiandrea04:01:28

and yes, it seems like I am back to doing Clojure 🎉

metal 3
dpsutton04:01:08

are you asking if starting an nrepl server uses the port found in .nrepl.port or if when it starts it will write a file with the port its using into .nrepl.port

richiardiandrea04:01:37

I think I answered by checking the start-server implementation...it does not save the file automatically unless launched via cmd line... I was more wondering if both editors can read that file

pez06:01:30

Calva looks for different nrepl port files depending on project type. This can also be configured using custom connect sequences: https://calva.io/connect-sequences/

dpsutton06:01:44

i thought CIDER just watches the server output for a regex to grab the port. when you cider-connect it will just ask i thought. forgot how that works and if it actively looks for that file on cider-connect

dpsutton06:01:47

yeah cider will look for that file if it exists

dpsutton07:01:00

i'm guessing its just the port in there? should be simple enough to spit that out when you start your server if you want

dpsutton07:01:29

there's a delete on done option for files that will make sure to clean it up too to prevent it from laying around

richiardiandrea16:01:03

thank you both, I did not notice that Calva page 😄

richiardiandrea16:01:37

there might be an issue in the different spelling though... I see nrepl.port in calva but .nrepl-port in https://github.com/nrepl/nrepl/blob/565cc075dc8ba1179e0a9d6b4ef8eb6ae9d47f54/src/clojure/nrepl/cmdline.clj#L420 I know it's configurable but it might be worth using the same name

pez16:01:03

Where in Calva do you see nrepl-port?

pez16:01:54

Also, is there a reason you are not using jack-in?

richiardiandrea16:01:15

about the latter, yes - there is a lot of output from the app and a terminal suits us better 😄

richiardiandrea16:01:42

about the first question - maybe there is a mistake in that doc cause I see the right name under "Connecting"

richiardiandrea17:01:47

Just FYI it does not see that customizing the REPL port file works

dpsutton17:01:41

what are you doing?

richiardiandrea17:01:07

oh it does ... sorry I needed a vector lol

richiardiandrea17:01:24

this works "nReplPortFile": [".nrepl-port"],

dpsutton17:01:45

oh for customizing calva?

pez17:01:36

A bit of bad naming there…

pez17:01:28

@U0C8489U6 The only place I see nrepl-port mentioned is for shadow-cljs, which actually names it like that. Is there some other place it says that?

richiardiandrea17:01:09

that's the only place I saw that - and it confused me but maybe it's just me ... 😄

richiardiandrea17:01:39

I have everything fully working and very smoothly now 😄

pez17:01:46

Awesome!

richiardiandrea17:01:35

@U11BV7MTK yes my app now launches the nrepl server and writes the file (in dev mode). Calva picks the port from it when doing Connect to an existing REPL in project

pez17:01:31

The internal terminal i VS Code is pretty good, btw. And there is this button where it can be maximized and restored quickly. So to me jack-in makes sense since it uses this terminal. Just sayn’ 😃

👍 3
richiardiandrea17:01:17

I like that you can customize the project name thanks to calva.replConnectSequences

richiardiandrea17:01:25

very nice to your lil' custom menu 😄

😍 3