Honor content types for interactive evaluations#4071
Merged
Conversation
Rich results were REPL-prompt-only since 2018 (#2476): evaluating a form returning an image from a source buffer just printed the object. Interactive evals now opt in to content-typed responses, and the new cider-eval-rich-content-destination controls where rich results render: inline in the result overlay (the default), in the REPL (reusing its content-type handlers, buttons included), in the *cider-result* popup, or nil for the old plain-value behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second round of the rich-content revival, closing the gap plexus reported back in 2018 (#2476): content types were only requested for forms entered at the REPL prompt, so
C-x C-eon an image-returning form just printed the object.Interactive evals now opt in to content-typed responses, and the new
cider-eval-rich-content-destinationcontrols where rich results render:inline(default): images render right in the result overlay at point, like a regular eval result (and vanish the same way); non-renderable content falls back to its plain-text form.repl: exactly like rich results at the REPL prompt,[show content]buttons included.popup: the*cider-result*buffer, with fetch buttons for external references.nil: previous behavior.Handlers without an
:on-content-typeslot (eval-to-comment, pprint flows, third-party callbacks) are unaffected - the server keeps sending the plain value alongside.