Fork me on GitHub
#calva
<
2021-01-20
>
Eric Uitbeijerse08:01:45

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?

pez09:01:40

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

zimablue13:01:28

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

zimablue13:01:35

but what is equivalent of that when running node app?

zimablue13:01:14

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

zimablue13:01:19

what strange magic

pez13:01:10

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

pez13:01:51

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

zimablue13:01:49

hey, yeah or trying to

zimablue14:01:47

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

zimablue14:01:48

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

zimablue14:01:09

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

pez14:01:28

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…

bringe17:01:50

@U63D7UXJB 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.

dangercoder14:01:24

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.

dangercoder14:01:12

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 🙂

bringe17:01:25

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
Eric Uitbeijerse19:01:36

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

bringe23:01:04

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.

Eric Uitbeijerse07:01:34

Would be nice if it does not require a file save, that would save some time. I'll have another look at it later on and report back.

👍 1
dangercoder17:01:50

Tests understands the updates when I save the file manually

bringe18:01:18

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 Uitbeijerse19:01:27

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

dangercoder06:01:21

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

plexus16:01:00

is there any way to disable linting?

pez17:01:28

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

pez10:01:03

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

plexus11:01:54

Thank you ❤️

pez12:01:05

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

plexus16:01:26

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

clyfe17:01:04

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

😻 1
plexus16:01:00

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

plexus16:01:46

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

pez17:01:10

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.

ericdallo17:01:58

Yeah, Emacs uses ;; for commenting just like Calva

ericdallo17:01:18

Oh Does Calva uses only ; ?

ericdallo17:01:34

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

plexus17:01:40

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.

bringe17:01:35

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

bringe17:01:39

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

bringe17:01:44

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?

plexus17:01:22

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

plexus17:01:59

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

bringe18:01:29

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

bringe18:01:12

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

bringe18:01:21

@U07FP7QJ0 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.

plexus18:01:17

> 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

plexus18:01:40

I can make an issue

pez18:01:21

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.

plexus18:01:03

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.

bringe18:01:31

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

bringe18:01:34

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

bringe18:01:38

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

bringe19:01:54

I see this change from a year ago

pez19:01:52

No worries, @U07FP7QJ0. 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. 😃

pez19:01:51

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

bringe19:01:26

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

bringe19:01:09

@U07FP7QJ0 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

plexus17:01:32

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

bringe17:01:03

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

mjosefs18:01:24

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

borkdude18:01:03

@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
bringe18:01:32

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

👍 1
bringe18:01:45

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

borkdude18:01:51

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
ericdallo01:01:44

Already using with clojure-lsp , It's really a killer feature IMO