Commit Graph

9 Commits

Author SHA1 Message Date
Nathan Sobo
667634191e Document hiddenInCommandPalette option in atom.commands.add 2017-11-02 16:15:45 -06:00
Wliu
ab79a2d2b2 📝
[ci skip]
2017-10-28 00:53:01 +02:00
Will Binns-Smith
b7c328fd59 Clean up docs and comment wording 2017-08-28 14:49:54 -07:00
Will Binns-Smith
2ac1d54557 handleEvent -> onDidDispatch 2017-08-23 13:27:16 -07:00
Will Binns-Smith
c916c9d818 Better document the new api externally and internally 2017-08-22 10:53:04 -07:00
Will Binns-Smith
b3a296e802 Eagerly extract descriptor and callback 2017-08-22 10:53:04 -07:00
Will Binns-Smith
9b995c68ec Normalize listeners at registration time; add tests for rich functions 2017-08-22 10:53:04 -07:00
Will Binns-Smith
3aa95d96d4 [Commands] Add support for rich listener objects with first-class metadata
This adds support for listener objects which, in addition to the existing callback listeners, can optionally provide a displayName ahead of time to avoid a potentially awkward humanized displayName.
2017-08-22 10:53:04 -07:00
Will Binns-Smith
ac32ffb155 Convert CommandRegistry to JavaScript
This was bootstrapped with running `decaffeinate` on both command-registry
and its spec, but involved a line-by-line eyeing and updating for idioms
and, in one case, correctness:

For some reason, copying the keys to the new dispatchedEvent in
coffeescript (command-registry.coffee:235) currently does not result in a thrown
exception, as it should when trying to write over the read-only property
`isTrusted`, so I added a check to ensure that the key did not already
exist in the new event. Moreover, other definitions of `preventDefault`,
`stopPropagation` and friends, which are also enumerable afaict, would
also overwrite the ones defined just prior (command-registry.coffee:220
and command-registry.js:325), so that check ensures we don't overwrite
those either.

Test plan: `./script/lint && ./script/test`, and a lengthy smoke test of
various commands through keybindings, command palette, and package
interfaces.

Released under CC0.
2017-08-20 20:52:43 -07:00