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

Smart JShell reply formatter #1177

Open
Alathreon opened this issue Oct 3, 2024 · 0 comments
Open

Smart JShell reply formatter #1177

Alathreon opened this issue Oct 3, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Alathreon
Copy link
Contributor

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:
image
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.
@Alathreon Alathreon added the enhancement New feature or request label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant