Fork me on GitHub
#calva
<
2020-07-03
>
Jakub Holý (HolyJak)16:07:13

Hello! I have a Ring handler like this:

(defn handler [req]
  (println "REQ=" req)
  {:status 200 :body "OK"})
I know it runs and it is this version that runs but I do not see the println output anywhere, neither in the Output window nor in the CLJ REPL window. Where can I see it then? Thanks! Update: Oh, I see! I started the nREPL externally and connected to it and this println ends up in the terminal where I started it. I guess there is no way to get its output visible inside VS Code?

pez16:07:47

If you start it from a VS Code terminal you should get the output there.

Jakub Holý (HolyJak)16:07:59

Thank you! The thing is that I wanted to run the whole dev setup inside a Docker container (for ease of use during a workshop) so that is not really an option I am afraid. But not having these outputs visible in VS Code is bad as well so I have to look for other options here... 😢

Jakub Holý (HolyJak)16:07:06

I am used to Ctrl+k - kill, similar to VS Code's kill to end of list, I guess - not only deletes but also puts the text into the clipboard so that I can paste it elsewhere. Is this supported somehow?

pez16:07:03

Maybe you can run the container from a VS Code terminal, and somehow route the REPL output out of the container? (I'm no Docker expert so have no idea if it is even feasible).

3
pez16:07:54

Regarding ctrl+k.... See if there is a kill-ring extension that does something like that. It wouldn't be structural, of course. Maybe you can map ctrl+k to the Calva command for selecting to the end of the containing form. Then killing to the end of a form and copy it to the clipboard with be a chord like ctrl+k ctrl+x...

Jakub Holý (HolyJak)16:07:01

Thank you, I will have a look! I am quite used to it from both Emacs and Cursive but I guess many people live without it so there are certainly other ways to achieve the same goal...

pez16:07:21

I think there might be extensions that let you string together commands. If so you would be able to get something more close to the real ctrl+k by stringing together the Calva select to end of list command with the vscode cut command.

👍 3
Jakub Holý (HolyJak)17:07:15

Another question, is there a way to show the docstring of a function other than (doc ..) in the REPL, e.g. on F1? Solved: Mouse over does it 🙂 Nice!

pez18:07:00

In the editor there is a keyboard shortcut for it too.

👍 3