Open alexander-yakushev opened 1 month ago
Interesting
What's the current behavior if you don't manually remove ^
?
What's C-c C-d C-d
?
C-c C-d C-d is cider-doc
. The current behavior for cider-inspect
is to read and inspect the next form after the type tag
I'd say that this would be a harmless/DWIM 'breaking' change to do - I'd fail to imagine people intentionally hovering over T in ^T x
and expecting the inspector to go over x
.
Most likely it's a byproduct of whatever the original impl was
I also think so.Most of the code type hints local variables anyway which can't be inspected.
I've fixed this for myself using this hack:
(defun cider-inspect-last-sexp ()
(interactive)
(if-let (type-tag (cider-symbol-at-point))
(cider-inspect-expr type-tag (cider-current-ns))
(cider-inspect-expr (cider-last-sexp) (cider-current-ns))))
I check if (cider-symbol-at-point)
returns something meaningful. If so, I inspect that, otherwise I inspect (cider-last-sexp)
. cider-symbol-at-point
is what cider-doc
uses to strip ^
symbol from the classname.
But I'm not so sure if I'm comfortable pushing this to other people, and I don't know all implications yet.
Quite often I want to inspect a class that is written with
^
in the source file. To inspect it with the regular inspect-last-expr, I have to remove the^
first. I noticed thatC-c C-d C-d
handles type tags fine. Can we have something like that for the inspector too?This can be handled on the orchard.inspect side but I don't think it's the best place to do that.