Fork me on GitHub
#calva
<
2021-12-20
>
Marc O'Morain10:12:24

What’s the best place to log diagnostic messages from the Calva test runner, that we would want users to be able to view when debugging issues?

pez10:12:08

For error messages I think the output/repl window works. If it’s a more verbose diagnostics level that the user can enable, then the Calva says output channel might be a good place.

ericdallo16:12:30

FYI: with latest clojure-lsp released today the code action should work again

bringe16:12:58

Awesome, thanks

JR22:12:21

Sorry to be dense here, but it looks like calva picked up the newest clojure-lsp, but some things aren’t working. Now when I add an undefined function call to a new project, there’s no indication that it’s bad. So I did lein create foo opened it with calva, and in core.clj I typed (mynewfunc 1).

JR22:12:28

Calva is utilizing cider-nrepl and clojure-lsp to create this VS Code experience.
  nREPL dependencies configured:
    nrepl: 0.8.3
    cider-nrepl: 0.26.0
    cider/piggieback: 0.5.2
  clojure-lsp version configured: latest

If you are new to Calva, please consider starting with the command:
  **Calva: Fire up the Getting Started REPL**
  

(See `showCalvaSaysOnStart` in Settings to control the auto-showing of this message panel.)

clojure-lsp version used: 2021.12.20-00.36.56
clj-kondo version used: 2021.12.19

JR22:12:06

Oh, maybe it had something to do with the VPN? I saw this in the log:

2021-12-20T22:28:40.263Z  INFO [clojure-lsp.feature.file-management:?] - Changes analyzed by clj-kondo took 0.04 secs with 39 tries
2021-12-20T22:28:40.309Z  INFO [clojure-lsp.feature.file-management:?] - Changes analyzed by clj-kondo took 0.04 secs with 40 tries
2021-12-20T22:28:40.313Z  WARN [clojure-lsp.feature.file-management:146] - Aborting changes due to too much retries: 41
I disconnected from the VPN, restarted calva and now I see the appropriate errors again. And I can verify that “Create Private Function” works!

JR22:12:20

Eh, maybe I should say it sometimes works. It stopped working now, again on that small app. When it stops working previous errors wavy red lines get stuck in the editor and newly introduced errors don’t get displayed. Calva Connection Log says “Socket closed”.

JR22:12:55

And in Calva Language Client, I see this:

{
            "range": {
                "start": {
                    "line": 7,
                    "character": 1
                },
                "end": {
                    "line": 7,
                    "character": 11
                }
            },
            "severity": 1,
            "code": "unresolved-symbol",
            "source": "clj-kondo",
            "message": "Unresolved symbol: mynewfunc2",
            "tags": []
        }
where mynewfunc2 was created by the “Create Private Function” menu action, and is exactly where the call to the undefined function was before it got defined. So I guess this problem is in Kondo?

ericdallo00:12:38

Aborting changes due to too much retries: 41
That's something I added on latest release regarding some concurrency issues, it should not happen all the time though, is your project big?

ericdallo01:12:41

I can repro these weird behavior @U02PB3ZMAHH of logging a lot of times:

Changes analyzed by clj-kondo took 0.04 secs with X tries

ericdallo01:12:23

I think there is something to be improved there, could you try with this LSP config meanwhile?

{:linters {:clj-kondo {:async-custom-lint? false}}}
on your .lsp/config.edn or .config/clojure-lsp/config.edn

🙌 1
JR14:12:46

@UKFSJSM38 That makes things work!

ericdallo14:12:58

yeah, I'll try to fix it, the issue is that with that flag the performance is reduced for big buffers, but it makes things more stable

Darrell17:12:49

Is there a way to delete surrounding braces or brackets?

wilkerlucio17:12:54

not sure in Calva, but in generic Paredit terms you are looking for an operation called Splice Sexp

wilkerlucio17:12:07

the default shortcut may be ctrl + s (on macs, not sure win/linux)

pez17:12:37

ctrl+alt+s in Calva

Darrell17:12:34

That worked. Thanks @U0ETXRFEW!

pez17:12:08

A command I find my self using surprisingly often is Splice Killing Backwards: ctrl+alt+shift+backspace.

gratitude 1
👀 1
☝️ 1
Tomas Brejla15:12:06

Me too. ctrl+alt+shift+backspace is one of those "please don't change/remove this" kind of commands. So.. please don't change/remove it! 🙏 🙂 It's just too good.

Darrell15:12:19

Wow, I’m going to make heavy use of that one!

👍 1
pez21:12:26

It ain’t goin’ anywhere. 😃