Fork me on GitHub
#clj-kondo
<
2023-06-18
>
ericdallo23:06:07

The LSP completion of vars of a big Nubank library that uses potemkin for the API stopped working recently and it's really affecting development since you can't the available vars of the API, is it possible to support this way of using potemkin? ๐Ÿงต

ericdallo23:06:14

The issue is that this ns api is huge, so we faced a limit of vars that a namespace can have ๐Ÿ˜… as a workaround, we found (load! "some-path") that fixed the issue, but that broke the kondo/lsp support, I'll try to explain how this behaves ATM: some_component.clj

(ns some-component)

(defn foo [] ..)
api.clj
(ns api 
  #_{:clj-kondo/ignore [:unused-namespace]}
  (:require [some-component]
            [potemkin :as potemkin]))

(load "api/chunk_1")
(load "api/chunk_2")
api/chunk_1.clj
(in-ns 'api)

(potemkin/import-vars
 some-component/foo) 

ericdallo23:06:38

AFAICS, this happens because kondo doesn't follow load , since it's a runtime thing, makes sense, but kind of break this potemkin integration and maybe other cases, I was wondering if we can fix it somehow, this is a really important lib used across hundreds of Nubank projects to develop mobile screens and have a good dev support for it is important. I thought maybe kondo could try to follow the api/chunk_1 and consider the in-ns? is it a naive thought?

๐Ÿ‘ 2
borkdude08:06:36

I thought clj-kondo already follows in-ns, but if not, we could fix it

borkdude08:06:48

issue / PR welcome

๐Ÿ‘ 4