cider

A channel dedicated to the Clojure Interactive Development Environment that Rocks (aka CIDER). :cider:
richiardiandrea 2021-01-21T04:01:03.001600Z

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?

richiardiandrea 2021-01-21T16:16:03.005600Z

thank you both, I did not notice that Calva page πŸ˜„

pez 2021-01-21T16:22:03.006600Z

Where in Calva do you see nrepl-port?

pez 2021-01-21T16:22:54.006800Z

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

richiardiandrea 2021-01-21T16:44:15.007Z

about the latter, yes - there is a lot of output from the app and a terminal suits us better πŸ˜„

richiardiandrea 2021-01-21T16:44:42.007200Z

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

richiardiandrea 2021-01-21T16:45:15.007400Z

found -> here it says nrepl.port https://calva.io/connect-sequences/#settings-for-adding-custom-sequences

richiardiandrea 2021-01-21T17:00:47.007700Z

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

dpsutton 2021-01-21T17:01:41.007900Z

what are you doing?

richiardiandrea 2021-01-21T17:02:07.008100Z

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

richiardiandrea 2021-01-21T17:02:24.008300Z

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

dpsutton 2021-01-21T17:02:45.008500Z

oh for customizing calva?

pez 2021-01-21T17:10:36.008700Z

A bit of bad naming there…

pez 2021-01-21T17:20:28.008900Z

@richiardiandrea 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?

richiardiandrea 2021-01-21T17:21:09.009100Z

that's the only place I saw that - and it confused me but maybe it's just me ... πŸ˜„

richiardiandrea 2021-01-21T17:21:39.009400Z

I have everything fully working and very smoothly now πŸ˜„

pez 2021-01-21T17:21:46.009600Z

Awesome!

richiardiandrea 2021-01-21T17:22:35.009800Z

@dpsutton 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

pez 2021-01-21T17:23:31.010Z

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’ πŸ˜ƒ

πŸ‘ 1
richiardiandrea 2021-01-21T17:25:17.010300Z

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

richiardiandrea 2021-01-21T17:25:25.010500Z

very nice to your lil' custom menu πŸ˜„

😍 1
richiardiandrea 2021-01-21T18:42:16.010800Z

oh I found it also here https://github.com/BetterThanTomorrow/calva/blob/published/src/nrepl/connectSequence.ts#L126

richiardiandrea 2021-01-21T04:01:28.001700Z

and yes, it seems like I am back to doing Clojure πŸŽ‰

🀘 1
dpsutton 2021-01-21T04:27:08.001900Z

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

richiardiandrea 2021-01-21T04:56:37.002100Z

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

pez 2021-01-21T06:38:30.004500Z

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/

dpsutton 2021-01-21T06:40:44.004800Z

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

dpsutton 2021-01-21T06:42:47.005Z

yeah cider will look for that file if it exists

dpsutton 2021-01-21T07:00:00.005200Z

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

dpsutton 2021-01-21T07:00:29.005400Z

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