clojure-emacs / cider

The Clojure Interactive Development Environment that Rocks for Emacs
https://cider.mx
GNU General Public License v3.0
3.54k stars 645 forks source link

Add support for reader tags to cider-doc #2382

Closed j-cr closed 5 years ago

j-cr commented 6 years ago

Currently, if you try to get a docstring for a reader tag, you'll get something like Symbol #light not resolved.

Clojure doesn't "officially" support docstrings for tags, but since all tags are stored in *data-readers* as Symbols, it's possible for library authors to add :doc to them and for the tooling to recognize the tags and show the docstring.

If there's no docstring on the tag (e.g. it was loaded via data_readers.clj), then simply showing something like that would be helpful:

#foo/bar
Reader tag
  Not documented.

#foo/bar refers to `my.lib.foo/bar-reader`

[back]

I haven't looked at the code yet and not very familiar with how cider works, but I guess this shouldn't be too hard to implement? Check if the symbol starts with # => look up *data-readers*. Let me know if you want a pull request and\or there're some caveats I'm not aware of. (By the way, I'm a fan of your work, Bozhidar! Thank you for everything you do for the clojure and emacs communities. CIDER rocks!)

Brought up by @splayemu in https://clojureverse.org/t/speck-concise-inline-function-specs/2489/14

bbatsov commented 6 years ago

Yep, this should be easy to implement. PRs welcome!

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!

stale[bot] commented 5 years ago

This issues been automatically closed due to lack of activity. Feel free to re-open it if you ever come back to it.