eraserhd / rep

A single-shot nREPL client designed for shell invocation
Eclipse Public License 1.0
94 stars 8 forks source link

Kakoune integration silently fails if detected namespace is not required #9

Closed adrusi closed 3 years ago

adrusi commented 3 years ago

rep silently does nothing if passed --namespace=X where X has not been required. I'm not sure what the appropriate fix here is, but possibly silently sending a require invocation to the repl server in rep-find-namespace or maybe clojure.core/load instead.

eraserhd commented 3 years ago

This is an interesting question. I'm not sure I like what could be a surprise of rep requiring the namespace, especially conditionally. vim-fireplace just evaluates the namespace form, which seems less destructive. On the other hand, looking at how emacs integration works, where the maximum flexibility means that the user has to do many small things while hold a bunch of state in their heads....

I guess I'm saying I'm not sure what to do about this.

In Kakoune, the current workaround is to first do ,ef, which is like emacs' evaluate-buffer that users need to do before working with the code in it.

adrusi commented 3 years ago

Is there a way to get rep to report a descriptive error when attempting to eval in a non-loaded namespace? Something to the effect of reminding the user to eval the namespace (and maybe adding a command to eval the namespace form without passing --namespace to rep). I don't know what kind of feedback the nrepl server gives when this type of failure happens.

On Fri, Apr 30, 2021, 11:52 Jason Felice @.***> wrote:

This is an interesting question. I'm not sure I like what could be a surprise of rep requiring the namespace, especially conditionally. vim-fireplace just evaluates the namespace form, which seems less destructive. On the other hand, looking at how emacs integration works, where the maximum flexibility means that the user has to do many small things while hold a bunch of state in their heads....

I guess I'm saying I'm not sure what to do about this.

In Kakoune, the current workaround is to first do ,ef, which is like emacs' evaluate-buffer that users need to do before working with the code in it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/eraserhd/rep/issues/9#issuecomment-830190080, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABMYDNY5QW5TPE5OSKGDXTTLLG3PANCNFSM434PGWAA .

eraserhd commented 3 years ago

Turns out this is reported differently from exceptions. I added a check and an error message.