This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-30
Channels
- # adventofcode (95)
- # announcements (17)
- # babashka (28)
- # beginners (107)
- # calva (34)
- # clj-kondo (7)
- # cljs-dev (20)
- # cljsrn (1)
- # clojure (95)
- # clojure-europe (41)
- # clojure-italy (3)
- # clojure-nl (5)
- # clojure-spec (7)
- # clojure-uk (4)
- # clojurescript (77)
- # cursive (7)
- # data-science (1)
- # datalog (4)
- # datomic (12)
- # events (3)
- # fulcro (32)
- # graalvm (2)
- # hugsql (19)
- # introduce-yourself (4)
- # jobs (2)
- # lsp (20)
- # membrane-term (19)
- # numerical-computing (1)
- # off-topic (8)
- # pathom (3)
- # polylith (17)
- # portal (42)
- # re-frame (7)
- # reagent (32)
- # remote-jobs (1)
- # shadow-cljs (86)
- # spacemacs (3)
- # tools-deps (52)
- # uncomplicate (1)
- # xtdb (23)
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
(try (throw (ex-info "Oh no" {})) (catch Throwable e (println e)))
evaluates to nil
and repl shows the exception
@U0GE2JPNC you might want to open developer console in VSCode (`Help/Toggle Developer Tools` ). Maybe you'll find some exception in there.
@U01LFP3LA6P I get this kind of messages, but they seem to come all the time, not when eval causes an exception
are you using anything debugging-related in calva?
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)
nil
clj꞉user꞉>
@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.
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
I added the "--middleware" "[cider.nrepl/cider-middleware]"
back to my deps.edn and now it works again
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.
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: https://github.com/BetterThanTomorrow/calva/issues/545. It’s somewhat related, but not really what you originally requested.
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.