calva

Wednesdays you might find @U0ETXRFEW in the Gather Calva space. Invite is https://gather.town/invite?token=GZqrm7CR and the password is `Be kind`.
levitanong 2021-01-20T04:18:09.173400Z

I imagine the printing is throttled so that it doesn't interfere with the responsiveness of the rest of the app. If this were implemented with core async (it probably isn't 😆 ) simply closing the channel should cancel the rest of the queue.

pez 2021-01-20T07:30:40.173900Z

This is TypeScript and promises. 😃 Would be nice to just close a channel. Maybe we can achieve that somehow…

Eric Uitbeijerse 2021-01-20T08:21:45.177Z

Using 2.0.152 on Windows, seems that the decorations of the debug instrumented function is not shown anymore. The instrumentation still works as expected, just can't visually see that the function is instrumented. Is that by design?

pez 2021-01-20T09:17:40.177400Z

Sounds like a bug. Please file an issue. ❤️

Eric Uitbeijerse 2021-01-20T10:47:56.177900Z

Done (https://github.com/BetterThanTomorrow/calva/issues/969)

🙏 1
zimablue 2021-01-20T13:30:28.179400Z

I understand error "no js runtime" on browser side indicates necessity of having chrome or something open and connected

zimablue 2021-01-20T13:30:35.179700Z

but what is equivalent of that when running node app?

zimablue 2021-01-20T13:33:14.180200Z

solved my own problem with bad timing, you need ot actually require the exported javascript in node for it to work?

zimablue 2021-01-20T13:33:19.180400Z

what strange magic

pez 2021-01-20T13:54:10.182600Z

It’s not all voodoo. 😃 There needs to be a Clojure REPL running and it is started as part of your app/library.

pez 2021-01-20T13:54:51.183100Z

Based on that error message I assume you are using #shadow-cljs?

zimablue 2021-01-20T13:59:49.183400Z

hey, yeah or trying to

zimablue 2021-01-20T14:00:47.184600Z

I am playing in ts but trying to understand something in internals of datascript so tried to get something connected, saw that calva uses shadow-cljs internally (I think) so tried that, but half a day later I realize that from the files in the repo, datascript is set up to use something else (?) but I'm in a REPL now so we all good

zimablue 2021-01-20T14:01:48.185800Z

another question - is there any way to visually debug typescript/clojurescript both? like you're working on your typescript app and somehow can put a breakpoint in a clojurescript dependency

zimablue 2021-01-20T14:02:09.186400Z

as I say it it sounds too complex for anything to work without writing it yourself

pez 2021-01-20T14:15:28.187800Z

The Calva debugger only works with Clojure. But there is some trace debugger out there you can use. I have forgotten where I saw it…

dangercoder 2021-01-20T14:38:24.188400Z

Does anyone else have issues with running tests through "Run tests in current namespace"? When I redefine my tests, calva doesn't understand that they have been updated.

dangercoder 2021-01-21T17:44:50.010700Z

Tests understands the updates when I save the file manually

dangercoder 2021-01-21T17:45:15.010900Z

Thanks for the tip @eric.uitbeijerse

bringe 2021-01-21T18:06:18.011700Z

A save is not supposed to be necessary since the test command reloads the file, and is not necessary for me. An issue would be appreciated.

Eric Uitbeijerse 2021-01-21T19:25:27.015700Z

Just verified the issue also occurs on a clean project and it does. Raised issue #975 as requested.

bringe 2021-01-21T20:15:54.019300Z

Thanks!

dangercoder 2021-01-22T06:01:21.042300Z

Ah, I just created an issue. I will add my information to #975.

dangercoder 2021-01-20T14:39:12.188500Z

I also tried to reload the whole shebangs into the repl. If I run the tests through the repl without Calva, things works fine though 🙂

plexus 2021-01-20T16:02:00.191500Z

is there any way to disable linting?

pez 2021-01-22T10:44:03.057500Z

Thanks! I’ll have a look when my work-for-food day is over. 😃

plexus 2021-01-22T11:57:54.061Z

Thank you ❤️

pez 2021-01-22T12:35:05.063100Z

Used some of my lunch for it instead, actually. 😃

plexus 2021-01-20T16:06:26.192100Z

can I make "Toggle Line Comment" use ;; instead if ;?

plexus 2021-01-20T16:13:00.192400Z

I've managed by changing /usr/share/code/resources/app/extensions/clojure/language-configuration.json. not sure if there's a better way?

plexus 2021-01-20T16:13:46.193Z

It saddens me deeply to see a project I respect deeply promote this incorrect commenting style

clyfe 2021-01-20T17:09:04.193100Z

I'm on v2.0.152 & ctrl+/ comments with ;;.

😻 1
pez 2021-01-20T17:10:28.194200Z

Configure clj-kondo with zero linters, I think it's the way to do it.

pez 2021-01-20T17:13:10.196800Z

You are the second one this week to speak about incorrect commenting styles. We have not yet fully understood the problem though. So please explain and we will of course consider. PR welcome.

ericdallo 2021-01-20T17:19:58.196900Z

Yeah, Emacs uses ;; for commenting just like Calva

ericdallo 2021-01-20T17:20:18.197100Z

Oh Does Calva uses only ; ?

ericdallo 2021-01-20T17:20:54.197300Z

@pez check it out: https://github.com/bbatsov/clojure-style-guide#comments

ericdallo 2021-01-20T17:25:34.197600Z

users are probably referring to comment a whole line which should use ;; instead of ;

plexus 2021-01-20T17:34:40.197800Z

in age-old LISP tradition ; is for end-of-line comments, ;; is for commenting out whole lines/blocks, ;;; , ;;;; , ;;;;; etc are for levels of headings https://stackoverflow.com/questions/6365334/lisp-commenting-convention practically speaking the main difference it makes is that in Emacs if you (re-)indent a line starting with ; it will align it at column 40. This is especially aggrevating if like me you use aggressive-indent-mode, since these lines will all jump 30-odd columns to the right as soon as you open a file. that all said this is not a hill I'm willing to die on, several commonly used editors are defaulting to ; for regular commenting, so maybe this ship has sailed and emacs clojure-mode will end up dealing with it. But... I'm going to be sore about it just a little longer.

bringe 2021-01-20T17:42:50.198200Z

@zimablue There is https://github.com/clojure/tools.trace, though not sure about it working with cljs. If not, there may be other solutions out there.

bringe 2021-01-20T17:44:25.198500Z

Please create an issue with repro steps. I've not experienced this myself, but maybe it's a particular case, or something has broken.

👍 1
plexus 2021-01-20T17:48:32.199Z

Is it possible to not show "calva is activated" on startup?

bringe 2021-01-20T17:48:35.199100Z

I think it makes sense to me to make Calva use ;; for line comments. I don't think there's a particular reason it uses ; , at least that I'm aware of

bringe 2021-01-20T17:50:39.199300Z

Wait, Calva does use ;; for line/block comments. When do you see it using ;?

bringe 2021-01-20T17:53:44.199500Z

The "Add line comment" and "Toggle line comment" commands use ;; , which seems in line with the Clojure style guide. Is there something I'm missing?

plexus 2021-01-20T17:55:22.199700Z

yeah someone else mentioned that, for me it was using ;...

plexus 2021-01-20T17:55:59.199900Z

/usr/share/code/resources/app/extensions/clojure/language-configuration.json it looks like this is actually a file that comes with VS Code itself?

bringe 2021-01-20T17:57:03.200100Z

I thought we had a setting to disable this, but maybe there was just talk about it. @pez?

bringe 2021-01-20T18:01:29.200600Z

Hmm interesting. I see this is a "built-in" extension. I wonder if in some cases/systems our language config is being overridden, and why

bringe 2021-01-20T18:02:12.201Z

And you didn't install another clojure extension in the past?

bringe 2021-01-20T18:07:21.201700Z

@plexus Would you mind creating an issue with the details mentioned as well as your system details like vs code version and OS? That would be much appreciated so we can track this.

plexus 2021-01-20T18:09:17.201900Z

> And you didn't install another clojure extension in the past? I think not... I installed this some time back but am only now trying to use it in earnest for a while. I'm on Linux/ubuntu

plexus 2021-01-20T18:09:40.202100Z

I can make an issue

pez 2021-01-20T18:15:21.202700Z

VS Code comes with a built-in Clojure extension, which, iirc, uses a toggle line comment setting that does not adhere to standard. Someone convinced me that Calva should fix this, so I did. TBH I never quite understood why this was so important. We had a discussion in this channel about it and there were people against and for changing. Anyway, we can change back too. I remember having trouble exposing it as a user setting. But that could be easier today, both because I know the APIs much better and because the APIs might have improved.

mjosefs 2021-01-20T18:15:24.202900Z

Hi! Just a bit of feedback from a new Calva user on the onboarding experience, when it comes to linting: might be worth adding something to https://calva.io/linting/ on how to make the clj-kondo config work with Calva inside VS Code (as opposed to what to write in the config, which the clj-kondo documentation is more heavy on – the Introduction part was not entirely clear to me in this use case). My specific issue was, having a repository with several projects, it didn’t apply the config.edn held in the .clj-kondo directory of a parent folder (not the repository root). My first fix was putting a .clj-kondo directory in all of the separate project directories as well; this appeared to have stopped working for me today, but a new fix was just putting it in a .clj-kondo directory in the repository root. (Would be useful to let the config be in any folder above the specific project, but maybe that’s a clj-kondo issue.) Also, the first bulleted link “Exclude unresolved symbols from being reported” appears broken (looks like a big chunk of the documentation was deleted on December 4). In any case, very happy with it – thanks! :)

plexus 2021-01-20T18:42:03.204400Z

thanks for all the effort! It is a really insignificant thing but it sticks out like a sore thumb. But seems like Calva tries to do the right thing, and that that works for other so I assume it's my setup and it's not affecting that many people. To be honest I'd be fine too with a community concencus that this tradition isn't that important and that we starndardize on single semicolon, but sadly I don't see that happening either. And IIRC Cursive has chosen to do the single semicolon so we are stuck in limbo in any case. So yeah sorry for making a fuss about this.

borkdude 2021-01-20T18:45:03.205300Z

@marcus.josefsson There is a bug or omission(?) in calva or LSP which should be fixed now when they upgrade the clj-kondo dependency. cc @brandon.ringe @ericdallo

☝️ 1
bringe 2021-01-20T18:50:32.207100Z

Thanks @marcus.josefsson for the feedback! As stated above this should be fixed soon. I'll look into that link.

👍 1
borkdude 2021-01-20T18:50:51.207500Z

You should be able to put .clj-kondo dirs anywhere in your repo and clj-kondo should pick up on this. There is no need to have only one top level .clj-kondo dir.

👍 1
bringe 2021-01-20T18:54:45.207800Z

Link fixed. Maybe the content isn't the same, but I linked to something else useful :man-shrugging:

bringe 2021-01-20T18:56:31.208Z

I think the important thing at least is that we make Calva do the same thing on all systems, so it's troubling that in some cases it does ; and others ;;

bringe 2021-01-20T18:57:34.208200Z

> VS Code comes with a built-in Clojure extension, which, iirc, uses a toggle line comment setting that does not adhere to standard @pez can you point me to this?

bringe 2021-01-20T18:59:38.208400Z

I see /calva-fmt/clojure.tmLanguage.json uses "(?<!\\\\);" for begin comment, but idk if that would affect the comment commands

bringe 2021-01-20T19:03:54.208600Z

I see this change from a year ago

borkdude 2021-01-20T19:18:56.209Z

2
🎉 2
borkdude 2021-01-20T19:19:52.209100Z

💥 1
Eric Uitbeijerse 2021-01-20T19:29:36.209500Z

@jarvinenemil It still works fine for me, but I do have to save all the files after I update the tests (Ctrl-K S)

pez 2021-01-20T19:40:52.210Z

No worries, @plexus. I think some of this is due to that Calva is built by newcomers to Clojure. We’re still orienting ourselves and learning about the legacy. It is both a weakness and a strength, I tell myself. 😃

pez 2021-01-20T19:42:51.210200Z

I find that this comment from https://github.com/avli/clojureVSCode always puts a smile on my face: > I’m trying, believe me!

bringe 2021-01-20T19:43:26.210400Z

Ohh I see, sorry, for some reason I was thinking you said Calva came with some other clojure extension 😅 , which is true to some extent, but not what you meant

bringe 2021-01-20T19:49:09.210600Z

@plexus Please comment here your system details when you get a second. We can at least gather info about this over time to try to figure out what's going on. https://github.com/BetterThanTomorrow/calva/issues/971

bringe 2021-01-20T23:54:04.211900Z

It shouldn't require a file save, if it does there is a bug. For me, I can run a failing test, make it pass, not save the file, "run tests in current namespace" and it passes.