This commit makes all interactions between Task and Worker look
like method calls. The worker now has a global `callTaskMethod`
function that it can use to call methods on the Task object. And the
Task can use `callWorkerMethod` to call methods on a global `handler`
object in the worker. The worker's initial `handler` actually contains
the `start` method, which the Task initially calls to kick things off.
Then the global `handler` gets replaced with whatever `handlerPath`
is specified by the Task. The worker then calls `workerStarted` on its
parent Task object.
This commit also gets rid of the `onProgress` method with the reply
semantics, favoring a more explicit interaction. When `snippetsLoaded`
finishes adding the snippet data, we call `loadNextPackageSnippets`
explicitly rather than returning a reply message.
resolve now checks the existence of a module already loaded at the
given path before checking if the file exists on disk.
This removes the need for many redundant fs.exists and fs.isFile
calls for already loaded modules.
This speeds up package loading since most packages have a common
set of requires that were doing needless fs operations for each
searched path when the module was already in the cache at that
path.
Also, add a spec to cover the loading of keymaps in `atom-spec` and
reset the `keymap`'s internal data after each spec gets run to prevent
test pollution with keymaps.
We'll look first in the user themes directory, then in the built-in
themes directory. This allows us to default to 'IR_Black' and not crash
if the user doesn't setup their `~/.atom/themes` directory.
Previously, we had a custom method on the `TextMateBundle` class for
retrieving these variables from the bundle. Now we're using Atom's
`syntax.getProperty` mechanism. The idea is to map TextMate concepts
to their Atom equivalent, rather than building everything directly
around TextMate.
We'll store all syntax-related global state in the `syntax` global. For
now, this means that all scoped properties will be stored here, as well
as all grammars.
We now look at the `core.disabledPackages` config key. Rename the `src/extensions` directory to `src/packages`. The config object now talks about loading packages instead of extensions.
This is the fastest way I've found to get the nextTick behavior, which allows us to aggregate multiple requests for display update (from selection changes, cursor movement, line changes) etc into a single call at the end of processing an event.