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

[inspector] Add configuration for max-nested-depth and spacious #3664

Merged
merged 3 commits into from
May 17, 2024

Conversation

alexander-yakushev
Copy link
Member

The PR doesn't depend on cider-nrepl being the latest version, but a release of it would be appreciated before merging. CIDER versions in the customs are approximated.

@vemv
Copy link
Member

vemv commented May 13, 2024

Looks good. A cider-nrepl artifact is being built. I'll bump it here then

(please don't merge this before that)

@vemv
Copy link
Member

vemv commented May 13, 2024

Done, you can merge master in

@alexander-yakushev
Copy link
Member Author

Thank you! I added a CHANGELOG commit, or is that unnecessary?

cider-inspector.el Outdated Show resolved Hide resolved
cider-inspector.el Outdated Show resolved Hide resolved
@alexander-yakushev
Copy link
Member Author

alexander-yakushev commented May 14, 2024

I changed cider-inspector-spacious-collections from a defcustom to a defvar. It is very likely that we will remove this option in the next few versions (we only add it as a fallback and to gauge if anybody cares enough about reverting it to the old mode). With defvar I think there will be smaller chance of this customization lingering in people's configs, and we won't have to keep it for backward compatibility.

@bbatsov
Copy link
Member

bbatsov commented May 14, 2024

Fair enough. I asked about this before seeing your comment.

I'd suggest to mention the changes in this PR in the changelog as well and it'd be good if the new defcustom is also mentioned in the inspector's docs, so more people would actually discover it.

@alexander-yakushev
Copy link
Member Author

Ping 🙂

@bbatsov
Copy link
Member

bbatsov commented May 17, 2024

@alexander-yakushev Did you see my previous small remarks? I see there no changes after writing them (e.g. the incorrect CIDER version in one defcustom)

@alexander-yakushev
Copy link
Member Author

Yep, I addressed them right after.
image

"Default level of nesting for collections to display before truncating.
The max depth can be also changed interactively within the inspector."
:type '(integer :tag "Max nested collection depth" 5)
:package-version '(cider . "1.1.4"))
Copy link
Member

Choose a reason for hiding this comment

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

1.14.0 :-)

Copy link
Member

Choose a reason for hiding this comment

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

I still see the wrong version here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, this is my bad.

:package-version '(cider . "1.1.4"))

(defvar cider-inspector-spacious-collections nil
"Controls whether the inspector renders values in collections spaciously.")
Copy link
Member

Choose a reason for hiding this comment

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

Maybe explain a bit more what "spaciously" means in this context. If I didn't know what this controls I'd have a hard time figuring it out.

Btw, why did you decide to make this a defvar instead of defcusom? I doubt anyone was particularly attached to the extra spaces, but defcustoms are easier to discover.

Copy link
Member

Choose a reason for hiding this comment

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

I saw your other comment, forget about this.

@@ -68,6 +68,10 @@ You'll have access to additional keybindings in the inspector buffer
| `cider-inspector-set-max-coll-size`
| Set a new maximum size above which nested collections are truncated

| kbd:[C]
Copy link
Member

Choose a reason for hiding this comment

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

I think it'd better to pick some free lowercase letter for this. (e.g. d)

Copy link
Member Author

Choose a reason for hiding this comment

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

I chose a capital letter intentionally to not take away a letter from the binding space. I don't consider this customization to be used often or ever. We'll probably change the default some time down the road I expect this variable will be changed dynamically in some unique cases, but otherwise, it's a meh variable to customize.

Copy link
Member Author

Choose a reason for hiding this comment

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

Besides, there is certain synergy in changing length (*print-length*) and depth (*print-depth*), so they can be neighbours on the same letter, even if the letter itself does not relate to depth much.

Copy link
Member

Choose a reason for hiding this comment

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

Fair enough.

inspector buffer using the `s`, `c`, and `a` keybindings.
`cider-inspector-page-size`, `cider-inspector-max-coll-size`,
`cider-inspector-max-nested-depth`, and `cider-inspector-max-atom-length`. The
values can be adjusted for the current inspector buffer using the `s`, `c`, and
Copy link
Member

Choose a reason for hiding this comment

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

You didn't mention the new keybinding here. I wonder if it's a good idea to repeat here the data from the table above, though. Perhaps this sentence can be removed or made more generic to require fewer updates.

@bbatsov
Copy link
Member

bbatsov commented May 17, 2024

Hmm, perhaps I didn't press the button "finish review" then. 😅

@bbatsov bbatsov merged commit caa2a2c into master May 17, 2024
9 of 35 checks passed
@bbatsov bbatsov deleted the inspector branch May 17, 2024 08:48
@bbatsov
Copy link
Member

bbatsov commented May 17, 2024

Thanks and sorry about the delay here!

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

3 participants