Enhance documentation for atom.commands.dispatch() method#1411
Merged
Conversation
Add comments to clarify that atom.commands.dispatch() can pass arguments to commands
There was a problem hiding this comment.
Pull request overview
Enhances the inline API documentation for CommandRegistry::dispatch() to clarify that command dispatch can carry arguments via event detail.
Changes:
- Add explanatory notes describing using
dispatch()to pass arguments when keymaps can’t. - Document the
detailparameter as being assigned to the dispatched event’s.detail.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1 task
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
savetheclocktower
approved these changes
Feb 14, 2026
d9cdd95
into
pulsar-edit:master
197 of 199 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add comments to clarify that
atom.commands.dispatch()can pass arguments to commands.I haven't tested it yet, but this
detailarg seems to allow for the following ability:And this:
Technically we can dispatch a command like this too:
and the command handler could use those properties:
A separate PR should be able to add arg support for key maps if it doesn't exist already (or document that if it does). For keymaps, the
.detailproperty makes sense, as there'd be no way to handle custom event classes via static JSON (unless we maintained a map of class by their class name, and use their class name in the JSON).