Fork me on GitHub
#calva
<
2020-03-27
>
mkarp13:03:22

Hey! What are the steps I need to do in order to use zprint formatter in Calva?

pez13:03:13

For pretty printing, you mean?

pez13:03:25

Here are the docs about that anyway 😃 https://calva.readthedocs.io/en/dev/pprint.html

mkarp13:03:12

@pez Yes, exactly 🙂 I saw this comment mentioning “Will need to be configured before https://calva.readthedocs.io/en/dev/connect.md if you want Calva’s help to inject its dependencies”, and that’s why I asked I’ve added zprint to the dependencies and can use it in the REPL. But "printEngine": "zprint" doesn’t seem to work when I eval things in Calva — the output is printed without any formatting. If I set "printEngine": "calva" , then the eval is nicely formatted. Any ideas?

pez13:03:21

Could be a bug. But iircc Calva uses zprint. Could be remembering that wrongly though, I treshed back and forth a bit implementing that.

mkarp13:03:21

Cool, thanks. It’s not a pressing issue “printEngine”: “calva” works well 👍

pez14:03:49

I'll have a look. It's on my todo to check out an update to zprint anyway (which could be why it doesn't work, coming to think about it).

Darrell16:03:46

Hey @pez. I’ve been having success with cmd+k cmd+i for one window but I opened a new window for a new project and now it doesn’t do anything. Is there some place I can look to see why?

pez16:03:21

Are you sucessfully jacked in in that new window?

pez16:03:43

^edited ^

Darrell16:03:40

As best I can tell, yes. Hovering over the “nREPL” icon in the status bar shows “<nrepl://localhost:8777> (Click to reset connection)”

hindol16:03:56

In the new window, can you click on something other than the editor, and then refocus the editor?

Darrell17:03:10

That didn’t help, unfortunately. I even tried restarting Visual Studio and then re-connecting to my nrepl.

hindol17:03:03

You have both window connected at the same time? And to the same REPL?

Darrell17:03:22

Actually, I disconnected the other project window and closed that, thinking that could be the problem but that didn’t change anything.

pez17:03:46

I often have several windows opened and connected to different REPL servers, so that shouldn't be the problem.

pez17:03:52

But I am also curious about if it is the same REPL server or a different one. Also, how are you connecting the REPL?

Darrell17:03:05

Clicking the “nREPL” icon in the status, selecting “Connect to a running REPL in your project”, selecting “Leiningen + shadow-cljs”, selecting “localhost:8777", selecing “:client”. I should note that all of this code is the “todomvc” example in the Re-Frame repo.

pez18:03:44

Try letting Calva start the repl, aka Jack-in.

Darrell19:03:10

Let me try that.

sergey.shvets22:03:46

Hi! Thanks for the awesome tool! Migrating from Cursive and very happy with the experience!

sergey.shvets22:03:10

I want to solve a thing that bothers me a lot, but can't find a way: how do I line-wrap comment strings?

sergey.shvets22:03:03

I only found a way to have line wrap for files, but that wraps code too

pez22:03:32

Not quite following. Can you give an example?

pez22:03:50

Also, thanks and welcome!!

sergey.shvets22:03:49

If I have a docstring for e.g. method:

(defn method-name
  "Very long docstring that doesn't fit one line in a screen"
 [params]
body) 

sergey.shvets22:03:14

I want that string to line-wrap after e.g 80 symbols, so I don't need to do a hard return. If I do newlines myself then it messes up with formatters in e.g. docstrings showing on hover.

sergey.shvets22:03:24

I want to get rid of the line break after "registered" as in screenshot above

pez22:03:16

But you don't want it to wrap other lines of code? I don't think that's possible in vscode.

sergey.shvets22:03:31

Yes, I want that to apply only to docstrings. I think it will make a life of doc generators and sharing code easier.

sergey.shvets22:03:44

Thanks, wanted to make sure I'm not missing something obvious

sergey.shvets22:03:08

How do you usually format docstrings?

pez22:03:21

Personally, I let vscode wrap all lines for me. But there are still cases when I wrap docstrings a bit manually and they get weird in the hovers...

sergey.shvets23:03:30

I'll try that, thanks.

Shriyans23:03:15

is there a way with calva (jack in) that i can still access to repl in vscode terminal ?

pez23:03:41

If you use Leiningen you can do lein repl :connect

Shriyans23:03:47

ahh this works ! thanks