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

Consider using activationHooks to prevent impacting atom boot time #30

Open
MarcPorciuncula opened this issue Mar 5, 2016 · 0 comments

Comments

@MarcPorciuncula
Copy link
Collaborator

In package.json you can specify activationHooks, an array of events that will trigger the activation of the package. When you specify activationHooks, your package no longer activates on boot, but the first time when one of these events fires.

Here's an example package.json from the atom docs for a word count package that's activated only for javascript and coffeescript:

{
  "name": "wordcount",
  "main": "./lib/wordcount",
  "version": "0.0.0",
  "description": "A short description of your package",
  "activationHooks": ["language-javascript:grammar-used", "language-coffee-script:grammar-used"],
  "repository": "https://github.com/atom/wordcount",
  "license": "MIT",
  "engines": {
    "atom": ">0.50.0"
  },
  "dependencies": {
  }
}

Since the current behaviour of less-than-slash is to operate on any and all files of all grammars, I'm not sure what event to use to trigger it. I also couldn't find docs on the types of events available to use in activationHooks.

Side thought: should users be able to configure which grammars less-than-slash is activated for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant