False positive errors in Calva when using potok streams
Hi! In our project, we use potok to manage streams, so we have many functions that follow this pattern.
However, in Calva we are seeing errors reported for each of these cases, even though the code is valid. Here's an example:
` (defn finalize [] (ptk/reify ::finalize ptk/UpdateEvent (update [ state] (dissoc state :viewer))))
` In Calva, this shows an error like the one in the attached screenshot:
We tested the same code with clj-kondo directly and it does not report any errors. So it seems like this might be related to how Calva is integrating clj-kondo or how it's configured.
Could this be a configuration issue? Have you seen something like this before? Any suggestions on how we could get rid of these false positive errors?
Thanks a lot for your help, and thanks for the great tool!
Hi! This is quite strange.... Calva integrates with clj-kondo only secondary via clojure-lsp. I would try see if running clojure-lsp in the project reports anything.
In addition to the error, we have these info messages
The issue is due to the clj-kondo hook used in penpot. It uses a local atom as symbol registry to detect duplicates. This is fine when clj-kondo passes only once over each file, but I suspect that clojure-lsp's embedded clj-kondo does not start its clojure interpreter anew nor reset its state before parsing files a second time.
So I'm not sure this is a calva issue. Nevertheless, emacs users do not experience this problem, and yet they also run clojure-lsp so maybe there's some configuration that tells it to reset internal state before each pass or something like that?
Thanks for the update. Seems like if it works in emacs it is strange that Calva has problems with it. Do you have any ideas on this, @ericdallo ?