Fork me on GitHub
#cursive
<
2020-11-12
>
saitouena08:11:02

Is there any way to rename ns a.b to a.c.b ? I could rename a.b to a.c with M-x refactor-this + Rename but I couldn't do it for the above case. I think cursive currently cannot do it if it moves over directories. Is that correct?

cfleming08:11:37

That’s correct right now, but this will be possible soon.

❤️ 3
👍 3
saitouena08:11:01

I appreciate it so much! 👍 I'm looking forward to it. It would make it easier to refactor project structure.

cfleming08:11:52

Yes, no doubt!

folcon16:11:34

I've been trying to get nrepl working inside wsl2 for a while now and I'm not having much luck, has anyone else being trying this? Specifically running intellij in windows and trying to connect the remote repl to an nrepl instance via shadow-cljs running within wsl2. All of my ports appear to be open, but for some reason nrepl refuses connections. Does it not accept any external connections by default or something? I can definitely connect to it within wsl2 and I can connect to other running parts of shadow-cljs.

tanzoniteblack17:11:31

what host are you using? localhost or the explicit IP address of the WSL2 instance?

tanzoniteblack17:11:10

I have no idea if that's relevant or not, but random things like that do trip me up sometimes with wsl2 interop

tanzoniteblack17:11:58

I also use windows+wsl2 for development. But, I just run intellij from wsl2 directly, using x410 as an x server on the windows side

folcon17:11:47

I've tried both, as well as using ssh to do port forwarding, it's surprisingly opaque.

folcon17:11:34

Hmm, does that end up working well? I'm a little concerned about whether that's going to cause odd quirks like file system slowdowns or keyboard shortcut issues?

tanzoniteblack17:11:05

https://nrepl.org/nrepl/usage/clients.html

clj -Sdeps '{:deps {nrepl {:mvn/version "0.8.3"}}}' -m nrepl.cmdline --connect --host host --port port
are you able to connect directly from powershell?

tanzoniteblack17:11:31

and it works well for me. I use intellij professionally for kotlin / javascript / clojure & do all of it directly in wsl2

tanzoniteblack17:11:39

I haven't had any issues related to file system slowdowns as long as your code is also in the wsl2 disk. the file system speed issues only exist when accessing files from windows instead of the local partition

tanzoniteblack17:11:33

no issues with keyboard shortcuts, but x410 does stick to the keyboard layout that you started it with. So if you switch between different windows keyboards (like I do with Russian & Chinese), they don't work directly in the intellij window.

tanzoniteblack17:11:03

only other annoyance is x410 connections are done over tcp, and those connections don't survive shut downs or sleep. So you have to close intellij before you turn off your computer

tanzoniteblack17:11:31

the windows team is supposed to be releasing a native version of handling gui apps from wsl2 this year. I'm hopeful those will fix those issues for me 🙂

tanzoniteblack17:11:37

but they're all pretty minor for my workflow

folcon18:11:38

Hmm, that's pretty lucky. I'm assuming hibernating would also be an issue, which would be a problem for me. Sometimes leaving my code overnight and being able to just dive back in the morning is really helpful 😃...

folcon18:11:20

I've been testing with:

lein repl :connect 127.0.0.1:8777
Which I assume is similar? It certainly works within the wsl bash shell...

folcon18:11:39

Trying it from powershell isn't great however

tanzoniteblack18:11:06

yeah, hibernating also has the same issues

tanzoniteblack18:11:24

in order to debug if it's a "windows thing" or "cursive/java thing", you'll probably need to be able to test it from powershell

folcon18:11:58

The interesting thing is if I remove the entries in netsh portproxy then the response changes: with: netsh interface portproxy add v4tov4 listenport=8777 listenaddress=0.0.0.0 connectport=8777 connectaddress=172.18.255.20

lein repl :connect 0.0.0.0:8777
Connecting to nREPL at 0.0.0.0:8777
SocketException Connection reset
        java.net.SocketInputStream.read (:-1)
        java.net.SocketInputStream.read (:-1)
        java.io.BufferedInputStream.fill (:-1)
        java.io.BufferedInputStream.read (:-1)
        java.io.FilterInputStream.read (:-1)
        java.io.PushbackInputStream.read (:-1)
        bencode.core/read-byte (core.clj:87)
        bencode.core/read-byte (core.clj:-1)
        bencode.core/read-token (core.clj:239)
        bencode.core/read-token (core.clj:237)
        bencode.core/read-bencode (core.clj:257)
        bencode.core/read-bencode (core.clj:254)
Bye for now!
without:
lein repl :connect 0.0.0.0:8777
Connecting to nREPL at 0.0.0.0:8777
ConnectException Connection refused: connect
        java.net.DualStackPlainSocketImpl.connect0 (:-2)
        java.net.DualStackPlainSocketImpl.socketConnect (:-1)
        java.net.AbstractPlainSocketImpl.doConnect (:-1)
        java.net.AbstractPlainSocketImpl.connectToAddress (:-1)
        java.net.AbstractPlainSocketImpl.connect (:-1)
        java.net.PlainSocketImpl.connect (:-1)
        java.net.SocksSocketImpl.connect (:-1)
        java.net.Socket.connect (:-1)
        java.net.Socket.connect (:-1)
        java.net.Socket.<init> (:-1)
        java.net.Socket.<init> (:-1)
        nrepl.core/connect (core.clj:178)
Bye for now!
So it's connecting to something?

tanzoniteblack18:11:55

try connecting to the actual IP address of the wsl2 virtual machine. you can get that by running ip addr in the wsl2 terminal & pulling the value for eth0

folcon18:11:54

Nope, then you just get the connection refused, which makes sense as there's no open port on that IP address I think? Actually, I wonder if this is windows firewall being clever

folcon18:11:38

Nope that's not it either

tanzoniteblack18:11:55

no more ideas. Sorry

folcon18:11:53

Thanks for the help anyway 😃

folcon19:11:19

Finally figured it out I think? Well sort of, I can connect to it via ssh if I use an alternative port via:

ssh -L 8778:localhost:8777 [email protected]
So I guess that's one way of doing it >_<...