clojure-emacs / orchard

A fertile ground for Clojure tooling
Eclipse Public License 1.0
324 stars 54 forks source link

Inspector: support IDeref #220

Open vemv opened 8 months ago

vemv commented 8 months ago

Custom objects implementing IDeref should be navigable to their derefed value.

The resulting UI should be equivalent to the atom one:

image

i.e. Contains wording, extra level of indentation.

alexander-yakushev commented 3 months ago

The possible problem here could be if the IDeref object is not realized yet. It is arguable whether descending into an unrealized IDeref should trigger its evaluation.

It ie easier if the object also implements IPending and tells us it is realized.

vemv commented 3 months ago

We could also observe a flag passed from cider/cider-nrepl.

Another way to be cautious is to only deref if we're looking at a "leaf" so to speak - if we're inspecting an IDeref, we deref, but if the IDeref is merely an object within the inspected collection, we don't.

vemv commented 3 months ago

I gave this some hammocking and it would seem simple and easy to make down also mean "if the current element is an ideref, deref it".

That way users always see the ideref first, and can explicitly yet easily choose to deref it.