Fork me on GitHub
#calva
<
2022-03-24
>
pez09:03:28

Dear Calva friend: Please consider what @brandon.ringe has done and is doing for Calva and ask yourself the question if you or your company should be sponsoring his amazing and generous contribution: https://www.linkedin.com/feed/update/urn:li:activity:6912678946102763521/ https://twitter.com/pappapez/status/1506657940702380032

3
❤️ 1
Eugen08:03:10

thank you @U0ETXRFEW for encouraging people to sponsor. I decide to sponsor you both monthly for a small ammount for as long as I can.

🙏 1
❤️ 1
pez09:03:16

That's awesome @U011NGC5FFY!

🎉 1
bringe15:03:55

Thanks @U011NGC5FFY and thanks @U0ETXRFEW for the shoutouts!

Stefan12:03:04

I think 257 has broken connecting over live share to a remote repl? When I try to, I get a list of roots, I choose ‘/’, then I get type, I choose ‘generic’, and then nothing… Can anyone confirm or does this work for you?

pez13:03:02

I did change stuff around this. And I have to admit I didn't try Live Share. But you do get the correct menu?

pez13:03:15

Is it working in 256?

Stefan14:03:17

The paths are correct, but different from local. Locally, the paths are absolute paths from the root of my file system. Over live share the paths are absolute from the root of the workspace. For example, locally I might have /Users/my/my-project and when connecting over live share that would show up as /. I can try with 256 later. It worked yesterday, but that may have been an even older version, not sure.

pez14:03:53

It was probably 256. I'll take a closer look at your commits for this and see if I can figure out what I didn't figure out this time. 😃

Stefan15:03:40

Thanks Peter! I like the 257 change by the way, as a poly user! 🙏

pez15:03:26

Poly-feelings about 257, then? 😃

pez15:03:12

Can you file an issue describing this, btw? I'm not using LiveShare often enough to be very reliable in judging when it works or not. 😃 The thing with different path roots is extra interesting.

Caleb Figgers14:03:31

With 256, if I try to jack in in a completely empty directory, Calva creates and opens an output.calva-repl file and then offers Babashka and nbb as connection options. With 257, in a completely empty directory the jack-in command creates .clj-kondo and .lsp folders, but does not offer any options to connect with.

🙏 1
pez15:03:15

Thanks! Here's a related issue https://github.com/BetterThanTomorrow/calva/issues/1613 can you add this repro there, pleaase?

Caleb Figgers15:03:28

Done. Hope it helps!

pez15:03:09

Wonderful repro. Thanks!

avi19:03:31

👋 I’m a relative n00bish user of Calva, and I’ve just installed it and I’m trying to use it with a ClojureScript project for the first time… and rainbow brackets aren’t showing up. Well, not consistently. I think I’ve spotted them here or there, but most of them time, no. I’m not sure if there’s a pattern. Has this been reported before? Any tips for debugging this?

pez06:03:17

Hi there! There's an open issue that indicate we have a bug causing rainbows to glitch. https://github.com/BetterThanTomorrow/calva/issues/1616 I'm not sure it is the same as you are seeing, but mentioning it so that you know of a place where you can add clues helping us locate the bug. We've been changing some rather fundamental stuff in the code base that could have caused this. The rainbow code is a bit of a beast.

1
pez06:03:41

As for > I think I’ve spotted them here or there Is that within the same session, or do some sessions have rainbows and others not?

orestis09:03:52

I just want to raise that VSCode now has native rainbow brackets and probably the Calva feature can be removed.

pez09:03:04

The Calva rainbows are going nowhere. 😃

pez09:03:35

Calva's rainbow brackets are Clojure aware and also work nicely together with Calva's rainbow indent guides.

pez09:03:53

Also, for clarity, the issue linked (and maybe also @U69US348Z’s report) is probably rather a symptom of the Highlight feature having some troubles. So it is not only about rainbows.

orestis10:03:21

VSCode also has rainbow indent guides :)

