This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-09
Channels
- # aleph (1)
- # announcements (7)
- # asami (1)
- # beginners (44)
- # calva (54)
- # cherry (24)
- # cider (6)
- # clj-kondo (19)
- # cljsrn (27)
- # clojure (119)
- # clojure-europe (61)
- # clojure-gamedev (38)
- # clojure-germany (7)
- # clojure-nl (1)
- # clojure-norway (104)
- # clojure-portugal (4)
- # clojure-spec (4)
- # clojure-uk (1)
- # clojurescript (38)
- # cursive (18)
- # datomic (11)
- # emacs (9)
- # events (1)
- # fulcro (4)
- # holy-lambda (7)
- # introduce-yourself (7)
- # jobs (1)
- # malli (6)
- # off-topic (4)
- # pathom (4)
- # pedestal (16)
- # podcasts-discuss (1)
- # polylith (27)
- # portal (17)
- # releases (2)
- # shadow-cljs (46)
- # squint (1)
- # xtdb (9)
How do I "jump to definition" for a clojure function defined in another library/jar? For eg, when I press F12
(windows vscode) on the function reitit.swagger/create-swagger-handler
, I expect to jump to its definition. Right now I get a message, "no definition found".
my repl is connected, and the file is evaluated in the repl
does this functionality depend on the presence of certain nrepl middlewares? this repl is started by the application code, I haven't seen which middlewares it loads.
Calva should complain when it connects the repl, if the middleware (cider-nrepl) is missing. Is the app running in a container?
The app is running inside WSL2. I started vscode from inside WSL2.
The nrepl server is started using
(nrepl/start-server :port port :bind bind)
Connecting to the repl print this,
; Connecting ...
; No nrepl port file found.
; 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'
> Definitions work for symbols in your own code base? You are right. Even this doesn't work.
Yeah. Ctrl + Alt + C, Enter
Evaluation succeeded, the namespace changed to this in the repl. I can call the functions in this ns from the repl.
When I press F12
on a function in my own codebase, I see the dev console print the error message "ERR The server does not recognize or cannot perform the 'info' operation".
Welcome to Calva. Happy Clojure and ClojureScript coding! ??
Please check these resources out:
Calva Documentation:
#calva at the Clojurians Slack:
Bug reports:
If you like Calva, please consider how you can contribute:
Calva is utilizing cider-nrepl and clojure-lsp to create this VS Code experience.
nREPL dependencies configured:
nrepl: 1.0.0
cider-nrepl: 0.28.5
cider/piggieback: 0.5.3
clojure-lsp version configured: latest
If you are new to Calva, please consider starting with the command:
**Calva: Fire up the Getting Started REPL**
(See `showCalvaSaysOnStart` in Settings to control the auto-showing of this message panel.)
clojure-lsp version used: 2022.11.03-00.14.57
clj-kondo version used: 2022.11.02
Not sure where is the calva version shown ...Yeah, its an nrepl issue. I connected a new repl, started by Calva + Leiningen, once that is connected, everything works. If I use the nrepl started by the app, then F12 doesn't work
Yes, the repl probably lacks the cider-nrepl
middleware. But Calva should fall back on clojure-lsp in this case. And it should inform you about the missing middleware when connecting the REPL. So I am hoping you are on an old Calva.
Using [cider/cider-nrepl "0.26.0"]
. any tips on what all I need to change to this line, to enable proper Calva+Cider support? (nrepl.server/start-server :port 7000)
I am on Calva version v2.0.318
See here for starting nrepl with the cider middleware: https://docs.cider.mx/cider-nrepl/usage.html#via-embedding-nrepl-in-your-application
The extension panel showed a message "Reload required". I clicked that. Also restarted VS code for good measure. This time when I connect to the built-in application repl, I was shown an error message notification, that asked me to visit the url "https://calva.io/connect/".
is this what you expected to happen?
You see in that ^ Calva says output, which versions of nrepl and cider-nrepl Calva prefers. You can also use the command Calva: Copy Jack-in command to clipboard, to see the command line Calva would use to start the repl.
Before you fix the repl middleware, can you confirm that the definitions work with the latest Calva?
This is awesome. Yeah, I connected to the applications repl. Got the error notification. Despite that F12 works for my code and library code.
Thank you for the prompt response, I feel silly for not checking the extensions panel sooner 🙂 Calva is awesome! Thank you team for your hard work!!
We should print the version and advice to update in Calva says and/or the output/repl window.
> Please consider filing a review on the marketplace. Done!
Created these: • https://github.com/BetterThanTomorrow/calva/issues/1954 • https://github.com/BetterThanTomorrow/calva/issues/1955 Low hanging fruit. good-first-issue 😃
Have I mentioned that I have set VS Code’s hover delay to 1300 ms, and that it is blissful? What settings do you recommend? Please share! 🧵
Created these: • https://github.com/BetterThanTomorrow/calva/issues/1954 • https://github.com/BetterThanTomorrow/calva/issues/1955 Low hanging fruit. good-first-issue 😃
Dear Calva friends, I've noticed lately that Calva's default on-type-indenter is in conflict with the formatter in certain situations. I haven't been able to pinpoint what it is about before, but today I realized it is happening when I work with garden, and also a bit about why it happens. Garden has a few def<something-something>
macros, and when using them, the on-type-indenter indents like so:
(garden.def/defstyles styles
|)
While the correct indent position (given default cljfmt config) should be:
(garden.def/defstyles styles
|)
And, indeed if you hit tab
in this situation:
(garden.def/defstyles styles
|
[:.foo])
You'll get:
(garden.def/defstyles styles
|
[:.foo])
This is because cljfmt default config has this rule:
#"^def(?!ault)(?!late)(?!er)" [[:inner 0]]
Which our on-type-indenter applies on the full symbol and it doesn't match garden.def/defstyles
, of course. I know how to fix this particular family of cases, but I realize I'd like to know a bit more about this to get a proper fix in place. So, this is a call for help collecting instances where the indenter indents differently from the formatter. Please experiment with it a bit and report any findings here:
• https://github.com/BetterThanTomorrow/calva/issues/1956
This is especially interesting if you have some custom indentation rules defined. If so, please include the rules of relevance with the report.
Thanks in advance! 🙏 ❤️Much gratitude for Calva in general but especially the Ctrl+Alt+Enter
shortcut for eval'ing the form under the cursor. It's like a superpower!

No, I'm just using the wrong terminology 😅 I mean the "Evaluate from start of list to cursor, closing brackets" binding
Which appears to be the standard
We recently added a command for evaluating the selection, closing the opened brackets. Have you found that one?
No, which one is that?
Ctrl+Enter right? I also enabled "eval on save" which helps too. Calva is great. Unfortunately Calva can't download clojure-lsp due to corporate firewall. Wish it were bundled with calva like clj-kondo.
You know you can give Calva the path to your clojure-lsp binary and it will use that, @UC1DTFY1G?
@U0ETXRFEW I am aware. The trouble is my corporate firewall doesn't let me download nearly anything. So I really can't get the clojure-lsp zip file for windows. I can't even clone from github. It's messed up. I didn't mean anything against Calva. I was just venting 😄
http://calva.io is not Calva-colored for some reason. I wonder what's up with that...