Skip to main content

Module events

Module events 

Source
Expand description

LA.1 — typed events the loader publishes about the mode/language catalog, as distinct from the plugin lifecycle.

Event::PluginLoaded already fires once per load, but it says “a plugin finished loading”, not “the set of languages and major modes the editor can resolve against just changed”. Those are different facts with different subscribers: the first is what an init.rs on-plugin-loaded handler waits for; the second is what makes an already-open buffer’s major mode stale (mode-architecture.md §7.4, “Major mode, second trigger”).

Keeping them apart is what keeps the re-resolution cheap. Re-running the ordered major resolver is O(major-modes × open buffers); riding PluginLoaded would pay that for every auto-pair-shaped plugin that cannot possibly have changed the answer.

Structs§

LanguagesRegistered
Fired once per plugin load whose drain could have changed the mode/language catalog — i.e. the manifest declared language or modes.