orestis10:03:02

@U0ETXRFEWz can you share some sample code with what you mean “Clojure aware”? I'm curious what I'm missing

pez10:03:28

The VS Code rainbow indent guides can't be configured to only highlight the Clojure current form. At least they couldn't last time I tried.

pez10:03:34

Re examples for ”Clojure aware”: Here's some test code we have in the Calva repo:

(a(b
   #?@(c
       #f
        (#b
          [:f :b :z])
       #z
        1)))
(comment
  1
  #foo
   #bar
    #baz
     #{:foo (#foo '[1
                    2
                    3])})

(comment
  
  #foo :bar
  (foo #foo ('foo^' :bar))
  #_ 'abc 
  #foo  @~#(foo 
             :bar) \space
  \' {:foo (#foo '[1 2 3])} 'abc
  #_#_
  #foo
   #bar
    #baz
     #{:foo (#foo '[1 2 3])}
  #foo
   'bar
  \a [] "a"

  )

"#########" ; 
The top forms renders like in the attached pic. Note the cursor. How the indent-guide only highlights the currently enclosing form. And how the reader tags are colored with the brackets they belong to. And (not rainbow related, but similar and consistent Clojure awareness) how the matching (current) brackets are highlighted even though the cursor is outside them, because reader tags.

avi13:03:00

Thank you! If I notice any patterns I will post to that issue. > Is that within the same session, or do some sessions have rainbows and others not? I’m not sure, I will try to keep an eye out and report back.

pez14:03:41

I think I fixed the issue some days ago: https://github.com/BetterThanTomorrow/calva/issues/1616

👏 1
avi22:03:36

Great news! Thank you! I’ll report back if I see the issue again.

🙏 1
orestis14:04:42

@U0ETXRFEW BTW I finally got around to taking a screenshot of the built-in VSCode rainbow brackets + indent guides. This is what it looks like with Calva disabled entirely.

orestis14:04:20

And here with calva enabled

Marc O'Morain21:03:45

My REPL problem is fixed ❤️ ❤️ ❤️ ❤️ ❤️ ❤️

findmarc@cci-marc-1hv2q ~/code/circleci/circle $ find . -name project.clj
./project.clj
./src/circle/project.clj
./src/circle/http/builds/blocking/project.clj
./src/circle/http/api/v1/v1_0/project.clj
./src/circle/http/api/v1/v1_1/project.clj
./src/circle/http/api/v1/shared/project.clj
./src/circle/http/api/v2/insights/project.clj
./src/circle/http/api/v2/project.clj
./src/circle/http/api/v2/entities/insights/project.clj
./src/circle/http/api/v2/entities/project.clj
./src/circle/http/api/private/project.clj
./src/circle/model/project.clj
./src/circle/model/api/project.clj
We have a lot of project.clj files, but only one is a leiningen project, the others are source code. Starting a REPL used to be tricky since it would fail if you had a file in src open.

🎉 1
metal 1
❤️ 1
pez06:03:38

I was thinking about this use case of yours, @U0K592YDP, when I implemented the change. I think it should be fairly in reach to filter away the non-project files from that menu.

Marc O'Morain10:03:35

I don’t need any more filtering really – you’ve made the issue 95% better, and that final 5% doesn’t bother me at all.

pez10:03:32

It can trip new users up, though. But super good to know that it works well for you as it does. We'll see if we get any support issues from not filtering the list more carefully.

Mark23:03:37

As a fairly new clojure user, how do I reload the calva repl after I add a package to project.clj and run lein deps?

Mark23:03:27

i.e. right now I just have to restart vscode after I run lein deps

phill23:03:00

Does "f1 developer:reload window" help?

Mark23:03:08

Sort of. It's faster than completely restarting vscode. But I still have to start the repl again. From within lein repl I used to be able to do something like (use 'my-namespace.core :reload-all) and that would usually work.

Caleb Figgers01:03:54

