This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (8)
- # architecture (3)
- # aws (18)
- # beginners (96)
- # bristol-clojurians (3)
- # calva (15)
- # cider (7)
- # clj-kondo (8)
- # clojure (135)
- # clojure-denmark (1)
- # clojure-dev (14)
- # clojure-europe (37)
- # clojure-italy (9)
- # clojure-nl (14)
- # clojure-sanfrancisco (1)
- # clojure-spec (1)
- # clojure-uk (54)
- # clojurescript (27)
- # core-async (243)
- # cursive (28)
- # data-science (6)
- # datomic (33)
- # fulcro (25)
- # graalvm (24)
- # hoplon (2)
- # instaparse (12)
- # jackdaw (1)
- # java (21)
- # juxt (12)
- # meander (10)
- # nyc (4)
- # off-topic (6)
- # om (3)
- # pathom (17)
- # perun (1)
- # re-frame (29)
- # reitit (4)
- # rum (3)
- # shadow-cljs (119)
- # spacemacs (31)
- # xtdb (14)
Does an option exists somewhere to keep spaces in manually aligned code when I do
Reformat Code ?
For example I wrote
and want it to be kept intact on reformat?
[a b c] [aaa bbb ccc]
No, there isn’t. And there’s really no good way that could work except for an annotation like “Never reformat this form” - at the end of the day, reformatting is only moving spaces around.
I’m thinking of something like
clojure.test/are where you might want to consistently align the columns.
@cfleming “Is that inside any form that a general rule could be made for?” I would not say that :thinking_face:
Generally for me it would be fine to have checkboxes
Don't touch multiple non-trailing spaces ,
Don't remove newlines so that Cursive only align code and insert missing space between words
I’m not sure how Cursive would determine “multiple non-trailing spaces” - basically, that would mean that Cursive wouldn’t reformat at all, as far as I can tell.
@cfleming «Cursive doesn’t remove newlines when reformatting at the moment.» Not in this case
leading comma force second line to be collapsed
(xxx) , (yyy)
@cfleming «I’m not sure how Cursive would determine “multiple non-trailing spaces”» I've meant not leading and trailing spaces.
Ah, IntelliJ has an action for that, “Auto-Indent lines”, which just adjusts the initial indent. Is that what you’re looking for?
Well, I've tested “Auto-Indent lines”, it's not exactly the what I want. My use-case (using parinfer): • there is a code formatted with “Default to only indent” disabled • I enable “Default to only indent” and want to update indentation • in this case “Auto-Indent lines” does not change indentation in forms but “Reformat Code” does. But “Reformat Code” also breaks all manual alignment Generally I would like to try various ideas to make code more readable but automatic code formatting makes it almost impossible.
It looks like the cursive error reporting endpoint is down.
cursive.exception.GithubException: 500 Internal Server Error at cursive.exception.ClojureErrorReportSubmitterKt.create(ClojureErrorReportSubmitter.kt:158)
GitHub is having problems today: https://www.githubstatus.com/incidents/q07bfjh7jf1t
Is there a way to rename a namespace and updates all of the requires to it
yummly.utils.hash-map-util and update all of the
(require [hash-map-util]) to
(require [yummly.utils.hash-map-util :as hash-map-util])
when I tried rename, it complained that
yummly.utils.hash-map-util wasn't a valid identifier
Yes, that’s the problem. Currently Cursive only allows renaming the last namespace segment, because otherwise files have to be moved. I’m planning to fix this soon.
Generally I search/replace old name -> new name and then use Cursive's “move file to correct location”. https://clojurians.slack.com/archives/C0744GXCJ/p1582827806029600
Moving the file (within the IDE) doesn't change the namespace either. It would be nice if it did. I search and replace the ns text as a workaround.