Fork me on GitHub
#cursive
<
2019-12-11
>
nmkip15:12:19

Hi, I'm running a re-frame application with cursive and I started a remote nREPL using the port that appears in the shadows-cljs logs. I changed the dropdown value from cljto cljs and I can evaluate expressions like (+ 1 1)from the editor. However, when I try to evaluate (s/def ::id int?) I get the following error:

Unexpected error (AssertionError) macroexpanding s/def at (/tmp/form-init7788612072615295307.clj:1:1).
Assert failed: (map? env)
any ideas? (I evaluated the (:require [cljs.spec.alpha :as s]) )

cfleming19:12:20

I’m not sure, no. Do you have reason to think that this is Cursive-specific? If not #clojure might be a better place to ask.

nmkip13:12:05

No, I don't know if this is Cursive-specific.

favila21:12:08

Is there a way to set $CLJ_CONFIG on a per-project basis? I’m trying to setup a monorepo style deps.edn project, where one shared deps.edn has :default-deps and then there is a per-module deps.edn with empty version coordinates

cfleming21:12:41

There isn’t, but there should be and several people have asked about this. I’ll have a look and see if I can get it in the next EAP.

thanks3 1
favila21:12:58

Honestly I’d prefer if deps.edn supported this natively

1
favila21:12:57

I’m not sure what utility :default-deps even has if deps.edn doesn’t have an explicit notion of a parent deps.edn

alexmiller21:12:06

not much right now

kenny21:12:17

Out of curiosity, why does the Rename var action sometimes pop up a modal for renaming and other times do it inline? I vastly prefer the inline renaming since you can see what it's doing. It seems like there are several cases where the modal could be replaced with the inline rename.

cfleming22:12:47

It should only pop up the modal for renaming global things, i.e. vars. Locals should always be inline.

kenny22:12:59

Renaming a here opens a modal:

(defn example
  [a]
  (inc a))
Shouldn't that be considered a local?

cfleming22:12:13

Yes, definitely - I’ll check that.

kenny22:12:46

Same with renaming b:

(defn example
  [a]
  (let [b ""]
    (inc b)))

kenny22:12:38

a here as well:

(defn example
  []
  (with-open [a ""]
    a))

kenny22:12:09

Ok, I may have found a pattern. It appears to only happen in CLJC files.

kenny22:12:00

Yep. All of the above work in clj or cljs, not cljc.

cfleming03:12:32

Interesting, thanks. That should make it easy to reproduce.

kenny22:12:25

For some reason, certain namespaces appear twice in the namespace search. See the below screenshot where I am searching for "resour" and compute.data-model.resource-price appears twice.

cfleming22:12:31

I think that’s when namespaces are defined in CLJC files - one is a CLJS ns and the other is CLJ. I need to revisit CLJC in general because of problems like this.

kenny22:12:23

Ah yes. That ns is cljc.