You can just run the Jack-in command again even if you're already Jacked in. It'll close your current nREPL and fire up a new one with the dependency included. (Also, it automatically runs the equivalent of lein deps so you don't have to do that as a separate step.)

☝️ 1
pez05:03:50

@U0383EA0A23 are you using Pomegranate in your project? I think that is the goto-tool for hot loading dependencies. The workflow depends on the use-case, but mostly it is to first use Pomegranate at the REPL to add and load libraries and see how things work. Then edit project.clj.

pez05:03:20

For cases when (use 'my-namespace.core :reload-all) works from the lein repl prompt, that will work from Calva's REPL as well, wether you do it from a rich comment or from the prompt.

Mark12:03:16

@U034SN1AFM5 ah I didn't realize that! I assumed it would start multiple repls. Perfect, thank you @U0ETXRFEW I haven't used Pomegranate but I'll check it out, thanks

pez12:03:31

@U0383EA0A23 just checking, what are the reasons you are going with #leiningen instead of #tools-deps?

Mark12:03:43

@U0ETXRFEW I'm very inexperienced and it's just what I happened to stumble across first

Caleb Figgers12:03:40

@U0ETXRFEW what are the reasons someone might go with #tools-deps instead of #leiningen?

pez13:03:06

tools-deps configures your project with data instead of code. 😃 I'm only half joking, it is more in the spirit of Clojure in other ways as well. Like only focusing on the dependency part of the project. Leiningen is awesome, but crams a lot of stuff into the same tool.

pez13:03:27

I'm not super opinionated, but I do recommend tools-deps over Leiningen even for a beginner. As a beginner what speaks for Leiningen is that it is so easy to create projects from templates. As a beginner what speaks for tools-deps is that that is the direction the Clojure community is moving.

1
👍 2
pez13:03:09

We probably should take on the task of adding tools-deps versions of many of the more used/useful templates. Maybe there is more to making it as easy to create projects from templates with tools-deps as it is with Leiningen, I don't know... WDYS, @U04V70XH6?

seancorfield16:03:11

@U0ETXRFEW That's probably a question for #deps-new since it needs more discussion around context (and isn't Calva-specific). I'm also not entirely sure what questions you're really asking here...

pez17:03:21

My question is more of general orientation. I like the convenience Leiningen has around this and would like to participate to bring the same convenience for people using tools-deps etcetera. clj-new makes it pretty easy to create projects from Leiningen templates, but those are often (always?) Leiningen projects. So I can see myself making tools-deps versions of some project templates. But beyond that I am quite unfamiliar with what's involved.

seancorfield17:03:21

There are some deps.edn-based templates out there but there are no automated project.clj->`deps.edn` converters for the general case. Simple project.clj files can be automatically converted but for lein jar / lein uberjar etc you'd also need to add build.clj (or use my build-clj as a library). Once you get beyond the default lein commands, things get more complicated. Profiles sort of map to aliases (but not quite, due to lein's default profile usage -- which varies by command: repl, test, uberjar all use a different set of profiles, as I recall). Then there's ClojureScript build stuff in projects which I have no idea about.

seancorfield17:03:09

And then of course there's the documentation issue: if a template's README is full of lein commands, adding deps.edn isn't going to help a lot of users since they won't know how to run the equivalent clojure CLI commands.

pez17:03:55

Thanks! I've converted some Luminus projects after the fact lately. I might start with that template. 😃

seancorfield18:03:49

I think the best approach is a template-by-template one, sending PRs to the maintainer to adopt deps.edn -- alongside project.clj for the most part, rather than trying to supplant it.

👍 1
pez06:03:17

Hi there! There's an open issue that indicate we have a bug causing rainbows to glitch. https://github.com/BetterThanTomorrow/calva/issues/1616 I'm not sure it is the same as you are seeing, but mentioning it so that you know of a place where you can add clues helping us locate the bug. We've been changing some rather fundamental stuff in the code base that could have caused this. The rainbow code is a bit of a beast.

1