Fork me on GitHub

What could be the problem when Calva does not show any exceptions? I can eval statements and the results are shown in repl window, but if the evaluation causes an exception, nothing is shown anywhere?


For example, I can evaluate (ex-info "Oh no" {}) and the repl windows pretty prints it just fine, and the evaluation result is printed next to the form


But if I evaluate (throw (ex-info "Oh no" {})) absolutely nothing happens.


It is still evaluated, it’s just that the exception goes … somewhere


(try (throw (ex-info "Oh no" {})) (catch Throwable e (println e))) evaluates to nil and repl shows the exception

Tomas Brejla13:11:59

@U0GE2JPNC you might want to open developer console in VSCode (`Help/Toggle Developer Tools` ). Maybe you'll find some exception in there.


What kind of project is this? How do you start it?


I start the clojure process with nREPL first, then Connect to Running REPL…


But this happens also when I tried with babashka and Start a REPL project and Jack-in


Hmmm…. tried with fresh project and Start REPL and exceptions are shown normally


So there must be something in my projects that causes this. What could it be?


@U01LFP3LA6P I get this kind of messages, but they seem to come all the time, not when eval causes an exception

Tomas Brejla14:11:42

are you using anything debugging-related in calva?


There are no interesting message at the terminal where you started the REPL?


No, I don’t thinks so:

This is the Calva evaluation results output window.
; TIPS: The keyboard shortcut `ctrl+alt+c o` shows and focuses this window
;   when connected to a REPL session.
; Please see  for more info.
; Happy coding! ♥️

; Connecting ...
; Hooking up nREPL sessions...
; Connected session: clj
; TIPS: 
;   - You can edit the contents here. Use it as a REPL if you like.
;   - `alt+enter` evaluates the current top level form.
;   - `ctrl+enter` evaluates the current form.
;   - `alt+up` and `alt+down` traverse up and down the REPL command history
;      when the cursor is after the last contents at the prompt
;   - Clojure lines in stack traces are peekable and clickable.

; Evaluating 'afterCLJReplJackInCode'
(require 'user)


Oh, I meant the shell where you started the repl.


@U0GE2JPNC It looks like the repl you’re connected to does not include cider-nrepl middeware (judging by that debugger message in the dev console). I’m not sure if that’s causing your issue with exceptions though, but it’s worth looking into.

John Born04:12:27

I think I had this happen to me a few days ago. IIRC, I fixed it for myself by starting the repl through the jack-in command (rather than connecting to it and starting in a separate terminal shell).


@U9A1RLFNV Ok, that narrows it down, thank you. It has worked for me, but I guess I have changed classpath so that cider-nrepl is now missing. I’ll look into this.


@U021JR5PY3B That would be the best way, I’m sure. Unfortunately that’s not an easy to achieve for me, I have a setup where everything, including my service with nrepl, is started by docker-compose.


You can copy the command for jack-in by using the Calva command (search the command palette for “copy jack-in”) and paste it somewhere to see what Calva injects. You can either start your project repl in a similar way (with docker-compose, I guess), or you can modify your project file / configuration to include the dependencies.




I did that “copy jack-in to clipboard” thing (which by the way is just amazing think), but I now remember that at some point I read from nREPL docs that the --middleware argument is not required anymore


…and I remved it


everything seemed to work just fine, until much later I noticed this exception thing


I added the "--middleware" "[cider.nrepl/cider-middleware]" back to my deps.edn and now it works again

Tomas Brejla17:11:12

Hello. I know it's possible to navigate to source code of some library that I have in my :deps of my project by either ctrl-clicking the namespace symbol or using Go to Definition (`F12`) command on it. But in order to do that, I need to have the name of such namespace somewhere in my editor. Is it possible to open source of any 3rd party library's namespace without having to type the ns to my editor? Or perhaps see all the .clj/cljc/cljs files that my project transitively use?


I’m not sure if there’s a way, but Calva does not provide a way that I know of. Maybe there could be something with lein/clj that helps with this, but I don’t know that you would be able to easily read the results or navigate to the files.

Tomas Brejla09:12:14

the definition probably gets opened via clojure-lsp, right? So generic "open namespace by name" or "list namespaces" features would probably need to be implemented in there first.. (?)


When a repl is connected, definitions are opened via Calva (maybe with nrepl/cider-nrepl help). When the repl is not connected, definitions are opened via clojure-lsp.


There’s a feature request here for being able to navigate to namespaces by name: It’s somewhat related, but not really what you originally requested.

Tomas Brejla19:12:09

actually that seems like a very nice feature to have and is pretty much what I originally had in mind. Something like "open namespace/symbol" with modal window offering fuzzy search functionality and then opening the source the same way as F12 does.

👍 1