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

Option to not print Value for Spec assertion failures #2604

Closed
mjmeintjes opened this issue Mar 13, 2019 · 4 comments
Closed

Option to not print Value for Spec assertion failures #2604

mjmeintjes opened this issue Mar 13, 2019 · 4 comments

Comments

@mjmeintjes
Copy link

mjmeintjes commented Mar 13, 2019

Is your feature request related to a problem? Please describe.

I'm working with a big data structure, and when I have a spec assertion failure it hangs emacs and cider.

I'm assuming that it is because of the Value: section of the cider-error buffer that is way to large.

Describe the solution you'd like

Have an option to not print the Value section of the Spec assertion failed cider-error buffer, or hide the value row so that it is not printed, or limit it.

Or, make it work with the configured print-fn.

Describe alternatives you've considered

  • I've tried setting nrepl.middleware.print/print-fn to a custom fn, but it does not seem to have any effect on the stacktrace window.
  • I've tried setting nrepl.middleware.caugh/caught-fn to a custom fn, but it does not seem to have any effect on the stacktrace window.
  • Setting cider-show-error-buffer to nil solves the problem, but it means I dont get the cider error buffer anymore. This is what I'm currently doing.

Additional context
cider-version - CIDER 0.22.0snapshot

  (require '[clojure.spec.alpha :as s])
  (set! *print-length* 10)
  (s/check-asserts true)
  (s/assert int? (range 10000))

gives

cider-error buffer:

1. Unhandled clojure.lang.ExceptionInfo
   Spec assertion failed.

         Spec: #function[clojure.core/int?]
        Value: (0
                1
                2
                3
                4
                5
                6
....
                9999)

     Problems: 

         failed: int?

In the repl the following is printed:

(0 1 2 3 4 5 6 7 8 9 ...) - failed: int?

When I increase range to 1000000 it just hangs emacs.

@stale
Copy link

stale bot commented May 8, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!

@stale stale bot added the stale label May 8, 2019
@stale stale bot removed the stale label May 12, 2019
@bbatsov
Copy link
Member

bbatsov commented May 12, 2019

This seems related to clojure-emacs/cider-nrepl#609 I think it needs to be addressed in the stacktrace middleware, as we originally didn't account for such data appearing in the stackframes. //cc @cichli @jeffvalk

@stale
Copy link

stale bot commented Aug 10, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!

@stale stale bot added the stale label Aug 10, 2019
@stale
Copy link

stale bot commented Sep 9, 2019

This issues been automatically closed due to lack of activity. Feel free to re-open it if you ever come back to it.

@stale stale bot closed this as completed Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants