This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-01-28
Channels
- # babashka (28)
- # beginners (252)
- # bristol-clojurians (2)
- # calva (28)
- # cider (11)
- # clj-kondo (15)
- # cljs-dev (7)
- # clojure (378)
- # clojure-europe (4)
- # clojure-italy (4)
- # clojure-nl (3)
- # clojure-norway (4)
- # clojure-uk (32)
- # clojurescript (128)
- # cursive (39)
- # data-science (18)
- # docker (37)
- # figwheel-main (10)
- # fulcro (45)
- # ghostwheel (7)
- # graalvm (2)
- # hugsql (1)
- # jobs (2)
- # joker (5)
- # kaocha (5)
- # luminus (12)
- # off-topic (37)
- # onyx (4)
- # pathom (22)
- # pedestal (70)
- # re-frame (7)
- # reagent (30)
- # ring (4)
- # shadow-cljs (12)
- # spacemacs (1)
- # sql (26)
- # tools-deps (7)
- # vrac (2)
- # vscode (7)
- # xtdb (27)
@cfleming I found a subtle bug in Cursive: the param b
is shadowed by the function name. A runtime test shows that the opposite is in fact happening.
Hi all, is there any way in cursive to get case
expressions to align properly? Known issue?
You can change the default indentation to “2 spaces” by clicking on the small lightbulb that appears when you put the cursor around (`case`
right, my issue isn’t really the number of spaces but the fact that (:a :b)
doesn’t align with (:d :e)
etc in my example.
I use “reformat code” extensively which essentially disqualifies the use of case
for me…can’t stomach looking at that indentation : )
ok, solved, with either “indent” or “function” setting for case they do align:
(defn equ
[a]
(case a
(:a b) true
:c true
(:d :e) true
false))
I’m happy and apologies for not finding this soonerAn alternative is to use map lookups instead of a case statement. That way you can also get vertical alignment.
@U4P4NREBY how would you do branches with multiple elements in them with map lookups?
I did this with:
(condp get a
#{:a :b} true
#{:c} false
....
which kinda works but has extra noise in thereWhy doesn't code completion work for things def'd in comment forms?
Because it’s a bit tricky, basically. You’d only want the completion to work within the comment block, not in normal code, and that’s somewhat complicated. That said, it’s possible - if you could file an issue for that I’ll take a look at it.
in the editor color settings, is there a way to color the top level symbols for Clojure (defn foo [a] (bar :x))
, coloring foo
but not bar
? It's not there in the clojure specific settings
I guess inheriting from Language Defaults > Identifiers > Function declaration or Global variable could work? But yes, I would like to only make it highlight at the definition site, not the usage
That’s a good idea about inheriting the style. I’ll check whether that’s doable/easy.
And one other thing, would it be possible to make a difference between line comments (with ;) and form comments (with comment or #_)? Line comments usually provide important info and would like to highlight that, but commented forms can be greyed out. For some background, I'm trying to implement https://github.com/tonsky/intellij-alabaster in a dark scheme
Is there a solution for turning of namespace maps?
Running (set! *print-namespace-maps* false)
in user.clj gives me
java.lang.IllegalStateException: Can't change/establish root binding of: *print-namespace-maps* with set
No, unfortunately. I’m planning to have an init section in REPL run configs, containing commands to be run after the REPL is initialised. That would fix this case and others.
user.clj is read too early
the repl binding for *print-namespace-maps*
hasn't been set yet
Right, I realize that's the problem. It's unfortunate, since I can't find any hook that is run later.
Overriding print-method
like suggested here https://groups.google.com/forum/#!topic/clojure/XAP0ENMSUTc does work.
The case is similar if you want to (set! *warn-on-reflection* true)
in user.clj for example, won't work