Fork me on GitHub
#calva
<
2022-05-03
>
orestis06:05:26

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?

pez07:05:59

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

orestis07:05:44

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

pez07:05:43

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

pez11:05:38

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

steffan14:05:17

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 (Var.java:705)
        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 (Var.java:393)
        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 (Compiler.java:7181)
        clojure.lang.Compiler.eval (Compiler.java:7171)
        clojure.lang.Compiler.eval (Compiler.java:7136)
        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)
        java.lang.Thread.run (Thread.java:833)

Jack-in process exited. Status: 1

pez14:05:52

> 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!

pez14:05:30

> 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?

pez14:05:11

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

steffan14:05:44

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 https://github.com/BetterThanTomorrow/calva/blob/c78ea3d51c5d52b6d34c7b66952223192533bb2b/src/file-switcher/file-switcher.ts#L10 to ensure the editor gets focus...

steffan14:05:01

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

🙏 1
1
steffan14:05:16

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:

pez14:05:32

Oh, wow, never seen that one.

pez15:05:59

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

steffan15:05:17

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:

steffan15:05:53

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

pez15:05:37

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.

1
steffan19:05:13

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. https://github.com/BetterThanTomorrow/calva/pull/1708

🙏 1
❤️ 4
👀 3
1
pez20:05:00

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

1