tpope / vim-fireplace

fireplace.vim: Clojure REPL support
https://www.vim.org/scripts/script.php?script_id=4978
1.74k stars 139 forks source link

Force all classpath entries to be absolute paths #327

Closed chopptimus closed 5 years ago

chopptimus commented 5 years ago

CLI tools adds relative paths to the classpath but fireplace#path is expecting absolute paths. This commit forces all classpath entries to be absolute.

tpope commented 5 years ago

This assumes the local and remote current working directories match but that isn't necessarily the case.

Is this happening with the cider nrepl middleware? I think it would probably be reasonable for the middleware to force the paths to absolute.

chopptimus commented 5 years ago

I am using the cider nrepl middleware, which is returning the java.class.path system property in the case of Java 9+ (I'm using 11). I'll check if the behaviour is any different with 8 tomorrow.

chopptimus commented 5 years ago

Looks like clojure.java.classpath returns absolute paths using a classloader for Java 8 but just returns the system property for Java 9+ without doing anything to relative paths. I think Lein forces all paths to be absolute anyway so it's not a problem there but that's not the case for CLI tools.