clojure-emacs/sayid

Pressing "g" cannot locate source file.

Opened this issue · 1 comments

Not sure what is broken, here. When I press in "g" during looking into function's trace it fails at the moment of finding proper file:

  • Emacs version 25.1.1
  • latest sayid from master branch

Here https://github.com/bpiel/sayid/blob/master/src/el/sayid.el#L777 I've got exception:
File not found: antonov/api/availability.clj

I tried to trace it in emacs (sayid-find-existing-file file) => ("clojure" "/private/var/folders/ty/q1nfz8qn24x_8p27fx7z14yr0000gp/T" "cider" "mranderson047")`

Looks wrong because project root is not existing here. Please help me trace and fix this exception.

p.s. Sayid probably can go thru existing opened file-buffers, and if filepath will match file requested - write expression there. Or even better solution open cider-scratch and writedown form there.
If you're fine with using cider-scratch I can implement it. thanks!

bpiel commented

Sayid doesn't know how to find a file if none of the files in the project path have been eval'd yet. I'm guessing that's what's going on here. It's a fundamental issue that I'm not sure how to get around.

I'm also guessing that this command mostly worked for you -- in that it probably def'd vars, generated an expression string and put it in the kill ring for you. The last step is to take you to the function's source, which failed.

If the function source can't be found, falling back to cider-scratch sounds like a reasonable default, although sayid should probably give some messaging about why it happened.

A PR to address any of the above would be great. If you submit one, I'll review as quickly as I can. thanks