This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-03-19
Channels
- # announcements (5)
- # babashka (49)
- # beginners (11)
- # biff (5)
- # calva (123)
- # clerk (9)
- # cljdoc (5)
- # cljs-dev (9)
- # clojure (62)
- # clojure-europe (32)
- # clojure-nl (1)
- # clojure-norway (54)
- # clojure-uk (3)
- # clojurescript (30)
- # community-development (5)
- # cursive (9)
- # devops (5)
- # events (1)
- # fulcro (35)
- # graalvm (10)
- # gratitude (3)
- # hyperfiddle (9)
- # jobs (3)
- # keechma (1)
- # lsp (10)
- # malli (14)
- # off-topic (42)
- # overtone (1)
- # releases (3)
- # shadow-cljs (66)
- # squint (153)
- # xtdb (19)
Trying to replicate https://twitter.com/ikitommi/status/1480215765143932931/photo/1, but cannot get the editor to play along: getting those "cannot be resolved" warnings + indentation seems off. evaluating in REPL indeed shows a pretty dev error + clj-kondo also warns correctly on invalid type (I have clojure-extras installed); so it's only those editor warnings & indentation. I must be missing something obvious. tried searching around slack and google, but couldn't find the answer. any ideas? thanks a lot.
I think you want to use Resolve As, see: https://cursive-ide.com/userguide/macros.html#customising-symbol-resolution. I believe the malli annotations are designed to look like Plumatic Schema’s, so you can resolve mx/defn as schema/defn and things should hopefully work.
hi @U0567Q30W thanks for the quick reply, that is great. I didn't know about those Resolve As. I tried it out and it solved the first warning, thanks.
however, the args are still left with warnings, see the screenshot. i've noticed, btw, that .clj-kondo/metosin/malli/config.edn
contains the following rules:
{:lint-as {malli.experimental/defn schema.core/defn}
:linters {:unresolved-symbol {:exclude [(malli.core/=>)]}}}
which are followed when using clj-kondo from the command-line but not followed in the editor.
sorry if a reason for this is obvious, I'm still trying to wrap my head around what is the role of cursive and clojure-extras in relation to these clj-kondo lib configurations.So, Cursive doesn’t do anything with the clj-kondo config at the moment, they’re completely independent and use different mechanisms.
I just tried this, and it works for me. I think you might have resolved mx/defn as the wrong defn. Here’s how I did it. I do the Resolve As on mx/defn:
@U0567Q30W thanks a lot for looking into this. I indeed didn't enter the correct schema :face_palm: the code works now like a charm. Sorry for the noise and thanks for taking the time 🙏