Fork me on GitHub

I suddenly lost my beloved NeoVim Escape functionality. The troubleshoot log says:

From 55 keybinding entries, matched calva.clearInlineResults, when: calva:keybindingsEnabled && editorTextFocus && !editorHasMultipleSelections && !editorHasSelection && !editorReadOnly && !hasOtherSuggestions && !parameterHintsVisible && !selectionAnchorSet && !suggestWidgetVisible && editorLangId == 'clojure', source: user extension betterthantomorrow.calva.
-- I can of course change the keybinding, but I was wondering if calva could add a condition here, so that the keybinding is active only if there's actual inline results in the buffer?


I thought we did that. We should, I agree. Issue?


I'll file something. I can't see anything in the when condition that is calva specific though.


We might not have this context. But it should be straight forward to create it and then add it to this binding.

Cora (she/her)11:05:59

there's the remap if you want it


That's not what we want though. 😃 We just want escape to keep doing its normal job in the absence of inline results.

Cora (she/her)11:05:35

for sure! it would be nice have that but in absence of that solution this is the crutch y'all mentioned

Cora (she/her)11:05:04

err, orestis mentioned


Hi! 👋:skin-tone-2: I'd like to try out a potential improvement in Calva, so am trying to follow the "How to Hack on Calva" instructions to get going. I'm coming unstuck on this step, as I'm unsure what I should be doing: > Back in the Calva window, connect the REPL, choosing the calva project root and then the Calva project type, accepting the host and port to connect to. Which window is this instruction referring to? I'm guessing its the VS Code window where I opened the Calva folder, but this isn't clear. Also, how exactly should I "connect the REPL"? I tried jack-in but got this error message:

npx shadow-cljs -d cider/cider-nrepl:0.27.4 watch :calva-lib :test
shadow-cljs - config: /home/steffan/projects/calva/shadow-cljs.edn
shadow-cljs - connected to server
shadow-cljs - watching build :calva-lib
already started
{:build-id :calva-lib}
ExceptionInfo: already started
        shadow.cljs.devtools.server.supervisor/start-worker (supervisor.clj:27)
        shadow.cljs.devtools.server.supervisor/start-worker (supervisor.clj:19)
        shadow.cljs.devtools.api/start-worker (api.clj:117)
        shadow.cljs.devtools.api/start-worker (api.clj:113)
        shadow.cljs.devtools.api/watch* (api.clj:187)
        shadow.cljs.devtools.api/watch* (api.clj:173)
        shadow.cljs.devtools.server/watch-builds (server.clj:577)
        shadow.cljs.devtools.server/watch-builds (server.clj:560)
        shadow.cljs.devtools.server/from-cli (server.clj:633)
        shadow.cljs.devtools.server/from-cli (server.clj:597)
        clojure.lang.Var.applyTo (
        clojure.core/apply (core.clj:667)
        clojure.core/apply (core.clj:662)
        shadow.cljs.devtools.cli-actual/lazy-invoke (cli_actual.clj:23)
        shadow.cljs.devtools.cli-actual/lazy-invoke (cli_actual.clj:20)
        shadow.cljs.devtools.cli-actual/blocking-action (cli_actual.clj:129)
        shadow.cljs.devtools.cli-actual/blocking-action (cli_actual.clj:116)
        shadow.cljs.devtools.cli-actual/main (cli_actual.clj:177)
        shadow.cljs.devtools.cli-actual/main (cli_actual.clj:132)
        clojure.core/apply (core.clj:671)
        clojure.core/apply (core.clj:662)
        shadow.cljs.devtools.cli-actual/from-remote (cli_actual.clj:210)
        shadow.cljs.devtools.cli-actual/from-remote (cli_actual.clj:201)
        clojure.lang.Var.invoke (
        shadow.cljs.devtools.cli/from-remote (cli.clj:79)
        shadow.cljs.devtools.cli/from-remote (cli.clj:77)
        shadow.user/eval36783 (NO_SOURCE_FILE:1)
        shadow.user/eval36783 (NO_SOURCE_FILE:1)
        clojure.lang.Compiler.eval (
        clojure.lang.Compiler.eval (
        clojure.lang.Compiler.eval (
        clojure.core/eval (core.clj:3202)
        clojure.core/eval (core.clj:3198)
        shadow.cljs.devtools.server.socket-repl/repl/fn--15863 (socket_repl.clj:61)
        clojure.main/repl/read-eval-print--9110/fn--9113 (main.clj:437)
        clojure.main/repl/read-eval-print--9110 (main.clj:437)
        clojure.main/repl/fn--9119 (main.clj:458)
        clojure.main/repl (main.clj:458)
        clojure.main/repl (main.clj:368)
        shadow.cljs.devtools.server.socket-repl/repl (socket_repl.clj:28)
        shadow.cljs.devtools.server.socket-repl/repl (socket_repl.clj:26)
        shadow.cljs.devtools.server.socket-repl/connection-loop (socket_repl.clj:102)
        shadow.cljs.devtools.server.socket-repl/connection-loop (socket_repl.clj:72)
        shadow.cljs.devtools.server.socket-repl/start/fn--15878/fn--15879/fn--15881 (socket_repl.clj:142) (

Jack-in process exited. Status: 1


> I'm guessing its the VS Code window where I opened the Calva folder, but this isn't clear This is the correct guess. 😃 Please update the wiki page with what something clearer. Maybe we should somehow establish that we will have two windows when we work, the one with the Calva project, and the Development Extension Host, where you open whatever folder you want (except the Calva project). This tripped @U07M2C8TT up as well, so a better description would be great!


> Also, how exactly should I "connect the REPL"? This refers to the command Calva: Connect to a running REPL in your project. Maybe you can update the wiki page clearing this up too?


And, where are my manners! I should have started with: Hi! @U2C6SPLDS! Welcome. It makes me happy you are trying to hack on Calva,


Hello @pez 👋:skin-tone-2: I've now managed to complete that part of the instructions, thank you! Now lets see if my anticipated Calva code change works - It's a trivial change to ensure the editor gets focus...


I'll take a look at tweaking the instruction text too

🙏 1

Hmm, I'm not having much luck today. Any attempts to use Jack-in in the window running the extension results in an error, as if no Clojure runtime can be found:


Oh, wow, never seen that one.


I would try to kill all watchers and run the build task again. Maybe something was out of sync...


I've found the issue : I had an zprint extension that was upsetting things due to a missing source map. The extension works normally, but in debug mode it throws all the toys out of the pram 🤷:skin-tone-2:


My little Calva change works! It's a simple change to ensure the editor gets focus when switching between main and test namespaces in Calva. @pez Do I need to create an issue first before creating the PR? It's a very simple fix


Yes, yes. The changelog links to the issues that are fixed in a release. So create the issue. Use a closing commit message. Update the changelog.


Hello @pez & @brandon.ringe 👋:skin-tone-2: I have submitted a simple PR for your perusal. It fixes a small issue with setting editor focus when switching between implementation and test namespaces. Hopefully I've followed all the PR instructions correctly, it's my first Calva contribution.

🙏 1
❤️ 4
👀 3

Merged it! It's lovely with tiny PRs like this, which fix much bigger problems. Leverage!