{"action":"created","issue":{"url":"https://api.github.com/repos/atom/atom/issues/7638","labels_url":"https://api.github.com/repos/atom/atom/issues/7638/labels{/name}","comments_url":"https://api.github.com/repos/atom/atom/issues/7638/comments","events_url":"https://api.github.com/repos/atom/atom/issues/7638/events","html_url":"https://github.com/atom/atom/pull/7638","id":92477290,"number":7638,"title":"Add activationHooks + Trigger `{grammar-package-name}:grammar-used` Hook When A text-editor-element's Grammar Is Set","user":{"login":"joefitzgerald","id":744740,"avatar_url":"https://avatars.githubusercontent.com/u/744740?v=3","gravatar_id":"","url":"https://api.github.com/users/joefitzgerald","html_url":"https://github.com/joefitzgerald","followers_url":"https://api.github.com/users/joefitzgerald/followers","following_url":"https://api.github.com/users/joefitzgerald/following{/other_user}","gists_url":"https://api.github.com/users/joefitzgerald/gists{/gist_id}","starred_url":"https://api.github.com/users/joefitzgerald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joefitzgerald/subscriptions","organizations_url":"https://api.github.com/users/joefitzgerald/orgs","repos_url":"https://api.github.com/users/joefitzgerald/repos","events_url":"https://api.github.com/users/joefitzgerald/events{/privacy}","received_events_url":"https://api.github.com/users/joefitzgerald/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-07-01T20:22:21Z","updated_at":"2015-07-06T21:15:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/atom/atom/pulls/7638","html_url":"https://github.com/atom/atom/pull/7638","diff_url":"https://github.com/atom/atom/pull/7638.diff","patch_url":"https://github.com/atom/atom/pull/7638.patch"},"body":"This PR:\r\n\r\n* Adds `activationHooks` to package.json\r\n* Triggers the `{grammar-package-name}:grammar-used` hook when a text-editor-element's grammar is set\r\n\r\nThis allows package authors to defer package activation for language-specific packages until the first use of the grammar(s) their package serves. It also leaves open the possibility to trigger other activation hooks in the future with minimal code.\r\n\r\n- Fixes #6629\r\n\r\n/cc @kevinsawicki"},"comment":{"url":"https://api.github.com/repos/atom/atom/issues/comments/119000492","html_url":"https://github.com/atom/atom/pull/7638#issuecomment-119000492","issue_url":"https://api.github.com/repos/atom/atom/issues/7638","id":119000492,"user":{"login":"joefitzgerald","id":744740,"avatar_url":"https://avatars.githubusercontent.com/u/744740?v=3","gravatar_id":"","url":"https://api.github.com/users/joefitzgerald","html_url":"https://github.com/joefitzgerald","followers_url":"https://api.github.com/users/joefitzgerald/followers","following_url":"https://api.github.com/users/joefitzgerald/following{/other_user}","gists_url":"https://api.github.com/users/joefitzgerald/gists{/gist_id}","starred_url":"https://api.github.com/users/joefitzgerald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joefitzgerald/subscriptions","organizations_url":"https://api.github.com/users/joefitzgerald/orgs","repos_url":"https://api.github.com/users/joefitzgerald/repos","events_url":"https://api.github.com/users/joefitzgerald/events{/privacy}","received_events_url":"https://api.github.com/users/joefitzgerald/received_events","type":"User","site_admin":false},"created_at":"2015-07-06T21:15:54Z","updated_at":"2015-07-06T21:15:54Z","body":"> I think I see where you're going with using the package-name prefix in the hook name. However, there's also the grammar scope name, and a single language package could contain multiple grammars.\r\n\r\nI could just emit once for the package name and then again for the grammar scope name?"}}