This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-19
Channels
- # announcements (52)
- # asami (83)
- # atom-editor (1)
- # babashka (143)
- # beginners (123)
- # calva (18)
- # chlorine-clover (21)
- # cider (7)
- # clj-kondo (57)
- # cljs-dev (4)
- # clojure (209)
- # clojure-boston (1)
- # clojure-europe (27)
- # clojure-germany (12)
- # clojure-italy (17)
- # clojure-nl (3)
- # clojure-serbia (6)
- # clojure-spec (1)
- # clojure-uk (59)
- # clojurescript (82)
- # conjure (9)
- # core-async (6)
- # cursive (20)
- # data-science (1)
- # datahike (1)
- # datascript (1)
- # datomic (86)
- # duct (5)
- # emacs (6)
- # events (6)
- # figwheel-main (4)
- # fulcro (27)
- # graalvm (19)
- # leiningen (14)
- # lsp (30)
- # malli (48)
- # meander (3)
- # off-topic (6)
- # pedestal (2)
- # practicalli (1)
- # rewrite-clj (21)
- # shadow-cljs (18)
- # sql (15)
- # tools-deps (9)
- # vim (3)
- # wasm (3)
- # xtdb (18)
how do I stop Cursive indenting ; comments
inside (comment)
blocks when I type them on a new line ? It never used to do it. Also inside (comment)
s if I delete to go up a line, that line is now indented where it wasn't before
Those settings are in the code style for Clojure in IntelliJ settings
Not sure which specific one is causing that
Can you provide a complete example?
I already have "Default to indent only" and "Force Only Indent for all forms" selected
actually I found it's the same for any form inside a (comment)
block. I can't work out how to stop it indenting forms
I don't want Cursive to help me with formatting unless I explicitly ask it to
Cursive's static analyzer seems to have an issue with the following, marking the .set
calls inside the threading macros (complaining about the missing last arg):
(doto some-object
(.set "RequiredField" required-field)
(-> (.set "OptionalField1") (->> (some->> optional-field-1)))
(-> (.set "OptionalField2") (->> (some->> optional-field-2))))
which is a weird way of saying
(.set some-object "RequiredField" required-field)
(some->> optional-field-1 (.set some-object "OptionalField1"))
(some->> optional-field-2 (.set some-object "OptionalField2"))
some-object
In contrast, clj-kondo seems to be okay with it.Why is this so nested to begin with?
Well, I wanted to see if I can turn the code in the second block into a doto
and this is what I ended up having to do
clj-kondo actually expands the macros, so it’ll be able to see that that’s ok. I can check what’s happening there, but no guarantees of much effort being spent to support code like that, sorry 🙂
Don't spend time on it, it isn't a particularly useful pattern anyway 😁 Just posted it as I found it interesting
@hlship we should start a new thread here for your issue since it’s not related to the problem in the other thread.
Yes, as I noted, I didn't realize I was posting on the existing thread. I think I'm actually in good shape now that I deleted all the .iml files, and the deps.edn issue might have been resolved the same way.
I've got like 30 windows open across two monitors and I feel like I'm going a little bit blind.
One thing I’m not sure of is how well the inter-module deps will work if you’re mixing lein and deps projects. I had to do a lot of trickiness to make that work with lein, and deps has its own way of doing that bit. I think what that means is that things might not work totally correctly until the project is fully migrated - this will probably manifest as having to install your deps projects into your local maven repo so lein can find them.
Assuming you’re planning to use :local/root
for your deps dependencies, I think you’d be best to convert the project from the leaves to the root.