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

Newline support for Calva Inspector #2695

Open
skylize opened this issue Jan 7, 2025 · 8 comments
Open

Newline support for Calva Inspector #2695

skylize opened this issue Jan 7, 2025 · 8 comments
Labels
data inspection ux User experience related

Comments

@skylize
Copy link
Contributor

skylize commented Jan 7, 2025

Given that Calva Inspector is intended to deprecate the Calva Output Window, certain features seem pretty important which are currently missing. One such feature is pretty printing with printed newlines.

The easy way to understand why this matters is a not-even-that-large map. Without newlines, this scrolls off the side and is extremely difficult to read.

{:foo "abc" :bar "def" :buz "hij" :baz "klm" :qux "nop" :wof "qrx" :raz "yz"}  

which probably looks something like this, hiding a lot of potentially important data

{:foo "abc" :bar "def" :buz ...

I see no reason this feature needs to match the Output Window's current support for user's choice of printer. Just use pprint and move on.

@PEZ PEZ added ux User experience related data inspection labels Jan 8, 2025
@PEZ
Copy link
Collaborator

PEZ commented Jan 8, 2025

To clarify. The Inspector is not intended to deprecate the Calva Output Window. We're going to stop sending results to the Calva REPL Window by default and instead direct them to whatever is set to the the result output destination.

As for newlines in the inspector. That's why we can inspect the results there. The point is that each level of entries in the result should take just one row, until you expand them.

image

Pretty printing the results would be the same as what you get in the Calva output destination, and then there's no reason to inspect anything.

I have a feeling there's some Ux issue with the inspector that we need to address...

@PEZ
Copy link
Collaborator

PEZ commented Jan 8, 2025

Also, you can hover the inspector rows to get the data pretty printed:

image

There all fit on one row, but a larger structure will be wrapped in lines:

image

@skylize
Copy link
Contributor Author

skylize commented Jan 8, 2025

Seems to be not working as expected because pretty printing with "calva" as the printer is broken for me. Maps just show up as ##. As such, I'm not seeing fold out options. Just realized hover is working and showing the same ##. I didn't think to report the issue with printing because I was just trying briefly to compare with puget, that I've been happy with for a while.

@skylize
Copy link
Contributor Author

skylize commented Jan 8, 2025

Please note that at some point after we have created a dedicated Output Window, the REPL Window will probably be retired as a destination for output.
-- https://calva.io/output/#about-stdout-in-the-repl-window

To clarify. The Inspector is not intended to deprecate the Calva Output Window

You're telling me exactly the opposite of what you said in the docs. Not sure how mixed messages clarifies anything.

@PEZ
Copy link
Collaborator

PEZ commented Jan 8, 2025

Could you try use defaults for pretty pretty printing options? And if that works, see if you can find which setting make the maps disappear. FYI: The calva setting is similar to zprint in results. It is zprint being used on the client side of things. And it is zprint client side that we use for the inspector as well, and we also reuse some of the options, like length and depth for the inspector.

@PEZ
Copy link
Collaborator

PEZ commented Jan 8, 2025

You're telling me exactly the opposite of what you said in the docs. Not sure how mixed messages clarifies anything.

To me I say the same things in both places. I probably suck at explaining it. It is a bit messy because of legacy. Anyway, there is no Calva Output Window (yet). There is a Calva REPL Window and there are some Calva Output Destinations. The REPL Window can be used as an output destination. This is currently the default. We will change the default (and, possibly, at some point remove the option to use the REPL Window as an output destination).

@skylize
Copy link
Contributor Author

skylize commented Jan 8, 2025

I get this exception from zprint setting. Apparently zprint is missing? But default works.

Error printing return value (FileNotFoundException) at clojure.lang.RT/load (RT.java:482).
Could not locate zprint/core__init.class, zprint/core.clj or zprint/core.cljc on classpath.

@PEZ
Copy link
Collaborator

PEZ commented Jan 8, 2025

The zprint dependency is supposed to be added by jack-in. I don't know why that doesn't happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data inspection ux User experience related
Projects
None yet
Development

No branches or pull requests

2 participants