Skip to content
This repository was archived by the owner on Oct 21, 2022. It is now read-only.

Conversation

sbauer322
Copy link
Contributor

This stems from @carocad's watch docstring PR, #89, as I found no clean way to append to his PR. The original will be closed.

The main difference is the usage of the :doc key for behaviors when a lot of information not suited for the :desc key occurred. The :doc key will officially be used for additional optional documentation once this Light Table PR is merged: LightTable/LightTable#2276

There is also various minor formatting changes.

@sbauer322
Copy link
Contributor Author

On November 12, 2016, I will be merging this pull request If no one responds or comments before then.

It would be nice to have feedback to confirm everything is in order.

@sbauer322
Copy link
Contributor Author

Last call @LightTable/maintainers before this is merged!

@cldwalker
Copy link
Member

Taking a look

Copy link
Member

@cldwalker cldwalker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking on these behavior docstring improvements. Back to you for addressing feedback


(defn truncate [v]
(defn truncate
"Useless function... Same as 'identity'. Deprecated and to be removed."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth removing as this is needless commentary on a fn that is self explanatory. Also, dev comments/todos don't belong in fn docstrings

Copy link
Contributor Author

@sbauer322 sbauer322 Nov 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we keep "Same as 'identity'. Deprecated and to be removed." at least? Letting users know the function is to be deprecated and that there already exists an alternative seems reasonable.

If the function docstring is not an appropriate place for this then where would be?


(behavior ::cljs-result.inline-at-cursor
:desc "Clojurescript: Show the resulting evaluation inline at cursor location"
:doc "This is probably the same as `::cljs-result.inline` but puts the result widget somewhere else."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove docs that aren't sure of functionality, here and other :doc keys that use "probably"


(behavior ::cljs-watch-src
:desc "Clojurescript: Wraps the watched source code"
:doc "Wraps watched code with a call to `js/lttools.watch` to catch its result and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation shouldn't be specifying implementation. Please replacejs/ltools.watch with a description of what it does or recommend removing :doc


(behavior ::clj-watch-src
:desc "Clojure: Wraps the watched source code"
:doc "Wraps watched code with a call to `lighttable.nrepl.eval/watch` to catch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same feedback as for :cljs-watch-src

:print-length (object/raise-reduce editor :clojure.print-length+ nil)
:code (watches/watched-range editor nil nil nil))})))
(behavior ::on-eval.cljs
:desc "Clojurescript: Eval editor content"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change all desc keys to use "Clojure:". Our :desc convention has been to use the prefix for plugin name, not as a language descriptor

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do - Could you point me to where we specify the :desc convention?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dunno if it's explicitly stated anywhere. Probably worth documenting in wiki/docs. I'd recommend reading more plugins and especially writing a plugin to familiarize yourself with conventions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have opened LightTable/LightTable#2296 to document this.

(string/replace #"__\|(.*)\|__" watch)))

(behavior ::cljs-watch-custom-src
:desc "Clojurescript: Prepare exp for watching"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should avoid using aliases like exp until we have a common place for users to look for commonly used aliases. exp -> expression should work

(object/raise editor :editor.doc.show! result)))))

(behavior ::clj-doc-search
:doc "Links the 'Search language docs' input-text on the sidebar with a trigger to
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please convert to :desc. While I'm ok using :doc as an additive key we shouldn't be using it as a replacement for :desc. Same feedback for other behaviors that only have :doc

@sbauer322 sbauer322 force-pushed the plugin-docstring branch 2 times, most recently from 226eb4f to 6dd1e0a Compare November 29, 2016 02:27
@sbauer322
Copy link
Contributor Author

@cldwalker the requested changes have been addressed.

Copy link
Member

@cldwalker cldwalker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is looking good. Two small tweaks and then I'll take a quick look

(fill-watch-placeholders (:exp opts) src meta watch))))

(behavior ::clj-watch-custom-src
:desc "Clojure: Prepare exp for watching"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth updating exp to expression here as well


(defn truncate [v]
(defn truncate
"Same as 'identity'. Deprecated and to be removed."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned before, please remove. The function is self explanatory and the person who added has no knowledge of when this is to be deprecated and removed. Code todos should not be accepted from external contributors who have little to no relevant contributions

@sbauer322
Copy link
Contributor Author

Ready for you, @cldwalker!

@cldwalker
Copy link
Member

Nice work! Let's ship it 👍 🚢 🌊

@sbauer322 sbauer322 merged commit 65acb2f into LightTable:master Dec 14, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants