Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn the user if there's no way to eval a s-exp within cider-scratch buffer #3028

Open
Ivanknmk opened this issue Jul 25, 2021 · 3 comments
Open
Labels
enhancement good first issue A simple tasks suitable for first-time contributors

Comments

@Ivanknmk
Copy link

Ivanknmk commented Jul 25, 2021

Disclaimer: I'm a noob and didn't know having a nREPL server running was a requirement to eval a sexp inside a cider scratchpad. Feel free to ignore if this isn't relevant or if it is emacs related.

Is your feature request related to a problem? Please describe.
I was trying to eval a sexp within a cider-scratch buffer but it didn't work. I checked the open buffers for erros, and saw nothing. Somehow, I discovered that I had to have a nREPL server running to be able to eval. This is probably a n00b fail but thought it wouldn't hurt to suggest a small tweak to it.

Describe the solution you'd like
Log a message, show a warning, warn the user somehow that a nREPL instance needs to be running as a requirement to be able to eval something inside a cider scratchpad.

Describe alternatives you've considered
None... I don't have enough knowledge to actually propose a concrete suggestion or fix.

Additional context
Nothing happens when SPC m e e is entered. Note: SPC m e e triggers cider-eval-last-sexp.

Screen Shot 2021-07-25 at 11 15 06

@bbatsov
Copy link
Member

bbatsov commented Aug 6, 2021

That's weird, I thought all evaluation commands were showing error messages if CIDER is not connected to nREPL. I'll take a look.

@bbatsov bbatsov added the good first issue A simple tasks suitable for first-time contributors label Aug 6, 2021
@yuhan0
Copy link
Contributor

yuhan0 commented Apr 30, 2022

I believe this might have been a regression brought by the change to cider-map-repls in #2558.
Currently all cider-eval-* commands fail silently when there is no REPL connected, because cider-map-repls is called interactively with a hardcoded :auto arg

(cider-map-repls :auto

which passes ensure = nil in the call to cider-repls, disabling the check and error messages when no REPLs are present.
(:auto nil)

I don't quite understand the change in that PR, maybe it was an overcorrection that caused the check to be always disabled instead of that specific case of loading multiple clj(s/c) files.

@bbatsov
Copy link
Member

bbatsov commented Apr 30, 2022

Yeah, that's definitely a regression that we'll need to address.

@vemv vemv pinned this issue Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement good first issue A simple tasks suitable for first-time contributors
Projects
None yet
Development

No branches or pull requests

3 participants