calva 2025-11-12

Hi, in a multi-module (each having its own deps.edn) project, the wrong arity calls across modules are not flagged in red. What am I missing? Do I need to configure something? (I have CIDER-nREPL running and connected.)

You will need to have a deps.edn that puts all other modules together, preferrably at the project root. When opening that project in VS Code Calva should start the clojure-lsp server using this deps.edn and build the classpath from that.

I already aliased modules using :local/root in the root deps.edn.

Great, And which clojure-lsp server is serving the project? You can check where the white dot is in the menu that opens clicking the clojure-lsp button in the statusbar.

I see root lsp-server (Active) serving it.

Cool. I suspect it is something with the classpath. Do you see what you expect doing something like clojure -Spath | tr ':' '\n' from the project root?

The classpath is alright, and the regular flagging on arity error is happening. It's only a corner case of chained referencing across def forms where the flagging doesn't happen.

I created a repro case - in repro.core/foo the call to u/bar is not flagged.

Calva relies entirely on clojure-lsp for this, so you may get some better input on this asking in #lsp

👍🏽 1

Even within the same module, wrong arity is not flagged.

FWIW, the .cpcache file is not generated in the module. (In another project where flag-on-arity-error works, the module has a project.clj too and .cpcache file is generated under the module.)

Some troubleshooting later, this looks like a corner case - the flagging is absent only when I have chain of references across def forms. (I generated .cpcache with clojure -Spath, which does not help.)