Fork me on GitHub
#cider
<
2019-08-11
>
Yehonathan Sharvit07:08:09

I want to change the location of a namespace from model.entry to data.entry When I update the require expression of a ns that requires valid-entries? from model.entry to data.entry, CIDER complains

valid-entries? already refers to: #'mr-hankey.model.entry/valid-entries? 
I understand that the var is redefined. But this is exactly what I want.

dominicm07:08:26

This is a clojure error

Yehonathan Sharvit07:08:20

Is there a way in CIDER to reload a namespace from scratch?

dmaiocchi07:08:14

This works if you are editing the name space file

jumar07:08:55

@viebel what do you mean by reloading "from scratch"?

Yehonathan Sharvit07:08:32

@jumar I mean removing all the vars and load the new ones in order to prevent the “already refers” error

jumar08:08:25

I don't think there's out of the box support for that. You need to (remove-ns *ns*) and reload the buffer. Or you can use tools.namespace/refresh (perhaps via cider-ns-refresh?)

Yehonathan Sharvit08:08:28

seems to work @jumar. Thanks

richiardiandrea09:08:28

That's probably some nice and easy feature to add by the way

bozhidar09:08:20

What feature? Rename ns and refresh it?

dominicm13:08:54

I think there's an unload-ns or something

bozhidar14:08:55

I don’t think so. There’s undef-var, but I don’t recall anything about ns unloading.

bozhidar14:08:26

I guess we can easily extend undef var to an entire namespace, though. 🙂