Fork me on GitHub
#cursive
<
2020-11-27
>
helios09:11:04

Something strange. In my require i have [re-frame.context :as re-frame :refer [defc]] (it's a fork of re-frame) But later down in the text, where i have re-frame/subscribe cursive offers to require the ns

imre16:11:49

Why does cursive format tagged literals like this:

#kaocha/v1
    {:plugins [:kaocha.plugin/profiling
               :kaocha.plugin/print-invocations
               :kaocha.plugin/cloverage
               :kaocha.plugin.alpha/spec-test-check]}
and not like
#kaocha/v1
{:plugins [:kaocha.plugin/profiling
           :kaocha.plugin/print-invocations
           :kaocha.plugin/cloverage
           :kaocha.plugin.alpha/spec-test-check]}
?

cfleming19:11:15

Great question, I have no idea - I’d have to look at that.

pez23:11:29

cljfmt does something similar, although only one space indent. Maybe it is to show what is tagged? It makes a bit of extra sense when readers stack. Like so:

#kaocha/v1
 #foo/bar
  #baz
   {:plugins [:kaocha.plugin/profiling
              :kaocha.plugin/print-invocations
              :kaocha.plugin/cloverage
              :kaocha.plugin.alpha/spec-test-check]}

cfleming01:11:42

I don’t think I did it on purpose in Cursive, it’s probably just an artifact of sub-elements in the AST being indented by default. I’d have expected 2 spaces rather than 4, though.

imre07:11:26

My personal preference would be to have no indentation for these: a) they belong together b) that would match my teammates' spacemacs default formatting 😁

✔️ 3
pez08:11:57

Could be a similar artifact in cljfmt, I can't see that the behaviour is documented.

tony.kay22:11:32

I’m reading in the docs that ~file-namespace is supposed to sub in REPL commands as the current namespace. It is not expanding for me. Is this a typo in docs?

tony.kay22:11:14

hm…strangely, it expands if I put it on a line by itself

tony.kay22:11:00

I figured it out. Strange issue, but here it is: I wanted to reload the file myself (so I could catch compiler exceptions), and I tried this: (require '~file-namespace :reload) in the REPL command. That did not expand; however, if I do this it works:

(let [n '~file-namespace]
  (require n :reload))

cfleming20:11:56

Thanks, I’ll take a look - that should work anywhere.