clojure-emacs / orchard

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

Add additional types for eldoc #99

Open bbatsov opened 4 years ago

bbatsov commented 4 years ago

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.

vemv commented 2 years ago

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.")
bbatsov commented 2 years ago

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

vemv commented 1 year ago

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

vemv commented 1 year ago

...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