Skip to content

Conversation

@tribals
Copy link

@tribals tribals commented Nov 13, 2022

Closes #68

@tribals tribals mentioned this pull request Nov 13, 2022
@tonsky
Copy link
Owner

tonsky commented Nov 16, 2022

Looks great! Can you make it so that relative paths would work as well as absolute ones when specifying socket path? Kind of like .nrepl-port is searched in all opened folders?

Also, status bar shows None now, it shouldn’t
Screenshot 2022-11-16 at 20 36 51

@tribals
Copy link
Author

tribals commented Nov 17, 2022

Can you make it so that relative paths would work as well as absolute ones when specifying socket path?

When you connect through TCP, you need to be precise about what you're connecting to. I think, this is useful semantic which we need to keep when connecting through UNIX domain sockets too. There is no "relative" IP-address:TCP-port.

Kind of like .nrepl-port is searched in all opened folders?

Personally I disagree with this style of configuration. If you want to save your users from typing too much, I think something like os.path.expanduser would be helpful, or even expanding common environment variables like $XDG_RUNTIME_DIR. As well as common "Sublime Dirs" like project location or so. The problem with "Sublime Dirs" is that it is not clear, which directory is "opened" at this time? But proper integration with REPL server depends on precise path. Or, REPL could not be able to load your sources.

Consider this Sublime project layout:

top-dir
`+ sub-project
`+ sub-project1

What if both sub-project and sub-project1 developed in Clojure? Both has .nrepl-port (which points to TCP socket port, or in case of unix domain sockets - absolute socket file path 😁 ). Which one try to connect to? This depends on context - in which directory you are right now? But, in Sublime, there is no such one. There is only "project directory" (top-dir in our case). Then, specifying relative path would connect to any of sub-project and sub-project1 servers. It is better to provide some variable expansion instead. Then, you could specify socket as ~/work/foo/nrepl.sock, or {project_directory}/sub-project/nrepl.sock. Or, even $XDG_RUNTIME_DIR/nrepl.sock - I prefer to keep only one instance of nREPL server.

This is why you need to be precise when initiating client connection.

@tonsky
Copy link
Owner

tonsky commented Nov 21, 2022

Thanks! Merged in 2df3bb2

@tonsky tonsky closed this Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Filesystem socket support

2 participants