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

reformat doc comments in packages/store/src/types.js #6125

Closed
Chris-Hibbert opened this issue Sep 3, 2022 · 1 comment · Fixed by #8212
Closed

reformat doc comments in packages/store/src/types.js #6125

Chris-Hibbert opened this issue Sep 3, 2022 · 1 comment · Fixed by #8212
Assignees
Labels
devex developer experience documentation Improvements or additions to documentation enhancement New feature or request vaults_triage DO NOT USE

Comments

@Chris-Hibbert
Copy link
Contributor

Chris-Hibbert commented Sep 3, 2022

What is the Problem Being Solved?

WebStorm interprets left-justified JSDoc comments differently from VSCode. VSCode is compatible with the format that WebStorm likes. let's reformat for better compatibility

See the conversation

Description of the Design

The comments are currently formatted

 * @property {(label?: string) => Matcher} remotable
 * A far object or its remote presence. The optional `label` is purely for
 * diagnostic purpose. It does not enforce any constraint beyond the
 * must-be-a-remotable constraint.
 * @property {() => Matcher} error
 * Error objects are passable, but are neither keys nor symbols.
 * They do not have a useful identity.
 * @property {() => Matcher} promise
 * Promises are passable, but are neither keys nor symbols.
 * They do not have a useful identity.
 * @property {() => Matcher} undefined
 * All keys including `undefined` are already valid patterns and
 * so can validly represent themselves. But optional pattern arguments
 * `(pattern = undefined) => ...`
 * cannot distinguish between `undefined` passed as a pattern vs
 * omission of the argument. It will interpret the first as the
 * second. Thus, when a passed pattern does not also need to be a key,
 * we recommend passing `M.undefined()` instead of `undefined`.

WebStorm shows it like this:

storeTypeHints

It seems to be attributing left-justified comments to every entry above. Indentation makes it better.

 * @property {(label?: string) => Matcher} remotable - A far object or its
 *   remote presence. The optional `label` is purely for
 *   diagnostic purpose. It does not enforce any constraint beyond the
 *   must-be-a-remotable constraint.
 * @property {() => Matcher} error - Error objects are passable, but are
 *   neither keys nor symbols. They do not have a useful identity.
 * @property {() => Matcher} promise - Promises are passable, but are
 *   neither keys nor symbols. They do not have a useful identity.
 * @property {() => Matcher} undefined
 *   All keys including `undefined` are already valid patterns and
 *   so can validly represent themselves. But optional pattern arguments
 *   `(pattern = undefined) => ...`
 *   cannot distinguish between `undefined` passed as a pattern vs
 *   omission of the argument. It will interpret the first as the
 *   second. Thus, when a passed pattern does not also need to be a key,
 *   we recommend passing `M.undefined()` instead of `undefined`.

Security Considerations

This is "just" developer experience.

Test Plan

No test changes proposed.

@Chris-Hibbert Chris-Hibbert added documentation Improvements or additions to documentation enhancement New feature or request devex developer experience labels Sep 3, 2022
@Chris-Hibbert Chris-Hibbert added this to the Mainnet 1 RC0 milestone Sep 3, 2022
@turadg
Copy link
Member

turadg commented Sep 4, 2022

Note that #4900 will do this. It's currently blocked on hosseinmd/prettier-plugin-jsdoc#155 but you could run it on certain files and clean up.

E.g. this is the output for the file in question:
https://github.com/Agoric/agoric-sdk/pull/4903/files#diff-715e5ed37109b2e92aed1f30504c751d212c7c4f25c7301afb5a625db32cee0b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devex developer experience documentation Improvements or additions to documentation enhancement New feature or request vaults_triage DO NOT USE
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants