cider

A channel dedicated to the Clojure Interactive Development Environment that Rocks (aka CIDER). :cider:
practicalli-john 2020-10-22T01:02:46.252300Z

Getting a weird error when running cider-jack-in-clj with a Clojure CLI deps.edn project and using an alias with the -M flag rather than the deprecated -A flag (I've tried a few aliases with the same error). I have tried this with several versions of Clojure CLI tools installed, from 1.10.1.697 onwards. Using the -A flag does not give this error...

error in process sentinel: Could not start nREPL server: Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).
-Sdeps (No such file or directory)
CIDER 1.0.0snapshot (package: <tel:202009301242|20200930.1242>) Update: In the #tools-deps channel I am asking if the -M flag has issues when the -Sdeps option is also supplied (as I cant seem to turn -Sdeps injection for cider-jack-in-clj off completely with variables in .dir-locals.el)

practicalli-john 2020-10-22T10:39:56.255Z

^ @theophilusx

iarenaza 2020-10-22T21:37:11.280400Z

@jr0cket @theophilusx I suggested a potential fix in the Github issue.

👍 2
1
2020-10-22T01:12:04.253300Z

I am seeing the same error as @jr0cket, but using cider 20201020..1058 package

Steiner 2020-10-22T12:01:09.256100Z

hey. how can I use cider to debug my code, I watch the doc, but found nothing I understand.

Steiner 2020-10-22T12:01:17.256600Z

can you tell me how to operate??

practicalli-john 2020-10-22T12:02:38.257Z

@steiner3044 debugging basics with Cider https://practicalli.github.io/spacemacs/debug-clojure/cider-debug.html

Steiner 2020-10-22T12:06:47.257600Z

sorry, I don't use spacemacs, but original one

practicalli-john 2020-10-22T12:22:31.257700Z

only difference is C-M-x instead of , d b to start

Steiner 2020-10-22T12:28:44.257900Z

eh, which one should I use??

Steiner 2020-10-22T12:30:24.258500Z

eh, what operation should I do first??

practicalli-john 2020-10-22T12:37:36.258700Z

C-u C-M-x with the cursor on a function will instrument that function. This adds breakpoints to that function. Then evaluate a call to that function using the usual key bindings or command A menu should appear above the instrumented function. Use n (next) to step through the evaluation of each expression or form in the function, using any arguments passed to that function.

Steiner 2020-10-22T12:42:26.259700Z

another question, how to set proxy in cider, cider-jack-in failed because former proxy port is forbidden by me, and now I use a new port for proxy

Steiner 2020-10-22T15:21:33.260Z

I have to say, C-M-x in may key-bind is cider-eval

Steiner 2020-10-22T15:53:09.261100Z

eh, I am trying to debug in cider now, and I copy this code from doc:

(loop [i 0]
                  #break
                  (when (&lt; i 10)
                    (println i)
                    (recur (inc i))))
but it throws me an error that
1. Caused by java.lang.RuntimeException
   Unmatched delimiter: )
what's happening??

Steiner 2020-10-22T15:53:45.261600Z

ps: I am sure `

{:user {:plugins [[cider/cider-nrepl "0.9.0"]]}}
has been writen in my .lein/profile.clj

dpsutton 2020-10-22T15:55:57.261900Z

that version was released in 2015.

Steiner 2020-10-22T15:56:43.262100Z

!!!

Steiner 2020-10-22T15:56:52.262500Z

what should I do

dpsutton 2020-10-22T15:57:14.263Z

i can't believe it even works. remove that from lein profiles. if you use cider-jack-in CIDER now makes sure the correct dependencies are added

Steiner 2020-10-22T15:58:46.263800Z

you mean write [cider/cider-nrepl "0.9.0"] in to my project.clj??

dpsutton 2020-10-22T15:59:23.264400Z

no. don't add anything. if you use cider-jack-in it will add it automatically. also, that version is from 2015 so you certainly shouldn't use that version in any case

Steiner 2020-10-22T16:00:29.265400Z

but however, cider-toggle-trace-var only works when [cider/cier-nrepl] writen in .lein/profile.clj

dpsutton 2020-10-22T16:01:04.266100Z

CIDER needs cider-nrepl on the classpath. if you remove that from your lein profiles, but you use cider-jack-in CIDER will add the correct version for you on startup

dpsutton 2020-10-22T16:01:05.266300Z

/Users/dan/bin/lein update-in :dependencies conj \[nrepl\ \"0.8.2\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.25.3\"\] -- repl :headless :host localhost

dpsutton 2020-10-22T16:01:32.266900Z

is an example of the way that CIDER starts up a lein project. as you can see, it includes the correct recent version of cider-nrepl for all features of CIDER to work correctly

dpsutton 2020-10-22T16:02:49.268300Z

if you are starting your project in another manner then you are responsible for ensuring the dependencies are on the classpath. I'd recommend a profile and then lein with-profile +name-of-the-profile that includes the dep [cider/cider-nrepl "0.25.3"] or the most recent version of cider-nrepl

Steiner 2020-10-22T16:06:33.268500Z

user-error: 'cider-toggle-trace-var' requires the nREPL op "toggle-trace-var" (provided by cider-nrepl)

Steiner 2020-10-22T16:06:49.268800Z

I remove content of .lein/profile.clj

dpsutton 2020-10-22T16:09:44.269Z

how did you start your repl?

Steiner 2020-10-22T16:09:53.269200Z

cider-jack-in

dpsutton 2020-10-22T16:10:58.269700Z

at the top of the repl buffer do you see something like: ;; Startup: with a big command after it? can you post that?

dpsutton 2020-10-22T16:11:23.270100Z

and what is the output of lein --version ?

Steiner 2020-10-22T16:11:55.270400Z

2.8.1 maybe it's too low

dpsutton 2020-10-22T16:12:18.270800Z

yeah. lein upgrade 2.9.4 should update it

Steiner 2020-10-22T16:16:09.271500Z

hold on please, I install it from apt, now I want to build it from source, just for fun, can I do it??

dpsutton 2020-10-22T16:16:24.271800Z

i guess? uninstall from apt and then do what you want

practicalli-john 2020-10-22T16:19:17.272100Z

C-u C-M-x it seems. I dont use the cider keybindings, but the keybinding is described in the docs

Steiner 2020-10-22T16:41:37.272700Z

wow, I solve that after upgrade leiningen, thank you

👍 1
dpsutton 2020-10-22T16:42:10.273300Z

and in general, never put stuff in lein/profiles. Use a profile in the project or let CIDER manage it for you

Steiner 2020-10-22T16:59:42.274200Z

one more question ![image](https://docs.cider.mx/cider/_images/cider_debugger.gif) how can I do like this?? I copy it in my emacs, but find it not stop

Steiner 2020-10-22T17:04:01.274700Z

and this is Startup message

;; Connected to nREPL server - <nrepl://localhost:39981>
;; CIDER 1.0.0-snapshot, nREPL 0.8.2
;; Clojure 1.8.0, Java 11.0.8
;;     Docs: (doc function-name)
;;           (find-doc part-of-name)
;;   Source: (source function-name)
;;  Javadoc: (javadoc java-object-or-class)
;;     Exit: &lt;C-c C-q&gt;
;;  Results: Stored in vars *1, *2, *3, an exception in *e;
;; ======================================================================
;; If you're new to CIDER it is highly recommended to go through its
;; user manual first. Type &lt;M-x cider-view-manual&gt; to view it.
;; In case you're seeing any warnings you should consult the manual's
;; "Troubleshooting" section.