fix(plugins): gate on_load behind API v5

BREAKING CHANGE: plugins using on_load must target API v5 and declare api_version = 5.

Refs #901
This commit is contained in:
Hakan Seven committed 2026-08-29 15:57:26 +03:00
1 parent c527466791
commit 2842f6dc58
9 files changed
+43 -30

No files matched your search

+5 -7
View File
@@ -299,14 +299,12 @@ pub trait BuiltinPlugin: Send + Sync {
/// API major 4 or newer.
fn on_notification(&mut self, _command_id: Option<u64>, _notification: HostNotification) {}
/// Lifecycle callback invoked once after the plugin has been loaded and its
/// manifest/ribbon have been accepted by the host. The plugin receives the
/// active document tab's `HostApi` so it can set up worker threads or cache
/// `plugin_request_sender()` before any user command runs.
/// Lifecycle callback invoked once after the runner connects. The plugin
/// receives the active document tab's `HostApi` so it can set up worker
/// threads or cache `plugin_request_sender()` before any user command runs.
///
/// Added after API v4. The default implementation does nothing, so existing
/// plugins remain source-compatible. The runner only calls this for plugins
/// that report API major 4 or newer.
/// Added in API v5. The runner only calls this for plugins that report API
/// major 5 or newer.
fn on_load(&mut self, _host: &mut dyn HostApi) {}
}