orchard icon indicating copy to clipboard operation
orchard copied to clipboard

Add additional types for eldoc

Open bbatsov opened this issue 4 years ago • 4 comments

Currently the eldoc type is either function or variable:

(defn- extract-eldoc
  [info]
  (if-let [arglists (seq (-> info extract-arglists format-arglists))]
    {:eldoc arglists :type "function"}
    {:type "variable"}))

This means that the result users see is not particularly accurate, not to mention that the function check is pretty primitive. We should add types like macro, special-form, etc.

bbatsov avatar Aug 14 '20 14:08 bbatsov

Is eldoc fine with adding new types?

I couldn't add a reference to e.g. a 'macro' type in eldoc.el. I could find this:

(defvar eldoc-last-data (make-vector 3 nil)
  0 - ....
  1 - ...
  2 - `function' if function args, `variable' if variable documentation.")

vemv avatar Jan 09 '22 23:01 vemv

No idea. We have to ask on the mailing list at some point.

bbatsov avatar Jan 10 '22 05:01 bbatsov

https://github.com/clojure-emacs/orchard/pull/166 appears to have implemented this task.

vemv avatar Jun 23 '23 16:06 vemv

...well, we would have to add method and var to match this expectation https://github.com/clojure-emacs/cider/blob/599e60d5f8a27697dfbcfe09e7adfcc12b5b0f43/cider-eldoc.el#L327-L331

Do we want so? It's cheap, let's simply make sure that we're solving a concrete problem

vemv avatar Jun 23 '23 16:06 vemv