Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata inference for 'proxy' vars #788

Closed
vemv opened this issue Jul 27, 2023 · 0 comments
Closed

Metadata inference for 'proxy' vars #788

vemv opened this issue Jul 27, 2023 · 0 comments
Assignees

Comments

@vemv
Copy link
Member

vemv commented Jul 27, 2023

The following pattern can be sometimes found in Clojure:

(def json-request-format json/json-request-format)

Where

  • the def lacks a docstring,
  • the def value is a single symbol,
    • therefore its value is known at compile-time
  • said symbol can be resolved to a var,
  • and that var has a docstring.

...For those cases, the track-state middleware could add :doc metadata for CIDER usage.

Note that this is unobstrusive (non-mutative): users querying (-> #'x meta :doc) would not see our infered value.

We already are doing something similar in #787 (for :style/indent)

So, this pattern can be used for:

  • :doc
  • :arglists
  • :tag
  • :style/indent (preempting any inference)
  • possibly a few, safe, others.

This can be done for clj and cljs alike.

@vemv vemv self-assigned this Jul 27, 2023
vemv added a commit to clojure-emacs/orchard that referenced this issue Aug 2, 2023
vemv added a commit to clojure-emacs/orchard that referenced this issue Aug 2, 2023
vemv added a commit to clojure-emacs/orchard that referenced this issue Aug 2, 2023
vemv added a commit to clojure-emacs/orchard that referenced this issue Aug 2, 2023
vemv added a commit to clojure-emacs/orchard that referenced this issue Aug 3, 2023
@vemv vemv closed this as completed Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant