This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-25
Channels
- # announcements (9)
- # asami (69)
- # babashka (151)
- # babashka-sci-dev (34)
- # beginners (90)
- # cider (21)
- # clj-on-windows (17)
- # clj-otel (4)
- # cljsrn (5)
- # clojure (27)
- # clojure-austin (3)
- # clojure-europe (87)
- # clojure-gamedev (1)
- # clojure-nl (3)
- # clojure-norway (8)
- # clojure-poland (2)
- # clojure-uk (3)
- # clojured (10)
- # clojurescript (50)
- # core-async (73)
- # cursive (28)
- # data-science (2)
- # datomic (17)
- # etaoin (1)
- # honeysql (6)
- # introduce-yourself (3)
- # jobs (1)
- # joyride (12)
- # malli (5)
- # nbb (14)
- # off-topic (18)
- # pathom (4)
- # podcasts-discuss (2)
- # polylith (30)
- # project-updates (3)
- # re-frame (33)
- # reitit (1)
- # remote-jobs (13)
- # shadow-cljs (59)
- # sql (12)
- # tools-build (7)
- # xtdb (36)
Great, glad it’s helping! I have some more improvements for that on the way, including making it work better for CLJC.
Yeah, that's a great feature, thanks!
+1, I use it every day. I only wish I could make it force a newline after :require/:import 🙂
@U3ZG4CAF8 Code | Optimise Imports…
PS: it's also possible to optimize imports automatically just before committing
(just discovered this myself now)
@U0567Q30W how do you detect requires that are used just for side-effects? Some of my systems, for example, use require to pull in multi-methods, but they are never called directly? Do you look for multimethods and deftype/defrecord as a way to prevent accidental cleanup that would affect operation?
Hm…I’m also seeing a bug where it creates duplicates in the require…I just ran it a few times and it did this:
(:require
[cheshire.core :as cheshire]
[cheshire.core :as cheshire]
[cheshire.core :as cheshire]
[cheshire.core :as cheshire]
[cheshire.core :as cheshire]
[cheshire.core :as cheshire]
[cheshire.core :as cheshire]
[cljc.java-time.zone-id :as zone-id]
[cljc.java-time.zone-id :as zone-id]
[cljc.java-time.zone-id :as zone-id]
[cljc.java-time.zone-id :as zone-id]
[cljc.java-time.zone-id :as zone-id]
[cljc.java-time.zone-id :as zone-id]
[cljc.java-time.zone-id :as zone-id]
[clojure.core.async :as async]
[clojure.core.async :as async]
[clojure.core.async :as async]
[clojure.core.async :as async]
[clojure.core.async :as async]
[clojure.core.async :as async]
[clojure.core.async :as async]
[clojure.data.json :as json]
[clojure.data.json :as json]
[clojure.data.json :as json]
[clojure.data.json :as json]
[clojure.data.json :as json]
[clojure.data.json :as json]
...
I think maybe it is trying to preserve “sections” via the whitespace (which is how this ns was written), but it is getting confused or something. CLJ file.
I manually cleaned it up a bit and that made it work right…trying to pinpoint the bug…
Found it. There was a comment and that confuses it. I’ll open an issue @U0567Q30W https://github.com/cursive-ide/cursive/issues/2707
@U0CKQ19AQ Great, thanks, I'll get that fixed.