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

Evaluating code when piggiebacked onto figwheel throws FileNotFoundException #340

Closed dhleong closed 5 years ago

dhleong commented 5 years ago

Possibly related to #303, here's the exact error:

Execution error (FileNotFoundException) at cljs.user/eval148739$loading (form-init170088223683418274.clj:1).
Could not locate wish/sheets__init.class, wish/sheets.clj or wish/sheets.cljc on classpath.    

Since mine doesn't even seem to be looking for cljs files, I raised a separate issue. The same project setup had been working fine, so I used git bisect and found that 85515224261ccaa5894d1865d14b387d09368aed seems to be the first commit that broke things for me. After some digging, it looks like this line is the problem:

  let msg = extend({'session': get(self, 'id')}, a:msg, 'keep')

In my case when executing the code, in some cases self.id is not set, but the a:msg.session is; 'keep' is causing the provided session ID to get lost. I think the correct value for the third param is 'force', so that any provided session ID overwrites the current session ID. It could also be a bug that self.id is not set in some case, but I haven't tried to figure that out.

If changing 'keep' to 'force' seems like the right move, I'm happy to provide a PR.

tpope commented 5 years ago

You're right, there's a kink in the logic there, which I just pushed a fix for. I don't understand how id could be nil though, without session also being nil and the error condition above triggering. I'm also pushing a change to tighten the logic there but it's a shot in the dark. Please report back on whether or not things are working as intended.

dhleong commented 5 years ago

I'm not sure what it is, but it looks like b3e055a broke connecting to the repl. Just using :Connect <port> results in this error:

Error detected while processing function <SNR>135_Connect[19]..<SNR>135_register[1]..<SNR>163_transport_clone[1]..fireplace#session#for[7]..<SNR>164_session_me
ssage:
line    2:
E605: Exception not caught: Fireplace: session closed   
tpope commented 5 years ago

Dang it, I didn't actually disconnect when testing. Try now.

On Sun, Jun 30, 2019 at 4:39 PM Daniel Leong notifications@github.com wrote:

I'm not sure what it is, but it looks like b3e055a broke connecting to the repl. Just using :Connect results in this error:

Error detected while processing function 135_Connect[19]..135_register[1]..163_transport_clone[1]..fireplace#session#for[7]..164_session_me ssage: line 2: E605: Exception not caught: Fireplace: session closed

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

dhleong commented 5 years ago

That fixed it—thanks!