Fork me on GitHub
#cursive
<
2019-05-16
>
Ivan Koz05:05:49

why :repl-options :message doesnt work for cursive repl? https://gyazo.com/c5af7c9f4b5b6c3e1a5a9d9b7fb62755.png

Ivan Koz05:05:44

also any ideas how to set *print-namespace-maps* to false via lein

cfleming05:05:06

@nxtk You mean the :welcome thing?

cfleming05:05:14

I’m not sure about that, AFAIK it should work.

cfleming05:05:37

Cursive does some magic starting the REPL though, so there may be a problem there.

Ivan Koz05:05:26

check also if you can set print-namespace-maps to false, maybe related

Ivan Koz05:05:47

i tried repl init and set globals in project.clj no success

cfleming05:05:57

That one is https://github.com/cursive-ide/cursive/issues/1541, it wasn’t possible previously but may be in the recent versions of nREPL.

Ivan Koz05:05:39

yeah it works in nrepl 6.0 if i bind or set! manually from running repl

cfleming05:05:42

I don’t see any movement on the old JIRA issue: https://dev.clojure.org/jira/browse/NREPL-55, but there may be a new issue on the new github repo.

Ivan Koz05:05:48

but i can't configure it to apply automatically for some reason

Ivan Koz05:05:12

@cfleming but they fixed it already aren't they?

Ivan Koz06:05:44

see repl :init and :global-vars, i'm new to clojure maybe i'm doing it wrong?

cfleming08:05:32

@nxtk I don’t know sorry, I haven’t had time to read through all that yet.

p-himik10:05:40

Is it possible to load scratch files in REPL?

p-himik10:05:50

Or rather, is it possible to make it possible?

p-himik10:05:35

Also, it would be nice if Cursive resolved symbols within scratch files.

flowthing17:05:07

I think they do, you might need to (in-ns ‘my.ns) or use fully qualified symbols, though.

flowthing17:05:41

Another option is to add scratch.clj in your global .gitignore file and add a file by that name for each project.

p-himik17:05:29

Nope, in-ns didn't work. And adding a single file somewhat defeats the purpose since when I use regular scratch files, I can create as many as I want and they're shared between projects.

flowthing17:05:42

Weird. I’m fairly sure that has worked for me. I’ll check when I get in front of my laptop.

flowthing17:05:42

Yeah, it definitely works for me — although not for the user namespace, for some weird reason.

p-himik18:05:55

Ha! That was the namespace that I tried! 😄

p-himik18:05:03

OK, am confused. Could you please send me a small snippet that works for you? Because when I replace user with something else, even require and use stop being recognized.

flowthing18:05:30

I have:

(ns 
  (:require [integrant.core :as ig]
            [ :as io]))


(def config
  (ig/read-string (slurp (io/resource "config.edn"))))


(ig/load-namespaces config)
And then, in the scratch file (not buffer, just a sanity check):
(in-ns ')

(println config)
And that works fine and everything is resolved.

p-himik18:05:14

Thanks! Specifying an ns that I've already defined somewhere definitely works better for me. However, half of items in require and use are still not resolved for some reason. Maybe it has something to do with what the original ns requires and uses.

flowthing18:05:42

Right, that makes sense.

p-himik18:05:08

Yep, looks like it. So I guess Cursive doesn't parse (require) and (use). @cfleming Is my guess correct?

cfleming22:05:23

No, Cursive does parse require and use.

cfleming22:05:50

This is a pretty odd use case though so I’m willing to believe there are problems 🙂

cfleming10:05:18

@p-himik I’m not sure. Scratch files are weird internally, and it’s possible things won’t work with them. I have a mental to-do to look at them, but haven’t got to it yet.

p-himik11:05:32

I see. So the intended workflow with "Load file in REPL" is to create a file within the project? Or are there any other options? The phrase "scope for the module used to start the REPL" is a bit confusing.

cfleming22:05:55

Right, “Load file in REPL” was thought of as loading one of your standard source files into the REPL.

cfleming22:05:13

That predated scratch files entirely, but is also standard for lisp editors.

wilkerlucio16:05:04

@cfleming I'm still having the problem with the intellij losing referneces, just happened now, how can I take the logs to send to you?