Clojure REPL > Remote > Use Leiningen Port does nothing

581 views
Skip to first unread message

Dennis Schridde

unread,
Aug 18, 2017, 2:28:51 PM8/18/17
to cur...@googlegroups.com
Hi!

I am trying to setup a connection to a remote REPL in Cursive, but nothing
happens when I try to connect. I assume this is a bug in Cursive.

1. In the top right corner of the IntelliJ IDEA window, select "Edit
Configurations"
2. Click the green plus
3. Select "Clojure REPL" > "Remote"
4. Select "Use Leiningen Port"
5. Click "OK"
6. In the top right corner of the IntelliJ IDEA window, make sure to select
the new configuration and then click the green start button to "Run selected
configuration"
7. See that nothing happens; not even an error message or warning is shown

Instead I would expect the REPL-pane to pop up on the right side of the
window, or an error message to appear in the Event Log of the IDE.

In project.clj, I have the following options set (excerpt):

:ring {:nrepl {:start? true
:port 9998}}
:repl-options {:port 9998}

When I run `lein repl :connect` on the command line, the REPL is shown,
without an error messages or warnings:

# lein repl :connect
Connecting to nREPL at 127.0.0.1:9998
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.8.0
...

When I enter the hostname and port manually (i.e. select "Connect to server"
instead of "Use Leiningen REPL"), I do see the REPL-pane popping up on the
right side of the IDE window. I can then enter commands there and get a
reply.

Versions:
* Cursive: 1.6.1-2017.2
* JetBrains IntelliJ IDEA: 2017.2.2

If you need any additional information, please do not hesitate to ask.

--Dennis
signature.asc

Daniel Compton

unread,
Aug 21, 2017, 5:57:13 PM8/21/17
to cur...@googlegroups.com
Hi Dennis

From my understanding, Cursive picks up the port to use by looking for a ".nrepl-port" file. Is that present when you're trying to connect? Also, another thing that has caught me a few times is in a multi-module project, trying to connect to the wrong project.

Hope that helps, though I'm not sure if that's the issue.

--
Daniel.

--
You received this message because you are subscribed to the Google Groups "Cursive" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cursive+u...@googlegroups.com.
To post to this group, send email to cur...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cursive/751565999.Ln277GbReZ%40c07060.
For more options, visit https://groups.google.com/d/optout.

Colin Fleming

unread,
Aug 21, 2017, 6:01:43 PM8/21/17
to cur...@googlegroups.com

Hi Dennis,

Daniel is right that Cursive will determine the port from the .nrepl-port file. I suspect that the issue might be that lein doesn’t write that file out if you manually specify the port as you are doing, it’s possible that it’s only written when lein binds its server socket and receives an arbitrary port.

Let me know if that is in fact the issue, I’ll make sure that Cursive shows an error if that’s the case.

Cheers,
Colin

Dennis Schridde

unread,
Aug 22, 2017, 5:51:32 AM8/22/17
to cur...@googlegroups.com, Colin Fleming
Hi!

On Dienstag, 22. August 2017 00:01:08 CEST Colin Fleming wrote:
> Daniel is right that Cursive will determine the port from the .nrepl-port
> file. I suspect that the issue might be that lein doesn’t write that file
> out if you manually specify the port as you are doing, it’s possible that
> it’s only written when lein binds its server socket and receives an
> arbitrary port.
>
> Let me know if that is in fact the issue, I’ll make sure that Cursive shows
> an error if that’s the case.

Indeed, there is no .nrepl-port file in the project folder.

Would it be possible to parse the port from [:nrepl-options :port] in
project.clj, if .nrepl-port is missing?

--Dennis
signature.asc

Dennis Schridde

unread,
Aug 28, 2017, 11:18:21 AM8/28/17
to cur...@googlegroups.com, Colin Fleming
Hi Colin!
Have you had a chance to look into this?

--Dennis
signature.asc
Reply all
Reply to author
Forward
0 new messages