When do language packages load?


If you have a language package that includes some other instructions in it (keybindings, commands, whatever), is the non-grammar code loaded with all the other packages, or when the grammar is selected for a buffer?


I believe all of a package’s contents load at the same time. A grammar isn’t used to parse and tokenise an actual file until it’s needed… but Atom still needs to read metadata about the grammar, like filetypes, the grammar’s name (for listing in menus, etc), and most importantly, the scopeName attribute, which pretty much uniquely identifies a TMCG.


That’s what I’ve been going with as my assumption, yeah.


All packages load at the same time, on Atom startup. Some packages don’t activate when they are loaded.


Is this determined solely by the package itself?


Yes, see the section on the package.json mentioning activationCommands and activationHooks in the Flight Manual:



Thanks. I knew about those keys, but I wanted to verify that there were no other elements that would influence the timing of a package being activated.