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

Use new Orchard #869

Merged
merged 6 commits into from
May 1, 2024
Merged

Use new Orchard #869

merged 6 commits into from
May 1, 2024

Conversation

alexander-yakushev
Copy link
Member

@alexander-yakushev alexander-yakushev commented Apr 30, 2024

Update Orchard to the latest version. This gets all latest inspector updates and new orchard.print namespace.

  • Adapt inspector middleware to updated orchard.inspect

    • Fix tests
    • Remove deprecated calls
    • Handle nil inspector/empty config
    • Add middleware opts for new printing options
    • Fix some old bugs
  • Use new printing in cider debugger

  • You've added tests to cover your change(s)

  • You've updated the README

  • Middleware documentation is up to date

    • Please check out and modify the cider.nrepl ns which has all middleware documentation.
    • Run lein docs afterwards, and commit the results.

"inspect-next-page" next-page-reply
"inspect-prev-page" prev-page-reply
"inspect-set-page-size" set-page-size-reply
"inspect-set-max-atom-length" set-max-atom-length-reply
"inspect-set-max-value-length" set-max-value-length-reply
Copy link
Member

Choose a reason for hiding this comment

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

While we can keep this, it would be also much welcome to have an options map so that users can simply have a defcustom.

This way we have fewer calls / moving pieces.

Existing example:

https://github.com/clojure-emacs/cider/blob/1cd6ab7b7cb4a7e079a273600c4d28307c3aba40/cider-client.el#L315-L322

Copy link
Member Author

@alexander-yakushev alexander-yakushev Apr 30, 2024

Choose a reason for hiding this comment

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

I agree it feels excessive to be able to customize each of those separately on the fly. Being able to set it up in one place would be better. At the same time, I don't know if a single set of options will fit everything. For example, it feels like the debugger can use stricter limitations than inspector (because debugger shows values inline with the code and inspector has a dedicated buffer).

I also think that different options have different utility in being configurable. E.g., customizing page-size on the fly is awesome. Being able to change coll-length and coll-depth on the fly in the inspector can be useful – if you need to see just a couple extra items or levels. But changing atom-length and total-length is of questionable benefit to me.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I don't oppose this op, and similarly, not everything has to be exposed as an option.

Simply trying to make sure that we can get the most useful options easily conveyed from cider.el to the Inspector.

Copy link
Member Author

@alexander-yakushev alexander-yakushev Apr 30, 2024

Choose a reason for hiding this comment

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

Here's what I could do:

  1. Expose all five of these parameters as defcustoms in CIDER. Let the user customize these defaults as they wish.
  2. Keep page-size and coll-length dynamic ops as is. Add a new coll-depth op, bind it to C (shift-c) in CIDER inspector to not hijack another letter for a pretty useless command (c is currently for changing coll-length).
  3. Drop atom-length op from cider-nrepl. Make atom-length and value-length only changeable through defcustoms.

Thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

I'd do 1 and 2. 3, I'd try really hard to avoid breaking changes.

Perhaps clojure-emacs/cider#2960 would be a good read - starting from that discussion (and increasingly since) we've been trying to commit to avoiding breakage.

@vemv
Copy link
Member

vemv commented Apr 30, 2024

Re clojure-emacs/orchard#227 (comment) , maybe we can set that default here in advance

@alexander-yakushev alexander-yakushev force-pushed the new-orchard branch 6 times, most recently from 1c20a44 to 8c1d6df Compare May 1, 2024 08:57
@alexander-yakushev
Copy link
Member Author

alexander-yakushev commented May 1, 2024

Re clojure-emacs/orchard#227 (comment) , maybe we can set that default here in advance

While there is a default of 50000 (soon to be 10000) in orchard.inspect, we will probably also have a default for defcustom in CIDER, also 10000, so it can be handled there. I'll avoid adding another layer of defaults for it in cider-nrepl.

@alexander-yakushev alexander-yakushev force-pushed the new-orchard branch 2 times, most recently from a2f21d6 to 480cca1 Compare May 1, 2024 09:27
@alexander-yakushev alexander-yakushev marked this pull request as ready for review May 1, 2024 09:27
@alexander-yakushev
Copy link
Member Author

Ready now.

Copy link
Member

@vemv vemv left a comment

Choose a reason for hiding this comment

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

LGTM - great work!

@@ -364,6 +361,11 @@ if applicable, and re-render the updated value."
:requires {"max-coll-size" "New collection size."
"session" "The current session"}
:returns inspector-returns}
"inspect-set-max-nested-depth"
Copy link
Member

Choose a reason for hiding this comment

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

Good to specifically add to the changelog

@alexander-yakushev alexander-yakushev merged commit 79611e4 into master May 1, 2024
55 checks passed
@alexander-yakushev alexander-yakushev deleted the new-orchard branch May 1, 2024 15:51
@vemv
Copy link
Member

vemv commented May 1, 2024

I've installed this. First impression is of course good.

The inspector is my "repl" so to speak so there will be a fair bit of usage over the next days.

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.

None yet

2 participants