tpope / vim-fireplace

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

Jumping to definition in jar files breaks with certain version characters. #217

Closed dubiousdavid closed 9 years ago

dubiousdavid commented 9 years ago

So I have the following as a repl profile dependency in my lein profiles: [com.roomkey/example "0.4.0+repl"]. If I attempt to [<C-D> to a file that is not in my current project (e.g., a function in clojure.core), I get the following error:

Error detected while processing function <SNR>27_Edit..fireplace#source..fireplace#findresource..fireplace#jar_contents:
line   13:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 752, in __init__
    self.fp = open(file, modeDict[mode])
IOError: [Errno 2] No such file or directory: '/Users/davidsargeant/.m2/repository/com/roomkey/example/0.4.0 repl/example-0.4
.0 repl.jar'

If I comment out the dependency mentioned above, all is well. While the '+' is unusual, it is also valid for a version number.

tpope commented 9 years ago

Can you start by checking :echo join(fireplace#path(), "\n") and see if the jar file has the correct filename, that is + and not a space?

dubiousdavid commented 9 years ago

Just ran that command. Looks like it's a space a not a +:

/Users/davidsargeant/.m2/repository/com/roomkey/example/0.4.0 repl/example-0.4.0 repl.jar

tpope commented 9 years ago

Check lein classpath and (System/getenv "java.class.path") and see if the problem exists there.

Also, do you have cider-nrepl installed? Whatever your answer, try the opposite.

dubiousdavid commented 9 years ago

lein classpath looks correct. (System/getenv "java.class.path") returns nil in the repl. I do have cider-nrepl installed. Eliding that plugin in my lein profile made the problem go away.

tpope commented 9 years ago

Oops I meant System/getProperty but it's moot. Sounds like a cider-nrepl issue. Confirm with :echo fireplace#message({'op': 'classpath'}). Make sure you are on the latest cider-nrepl version, and if the problem persists, open an issue there.

dubiousdavid commented 9 years ago

I'm seeing '/Users/davidsargeant/.m2/repository/com/roomkey/example/0.4.0 repl/example-0.4.0 repl.jar' when running the command above. Using [cider/cider-nrepl "0.8.2"].

tpope commented 9 years ago

That's directly from cider-nrepl, so open an issue there, yeah.

dubiousdavid commented 9 years ago

Sounds good. Thanks for your help.