Open
Description
Is your feature request related to a problem? Please describe.
When using JShell, the result is very complete, maybe a bit too complete, it has a lot of detail and boilerplate that is useless most of the time.
It would be better to simplify it with a smart formatter, which cherry pick only the information the user wants.
As an example, see this:
Only the 4, and maybe the original code, 2+2 is useful. The rest isn't needed. But the rest takes 80% of the place. It's even worse with more code.
Note that wether or not the prompt should be dislayed the is outside of the scope of this issue.
Describe the solution you'd like
- There will be a new smart formatter that will cherry pick the information the user want.
- This smart formatter will be used by default, the original formatter will be available with an optional flag
Specs
In order:
-
- If there is any kind of error, display it, otherwise don't even display error section
-
-
- If the error is too big, cut it.
-
-
- If there is something printed, display it, otherwise don't even display print section.
-
-
- If the print is too big (it shouldn't since the print can't be more than 2k chars right know, but in the future, we might allow this), display that it is a print in the embed, but display the raw print with nothing else in the gist.
-
-
- If there is one snippet result, there is not error and no print, display the result of the expression, otherwise don't even display result section
-
-
- If the result is too big, display that it is a result in the embed, but display the raw result with nothing else in the gist.
-
-
- If all 3 are false, just display "Eval successful and nothing to display."
Describe alternatives you've considered
- Do nothing and keep it like it is.
- Create a smart formatter, but disable it by default, instead of enabling it by default.