This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-01-29
Channels
- # babashka (4)
- # babashka-sci-dev (96)
- # beginners (79)
- # calva (26)
- # cider (5)
- # clerk (2)
- # clj-kondo (23)
- # clojars (14)
- # clojure (54)
- # clojure-europe (8)
- # clojure-sweden (3)
- # clojurescript (76)
- # datomic (12)
- # deps-new (6)
- # emacs (20)
- # events (3)
- # exercism (1)
- # fulcro (11)
- # funcool (12)
- # hugsql (14)
- # hyperfiddle (6)
- # kaocha (1)
- # lambdaisland (1)
- # lsp (22)
- # malli (1)
- # matcher-combinators (6)
- # nbb (6)
- # off-topic (128)
- # polylith (14)
- # re-frame (4)
- # reagent (1)
- # releases (4)
- # shadow-cljs (8)
- # tools-build (13)
- # tools-deps (13)
- # tree-sitter (5)
Lsp seems to show defn-
signature as just: defn-: ([name & decls])
which isn't super helpful. Cider shows the full set of possibilities, and so does lsp when for defn
.
I think Cider must have it as a special case, because defn- does have as signature name & decls, but Cider is smart enough to list out the same options as for defn
I'll try, but I'm not sure that's it. The signature of defn- is actually name & decls, but defn- just passes decls to defn. So it seems Cider has a special case where for defn- it'll show the same signature as defn
Oh, I got it, you are complaining about the signature of defn- itself, I see... Clojure-lsp relies on the signature kondo analysis return, if they are not correct we should fix it in clj-kondo
Right. And I mean, it is correct. But I guess Cider goes the extra mile and improves it even from the real one.
@U04V15CAJ do you know what cider could be doing differently to present different arity for defn-
?
Maybe checking some metadata that kondo doesn't?
Could it be that you're looking at the arglists from CLJS here? https://github.com/clojure/clojurescript/blob/6dac3165d4bc8f785741ea86aef946b11c9d7d0f/src/main/clojure/cljs/core.cljc#L3303
Oh I see:
user=> (:arglists (meta #'defn))
([name doc-string? attr-map? [params*] prepost-map? body] [name doc-string? attr-map? ([params*] prepost-map? body) + attr-map?])
Ah yes, this can be fixed here:
https://github.com/clj-kondo/clj-kondo/blob/a12898dea17740f03652ac925331da061dc461bb/src/clj_kondo/impl/overrides.clj#L7-L18
clj-kondo doesn't really analyze the bootstrapped way of how defn
is defined and these overrides take care of that. You can file an issue and update it there and then it'll work