cider

A channel dedicated to the Clojure Interactive Development Environment that Rocks (aka CIDER). :cider:
Ben Sless 2020-07-14T07:07:44.365Z

Hello ciderians, I'm trying to start a headless repl with docker run and cider-connect to it. Getting the following error message:

[nREPL] Establishing direct connection to localhost:9999 ...
[nREPL] Direct connection to localhost:9999 established
[nREPL] Connection closed unexpectedly (connection broken by remote peer)
nrepl-send-sync-request: Sync nREPL request timed out (op clone id 1)
This is how I ran it:
docker run \
       -p 9999:9999 \
       -e "TOKEN=$TOKEN" \
       --rm \
       -v "$PWD":/usr/src/app \
       -w /usr/src/app clojure:openjdk-14-lein-2.9.3 \
       lein \
       update-in :dependencies conj \[nrepl\ \"0.8.0-alpha5\"\] -- \
       update-in :plugins conj \[refactor-nrepl\ \"2.5.0\"\] -- \
       update-in :plugins conj \[cider/cider-nrepl\ \"0.25.3-SNAPSHOT\"\] -- \
       repl :headless :host localhost :port 9999
Is there another port I need to bind?

Ben Sless 2020-07-14T07:17:39.365700Z

trivially solved with --net=host instead of port mapping. huh.

2020-07-14T13:06:17.366200Z

mine .dir-locals.el is

2020-07-14T13:06:20.366400Z

((clojure-mode (cider-jack-in-default . "clojure-cli") (cider-clojure-cli-global-options . "-A:test") (clojure-align-forms-automatically . nil)))

2020-07-14T13:06:37.366800Z

jack-in-default is not giving me directly clojure-cli

2020-07-14T13:06:53.367200Z

it opens the menu asking if its lein or clojure-cli

dpsutton 2020-07-14T13:07:30.368Z

What’s the docstring for “cider-jack-in-default”?

2020-07-14T13:08:06.368400Z

cider-jack-in-default is a variable defined in ‘cider.el’.
Its value is ‘clojure-cli’

  This variable has an alias: ‘cider-default-repl-command’.
  This variable is safe as a file local variable if its value
  satisfies the predicate ‘symbolp’.
  You can customize this variable.
  This variable was introduced, or its default value was changed, in
  version 0.9.0 of the cider package.

Documentation:
The default tool to use when doing ‘cider-jack-in’ outside a project.
This value will only be consulted when no identifying file types, i.e.
project.clj for leiningen or build.boot for boot, could be found.

As the Clojure CLI is bundled with Clojure itself, it’s the default.
In the absence of the Clojure CLI (e.g. on Windows), we fallback
to Leiningen.

2020-07-14T13:08:25.368900Z

but I want this on this project

dpsutton 2020-07-14T13:08:57.369800Z

That says “the value will only be consulted when no identifying file types “ are found

dpsutton 2020-07-14T13:09:12.370200Z

You want the preferred build tool version

2020-07-14T13:09:37.370600Z

ahn

2020-07-14T13:10:14.371400Z

anyone here knows about a variable I can change to have a default jack-in command?

bozhidar 2020-07-14T13:17:48.371800Z

@d.ian.b See cider-preferred-build-tool.

1
2020-07-14T13:17:58.372Z

thanks!

2020-07-14T13:19:23.372400Z

it worked ! @bozhidar =))

2020-07-14T16:53:47.374500Z

How do I change cljs compiler option when jack-in with cider? I use clojure cli against nodejs. My guess is to start from the form (cider.piggieback/cljs-repl (cljs.repl.node/repl-env))

2020-07-14T17:18:44.375700Z

ah, it's the parameters to cljs-repl after the first. I tried a hash-map instead of flattened keys, therefore I got errors

papachan 2020-07-14T20:43:46.377500Z

When i execute C-u C-c M-j i am able to write and run some alias from my deps.edn. but cider dont execute this alias if i dont remove all the line:

/usr/local/bin/clojure -Sdeps ... -m nrepl.cmdline --middleware '["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"]'

dpsutton 2020-07-14T21:07:35.377800Z

i'm not sure i follow

dominicm 2020-07-14T21:08:15.378500Z

@papachan does your alias contain :main-opts?

papachan 2020-07-14T21:08:36.378900Z

right now i disable all. i have this:

papachan 2020-07-14T21:09:02.379Z

papachan 2020-07-14T21:09:34.379900Z

just left :extra-paths with a dev directory to check it run clj file there

papachan 2020-07-14T21:09:56.380300Z

when i call from command line clj -A:dev it run perfect and show a result after being compiled.

papachan 2020-07-14T21:17:25.381800Z

OK seems the alias run as expected because i see the files from my dev/ directory. But the difference from calling from command line, it dont compile the files from this directory. i have to do it manually.

dominicm 2020-07-14T21:19:07.382500Z

:main-opts do not run with Jack in

papachan 2020-07-14T21:20:48.383500Z

ah ok. good to know. is there a way to see which config is loaded with cider repl? to check the directory list, classes etc

dpsutton 2020-07-14T21:42:39.384100Z

the repl will startup and show its startup command