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

Add stacktrace navigator for clojure.spec/asserts #2082

Merged
merged 4 commits into from
Oct 1, 2017

Conversation

vspinu
Copy link
Contributor

@vspinu vspinu commented Aug 26, 2017

clojure.spec/asserts are hard to read, especially in cider stacktrace browser. Adding specialized support for spec/asserts with the ability to toggle visibility of multi-line values.

spec-stacktrace

The visibility toggling is not fully integrated with the default cause-visibility-cycling in the stacktrace browser, mostly because the non-idiomatic usage of invisibility properties by cider-stacktrace.el. Instead of modifying buffer-invisibility-spec, as intended by emacs design, it modifies buffer text properties directly. I might rewrite that part some day but it's low priority. For now it's unlikely that anyone will be bothered by this.

Assuming that this will go into 0.16, so no doc entry as yet.

@@ -727,10 +726,53 @@ This associates text properties to enable filtering and source navigation."
(insert (propertize (format " at (%d:%d)" line column)
'font-lock-face message-face))))))

(defun cider-stacktrace--insert-keyed-value (indent key &rest args)
"Insert KEY and ARGS prefixed by INDENT."
(let ((str (when args
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation is wrong here.

What's keyed value? From the usages of this it seems you're just passing some labels as "keys".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the best name I could think of, but I hardly spend any time thinking about it. The idea is to be able to insert into the buffer a pair of objects - key and value. For example in the screenshot above in: is key and [:cljproj.core/email] is a value. If "value" is multi-line then all of those line should be indented.

In any case, will think of something better once I find time refresh on this.

@bbatsov bbatsov merged commit c60d1ae into clojure-emacs:master Oct 1, 2017
@vspinu vspinu deleted the spec-assert branch June 20, 2018 10:38
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 this pull request may close these issues.

2 participants