Fork me on GitHub

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?


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


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


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


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


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


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


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


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 "" :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 - 
Clojure 1.10.1
Loading src/repl.clj... 
"Elapsed time: 248.690089 msecs"
"Elapsed time: 327.614331 msecs"
"Elapsed time: 412.424682 msecs"
No nREPL ack received
Connecting to local nREPL server...

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


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...


@onetom Definitely not intentional.


Could you file an issue for that one?


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


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


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


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


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.


just left at their default values, I mean.


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?


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


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


Should be straightforward to just run it.


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.


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


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.


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


yeah that is working


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


Sorry, SDK, not JDK


this looks promising. think that might be it. :crossed_fingers:


ahhhh yeah


great success


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.


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


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


Cool, glad you got it worked out.


@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.


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


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


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"


Oh that's much better


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 is more general. We only ever keep our tests in the test directory so it'd be nice to have that default stick around.


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.


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


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?


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


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


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?


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