Run in Atom is an Atom package that allows code to be executed in the context of Atom itself. This means code can examine and manipulate Atom's state while it's running.
For example, running the following CoffeeScript with Run in Atom will log the contents of the current document to the console.
editor = atom.workspace.activePaneItemeditor.getText()
Example of calling asynchronous CoffeeScript with "Run In Atom" that triggers a visible UI change:
activePane = atom.workspaceView.getActivePaneView()atom.project.open().then (editor) ->activePane.splitDown(editor)
Code can be run in the following ways. In all cases it runs the selection if it exists, otherwise the whole document. The code's result is logged to the console.
alt-cmd-r
keyboard shortcutThis package is based on code from probablycorey's coffee-eval, with the following differentiating features:
Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.