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

Finer-grained opt-in to overlays #3522

Closed
daveliepmann opened this issue Oct 15, 2023 · 3 comments · Fixed by #3524
Closed

Finer-grained opt-in to overlays #3522

daveliepmann opened this issue Oct 15, 2023 · 3 comments · Fixed by #3524

Comments

@daveliepmann
Copy link
Contributor

daveliepmann commented Oct 15, 2023

I'm thankful for CIDER 1.8.0's improved use of Clojure 1.10+ error reporting features. One way I'd like to leverage this change is to get short/non-stacktrace error messages as an overlay, without changing the behavior of 1. stacktrace/*cider-error*-opening errors or 2. normal evaluation.

That is, my dream scenario is:

  1. successful/uneventful form evaluation, e.g. (range 100) --> no overlay, see result in minibuffer
  2. early-phase error (reading, macroexpansion, compilation), e.g. :::5 or (def 5) --> error overlay
  3. late-phase error, e.g. (throw (ex-info "boom" {:a "a"})) --> open *cider-error* with stacktrace, no overlay

Because cider-use-overlays is coarse-grained, it seems 1 and 2 are currently incompatible. Would it be possible to get more fine-grained config here?

Cheers and thanks

(relevant clojurians thread)

@vemv
Copy link
Member

vemv commented Oct 15, 2023

Thanks!

It seems feasible. defcustom cider-use-overlays currently accepts 'both, t, or nil.

We could add a errors-only option, which would be like t. Errors show in the repl in all cases, so we don't need both-errors-only, t-errors-only, etc.

@daveliepmann
Copy link
Contributor Author

daveliepmann commented Oct 15, 2023

Cool!

Errors show in the repl in all cases, so we don't need both-errors-only, t-errors-only, etc.

This doesn't matter to me because I don't mind if situation 2 (early-phase errors) shows a message in both minibuffer and the overlay (with the latter color-coded as an error), but I can't speak to the preferences of others. As long as 1, 2, and 3 are separately configurable I'm satisfied.

@vemv
Copy link
Member

vemv commented Oct 15, 2023

We have #3524 in transit, feel free to chime in

vemv added a commit that referenced this issue Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants