Fork me on GitHub
#cursive
<
2019-10-17
>
sooheon03:10:01

Sometimes, Switch NS to Current File does not seem to work. The REPL tab name changes, but the in-ns form isn’t evaluated, and ns shows I’m still on the old ns. It’s sporadic, and seems to happen most often immediately after starting a fresh REPL. Will some kind of log be helpful in finding this?

cfleming05:10:37

@sooheon.k What sort of REPL are you running?

sooheon18:10:20

Just the regular nrepl, run with deps and with test and dev aliases enabled.

emilaasa07:10:29

Thanks for making this! Works very well out of the box now I have to say.

cfleming07:10:40

@emilaasa Thanks, I’m glad it’s working well for you!

scarytom07:10:00

@cfleming is there any way to suppress it with a comment in the file?

cfleming07:10:28

Sadly, no, but there should be, I think there’s an issue about that.

cfleming07:10:51

Let me take a look, I’ll see if that’s easy to implement.

👍 4
onetom08:10:49

the Close REPL Tab doesn't seem to kill the Local nREPL process; is that intentional? i usually use that Close REPL Tab feature, because I have some run-away printing happening. the problem with not killing the process is that when i try to start a new repl, it will report a port binding error:

Syntax error (BindException) compiling at (/private/var/folders/q8/g95tg5x9659bq26pbclr9zyc0000gn/T/form-init11281550920119201408.clj:1:1).
Address already in use (Bind failed)
(because i've started using .nrepl.edn with content {:bind "0.0.0.0" :port 5555}) if i manually kill one of the 2 java processes i usually see in activity monitor, then i can start a new local nREPL, BUT after a few seconds it gets disconnected by a No nREPL ack received message:
Starting nREPL server...
"/Applications/IntelliJ IDEA 2019.3 "...
Connecting to local nREPL server...
ack'ing my port 5555 to other server running on port 51804 nil
nREPL server started on port 5555 on host 0.0.0.0 - 
Clojure 1.10.1
Loading src/repl.clj... 
"Elapsed time: 248.690089 msecs"
"Elapsed time: 327.614331 msecs"
"Elapsed time: 412.424682 msecs"
Loaded
No nREPL ack received
Connecting to local nREPL server...

Process finished with exit code 137 (interrupted by signal 9: SIGKILL)

onetom08:10:48

that Loading src/repl.clj... is the result of me pressing Cmd-Shift-L in repl.clj, so the newly started repl seems to work for awhile...

cfleming08:10:22

@onetom Definitely not intentional.

cfleming08:10:29

Could you file an issue for that one?

👍 4
kwladyka10:10:28

BTW Can cursive work with event variable used in this way in ClojureScript? It is valid and works.

ssdev16:10:20

Hi folks, forgive me, I'm an extreme noob to both cursive and clojure. I'm having trouble running a local repl in cursive. For some reason every time I hit start I get the error "Error running 'test': '12' is bad configured". I'm just using the defaults when creating the repl, choosing nREPL and "Run with Leiningen" Am I missing anything? I can connect to a remote repl, but wanted to run a local one in my project

manutter5116:10:51

Is your project named “test”? That might be a bad name to use.

ssdev16:10:43

That's the name of the repl config. I just tried another one with a different name of "Local Repl" and same results

manutter5117:10:52

Oh, ok. Hmm. Here’s what I have set up for my local REPL. “Which type of REPL to run” - nREPL, “How to run it?” In my case Run with Deps, aliases :local, :nrepl. “Common options” set to default.

manutter5117:10:06

just left at their default values, I mean.

ssdev17:10:59

hrmm. I can't choose run with deps, as it's disabled. This project is a leiningen scaffold. I'm wondering if I'm missing another step. What does the 'profiles' box do?

manutter5117:10:23

Ok, let me switch to a leiningen project, just a sec

manutter5117:10:47

Ok, Which type of REPL: nREPL, How to run it: Run with Leiningen, profiles is blank. Common options left at defaults

manutter5117:10:03

Should be straightforward to just run it.

manutter5117:10:44

The “Profiles” field is a reference to Leiningen profiles — you can have separate “profiles” for building a dev version of your app, a test version, and a production version, etc.

ssdev17:10:57

Yeah that's what I have... wondering if there's some path somewhere that maybe got messed up. I did change my jvm not too long ago, I wonder if intellij didn't pick up that change

manutter5117:10:52

Are you able to run your project from the command line? Run a REPL I mean. That would rule out typos in the project.clj file.

manutter5117:10:08

Or confirm them, if you type lein repl and get the same error.

ssdev17:10:48

yeah that is working

manutter5117:10:28

Ok, I’d next check Project Structure under the File menu and look at the JDK settings

manutter5117:10:55

Sorry, SDK, not JDK

ssdev17:10:30

this looks promising. think that might be it. 🤞

ssdev17:10:43

ahhhh yeah

ssdev17:10:45

great success

manutter5117:10:52

If you’ve recently upgraded to Java 12, you might want to consider having Java 8 around to use with Clojure until you get everything up and running — some of the older beginner material for Clojure isn’t ready for Java 9 and up yet.

ssdev17:10:00

Thank you sir! I was looking all over for that setting

ssdev17:10:42

yeah I had actually switched from 12 to 8 after installing intellij, it apparently did not pick that up

manutter5117:10:58

Cool, glad you got it worked out.

cfleming21:10:41

@ssanders My apologies, that is the worst error message ever. It comes from IntelliJ, I’ve been meaning to catch it and replace it with something that actually indicates where to look.

ssdev21:10:23

ha. No worries. I just realized that "12" was in reference to the jvm, so there was I guess a bit of a clue 🙂

cfleming21:10:26

It makes it sound like there is something fundamentally wrong with the integers.

😆 8
cfleming21:10:37

Ok, I think I’ve caught all places that might be thrown, the message is now: "The JDK for this module is misconfigured, check it under File | Project Structure"

ssdev21:10:11

Oh that's much better

cfleming22:10:57

Quick poll for Deps users: currently Deps provides no good way to identify which source roots should be marked as test roots. What Cursive does currently is to mark any source roots in the built-in ‘test’ alias as test roots, and all others as source roots. This isn’t very flexible. Which solution would you prefer? 1. Allow you to manually mark source roots as test roots, and for Cursive to leave them that way when syncing (most flexible, possibly annoying in large projects). 2. Allow you to specify which aliases should have their source roots marked as test roots (probably more repeatable).

1️⃣ 20
kenny22:10:19

1 is more general. We only ever keep our tests in the test directory so it'd be nice to have that default stick around.

👍 8
cfleming00:10:15

There is one problem with this though, now that I think about it. That marking as a test root won’t be shared across teams unless you’re checking module files in, which is usually not recommended.

wilkerlucio20:10:10

I like option 2, thinking about teams using it, having only local will require every member to remember

wilkerlucio20:10:35

maybe we could have a key like :cursive/test-paths in the deps config, to set which paths should be considered test paths, what you think?

cfleming21:10:54

@U066U8JQJ I seem to recall @U064X3EF3 saying custom keys in deps.edn were discouraged.

Alex Miller (Clojure team)21:10:10

we are automatically merging multiple deps.edn files there is no way to say how custom keys are combined right now, so I would encourage you to use a different mechanism

wilkerlucio21:10:55

I though about it considering the "open world" nature of maps that Clojure encourages, I mean, if you merge, that's probably something you can ignore in this case, but I guess in this case wouldn't matter, makes sense?

wilkerlucio21:10:17

even using very specific keys (qualified), you think its a problem?