calva

itaied 2025-11-18T20:30:34.591709Z

hey all im trying out polylith (using vscode and calva) i noticed that when i setup calva on the root folder (the workspace) it doesn't track nested projects (components) and i need to tell it to track it is it something that i can configure?

itaied 2025-11-18T20:31:29.924079Z

pez 2025-11-18T20:42:45.594189Z

What does “doesn’t track” mean in this context?

seancorfield 2025-11-18T21:12:21.646089Z

I use VS Code/Calva with a massive Polylith repo -- over 200 bases and components -- and I don't understand your question. Can you elaborate @itai?

itaied 2025-11-18T21:31:55.331199Z

i have created a new namespace (`test.clj` ) inside the user component but it didn't add the (ns ...) to it i thought that it doesn't offer autocomplete, but it does work now, it's just the auto insert of ns

itaied 2025-11-18T21:37:28.498839Z

as you can see here, when the lsp tracks the entire project it didn't add the ns definition, but when i added the inner project (the component) it did add it

pez 2025-11-18T21:43:11.586419Z

Thanks! I have also noted that sometimes the auto-add of the ns form doesn’t work, but never saw a pattern to it. I think it could be some kind of race condition in VS Code, but it could also be a limitation of clojure-lsp. It would be great with a reproduction project. You think you can create one?

itaied 2025-11-18T21:43:45.879639Z

i can just push the one i'm working on, it's the polylith tutorial @pez https://github.com/itai-spiritt/polylith-tutorial

🙏 1
seancorfield 2025-11-18T21:47:05.039709Z

At work, I just added a new file -- foo.clj in components/src/ws/affiliate -- and it correctly added (ns ws.affiliate.foo) in the new file. How did you create the new file? I right-clicked affiliate in the explorer and selected New File.

itaied 2025-11-18T21:49:15.704049Z

the same way... the lsp is configured only to watch the root folder?

seancorfield 2025-11-18T21:53:29.911149Z

.lsp/config.edn:

{:source-aliases #{:dev :test}
 :paths-ignore-regex [".*/googlepay/java.clj"]
 :clean
 {:ns-inner-blocks-indentation :same-line
  :ns-import-classes-indentation :same-line
  :sort {:refer {:max-line-length 1}}}}

seancorfield 2025-11-18T21:53:49.256109Z

I don't know what you mean about "configured only to watch the root folder".

itaied 2025-11-19T06:18:43.338229Z

i dont' have this file under .lsp i have only .cache

itaied 2025-11-19T07:08:56.712449Z

i just added the same config to my repo but still no ns is generated

mitchelkuijpers 2025-11-19T08:01:34.723309Z

Have you added those components to the root deps.edn?

itaied 2025-11-19T10:17:04.996339Z

yes i did

{:aliases  {:dev {:extra-paths ["development/src"]

                  :extra-deps {poly/user {:local/root "components/user"}
                               org.clojure/clojure {:mvn/version "1.12.2"}}}

            :test {:extra-paths ["components/user/test"]}

            :poly {:main-opts ["-m" "polylith.clj.core.poly-cli.core"]
                   :jvm-opts ["--enable-native-access=ALL-UNNAMED"]
                   :extra-deps {polylith/clj-poly {:mvn/version "0.3.31"}}}}}

mitchelkuijpers 2025-11-19T10:27:43.964399Z

Hmm then I have no idea what is wrong, I run insiders but that should not matter. I also remembering settings someting in calva so it only starts a lsp server for the project in root

pez 2025-11-19T14:03:17.764319Z

> so it only starts a lsp server for the project in root So that could be the problem. In the screenshot above we can see two servers running. Maybe it’s a race condition between those… in any case, in a poly project only the top level server should be started.

☝️ 1
itaied 2025-11-19T18:12:34.948329Z

when only the top level server is running nothing happens, only when i turn on the second one as well (the inner) it worked which configurations can i try?

itaied 2025-11-19T18:14:33.982559Z

i have just restarted the pc and it seems to work... 🤷 thank you all for your time and effort, i can't explain this voodoo...

👍 2
seancorfield 2025-11-19T18:36:43.495609Z

I only have one LSP server running and it's at the workspace root. Glad it is now working for you tho'...

pez 2025-11-19T18:47:50.102459Z

VS Code can get stale strangenesses that only a restart fixes. We’ve seen that before.

Shantanu Kumar 2025-11-18T05:08:03.073579Z

When I write (let [^Future fut ...] ...) in "Code actions" instead of suggesting to import java.util.concurrent.Future it suggests that I create a private function Future. Is it bug in Calva or in one of the dependencies?

pez 2025-11-18T08:01:48.186229Z

Code actions are provided by clojure-lsp.

Shantanu Kumar 2025-11-18T11:52:36.130709Z

Thanks, filed an issue: https://github.com/clojure-lsp/clojure-lsp/issues/2156

🙏 1