Open meditans opened 2 years ago
Grepping https://github.com/clojure-emacs/cider and https://github.com/clojure-emacs/cider-nrepl, *file*
isn't bound anywhere (relevant to this issue).
*file*
certainly should be bound whenever code is (re)loaded. tools.namespace (and therefore cider-refresh
) implicitly does this (because it relies on clojure.core primitives).
Other tools like Eastwood explicitly have to bind *file*
- not too long ago I added this to fix a similar bug: https://github.com/jonase/eastwood/blob/5a55eff81aff75dbca94adfb7f18e956e52fcf55/src/eastwood/analyze_ns.clj#L427
So the task to be done is:
:file
metadata*file*
if such a piece of data is received.Correction, the code that loads file is located in a separate repo: https://github.com/nrepl/nrepl/blob/e1558d7b7e1c5b50187edb92282282b87bcba998/src/clojure/nrepl/middleware/load_file.clj
(it doesn't bind *file*
either)
Expected and Actual behavior
Consider this file in an appropriate project:
I would expect both
cider-eval-defun-at-point
over thesource
invocations, andcider-eval-buffer
to respond withfoo
's source. Instead I get:For reference,
cider-ns-refresh
correctly prints the source code. The initial conversation for this happened on slack, where @vemv pointed out that this has probably to do with the fact that*file*
is maybe unbound during such calls.I think
cider-eval-buffer
,cider-eval-defun-at-point
andcider-eval-file
should have the right bindings.CIDER version information