diff --git a/crates/ide-host/src/plugins/api.rs b/crates/ide-host/src/plugins/api.rs index b995a17675..9919a406af 100644 --- a/crates/ide-host/src/plugins/api.rs +++ b/crates/ide-host/src/plugins/api.rs @@ -314,6 +314,16 @@ const DEFAULT_STREAM_BUFFER: usize = 256 << 10; const DEFAULT_STREAM_MAX_TOTAL: usize = 32 << 20; /// Most processes one plugin keeps running at once. const MAX_PROCESSES: usize = 8; +/// Pending `events.schedule` timers per plugin. +const MAX_TIMERS: usize = 16; + +/// A pending `events.schedule` timer: fires `id` in window `client` at `due`. +#[derive(Clone, Debug)] +pub(super) struct Timer { + pub id: String, + pub due: Instant, + pub client: Option, +} /// Most output one stream of a handle holds until the plugin reads it. const MAX_PENDING: usize = 1 << 20; /// Most files `find-files` walks before giving up. @@ -810,6 +820,8 @@ pub(super) struct Shared { pub subscriptions: Mutex, /// Paths outside their project that plugins watch (kept across idle reclaim). pub(super) external_watches: super::external_watch::ExternalWatches, + /// plugin → its pending `events.schedule` timers (kept across idle reclaim). + pub(super) timers: Mutex>>, /// plugin → files it shows problems for, withdrawn when it stops. diagnostics: Mutex>>, project_generations: Mutex>, @@ -918,6 +930,7 @@ impl Shared { closed_clients: Mutex::default(), subscriptions: Mutex::default(), external_watches: Default::default(), + timers: Mutex::default(), diagnostics: Mutex::default(), project_generations: Mutex::default(), log_tabs: Mutex::default(), @@ -1064,6 +1077,9 @@ impl Shared { self.prompts.lock().retain(|_, entry| entry.client != client); drop(closed); self.contexts.lock().retain(|(scope, ..), _| scope.as_deref() != Some(client)); + for timers in self.timers.lock().values_mut() { + timers.retain(|t| t.client.as_deref() != Some(client)); + } self.loopbacks.read().forget_window(client); self.window_status.lock().retain(|(window, ..), _| window != client); self.view_badges.lock().retain(|(window, ..), _| window != client); @@ -1120,6 +1136,24 @@ impl Shared { .retain(|(p, w), _| plugin.is_some_and(|plugin| plugin != p) || window.is_some_and(|window| window != w)); } + /// Removes the timers due at `now`: (plugin, window, id), earliest first. + pub(super) fn take_due_timers(&self, now: Instant) -> Vec<(String, Option, String)> { + let mut due = Vec::new(); + let mut all = self.timers.lock(); + for (plugin, timers) in all.iter_mut() { + timers.retain(|t| { + if t.due > now { + return true; + } + due.push((t.due, plugin.clone(), t.client.clone(), t.id.clone())); + false + }); + } + all.retain(|_, timers| !timers.is_empty()); + due.sort_by_key(|(at, ..)| *at); + due.into_iter().map(|(_, plugin, client, id)| (plugin, client, id)).collect() + } + pub fn client_closed(&self, client: &str) -> bool { self.closed_clients.lock().contains(client) } @@ -1224,6 +1258,7 @@ impl Shared { } if subscriptions { self.external_watches.remove_plugin(plugin); + self.timers.lock().remove(plugin); } if subscriptions && self.subscriptions.lock().remove(plugin) { self.sink.emit(None, PluginEvent::SubscriptionsChanged); @@ -3825,6 +3860,27 @@ impl HostApi for PluginApi { self.shared.sink.emit(None, PluginEvent::SubscriptionsChanged); } } + + fn schedule(&self, client: Option<&str>, id: &str, after: Duration) -> Result<(), HostError> { + if client.is_some_and(|c| self.shared.client_closed(c)) { + return Err(HostError::Cancelled); + } + let mut timers = self.shared.timers.lock(); + let mine = timers.entry(self.id().to_owned()).or_default(); + mine.retain(|t| t.id != id); + if mine.len() >= MAX_TIMERS { + return Err(HostError::Invalid(format!("at most {MAX_TIMERS} timers may be pending: cancel one first"))); + } + mine.push(Timer { id: id.to_owned(), due: Instant::now() + after, client: client.map(str::to_owned) }); + Ok(()) + } + + fn cancel_schedule(&self, id: &str) { + let mut timers = self.shared.timers.lock(); + if let Some(mine) = timers.get_mut(self.id()) { + mine.retain(|t| t.id != id); + } + } fn start_process(&self, cmd: ProcessCommand, cwd: Option<&Path>, client: Option<&str>) -> Result { self.start_process_stream(cmd, cwd, client, None) } diff --git a/crates/ide-host/src/plugins/files_changed.rs b/crates/ide-host/src/plugins/files_changed.rs index 93a595dc4f..d1d970048f 100644 --- a/crates/ide-host/src/plugins/files_changed.rs +++ b/crates/ide-host/src/plugins/files_changed.rs @@ -480,7 +480,8 @@ mod tests { #[test] fn every_runtime_event_has_a_matching_manifest_activation() { for kind in ide_plugin::EventKind::ALL { - if kind != ide_plugin::EventKind::Scheduled { + // `on-schedule` and `events.schedule` timers activate the plugin themselves. + if !matches!(kind, ide_plugin::EventKind::Scheduled | ide_plugin::EventKind::Timer) { assert!(ide_extension::EVENT_KINDS.contains(&kind.name())); } } diff --git a/crates/ide-host/src/plugins/mod.rs b/crates/ide-host/src/plugins/mod.rs index 5e61ea9fee..5ba9d66fc0 100644 --- a/crates/ide-host/src/plugins/mod.rs +++ b/crates/ide-host/src/plugins/mod.rs @@ -2144,6 +2144,10 @@ impl PluginHost { pub fn project_closed(&self, root: &Path, window: &str) { self.shared.close_project_generation(root); self.shared.external_watches.remove_project(root); + // Timers set for the window's project don't outlive it. + for timers in self.shared.timers.lock().values_mut() { + timers.retain(|t| t.client.as_deref() != Some(window)); + } self.withdraw_project_run_targets(root); self.shared.run_configurations.write().retain(|(_, r), _| r != root); @@ -2359,6 +2363,28 @@ impl PluginHost { } } + /// Queues the `events.schedule` timers due at `now` for their plugin and window. + fn queue_due_timers(&self, now: Instant) { + let due = self.shared.take_due_timers(now); + if due.is_empty() { + return; + } + let mut queues = self.queues.lock(); + for (plugin, client, id) in due { + if client.as_deref().is_some_and(|c| self.shared.client_closed(c)) { + continue; + } + let queue = queues.entry((plugin, client)).or_insert_with(|| EventQueue { + since: now, + last_event: now, + events: Vec::new(), + files_source: None, + }); + queue.last_event = now; + queue.events.push(WorkbenchEvent::Timer(id)); + } + } + pub fn post_events(&self, client: Option<&str>, events: Vec) { self.post_events_from(client, events, None); } @@ -2446,6 +2472,7 @@ impl PluginHost { | WorkbenchEvent::RunExited(_) | WorkbenchEvent::TerminalExited(_) | WorkbenchEvent::ContentTabAction(_) + | WorkbenchEvent::Timer(_) ) { remaining -= 1; @@ -2470,6 +2497,7 @@ impl PluginHost { pub fn flush_events_at(&self, now: Instant) { self.reload_changed_links(); self.queue_watched_changes(now); + self.queue_due_timers(now); let running: BTreeSet = self .plugins .read() @@ -2494,7 +2522,9 @@ impl PluginHost { let (id, _client) = key; let running = running.contains(id); let has_files = q.events.iter().any(|e| matches!(e, WorkbenchEvent::FilesChanged(_))); - let has_scheduled = q.events.iter().any(|e| matches!(e, WorkbenchEvent::Scheduled)); + // Due now: a timer was set for this moment, an `on-schedule` period elapsed. + let has_scheduled = + q.events.iter().any(|e| matches!(e, WorkbenchEvent::Scheduled | WorkbenchEvent::Timer(_))); // Already debounced by the watcher, like project file changes. let has_watched = q.events.iter().any(|e| matches!(e, WorkbenchEvent::WatchedFilesChanged(_))); let debounce = debounces.get(id).copied(); @@ -2680,6 +2710,7 @@ impl PluginHost { | EventKind::RunExited | EventKind::TerminalExited | EventKind::ContentTabAction + | EventKind::Timer ) }) { diff --git a/crates/ide-host/tests/integration/main.rs b/crates/ide-host/tests/integration/main.rs index 7b176b8039..21af467094 100644 --- a/crates/ide-host/tests/integration/main.rs +++ b/crates/ide-host/tests/integration/main.rs @@ -57,6 +57,7 @@ mod plugin_semantic_tokens; mod plugin_server_commands; mod plugin_symbols; mod plugin_syntax_decorations; +mod plugin_timers; mod plugin_view_badge; mod plugin_watch_paths; mod plugin_workbench; diff --git a/crates/ide-host/tests/integration/plugin_timers.rs b/crates/ide-host/tests/integration/plugin_timers.rs new file mode 100644 index 0000000000..b539a5b0ea --- /dev/null +++ b/crates/ide-host/tests/integration/plugin_timers.rs @@ -0,0 +1,80 @@ +//! `events.schedule` (API 1.21): one-shot timers a plugin sets for itself, fired in the +//! window that set them, replaced by id, cancelled, and dropped with the window. +use ide_host::plugins::{Consent, PluginHost}; +use ide_plugin::{Invocation, Limits}; +use std::path::{Path, PathBuf}; +use std::sync::Arc; +use std::time::{Duration, Instant}; + +const ID: &str = "timers"; + +fn fixture() -> PathBuf { + Path::new(env!("CARGO_MANIFEST_DIR")).join("../ide-plugin/tests/fixtures/timers") +} + +struct Setup { + _tmp: tempfile::TempDir, + host: PluginHost, +} + +fn setup() -> Setup { + let tmp = tempfile::tempdir().unwrap(); + let base = dunce::canonicalize(tmp.path()).unwrap(); + let host = PluginHost::new(base.join("plugins"), Arc::new(|_: Option<&str>, _| {}), Limits::default()).unwrap(); + host.load_all(); + host.startup_finished(); + host.install_from_dir(&fixture(), &Consent::all()).unwrap(); + Setup { _tmp: tmp, host } +} + +impl Setup { + fn run(&self, command: &str, arg: &str) -> Result, String> { + let inv = Invocation { client: Some("main".into()), ..Default::default() }; + self.host.run_command(ID, command, Some(arg), inv).map_err(|e| e.message) + } + + /// Delivers what is due `after` from now, then what the plugin received. + fn fired_after(&self, after: Duration) -> Vec { + self.host.flush_events_at(Instant::now() + after); + assert!(self.host.wait_events(Duration::from_secs(10))); + let stored = self.run("fired", "").unwrap(); + stored.map(|s| serde_json::from_str(&s).unwrap()).unwrap_or_default() + } +} + +#[test] +fn a_timer_fires_once_when_due_and_the_same_id_replaces_it() { + let s = setup(); + s.run("schedule", "retry 300").unwrap(); + s.run("schedule", "later 300").unwrap(); + s.run("schedule", "later 60000").unwrap(); + assert!(s.fired_after(Duration::ZERO).is_empty(), "nothing is due yet"); + assert_eq!(s.fired_after(Duration::from_secs(2)), ["retry"]); + assert_eq!(s.fired_after(Duration::from_secs(2)), ["retry"], "a timer fires once"); + assert_eq!(s.fired_after(Duration::from_secs(61)), ["retry", "later"]); +} + +#[test] +fn cancelled_timers_and_those_of_a_closed_window_never_fire() { + let s = setup(); + s.run("schedule", "cancelled 300").unwrap(); + s.run("cancel", "cancelled").unwrap(); + s.run("cancel", "unknown").unwrap(); + s.run("schedule", "closed 300").unwrap(); + s.host.forget_client("main"); + s.host.reopen_client("main"); + assert!(s.fired_after(Duration::from_secs(2)).is_empty()); +} + +#[test] +fn schedule_checks_its_bounds() { + let s = setup(); + for arg in ["x 249", "x 86400001", " 1000"] { + assert!(s.run("schedule", arg).unwrap_err().contains("timer"), "{arg}"); + } + for i in 0..16 { + s.run("schedule", &format!("t{i} 1000")).unwrap(); + } + assert!(s.run("schedule", "t16 1000").unwrap_err().contains("at most 16")); + s.run("schedule", "t0 2000").unwrap(); +} diff --git a/crates/ide-plugin/src/runtime.rs b/crates/ide-plugin/src/runtime.rs index 6d7b0e4cd5..bffd1464bf 100644 --- a/crates/ide-plugin/src/runtime.rs +++ b/crates/ide-plugin/src/runtime.rs @@ -693,6 +693,13 @@ pub trait HostApi: Send + Sync { Err(HostError::Failed("watching paths is unavailable here".into())) } fn unsubscribe(&self, kind: &str); + /// Wakes this plugin with a `timer` event `id` after `after`, in window `client` + /// (API 1.21); replaces a pending timer with the same id. `id` and `after` are checked. + fn schedule(&self, _client: Option<&str>, _id: &str, _after: std::time::Duration) -> Result<(), HostError> { + Err(HostError::Failed("timers are unavailable here".into())) + } + /// Cancels this plugin's pending timer `id`, if any (API 1.21). + fn cancel_schedule(&self, _id: &str) {} /// Starts `cmd` and returns the handle to it without waiting. fn start_process(&self, cmd: ProcessCommand, cwd: Option<&Path>, client: Option<&str>) -> Result; /// Starts `cmd` with streaming options (API 1.15). @@ -1275,6 +1282,10 @@ fn event_to_wit(e: WorkbenchEvent) -> wit_events::Event { data: serde_json::to_string(&p).expect("path serializes"), }), WorkbenchEvent::Scheduled => wit_events::Event::Scheduled, + WorkbenchEvent::Timer(id) => wit_events::Event::Other(wit_types::Extension { + kind: "timer".into(), + data: serde_json::to_string(&id).expect("id serializes"), + }), WorkbenchEvent::ActionPerformed(a) => wit_events::Event::ActionPerformed(wit_events::ActionPerformed { action: a.action, title: a.title, diff --git a/crates/ide-plugin/src/types.rs b/crates/ide-plugin/src/types.rs index 154262e536..5502109622 100644 --- a/crates/ide-plugin/src/types.rs +++ b/crates/ide-plugin/src/types.rs @@ -240,10 +240,12 @@ pub enum EventKind { /// Paths outside the project watched with `events.watch-paths` changed (API 1.18). WatchedFilesChanged, Scheduled, + /// A timer the plugin set with `events.schedule` fired (API 1.21); delivered without subscribing. + Timer, } impl EventKind { - pub const ALL: [Self; 22] = [ + pub const ALL: [Self; 23] = [ Self::DocumentChanged, Self::WebsocketReady, Self::FileClosed, @@ -266,6 +268,7 @@ impl EventKind { Self::ProjectClosed, Self::WatchedFilesChanged, Self::Scheduled, + Self::Timer, ]; pub fn name(self) -> &'static str { @@ -292,6 +295,7 @@ impl EventKind { Self::ProjectClosed => "project-closed", Self::WatchedFilesChanged => "watched-files-changed", Self::Scheduled => "scheduled", + Self::Timer => "timer", } } @@ -306,6 +310,7 @@ impl EventKind { Self::ActionPerformed | Self::InputModeChanged => Some(ide_extension::Capability::InputEvents), Self::RunOutput => Some(ide_extension::Capability::RunOutput), Self::Scheduled + | Self::Timer | Self::RunStarted | Self::RunExited | Self::TerminalExited @@ -485,6 +490,8 @@ pub enum WorkbenchEvent { /// `project` is the project the watch belongs to, `generation` is unset. WatchedFilesChanged(FilesChanged), Scheduled, + /// A timer this plugin set with `events.schedule` fired (API 1.21): its id. + Timer(String), } impl WorkbenchEvent { @@ -512,6 +519,7 @@ impl WorkbenchEvent { Self::ProjectClosed(_) => EventKind::ProjectClosed, Self::WatchedFilesChanged(_) => EventKind::WatchedFilesChanged, Self::Scheduled => EventKind::Scheduled, + Self::Timer(_) => EventKind::Timer, } } } diff --git a/crates/ide-plugin/src/wit_host.rs b/crates/ide-plugin/src/wit_host.rs index 79bb7475ba..1118cab64b 100644 --- a/crates/ide-plugin/src/wit_host.rs +++ b/crates/ide-plugin/src/wit_host.rs @@ -1895,6 +1895,32 @@ impl events::Host for StoreData { Ok(()) } + fn schedule(&mut self, id: String, after_ms: u32) -> Fallible<()> { + if let Err(e) = self.host.require_api("events.schedule", 21) { + return Ok(Err(to_wit(e))); + } + if id.is_empty() || id.len() > 128 || id.chars().any(char::is_control) { + return Ok(Err(wit::Error::Invalid("timer id must be 1-128 bytes without control characters".into()))); + } + if !(MIN_TIMER_MS..=MAX_TIMER_MS).contains(&after_ms) { + return Ok(Err(wit::Error::Invalid(format!( + "a timer fires {MIN_TIMER_MS} ms to {MAX_TIMER_MS} ms from now" + )))); + } + let client = self.client().map(str::to_owned); + Ok(self + .host + .schedule(client.as_deref(), &id, std::time::Duration::from_millis(u64::from(after_ms))) + .map_err(to_wit)) + } + + fn cancel_schedule(&mut self, id: String) -> wasmtime::Result<()> { + if self.host.require_api("events.schedule", 21).is_ok() { + self.host.cancel_schedule(&id); + } + Ok(()) + } + fn watch_paths(&mut self, paths: Vec) -> Fallible<()> { if let Err(e) = self.require(Capability::Events) { return Ok(Err(e)); @@ -1934,6 +1960,9 @@ impl events::Host for StoreData { /// The most paths one plugin watches outside one project (`events.watch-paths`). const MAX_WATCHED_PATHS: usize = 32; +/// Bounds of `events.schedule`: the event loop's own period, and a day. +const MIN_TIMER_MS: u32 = 250; +const MAX_TIMER_MS: u32 = 24 * 60 * 60 * 1000; impl tasks::Host for StoreData { fn begin(&mut self, title: String, cancellable: bool) -> wasmtime::Result> { diff --git a/crates/ide-plugin/tests/fixtures/api14/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/api14/dist/plugin.wasm index f2a3b3064f..918c276785 100644 Binary files a/crates/ide-plugin/tests/fixtures/api14/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/api14/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/api14/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/api14/dist/plugin.wasm.sources index 64bc00efcc..d54439d15d 100644 --- a/crates/ide-plugin/tests/fixtures/api14/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/api14/dist/plugin.wasm.sources @@ -1 +1 @@ -0db78244977b314a99277abd9259edbfc62c304e97a39d46fda547069c5186c1 +8fe67be847a6bd86dd288aa678357fd2caf28b4aa74e7067efd07961ab37ffa0 diff --git a/crates/ide-plugin/tests/fixtures/build-graph/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/build-graph/dist/plugin.wasm index cf05cb3f1e..f7f67058f0 100644 Binary files a/crates/ide-plugin/tests/fixtures/build-graph/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/build-graph/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/build-graph/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/build-graph/dist/plugin.wasm.sources index 5c28e3350c..d6c2c127a4 100644 --- a/crates/ide-plugin/tests/fixtures/build-graph/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/build-graph/dist/plugin.wasm.sources @@ -1 +1 @@ -4e7ceccb5ef879e0124f2717ae29ee7c241330a085f1628a7ea775078cddebfb +e562434a35eca32556c79381eacd380f101f03009a6aeae0d34db893bf93ba75 diff --git a/crates/ide-plugin/tests/fixtures/clipboard/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/clipboard/dist/plugin.wasm index e18916de1f..8e10d555dd 100644 Binary files a/crates/ide-plugin/tests/fixtures/clipboard/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/clipboard/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/clipboard/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/clipboard/dist/plugin.wasm.sources index 7938e7341a..e576a06321 100644 --- a/crates/ide-plugin/tests/fixtures/clipboard/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/clipboard/dist/plugin.wasm.sources @@ -1 +1 @@ -1034c381a884838c3ba6516c947ce6824c06f0dc9740a6aac9c43874649f5dd8 +3f2459f0b4b016ad28aaf4e157e43a25cda92b325ee09fbb37cccc8daa34df6b diff --git a/crates/ide-plugin/tests/fixtures/code-semantics/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/code-semantics/dist/plugin.wasm index abc05c7033..ec18c2702c 100644 Binary files a/crates/ide-plugin/tests/fixtures/code-semantics/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/code-semantics/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/code-semantics/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/code-semantics/dist/plugin.wasm.sources index 0e1fc152ee..b3cd8d03f0 100644 --- a/crates/ide-plugin/tests/fixtures/code-semantics/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/code-semantics/dist/plugin.wasm.sources @@ -1 +1 @@ -40d95bcd5086e5a20bc23d130b960e87a7c13c065d06cc05edcad931cd0d7f33 +286012eeb2145fbc92c7648e7759f1ada45e347b5421c1917cd944fc063e1863 diff --git a/crates/ide-plugin/tests/fixtures/commit/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/commit/dist/plugin.wasm index 0f1f3db08b..7a48563129 100644 Binary files a/crates/ide-plugin/tests/fixtures/commit/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/commit/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/commit/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/commit/dist/plugin.wasm.sources index d5fbb4f68c..a56cf3b1a5 100644 --- a/crates/ide-plugin/tests/fixtures/commit/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/commit/dist/plugin.wasm.sources @@ -1 +1 @@ -9b6b716f511497a37d37bdde39b8d669f78cb440ada45cdffe9dfe453bbaf930 +4fade1b835a8823e505e195b8a616093126ef670de2618ec54baac1fcbb60ce6 diff --git a/crates/ide-plugin/tests/fixtures/completion-list/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/completion-list/dist/plugin.wasm index 2b68a3d00f..2a9d514a88 100644 Binary files a/crates/ide-plugin/tests/fixtures/completion-list/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/completion-list/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/completion-list/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/completion-list/dist/plugin.wasm.sources index 899ea1f809..46396066f8 100644 --- a/crates/ide-plugin/tests/fixtures/completion-list/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/completion-list/dist/plugin.wasm.sources @@ -1 +1 @@ -c4100a64064acf9d51de0eed6b3232102df06d70eb7d3ea4793228be84e5a00d +bdff2d28e51e8c1eacc92a19b2a4e28581a9c5a895359187d83fecb5be3d3a85 diff --git a/crates/ide-plugin/tests/fixtures/completion-resolve/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/completion-resolve/dist/plugin.wasm index 3a3ec961c4..3ca8256625 100644 Binary files a/crates/ide-plugin/tests/fixtures/completion-resolve/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/completion-resolve/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/completion-resolve/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/completion-resolve/dist/plugin.wasm.sources index e28cdc795b..349ad1f869 100644 --- a/crates/ide-plugin/tests/fixtures/completion-resolve/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/completion-resolve/dist/plugin.wasm.sources @@ -1 +1 @@ -457306cdbd68b2b0aaa7073a9574d966deeb54993192f1935c1e4d0d92520d9f +e594c6b4a22cb97c7355793c3d294b966ba10b5a79cc847e47f6019489369fde diff --git a/crates/ide-plugin/tests/fixtures/custom-editor-toolbar/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/custom-editor-toolbar/dist/plugin.wasm index 5ef84f11a1..06ca067115 100644 Binary files a/crates/ide-plugin/tests/fixtures/custom-editor-toolbar/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/custom-editor-toolbar/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/custom-editor-toolbar/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/custom-editor-toolbar/dist/plugin.wasm.sources index 54b4cc6f2b..447b096681 100644 --- a/crates/ide-plugin/tests/fixtures/custom-editor-toolbar/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/custom-editor-toolbar/dist/plugin.wasm.sources @@ -1 +1 @@ -b10e885276249c17d2a41f2cc4cf7c1452eaefd2f9c2c4d1e2037f311ea0171e +af09884fe417936b2a76a6c22842630f661e3575c3862e31cad4867a4b9f9e56 diff --git a/crates/ide-plugin/tests/fixtures/data-tools/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/data-tools/dist/plugin.wasm index 856c2ff8a6..e82b9ca6bb 100644 Binary files a/crates/ide-plugin/tests/fixtures/data-tools/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/data-tools/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/data-tools/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/data-tools/dist/plugin.wasm.sources index a7b3f4a8a3..03d8e1d6d6 100644 --- a/crates/ide-plugin/tests/fixtures/data-tools/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/data-tools/dist/plugin.wasm.sources @@ -1 +1 @@ -2de813834872315bac348dbbc1f44d9e67ca3fbccf24f3d6ac2e0404d4632652 +ec069a728a1f3e914e7708f579fd1f7ce2dbd29e1483453696b15b75906be10e diff --git a/crates/ide-plugin/tests/fixtures/database-open/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/database-open/dist/plugin.wasm index 083515cadf..f6646b85f4 100644 Binary files a/crates/ide-plugin/tests/fixtures/database-open/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/database-open/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/database-open/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/database-open/dist/plugin.wasm.sources index c464e3c3db..e48fc40bdc 100644 --- a/crates/ide-plugin/tests/fixtures/database-open/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/database-open/dist/plugin.wasm.sources @@ -1 +1 @@ -dfbb456cb19f79cf4bde2961434193602659f3b357a09aa42b2c5647350a70b8 +9ee77f07270b33457abb1acca9430b83c3b8a2cd21e02e82a541e65cfa60b05d diff --git a/crates/ide-plugin/tests/fixtures/decorations/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/decorations/dist/plugin.wasm index e9d19d0e7f..b23daf62da 100644 Binary files a/crates/ide-plugin/tests/fixtures/decorations/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/decorations/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/decorations/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/decorations/dist/plugin.wasm.sources index 96cbfa70bf..35642f0a70 100644 --- a/crates/ide-plugin/tests/fixtures/decorations/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/decorations/dist/plugin.wasm.sources @@ -1 +1 @@ -2afe22a19f5d3ce2a47476de1421240dbb89a43a1b90d4e21b681be447587459 +035cb92e3fcc09302d302243f65183d1173bd04c415e2a8c5b67494ea964da26 diff --git a/crates/ide-plugin/tests/fixtures/detail-views/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/detail-views/dist/plugin.wasm index 664cd64e03..abf446788d 100644 Binary files a/crates/ide-plugin/tests/fixtures/detail-views/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/detail-views/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/detail-views/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/detail-views/dist/plugin.wasm.sources index 686c4ae350..5ef098b109 100644 --- a/crates/ide-plugin/tests/fixtures/detail-views/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/detail-views/dist/plugin.wasm.sources @@ -1 +1 @@ -da12c11b71b954be2e4526aa48300194d85b5f16657dcaf56400ddc08b3a2146 +4aef5fd2f4eb1e47877f70b752764f1d1c7345abde8722ebc314748c3b9b41d2 diff --git a/crates/ide-plugin/tests/fixtures/diagnostics/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/diagnostics/dist/plugin.wasm index cee5d700ef..fce8d90170 100644 Binary files a/crates/ide-plugin/tests/fixtures/diagnostics/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/diagnostics/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/diagnostics/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/diagnostics/dist/plugin.wasm.sources index c42e7a3e30..c20ac4b60d 100644 --- a/crates/ide-plugin/tests/fixtures/diagnostics/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/diagnostics/dist/plugin.wasm.sources @@ -1 +1 @@ -53788d2cc83b5fe02839175dc3b4a3640bf1c925eb031f9c555b60539005e84e +1e96fa8cfefd02b486c3abc060784f703529d1b7635c4b527c4ab0717cf29146 diff --git a/crates/ide-plugin/tests/fixtures/endpoints/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/endpoints/dist/plugin.wasm index 67bfded54c..f2e426140e 100644 Binary files a/crates/ide-plugin/tests/fixtures/endpoints/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/endpoints/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/endpoints/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/endpoints/dist/plugin.wasm.sources index 9a33318233..7217ab9c86 100644 --- a/crates/ide-plugin/tests/fixtures/endpoints/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/endpoints/dist/plugin.wasm.sources @@ -1 +1 @@ -d467c8dcdda58f2d83c46c259c790789747f1ca408cb7ddcef8c800dd2d57599 +35fd22ae39343dc0a606d6f31149fced471397eafe713e519a1d8b3f44805948 diff --git a/crates/ide-plugin/tests/fixtures/execution-output/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/execution-output/dist/plugin.wasm index e59d1c26db..77d4f4e871 100644 Binary files a/crates/ide-plugin/tests/fixtures/execution-output/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/execution-output/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/execution-output/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/execution-output/dist/plugin.wasm.sources index e2cde631df..ef545cd421 100644 --- a/crates/ide-plugin/tests/fixtures/execution-output/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/execution-output/dist/plugin.wasm.sources @@ -1 +1 @@ -27601dc768aa92cbdd014312031c5ccd29f771a65d955733f75dbdcb4d6847df +f70d9de39765ff84cca47030c9d7a8bca1caaadceb70d526e44821a5cbfbf6be diff --git a/crates/ide-plugin/tests/fixtures/execution/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/execution/dist/plugin.wasm index ea137f8211..5144ebf860 100644 Binary files a/crates/ide-plugin/tests/fixtures/execution/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/execution/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/execution/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/execution/dist/plugin.wasm.sources index a7d9681f5e..3d7e064a74 100644 --- a/crates/ide-plugin/tests/fixtures/execution/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/execution/dist/plugin.wasm.sources @@ -1 +1 @@ -997876fd37f0c2596de5af907ae126eeaa8be97ce12fc7fd5559d2fda71feb7c +64140ad91c947d9b672eef867e8ce86a1fa254cf41de8786c26aa64879cc69bb diff --git a/crates/ide-plugin/tests/fixtures/ext-owner/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/ext-owner/dist/plugin.wasm index 1703afe142..8db4b0076a 100644 Binary files a/crates/ide-plugin/tests/fixtures/ext-owner/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/ext-owner/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/ext-owner/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/ext-owner/dist/plugin.wasm.sources index 7a7d6af72d..ac81cfffd2 100644 --- a/crates/ide-plugin/tests/fixtures/ext-owner/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/ext-owner/dist/plugin.wasm.sources @@ -1 +1 @@ -5f9c258237bd2a038a0fe6559f1b6cddfb45c3c23ca9738768849b52b07c0540 +8daca93352b13cd876045913eed114a43b66d9f4b0ec48f2992f67f1a60ac65d diff --git a/crates/ide-plugin/tests/fixtures/file-templates/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/file-templates/dist/plugin.wasm index 32db807e01..4d69ecc65c 100644 Binary files a/crates/ide-plugin/tests/fixtures/file-templates/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/file-templates/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/file-templates/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/file-templates/dist/plugin.wasm.sources index 5fb19839bb..a43060986d 100644 --- a/crates/ide-plugin/tests/fixtures/file-templates/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/file-templates/dist/plugin.wasm.sources @@ -1 +1 @@ -6ec2d8b7c841c62d2a5d34c237ca255acc19eb8839b40fcb954896f858b785d0 +2990b5753169d476afd5be487cfdc26d4ffc66487a51a7a99ccd1e07c3cbd21c diff --git a/crates/ide-plugin/tests/fixtures/files-events/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/files-events/dist/plugin.wasm index 3925078d86..5027f613a0 100644 Binary files a/crates/ide-plugin/tests/fixtures/files-events/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/files-events/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/files-events/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/files-events/dist/plugin.wasm.sources index 9f37d9cb09..6ff98737c3 100644 --- a/crates/ide-plugin/tests/fixtures/files-events/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/files-events/dist/plugin.wasm.sources @@ -1 +1 @@ -702515bbdf2889c96c18e88d55cbbf427c59dfcbd74a855ee0564fe69321f0e3 +67233a03c58b09682303da49f3d6f209857f2ef3e910c2533a5055e233ff6096 diff --git a/crates/ide-plugin/tests/fixtures/grouped-views/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/grouped-views/dist/plugin.wasm index 76bde1892f..cc7eef2941 100644 Binary files a/crates/ide-plugin/tests/fixtures/grouped-views/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/grouped-views/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/grouped-views/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/grouped-views/dist/plugin.wasm.sources index b2ea724453..98b80c0010 100644 --- a/crates/ide-plugin/tests/fixtures/grouped-views/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/grouped-views/dist/plugin.wasm.sources @@ -1 +1 @@ -e9a13db283bb5996428ec5d8c02b71960df37e09c7096544984aa74569cd3f9b +d2f812daeae98c466e7b23450d86e583ed2db8bf7e39cd6e6005be4a0b1a08d1 diff --git a/crates/ide-plugin/tests/fixtures/hello/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/hello/dist/plugin.wasm index 42cbdbf06d..8416111a52 100644 Binary files a/crates/ide-plugin/tests/fixtures/hello/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/hello/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/hello/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/hello/dist/plugin.wasm.sources index 1c13fae2d7..91b73ad6a7 100644 --- a/crates/ide-plugin/tests/fixtures/hello/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/hello/dist/plugin.wasm.sources @@ -1 +1 @@ -a21246e41ea373db2a4076dfe58e5f93f5c2493d5af330c14a9d19b9d8519ec7 +ac7fdaffaef9f364997ce3434410f22b776e47aa98df78febad213c1a0dda2dc diff --git a/crates/ide-plugin/tests/fixtures/hover-actions/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/hover-actions/dist/plugin.wasm index 2c75bffa32..b712dfc64f 100644 Binary files a/crates/ide-plugin/tests/fixtures/hover-actions/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/hover-actions/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/hover-actions/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/hover-actions/dist/plugin.wasm.sources index 2b446397b9..e3fdb7b4d7 100644 --- a/crates/ide-plugin/tests/fixtures/hover-actions/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/hover-actions/dist/plugin.wasm.sources @@ -1 +1 @@ -719a9fbd852fa437bce882ea74eab5ec98484ecac3cb41cf3ec03aa7188753c1 +1b54498a31ffc6c373769f780c7f8510ca62787f6d0d5eafa904dd834bcadc5b diff --git a/crates/ide-plugin/tests/fixtures/hover/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/hover/dist/plugin.wasm index cc0790b97a..e3e351d311 100644 Binary files a/crates/ide-plugin/tests/fixtures/hover/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/hover/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/hover/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/hover/dist/plugin.wasm.sources index 2d72362a22..6e301d8cd8 100644 --- a/crates/ide-plugin/tests/fixtures/hover/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/hover/dist/plugin.wasm.sources @@ -1 +1 @@ -60c315d025f21d8767ecd014c8279ebe5ffae2ab21e04b8f2e7b02b9eaea4a08 +286c6f6253d58245102b9797c0d80f54749bdb51e458156f79fe54885b6a76d3 diff --git a/crates/ide-plugin/tests/fixtures/indexer/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/indexer/dist/plugin.wasm index 4fa22428cd..567fbaf356 100644 Binary files a/crates/ide-plugin/tests/fixtures/indexer/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/indexer/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/indexer/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/indexer/dist/plugin.wasm.sources index 977a9101b6..f06716d7de 100644 --- a/crates/ide-plugin/tests/fixtures/indexer/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/indexer/dist/plugin.wasm.sources @@ -1 +1 @@ -3eee6f098f4555b6572b52c92fbb727179cd0ef8a3a5a3a4f7ca56f808a108cf +67584a6306508021b9dd9453ce687b8dd73dd5c0577524172bb6ef2a506a4c86 diff --git a/crates/ide-plugin/tests/fixtures/inlay-hints/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/inlay-hints/dist/plugin.wasm index 103fdbc794..dee44b50bb 100644 Binary files a/crates/ide-plugin/tests/fixtures/inlay-hints/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/inlay-hints/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/inlay-hints/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/inlay-hints/dist/plugin.wasm.sources index 6e30a85ed3..70beef319a 100644 --- a/crates/ide-plugin/tests/fixtures/inlay-hints/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/inlay-hints/dist/plugin.wasm.sources @@ -1 +1 @@ -8852afa6aa3175cd0f229aa23a17ba99ecfb9dcc30e1d22e79bfbfc78a993821 +983f6a29e1bc6a0535cb9aea23216505f81e85f32b7497b5366568e04ccc81fd diff --git a/crates/ide-plugin/tests/fixtures/jobs/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/jobs/dist/plugin.wasm index e8c573836d..dc3e863541 100644 Binary files a/crates/ide-plugin/tests/fixtures/jobs/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/jobs/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/jobs/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/jobs/dist/plugin.wasm.sources index 1b193213c7..27c4dc88f7 100644 --- a/crates/ide-plugin/tests/fixtures/jobs/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/jobs/dist/plugin.wasm.sources @@ -1 +1 @@ -f121c229c3c859d1c653c52cb9920598e4ccb76dccf0b2171c5e8cd806287887 +483cf0a847b27bd107f385b9e256b184579d798b8e9a15dd383a938f71a94d2b diff --git a/crates/ide-plugin/tests/fixtures/language-features/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/language-features/dist/plugin.wasm index 7ba7eaa1fb..bab5f1fb3d 100644 Binary files a/crates/ide-plugin/tests/fixtures/language-features/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/language-features/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/language-features/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/language-features/dist/plugin.wasm.sources index a918ff0436..88d267ec5e 100644 --- a/crates/ide-plugin/tests/fixtures/language-features/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/language-features/dist/plugin.wasm.sources @@ -1 +1 @@ -1520af95c95473e62fc65a7d7b0c9cd0d0be63e6427e0bce8f61076a8ca36abc +9a3f69e9f7779e91106107b1fa34c13944058b8543330d55df0cc8b415d7b480 diff --git a/crates/ide-plugin/tests/fixtures/lsp-requests/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/lsp-requests/dist/plugin.wasm index bb7a64db03..a354942ce9 100644 Binary files a/crates/ide-plugin/tests/fixtures/lsp-requests/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/lsp-requests/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/lsp-requests/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/lsp-requests/dist/plugin.wasm.sources index 7e6fce7475..ad27253234 100644 --- a/crates/ide-plugin/tests/fixtures/lsp-requests/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/lsp-requests/dist/plugin.wasm.sources @@ -1 +1 @@ -4371ff5140e1ba6a6f977236c3ae0f16f7d1d9866157d6d32edc6252b39dcf55 +5b208da2e34ba9e2ce7653b2692586e8705fd5eb1466ce996a71882998ebb249 diff --git a/crates/ide-plugin/tests/fixtures/misbehave/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/misbehave/dist/plugin.wasm index bcc0752d5b..cc11c919a5 100644 Binary files a/crates/ide-plugin/tests/fixtures/misbehave/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/misbehave/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/misbehave/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/misbehave/dist/plugin.wasm.sources index 525c1e485a..0a59f806e9 100644 --- a/crates/ide-plugin/tests/fixtures/misbehave/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/misbehave/dist/plugin.wasm.sources @@ -1 +1 @@ -751cfd926cc911aa2e0e08a263ab0162ef9c9a7cb10ccc4e589b1a7ec6952def +cd715076bcce3606ec3bfadee5964a28e668f652c4c5219185aee05f5908b346 diff --git a/crates/ide-plugin/tests/fixtures/net-setting/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/net-setting/dist/plugin.wasm index 2bdd41ca15..f5d3b09339 100644 Binary files a/crates/ide-plugin/tests/fixtures/net-setting/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/net-setting/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/net-setting/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/net-setting/dist/plugin.wasm.sources index fa3ad5bc34..41d81ab556 100644 --- a/crates/ide-plugin/tests/fixtures/net-setting/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/net-setting/dist/plugin.wasm.sources @@ -1 +1 @@ -57409ecf10f15f49b0b87ad8908d3491b7cc26c8997d21400ee0bed23631a83e +d77ce6b138dbba4184e63bb178147f86fc9beae2a8dd24bba28ae696e49133a4 diff --git a/crates/ide-plugin/tests/fixtures/path-events/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/path-events/dist/plugin.wasm index 92ec855201..bc338fa7a3 100644 Binary files a/crates/ide-plugin/tests/fixtures/path-events/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/path-events/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/path-events/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/path-events/dist/plugin.wasm.sources index 90ea8e281b..baf5bdfeac 100644 --- a/crates/ide-plugin/tests/fixtures/path-events/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/path-events/dist/plugin.wasm.sources @@ -1 +1 @@ -afda156cd79a5b76b1507e40cfd2ab2f948bf7d82bf7a3564317c62d34c47bef +dfbb9da1f64f162a77feba37001b1574f785603a475365450707c615d3b8e174 diff --git a/crates/ide-plugin/tests/fixtures/private-dir/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/private-dir/dist/plugin.wasm index 00c05512cc..a6cdfff49b 100644 Binary files a/crates/ide-plugin/tests/fixtures/private-dir/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/private-dir/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/private-dir/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/private-dir/dist/plugin.wasm.sources index 92a786a98e..71a605565c 100644 --- a/crates/ide-plugin/tests/fixtures/private-dir/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/private-dir/dist/plugin.wasm.sources @@ -1 +1 @@ -af4c36aa2ccbaa4d96b6e285527d4d9de9c55da5844cda32d24e692d69668058 +9da9f094dad19091682682a241d17e4206738f2b832f4e603d8a51a54d63b701 diff --git a/crates/ide-plugin/tests/fixtures/project-view/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/project-view/dist/plugin.wasm index 6f9aa25883..9b2f6e1f4e 100644 Binary files a/crates/ide-plugin/tests/fixtures/project-view/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/project-view/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/project-view/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/project-view/dist/plugin.wasm.sources index 288b9741af..643497a644 100644 --- a/crates/ide-plugin/tests/fixtures/project-view/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/project-view/dist/plugin.wasm.sources @@ -1 +1 @@ -72a56aaf416dba436b6e3675529d25eac1f861c774ab5e8899a9a5bd37f8f1a3 +796e5d8bfe42c668d2688a72c2ad50053cde7f82888ac33e32f52ab4fec60be6 diff --git a/crates/ide-plugin/tests/fixtures/rename/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/rename/dist/plugin.wasm index d7fe53d181..a49726f3be 100644 Binary files a/crates/ide-plugin/tests/fixtures/rename/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/rename/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/rename/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/rename/dist/plugin.wasm.sources index 7dd2ddb1b0..6e81cf837b 100644 --- a/crates/ide-plugin/tests/fixtures/rename/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/rename/dist/plugin.wasm.sources @@ -1 +1 @@ -7918542fd905ee16fa2633f3cfcc404f7a882669d3b30c927028c70c58b78542 +5ff1341eac1f6703edbf557b0b6b6d6046078c00f163f7140fe987cce7715348 diff --git a/crates/ide-plugin/tests/fixtures/run-anything/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/run-anything/dist/plugin.wasm index f925f6d7ac..639e117d43 100644 Binary files a/crates/ide-plugin/tests/fixtures/run-anything/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/run-anything/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/run-anything/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/run-anything/dist/plugin.wasm.sources index b3373be920..8563d62c11 100644 --- a/crates/ide-plugin/tests/fixtures/run-anything/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/run-anything/dist/plugin.wasm.sources @@ -1 +1 @@ -aa0af7349bea316c75febc01bdac68c0ca9bfc78192df276e129044cd762306d +afa7550aef81aae6bc27229bed4d9b6ab4a5280c0321434954facd9bfb54a36e diff --git a/crates/ide-plugin/tests/fixtures/run-output/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/run-output/dist/plugin.wasm index ce3d91f795..2e5b93f8c0 100644 Binary files a/crates/ide-plugin/tests/fixtures/run-output/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/run-output/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/run-output/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/run-output/dist/plugin.wasm.sources index d5051eb274..4f4d3c5fdc 100644 --- a/crates/ide-plugin/tests/fixtures/run-output/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/run-output/dist/plugin.wasm.sources @@ -1 +1 @@ -a560827089dada8f1484242969088c505f7ee486ab5f82551c800f70a6637c9c +cf4df7af53ca6a333452a3fee0bf0687eef608dace6b70a69bfe9172f9046ad5 diff --git a/crates/ide-plugin/tests/fixtures/search/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/search/dist/plugin.wasm index 57000d3ff5..ccd72f336c 100644 Binary files a/crates/ide-plugin/tests/fixtures/search/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/search/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/search/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/search/dist/plugin.wasm.sources index f53f9942bc..9113bca40a 100644 --- a/crates/ide-plugin/tests/fixtures/search/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/search/dist/plugin.wasm.sources @@ -1 +1 @@ -b334bf475c86c7a5bf89b8dcb7838610c9ba81fdc389473e0a0716e37e0ad0f6 +ff3a5044cd50e6020ad73877e162047d2219649361480ec6ecf03267e32c5af0 diff --git a/crates/ide-plugin/tests/fixtures/semantic-tokens/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/semantic-tokens/dist/plugin.wasm index 233ddaab4b..e50512f922 100644 Binary files a/crates/ide-plugin/tests/fixtures/semantic-tokens/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/semantic-tokens/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/semantic-tokens/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/semantic-tokens/dist/plugin.wasm.sources index b6a98d68be..66a1b4ee3c 100644 --- a/crates/ide-plugin/tests/fixtures/semantic-tokens/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/semantic-tokens/dist/plugin.wasm.sources @@ -1 +1 @@ -7c1d4bd1b2fde8d3e110b3b7d383cf4a2df387a2414a34f91b8d711285b280f5 +2d2e5aad65cc1c3ac1c89762dc304e4905259d6ef864f91edf2b74c80b2073e5 diff --git a/crates/ide-plugin/tests/fixtures/settings-pages/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/settings-pages/dist/plugin.wasm index 6dea390b8c..e96ab1855d 100644 Binary files a/crates/ide-plugin/tests/fixtures/settings-pages/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/settings-pages/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/settings-pages/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/settings-pages/dist/plugin.wasm.sources index eeed9fed14..fcdc72b9ab 100644 --- a/crates/ide-plugin/tests/fixtures/settings-pages/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/settings-pages/dist/plugin.wasm.sources @@ -1 +1 @@ -13fa1388bfe546450b2ac30fecf69c6b0cde7fb937ed73ad7fc5c240708a1820 +93f7cb61f482db2032ff1aa1cc3f7dd4078be13fcd579e439da0f2b7670eba18 diff --git a/crates/ide-plugin/tests/fixtures/storage/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/storage/dist/plugin.wasm index 01ab9a0077..d61c19f987 100644 Binary files a/crates/ide-plugin/tests/fixtures/storage/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/storage/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/storage/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/storage/dist/plugin.wasm.sources index 1f5d1173c6..9ee083a324 100644 --- a/crates/ide-plugin/tests/fixtures/storage/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/storage/dist/plugin.wasm.sources @@ -1 +1 @@ -3bc1b36422bf070db59c4f2e8ed80370af220b8516e48f99bcb7f0c73ce06cf7 +9f7553a1db7109d654f0a92714ccd61e1d06cd6e4603aa5fcd5262391f2635d4 diff --git a/crates/ide-plugin/tests/fixtures/symbols/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/symbols/dist/plugin.wasm index 3cf764d8fb..7821b30529 100644 Binary files a/crates/ide-plugin/tests/fixtures/symbols/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/symbols/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/symbols/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/symbols/dist/plugin.wasm.sources index 149976e339..b1e84b7793 100644 --- a/crates/ide-plugin/tests/fixtures/symbols/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/symbols/dist/plugin.wasm.sources @@ -1 +1 @@ -70e0d484e345cd18c9d19ff2246a949d20d013231f8e8221e71bb42187352a54 +4a99c00d8b1db2fe44cef75b0f07c03766aca5cc42f7ad0d3d8b562961d617d3 diff --git a/crates/ide-plugin/tests/fixtures/syntax-decorations/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/syntax-decorations/dist/plugin.wasm index 8d2e12c4e5..42ffcf2bb2 100644 Binary files a/crates/ide-plugin/tests/fixtures/syntax-decorations/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/syntax-decorations/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/syntax-decorations/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/syntax-decorations/dist/plugin.wasm.sources index cbcacd5fdc..2ef2afe118 100644 --- a/crates/ide-plugin/tests/fixtures/syntax-decorations/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/syntax-decorations/dist/plugin.wasm.sources @@ -1 +1 @@ -f2dc5445b02f4a8e3ec602695c0ec39176a6d744c0874ed32450c6e9747e702c +d800c982b3f3bba00f73a93464694ba41799e36490b8d67868f75c72390b3af0 diff --git a/crates/ide-plugin/tests/fixtures/tables/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/tables/dist/plugin.wasm index 9b1e5934f3..bbdaf7478f 100644 Binary files a/crates/ide-plugin/tests/fixtures/tables/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/tables/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/tables/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/tables/dist/plugin.wasm.sources index 29abc5379e..5e63d318cf 100644 --- a/crates/ide-plugin/tests/fixtures/tables/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/tables/dist/plugin.wasm.sources @@ -1 +1 @@ -29a7eb777cce864cc12198b00fd07f39383931dd512e66c2cc3f31ffb5095f40 +66408b8c3fb5272aeba999d4dfdf49f6080abadd83268b66365ea4a655465f1d diff --git a/crates/ide-plugin/tests/fixtures/timers/Cargo.lock b/crates/ide-plugin/tests/fixtures/timers/Cargo.lock new file mode 100644 index 0000000000..70de0a5c1f --- /dev/null +++ b/crates/ide-plugin/tests/fixtures/timers/Cargo.lock @@ -0,0 +1,337 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "anyhow" +version = "1.0.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cb931c189b85683d69a5cfad41d4d418671e1ac413dd209f3f2fc31e3cfd902" + +[[package]] +name = "bitflags" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06" + +[[package]] +name = "equivalent" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826" + +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + +[[package]] +name = "hashbrown" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "735eaa21a6a5ffb2e84362faaeb90c05ba8e19797ca30428478cb6ea3a4921bc" +dependencies = [ + "foldhash", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + +[[package]] +name = "indexmap" +version = "2.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855" +dependencies = [ + "equivalent", + "hashbrown", + "serde", + "serde_core", +] + +[[package]] +name = "itoa" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bd1574e617a9a6c1f8f8181bd7e841e1f20e4277607ef28945765188d6284d4" + +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + +[[package]] +name = "log" +version = "0.4.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d15f86d12da44cd8d4ec3c73984537eb7f4cadcb9776a575a0a8a05ca11005c" + +[[package]] +name = "macro-string" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e7b3a5bbb2f63aaa223a671ea1bd0e7bc16bd30ce387324cf63995deaddbbd2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "openidea-plugin" +version = "0.1.0" +dependencies = [ + "serde", + "serde_json", + "wit-bindgen", +] + +[[package]] +name = "openidea-test-timers" +version = "0.1.0" +dependencies = [ + "openidea-plugin", + "serde_json", +] + +[[package]] +name = "prettyplease" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bfe0f4c752e450fc2faf62654f1c134747922825d5b04ca717b8874f41a40c0" +dependencies = [ + "proc-macro2", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.154" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "syn" +version = "3.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" + +[[package]] +name = "wasm-encoder" +version = "0.262.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4495a6f85dd94c411c749303efcbc5defade0b0cbdbc0541495241ab917a9b5a" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.262.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c86ff6668190d9fb70372b306b4f9fe8930f0e2f57ce72e4922bf2f117900949" +dependencies = [ + "anyhow", + "indexmap", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasmparser" +version = "0.262.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "974d643b125b272607e2fff8012ea14a8328acd7621e4bafa7afb32500052b1b" +dependencies = [ + "bitflags", + "hashbrown", + "indexmap", + "semver", +] + +[[package]] +name = "wit-bindgen" +version = "0.63.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b85a987ab61d365382d25c7d47e26edd48941b3bf6e3fbf76eff918bc71dab06" +dependencies = [ + "bitflags", + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen-core" +version = "0.63.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "775e122e390603abfacd548027016cd0113a6e2bf2f8ce6bdd3658b013456ea8" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.63.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84e26e13b9d972026778d2ffb7985736de116026fdc8d9464f966e12df2eb240" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "prettyplease", + "syn", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.63.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16a008a0d6b4840677326beb4edbeb210a2f1b7d0183fb7cc33f466b90fd7fb6" +dependencies = [ + "anyhow", + "macro-string", + "prettyplease", + "proc-macro2", + "quote", + "syn", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.262.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "078def49fdb49cab405c3006e05793b3fdaf7069126ba6b9c97d01ec8c98fe4c" +dependencies = [ + "anyhow", + "bitflags", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.262.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00f0dc051466ffe46787721fca3d088536f158ae400be044f1b1c386ba9397ad" +dependencies = [ + "anyhow", + "hashbrown", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-ident", + "wasmparser", +] + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/crates/ide-plugin/tests/fixtures/timers/Cargo.toml b/crates/ide-plugin/tests/fixtures/timers/Cargo.toml new file mode 100644 index 0000000000..74937e4a25 --- /dev/null +++ b/crates/ide-plugin/tests/fixtures/timers/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "openidea-test-timers" +version = "0.1.0" +edition = "2024" +publish = false + +[workspace] + +[lib] +crate-type = ["cdylib", "rlib"] + +[dependencies] +openidea-plugin = { path = "../../../../../sdk/rust/openidea-plugin" } +serde_json = "1" + +[profile.release] +opt-level = "s" +lto = true +strip = true +codegen-units = 1 +panic = "abort" diff --git a/crates/ide-plugin/tests/fixtures/timers/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/timers/dist/plugin.wasm new file mode 100644 index 0000000000..8a4304a572 Binary files /dev/null and b/crates/ide-plugin/tests/fixtures/timers/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/timers/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/timers/dist/plugin.wasm.sources new file mode 100644 index 0000000000..536e1f6aeb --- /dev/null +++ b/crates/ide-plugin/tests/fixtures/timers/dist/plugin.wasm.sources @@ -0,0 +1 @@ +c18e21c5a77a5ed36aad3ed2471077f72572ebaa41bd0dc70ee61754d6d61b2a diff --git a/crates/ide-plugin/tests/fixtures/timers/plugin.toml b/crates/ide-plugin/tests/fixtures/timers/plugin.toml new file mode 100644 index 0000000000..ebdbda4ce9 --- /dev/null +++ b/crates/ide-plugin/tests/fixtures/timers/plugin.toml @@ -0,0 +1,21 @@ +id = "timers" +name = "Timers test" +version = "0.1.0" +engines.openidea = "^1.21" +wasm = "dist/plugin.wasm" +activation = ["on-command:*"] + +[capabilities] +required = ["storage"] + +[[contributes.commands]] +id = "schedule" +title = "Set the timer given as ` `" + +[[contributes.commands]] +id = "cancel" +title = "Cancel the timer given" + +[[contributes.commands]] +id = "fired" +title = "Read the ids of the timers that fired" diff --git a/crates/ide-plugin/tests/fixtures/timers/src/lib.rs b/crates/ide-plugin/tests/fixtures/timers/src/lib.rs new file mode 100644 index 0000000000..076efa7926 --- /dev/null +++ b/crates/ide-plugin/tests/fixtures/timers/src/lib.rs @@ -0,0 +1,35 @@ +use openidea_plugin::{Error, Event, Invocation, Plugin, host, register_plugin}; + +#[derive(Default)] +struct Timers; + +impl Plugin for Timers { + fn run_command(&mut self, id: &str, _ctx: &Invocation, arg: Option<&str>) -> Result, Error> { + match id { + "schedule" => { + let (timer, ms) = arg.unwrap_or_default().split_once(' ').ok_or(Error::Invalid(" ".into()))?; + host::schedule(timer, ms.parse().map_err(|_| Error::Invalid(ms.into()))?)?; + Ok(None) + } + "cancel" => { + host::cancel_schedule(arg.unwrap_or_default()); + Ok(None) + } + "fired" => host::storage::get("fired"), + _ => Err(Error::NotFound(id.into())), + } + } + + fn handle_events(&mut self, events: &[Event], _ctx: &Invocation) { + let mut fired: Vec = + host::storage::get("fired").unwrap().map(|s| serde_json::from_str(&s).unwrap()).unwrap_or_default(); + for event in events { + if let Event::Timer(id) = event { + fired.push(id.clone()); + } + } + host::storage::set("fired", &serde_json::to_string(&fired).unwrap()).unwrap(); + } +} + +register_plugin!(Timers); diff --git a/crates/ide-plugin/tests/fixtures/view-badge/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/view-badge/dist/plugin.wasm index 7aca31f90c..a656440f52 100644 Binary files a/crates/ide-plugin/tests/fixtures/view-badge/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/view-badge/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/view-badge/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/view-badge/dist/plugin.wasm.sources index c29e902cc0..588e821f71 100644 --- a/crates/ide-plugin/tests/fixtures/view-badge/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/view-badge/dist/plugin.wasm.sources @@ -1 +1 @@ -e4745a11c1d9beeae6dab7d0774e5e90c8740ffa0643973a9b85a368c9dd6464 +782557f40a49df00c0b12404fa3cc8d7c5e254b2b07cb29d15e7f74c90f1108d diff --git a/crates/ide-plugin/tests/fixtures/watch-paths/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/watch-paths/dist/plugin.wasm index 979ac3d475..81fa58d3d1 100644 Binary files a/crates/ide-plugin/tests/fixtures/watch-paths/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/watch-paths/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/watch-paths/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/watch-paths/dist/plugin.wasm.sources index b82005c6bc..dce50b0bc3 100644 --- a/crates/ide-plugin/tests/fixtures/watch-paths/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/watch-paths/dist/plugin.wasm.sources @@ -1 +1 @@ -df4dceb0f45c836259a08be8aafcbdf728d0486ec486ee819f0dc12dedf137bb +dcef27565a9411c02d78f25dfdfcf05f87a3970df7c5112b49eabc2a506db5c1 diff --git a/crates/ide-plugin/tests/fixtures/web-content/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/web-content/dist/plugin.wasm index 1fd507dc8e..659ab643c9 100644 Binary files a/crates/ide-plugin/tests/fixtures/web-content/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/web-content/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/web-content/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/web-content/dist/plugin.wasm.sources index a709a4b00d..d08d35b2cf 100644 --- a/crates/ide-plugin/tests/fixtures/web-content/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/web-content/dist/plugin.wasm.sources @@ -1 +1 @@ -da5c7d95581c90df9e596fc19d82105bbbeedcf4fed83a3599dea93d5da25ce6 +e2f1d94e8bd24a8e4eb85fd0e683962c009aa5d8b76c1c6e5cb2d54f7b7e309a diff --git a/crates/ide-plugin/tests/fixtures/web-log/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/web-log/dist/plugin.wasm index 3528b16048..6004ae5ddf 100644 Binary files a/crates/ide-plugin/tests/fixtures/web-log/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/web-log/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/web-log/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/web-log/dist/plugin.wasm.sources index 6ae5290155..9ccdafc99e 100644 --- a/crates/ide-plugin/tests/fixtures/web-log/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/web-log/dist/plugin.wasm.sources @@ -1 +1 @@ -cd5bdebb3876d335deecafedf8bdcae25419285de7dc61d23d17e965c7522bfc +f9685cf1fa4e435214afda56931a8503299fe29941c5e3ceba474c564329c6ca diff --git a/crates/ide-plugin/tests/fixtures/web-pty/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/web-pty/dist/plugin.wasm index bcb2a58037..6edf72e03d 100644 Binary files a/crates/ide-plugin/tests/fixtures/web-pty/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/web-pty/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/web-pty/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/web-pty/dist/plugin.wasm.sources index 2573550062..70737ee6e6 100644 --- a/crates/ide-plugin/tests/fixtures/web-pty/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/web-pty/dist/plugin.wasm.sources @@ -1 +1 @@ -c690bf2cf9912f9fbcd1a7eaef49ed931b9a87f81fce1b80025c5cd8ddafd4e3 +fe1d58e1532b13d4773391855f315da51042da21d05a2882604db36a14644cc9 diff --git a/docs/en/plugins/guides/commands.mdx b/docs/en/plugins/guides/commands.mdx index 37a8b72d95..a806398d1a 100644 --- a/docs/en/plugins/guides/commands.mdx +++ b/docs/en/plugins/guides/commands.mdx @@ -335,6 +335,7 @@ in `Plugin::handle_events(events, ctx)` (WIT `events.wit`, export `event-handler | `input-mode-changed` | `events.input` | API 1.4: Vim mode changes in the focused editor | | `watched-files-changed` | `events` | API 1.18: paths watched with `host::watch_paths` changed | | `scheduled` | none | The `on-schedule:` period elapsed | +| `timer` | none | API 1.21: a `host::schedule` timer fired (`Event::Timer(id)`) | Events arrive in batches, oldest first, per window. An idle plugin collects them for 2 seconds before it is woken. `host::subscribe_paths(kind, &["config/*.yaml"])` (API 1.3) @@ -342,7 +343,11 @@ filters `file-opened`, `file-saved` and `files-changed` by project-relative glob `host::watch_paths(&paths)` (API 1.18) watches files and directories outside the window's project that an `fs.read` grant covers (a directory flat, at most 32 paths) and delivers `watched-files-changed` with absolute paths; the watches end with the project, its window or -the grant, and nothing remote is watched. Kinds +the grant, and nothing remote is watched. `host::schedule(id, after_ms)` (API 1.21) wakes the +plugin once, 250 ms to 24 h later, with `Event::Timer(id)` in the window of the call that set +it; setting an id again replaces it, so retries and backoff stay the plugin's own policy, and +`host::cancel_schedule(id)` drops it (at most 16 pending; they end with the window or when the +plugin stops, not on idle reclaim). Kinds newer than the SDK arrive as `Event::Other { kind, data }`; match the `#[non_exhaustive]` enum with a `_` arm. [Key Promoter](https://github.com/l0ng-ai/openidea/tree/main/plugins/official/key-promoter) (`action-performed`) and [Git Toolbox](https://github.com/l0ng-ai/openidea/tree/main/plugins/official/git-toolbox) diff --git a/docs/en/plugins/lifecycle.mdx b/docs/en/plugins/lifecycle.mdx index 5212bbb0ad..53eebc81fe 100644 --- a/docs/en/plugins/lifecycle.mdx +++ b/docs/en/plugins/lifecycle.mdx @@ -21,7 +21,7 @@ Declared contributions (commands, menus, themes, settings pages, …) are live a Code is instantiated lazily, when one of the plugin's commands runs or when an event listed in `activation` fires (see [Manifest › Activation](/en/plugins/manifest#activation)). On each new instance the IDE calls `Plugin::activate`; subscribe to events and restore state there. An error from `activate` fails the activation. -An instance unused for **5 minutes** is reclaimed: `deactivate` runs and the plugin is not running again until its next event. `on-schedule` activates it when due but does not keep it alive. Keep nothing in memory you can't rebuild in `activate`. +An instance unused for **5 minutes** is reclaimed: `deactivate` runs and the plugin is not running again until its next event. `on-schedule` and `host::schedule` timers activate it when due but do not keep it alive. Keep nothing in memory you can't rebuild in `activate`. ```rust use openidea_plugin::{Context, Error, EventKind, Plugin, host}; @@ -50,6 +50,7 @@ impl Plugin for MyPlugin { | `action-performed` | `events.input` | An IDE action ran: id, title, source (keyboard, menu, toolbar…), shortcut | | `input-mode-changed` | `events.input` | The focused editor's Vim mode changed (API 1.4) | | `scheduled` | none | The `on-schedule` period elapsed | +| `timer` | none | A timer the plugin set with `host::schedule` fired (API 1.21), without subscribing | | `run-exited`, `terminal-exited`, `content-tab-action` | none | A run, terminal or content tab this plugin started finished or sent an action (API 1.4) | Subscribe in code with `host::subscribe(EventKind::…)` (it lasts for the session, across idle reclaim) or declare `activation = ["on-event:"]` to receive events before first use. `host::subscribe_paths(kind, globs)` (API 1.3) narrows `file-opened`, `file-saved` and `files-changed` to project-relative globs; the host filters before waking the plugin. diff --git a/docs/en/plugins/versioning.mdx b/docs/en/plugins/versioning.mdx index 6858d246a0..9babff0c79 100644 --- a/docs/en/plugins/versioning.mdx +++ b/docs/en/plugins/versioning.mdx @@ -12,30 +12,30 @@ The plugin API has one version number: the version of the WIT package in [`wit/` ## Versions -| API | Shipped with | Highlights | -| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| 1.0.0 | OpenIDEA 0.1.36 | The base API: commands, events, storage, tasks, project and editor access, VCS, diagnostics, network and secrets, processes, declarative views and custom editors, settings, editor providers, syntax provider | -| 1.1.0 | OpenIDEA 0.1.37 | `vcs.remotes`, `ui.copy-to-clipboard`, `ui.open-url`, opening a project file at a line from a view | -| 1.2.0 | OpenIDEA 0.1.38 | Background document indexers, pickers, input boxes and confirmations, plugin context keys for `when` clauses, the files selected in the Project view, a manifest `icon`, the `viewItem.context` menu | -| 1.3.0 | OpenIDEA 0.1.39 | Commit message and before-commit checks, Services detail panes, diagnostics while typing, hover, inlay hints, semantic tokens, file-changing code actions, HTTP endpoints, files outside the project (`fs.read`/`fs.write`, `project.write`, private plugin directory), batched `files-changed` events and path filters, workspace symbols, long-running processes, notifications with buttons, translations, multi-page settings, file template variables, web view PTYs, log tabs and content tabs | -| 1.4.0 | OpenIDEA 0.1.40 | `net.http:`, `ipc:`, `ide.commands` and `database.sources` capabilities; editor and project snapshots, decorations, text search, Problems, Git log/blame/diff; output channels; OAuth loopback; runs, terminal sessions, run configurations, test result parsing and run targets; formatting and other language features; embedded languages; snippets; more menu locations; database sources; MCP tools | -| 1.5.0 | OpenIDEA 0.1.41 | `Project::notify` (a notification in one project's window), the `net:ask` capability, run target validation, per-command run target working-directory arguments | -| 1.6.0 | OpenIDEA 0.1.43 | Bounded, project-bound background WebSockets for event-stream plugins | -| 1.7.0 | OpenIDEA 0.1.44 | `views.open-diff`: two texts in the diff viewer, such as a review's file before and after | -| 1.8.0 | OpenIDEA 0.1.45 | The `problems-changed` workbench event: the host keeps every producer's diagnostics per file, so an annotation follows the file rather than the invoking window | -| 1.9.0 | OpenIDEA 0.1.46 | Run configurations with an environment and a debugger, requests to a running language server (`lsp:`), server commands routed to plugins, editor panels | -| 1.10.0 | OpenIDEA 0.1.47 | `build.dependencies`: the Maven / Gradle dependency graph the IDE resolved (`build.read`) | -| 1.11.0 | OpenIDEA 0.1.48 | `ui.read-clipboard`: the clipboard's text and image in commands the user ran (`clipboard.read`) | -| 1.12.0 | OpenIDEA 0.1.49 | `ui.set-console-rules`: highlight rules (regex, palette colours, styles) for Run and Debug console output | -| 1.13.0 | OpenIDEA 0.1.49 | Optional `search-provider` export and `searchCategories`: custom Search Everywhere tabs with cancellable queries | -| 1.14.0 | OpenIDEA 0.1.50 | Optional `hover-actions` export: left-edge line actions revealed by line-edge hover, with an anchor line and inclusive trigger range; `[[contributes.javaAgents]]` `vmOptions` / `jdk`: JVM flags (optionally JetBrains Runtime–only) before `-javaagent:`; `ui.set-status-item-menu` / `set-window-status-item-menu`: a menu on a status bar item | -| 1.15.0 | OpenIDEA 0.1.51 | `caret-moved` event; declarative `[[contributes.skills]]` (`path = "skills//SKILL.md"`) for bundling agent skills in plugins | -| 1.16.0 | OpenIDEA 0.1.52 | Optional `completion-list-provider` export: completion marked incomplete is asked again while typing on, without re-asking the language server or other plugins; `decorations.set-markdown`: line-end decorations whose hover is a Markdown card | -| 1.17.0 | OpenIDEA 0.1.53 | `decorations.set-styled`: editor decorations with their own `#rrggbb` / `#rrggbbaa` foreground and background, for colors outside the theme palette | -| 1.18.0 | OpenIDEA 0.1.54 | `[[contributes.overlays]]`: a package web page floating over the workbench that never takes the keyboard focus, placed and resized through `openidea.overlay`; `[[contributes.dialogs]]`: a package web page in a modal, resizable IDE dialog opened with `views.reveal`, with a `closed` view event and `openidea.dialog.close()`; `events.subscribe-paths-with-options` (`debounce-ms`), `workspace.project.generation` and `FilesChanged` project/generation fields, stale run target/configuration rejection, and the `project-closed` lifecycle event; `execution-configurations`, `run.start-with-options` and `runDetectors.outputMode`: `pipes` or `pty` console output for plugin run configurations; `[[contributes.runAnything]]` with the `run-anything-provider` export: Run Anything lines starting with the plugin's prefix; `views.open-terminal-session-in`: a keyed terminal in a project directory; `workspace.invoking-project`: the project of the window a call serves, also in `gutter-actions` and `hover-actions`; `events.watch-paths` and the `watched-files-changed` event: files and directories outside the project, within `fs.read` grants; the `run-configuration-completion` export: completion in the Arguments field of the plugin's own run configurations; `services.context` and `services.toolbar` menus on the IDE's own Services nodes, with the selected services as the command argument; `executor` on `[[contributes.javaAgents]]`: "Run/Debug '\' with \" beside Run and Debug, the only launches that get that agent, also startable from the plugin's own commands with a configuration id; grant-scoped `agents.fork-session`: fork a recorded native agent session (`claude`, `codex`, or `copilot`) into a new task in the invoking window's project (`agents` capability), with the host validating the session and building the fork invocation itself | -| 1.19.0 | OpenIDEA 0.1.56 | `[capabilities.reasons]`: the plugin's own sentence on why it asks for a capability, shown below the host's description in the permission dialog and Settings › Plugins; `settings.open` / `settings.open-permissions`: open Settings at one of the plugin's own pages or at its permissions; `net.fetch-stream`: a response whose body is read as it arrives (server-sent events, streamed model replies), with the SDK's `host::fetch_stream` and `sse` parser; `editor.open-as-text`: open a file in the built-in text editor even when a custom editor claims it (the SDK's `host::open_editor_as_text`); the `openIn` menu: the **Open In** submenu of the editor, its tab and the Project view | -| 1.20.0 | OpenIDEA 0.1.57 | Database table context menus and read-only table schema inspection (`database.schema`). Optional `syntax-decorations-provider` export: foreground marks on an open text editor, in the theme tokens `rainbow-1` … `rainbow-5` or its own `#rrggbb` colours for dark and light themes, and a bounded slice of the editor's syntax tree. | -| 1.21.0 | In development | Run lifecycle & Run Config extensions: `run-started` event, `run-exited` for user-launched plugin runs, `run.stop`, `"java"` in `attach-child`, `prepareCommand` `mode` (`"run"` / `"debug"`) and loopback `javaDebug` JDWP attach, `run.upsert-configuration`, `run.open-edit-configurations`, `ownsBeforeLaunch`, transient `logFiles` log-tail tabs (`project.read` / `fs.read`), and the `runConsole.toolbar` menu. Settings controls: `presentation` (`radio`, `segmented`, `slider`, `color`, `checkbox-list`), `enumOptions` labels, hints and icons for `enum` values, `minimum` / `maximum` / `step`, and `when` conditions that hide a setting. `build.sdks` and `build.artifacts` under `build.read`: read installed JDKs/Maven/toolchains (`active` marking the project selection), build-model Maven/Gradle WAR artifacts, and Project Structure › Artifacts definitions (with `id`, `origin`, and `tool`) in trusted projects. `TextEditor::visible_lines` under `editor.read`: the first and last document line on screen when the command or event was invoked. `cloneSources`: plugin pages in the Clone Repository dialog's source list. `popup = true` on `[[contributes.dialogs]]`: a lightweight popup that closes on a click outside it or when the window loses focus. Database discovery and SQL execution in trusted projects: `database.connected-sources`, `database.list-schemas`, and `database.list-tables` under `database.schema`, plus bounded `database.execute-query` under the separate high-risk `database.query` capability. Run devices: `[[contributes.devices]]` lists emulators, simulators and phones in a title bar chooser for the configurations it applies to. Project view panes (`[[contributes.projectViewPanes]]`, the `project-view-provider` export, `project-view.refresh` / `select-in`, `projectViewContext` menu items) under `project.read`; `git.branches.popup` / `git.branch.context` menus with `invocation.git-action-context` and `views.open-revision-comparison` under `vcs.read`. `views.set-badge` (`host::set_view_badge`): per-window stripe badges for a plugin's declared `[[contributes.views]]` (at most 4 characters, `> 99` as `"99+"`, cleared on disable/reload/uninstall). `customEditor.toolbar` menu: SVG command toolbar strip above the text half of a plugin's split or preview custom editor. `decorations.set-actionable` under `project.read`: styled decorations whose Markdown hover cards carry up to 4 buttons running the plugin's declared commands. `agents.start-task` under `agents`: a new task in the invoking window's project, created unsent with the prompt prefilled in the Agents window for the user to review and send, optionally continuing a recorded session as a fork. | +| API | Shipped with | Highlights | +| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 1.0.0 | OpenIDEA 0.1.36 | The base API: commands, events, storage, tasks, project and editor access, VCS, diagnostics, network and secrets, processes, declarative views and custom editors, settings, editor providers, syntax provider | +| 1.1.0 | OpenIDEA 0.1.37 | `vcs.remotes`, `ui.copy-to-clipboard`, `ui.open-url`, opening a project file at a line from a view | +| 1.2.0 | OpenIDEA 0.1.38 | Background document indexers, pickers, input boxes and confirmations, plugin context keys for `when` clauses, the files selected in the Project view, a manifest `icon`, the `viewItem.context` menu | +| 1.3.0 | OpenIDEA 0.1.39 | Commit message and before-commit checks, Services detail panes, diagnostics while typing, hover, inlay hints, semantic tokens, file-changing code actions, HTTP endpoints, files outside the project (`fs.read`/`fs.write`, `project.write`, private plugin directory), batched `files-changed` events and path filters, workspace symbols, long-running processes, notifications with buttons, translations, multi-page settings, file template variables, web view PTYs, log tabs and content tabs | +| 1.4.0 | OpenIDEA 0.1.40 | `net.http:`, `ipc:`, `ide.commands` and `database.sources` capabilities; editor and project snapshots, decorations, text search, Problems, Git log/blame/diff; output channels; OAuth loopback; runs, terminal sessions, run configurations, test result parsing and run targets; formatting and other language features; embedded languages; snippets; more menu locations; database sources; MCP tools | +| 1.5.0 | OpenIDEA 0.1.41 | `Project::notify` (a notification in one project's window), the `net:ask` capability, run target validation, per-command run target working-directory arguments | +| 1.6.0 | OpenIDEA 0.1.43 | Bounded, project-bound background WebSockets for event-stream plugins | +| 1.7.0 | OpenIDEA 0.1.44 | `views.open-diff`: two texts in the diff viewer, such as a review's file before and after | +| 1.8.0 | OpenIDEA 0.1.45 | The `problems-changed` workbench event: the host keeps every producer's diagnostics per file, so an annotation follows the file rather than the invoking window | +| 1.9.0 | OpenIDEA 0.1.46 | Run configurations with an environment and a debugger, requests to a running language server (`lsp:`), server commands routed to plugins, editor panels | +| 1.10.0 | OpenIDEA 0.1.47 | `build.dependencies`: the Maven / Gradle dependency graph the IDE resolved (`build.read`) | +| 1.11.0 | OpenIDEA 0.1.48 | `ui.read-clipboard`: the clipboard's text and image in commands the user ran (`clipboard.read`) | +| 1.12.0 | OpenIDEA 0.1.49 | `ui.set-console-rules`: highlight rules (regex, palette colours, styles) for Run and Debug console output | +| 1.13.0 | OpenIDEA 0.1.49 | Optional `search-provider` export and `searchCategories`: custom Search Everywhere tabs with cancellable queries | +| 1.14.0 | OpenIDEA 0.1.50 | Optional `hover-actions` export: left-edge line actions revealed by line-edge hover, with an anchor line and inclusive trigger range; `[[contributes.javaAgents]]` `vmOptions` / `jdk`: JVM flags (optionally JetBrains Runtime–only) before `-javaagent:`; `ui.set-status-item-menu` / `set-window-status-item-menu`: a menu on a status bar item | +| 1.15.0 | OpenIDEA 0.1.51 | `caret-moved` event; declarative `[[contributes.skills]]` (`path = "skills//SKILL.md"`) for bundling agent skills in plugins | +| 1.16.0 | OpenIDEA 0.1.52 | Optional `completion-list-provider` export: completion marked incomplete is asked again while typing on, without re-asking the language server or other plugins; `decorations.set-markdown`: line-end decorations whose hover is a Markdown card | +| 1.17.0 | OpenIDEA 0.1.53 | `decorations.set-styled`: editor decorations with their own `#rrggbb` / `#rrggbbaa` foreground and background, for colors outside the theme palette | +| 1.18.0 | OpenIDEA 0.1.54 | `[[contributes.overlays]]`: a package web page floating over the workbench that never takes the keyboard focus, placed and resized through `openidea.overlay`; `[[contributes.dialogs]]`: a package web page in a modal, resizable IDE dialog opened with `views.reveal`, with a `closed` view event and `openidea.dialog.close()`; `events.subscribe-paths-with-options` (`debounce-ms`), `workspace.project.generation` and `FilesChanged` project/generation fields, stale run target/configuration rejection, and the `project-closed` lifecycle event; `execution-configurations`, `run.start-with-options` and `runDetectors.outputMode`: `pipes` or `pty` console output for plugin run configurations; `[[contributes.runAnything]]` with the `run-anything-provider` export: Run Anything lines starting with the plugin's prefix; `views.open-terminal-session-in`: a keyed terminal in a project directory; `workspace.invoking-project`: the project of the window a call serves, also in `gutter-actions` and `hover-actions`; `events.watch-paths` and the `watched-files-changed` event: files and directories outside the project, within `fs.read` grants; the `run-configuration-completion` export: completion in the Arguments field of the plugin's own run configurations; `services.context` and `services.toolbar` menus on the IDE's own Services nodes, with the selected services as the command argument; `executor` on `[[contributes.javaAgents]]`: "Run/Debug '\' with \" beside Run and Debug, the only launches that get that agent, also startable from the plugin's own commands with a configuration id; grant-scoped `agents.fork-session`: fork a recorded native agent session (`claude`, `codex`, or `copilot`) into a new task in the invoking window's project (`agents` capability), with the host validating the session and building the fork invocation itself | +| 1.19.0 | OpenIDEA 0.1.56 | `[capabilities.reasons]`: the plugin's own sentence on why it asks for a capability, shown below the host's description in the permission dialog and Settings › Plugins; `settings.open` / `settings.open-permissions`: open Settings at one of the plugin's own pages or at its permissions; `net.fetch-stream`: a response whose body is read as it arrives (server-sent events, streamed model replies), with the SDK's `host::fetch_stream` and `sse` parser; `editor.open-as-text`: open a file in the built-in text editor even when a custom editor claims it (the SDK's `host::open_editor_as_text`); the `openIn` menu: the **Open In** submenu of the editor, its tab and the Project view | +| 1.20.0 | OpenIDEA 0.1.57 | Database table context menus and read-only table schema inspection (`database.schema`). Optional `syntax-decorations-provider` export: foreground marks on an open text editor, in the theme tokens `rainbow-1` … `rainbow-5` or its own `#rrggbb` colours for dark and light themes, and a bounded slice of the editor's syntax tree. | +| 1.21.0 | In development | Run lifecycle & Run Config extensions: `run-started` event, `run-exited` for user-launched plugin runs, `run.stop`, `"java"` in `attach-child`, `prepareCommand` `mode` (`"run"` / `"debug"`) and loopback `javaDebug` JDWP attach, `run.upsert-configuration`, `run.open-edit-configurations`, `ownsBeforeLaunch`, transient `logFiles` log-tail tabs (`project.read` / `fs.read`), and the `runConsole.toolbar` menu. Settings controls: `presentation` (`radio`, `segmented`, `slider`, `color`, `checkbox-list`), `enumOptions` labels, hints and icons for `enum` values, `minimum` / `maximum` / `step`, and `when` conditions that hide a setting. `build.sdks` and `build.artifacts` under `build.read`: read installed JDKs/Maven/toolchains (`active` marking the project selection), build-model Maven/Gradle WAR artifacts, and Project Structure › Artifacts definitions (with `id`, `origin`, and `tool`) in trusted projects. `TextEditor::visible_lines` under `editor.read`: the first and last document line on screen when the command or event was invoked. `cloneSources`: plugin pages in the Clone Repository dialog's source list. `popup = true` on `[[contributes.dialogs]]`: a lightweight popup that closes on a click outside it or when the window loses focus. Database discovery and SQL execution in trusted projects: `database.connected-sources`, `database.list-schemas`, and `database.list-tables` under `database.schema`, plus bounded `database.execute-query` under the separate high-risk `database.query` capability. Run devices: `[[contributes.devices]]` lists emulators, simulators and phones in a title bar chooser for the configurations it applies to. Project view panes (`[[contributes.projectViewPanes]]`, the `project-view-provider` export, `project-view.refresh` / `select-in`, `projectViewContext` menu items) under `project.read`; `git.branches.popup` / `git.branch.context` menus with `invocation.git-action-context` and `views.open-revision-comparison` under `vcs.read`. `views.set-badge` (`host::set_view_badge`): per-window stripe badges for a plugin's declared `[[contributes.views]]` (at most 4 characters, `> 99` as `"99+"`, cleared on disable/reload/uninstall). `customEditor.toolbar` menu: SVG command toolbar strip above the text half of a plugin's split or preview custom editor. `decorations.set-actionable` under `project.read`: styled decorations whose Markdown hover cards carry up to 4 buttons running the plugin's declared commands. `agents.start-task` under `agents`: a new task in the invoking window's project, created unsent with the prompt prefilled in the Agents window for the user to review and send, optionally continuing a recorded session as a fork. `events.schedule` / `events.cancel-schedule` (`host::schedule`): one-shot timers a plugin sets for itself (250 ms to 24 h, at most 16 pending, replaced by id), firing a `timer` event in the window that set them, without a capability. | The full list of what each version added is in [`plugins/README.md`](https://github.com/l0ng-ai/openidea/blob/main/plugins/README.md). diff --git a/docs/zh/plugins/guides/commands.mdx b/docs/zh/plugins/guides/commands.mdx index 5c4e3c3396..426c9afd9c 100644 --- a/docs/zh/plugins/guides/commands.mdx +++ b/docs/zh/plugins/guides/commands.mdx @@ -286,25 +286,28 @@ API 1.5 新增 `Project::notify(level, title, body, actions)`:只在该项目 或声明 `activation = ["on-event:file-saved"]` 让第一个事件唤醒插件,然后在 `Plugin::handle_events(events, ctx)` 中批量处理(WIT `events.wit`,导出 `event-handler`)。 -| 类型 | 权限 | 触发时机 | -| ----------------------- | -------------- | ------------------------------------------------- | -| `file-opened` | `events` | 文件在编辑器中打开 | -| `file-saved` | `events` | 文件写入磁盘之后 | -| `file-closed` | `events` | API 1.4:编辑器关闭(JSON 路径字符串) | -| `files-changed` | `events` | API 1.3:打开项目中防抖后的新建 / 修改 / 删除路径 | -| `editor-focused` | `events` | 获得焦点的编辑器变化 | -| `vcs-changed` | `events` | 仓库状态变化(提交、检出、拉取等) | -| `settings-changed` | `events` | API 1.4:插件中发生变化的设置键 | -| `action-performed` | `events.input` | 执行了 IDE 动作:id、标题、来源、快捷键 | -| `input-mode-changed` | `events.input` | API 1.4:当前编辑器的 Vim 模式变化 | -| `watched-files-changed` | `events` | API 1.18:用 `host::watch_paths` 监听的路径有变化 | -| `scheduled` | 无 | `on-schedule:` 的周期到了 | +| 类型 | 权限 | 触发时机 | +| ----------------------- | -------------- | --------------------------------------------------------------- | +| `file-opened` | `events` | 文件在编辑器中打开 | +| `file-saved` | `events` | 文件写入磁盘之后 | +| `file-closed` | `events` | API 1.4:编辑器关闭(JSON 路径字符串) | +| `files-changed` | `events` | API 1.3:打开项目中防抖后的新建 / 修改 / 删除路径 | +| `editor-focused` | `events` | 获得焦点的编辑器变化 | +| `vcs-changed` | `events` | 仓库状态变化(提交、检出、拉取等) | +| `settings-changed` | `events` | API 1.4:插件中发生变化的设置键 | +| `action-performed` | `events.input` | 执行了 IDE 动作:id、标题、来源、快捷键 | +| `input-mode-changed` | `events.input` | API 1.4:当前编辑器的 Vim 模式变化 | +| `watched-files-changed` | `events` | API 1.18:用 `host::watch_paths` 监听的路径有变化 | +| `scheduled` | 无 | `on-schedule:` 的周期到了 | +| `timer` | 无 | API 1.21:`host::schedule` 设的定时器到点(`Event::Timer(id)`) | 事件按窗口分批送达,旧的在前。空闲的插件会先攒 2 秒再被唤醒。`host::subscribe_paths(kind, &["config/*.yaml"])` (API 1.3)可以按项目相对通配符过滤 `file-opened`、`file-saved` 和 `files-changed`。 `host::watch_paths(&paths)`(API 1.18)监听窗口项目之外、`fs.read` 授权覆盖的文件和目录(目录只看自身条目, 不递归,最多 32 个路径),以绝对路径发送 `watched-files-changed`;项目、窗口关闭或授权撤销时监听随之结束, -不监听任何远程内容。比 SDK 新的事件类型以 +不监听任何远程内容。`host::schedule(id, after_ms)`(API 1.21)在 250 毫秒到 24 小时后唤醒插件一次, +在设置它的调用所属窗口里送达 `Event::Timer(id)`;同一个 id 再设一次即替换,重试和退避策略由插件自己决定, +`host::cancel_schedule(id)` 取消(每个插件最多 16 个待触发;窗口关闭或插件停止时结束,空闲回收不影响)。比 SDK 新的事件类型以 `Event::Other { kind, data }` 送达;这个枚举标记了 `#[non_exhaustive]`,匹配时要加 `_` 分支。 可运行的示例见 [Key Promoter](https://github.com/l0ng-ai/openidea/tree/main/plugins/official/key-promoter) (`action-performed`)和 [Git Toolbox](https://github.com/l0ng-ai/openidea/tree/main/plugins/official/git-toolbox) diff --git a/docs/zh/plugins/lifecycle.mdx b/docs/zh/plugins/lifecycle.mdx index 8779ce843d..9b0438a6ad 100644 --- a/docs/zh/plugins/lifecycle.mdx +++ b/docs/zh/plugins/lifecycle.mdx @@ -21,7 +21,7 @@ description: "插件代码何时加载和卸载、事件如何送达,以及如 代码按需实例化:执行插件的某个命令,或发生 `activation` 中列出的事件时(见 [Manifest](/zh/plugins/manifest) 中的“激活”一节)。每创建一个新实例,IDE 都会调用 `Plugin::activate`,在这里订阅事件、恢复状态。`activate` 返回错误则本次激活失败。 -实例 **5 分钟**没有调用就会被回收:执行 `deactivate`,插件回到未运行状态,直到下一个事件到来。`on-schedule` 到点会激活插件,但不会让它一直存活。不要在内存里保存 `activate` 中无法重建的东西。 +实例 **5 分钟**没有调用就会被回收:执行 `deactivate`,插件回到未运行状态,直到下一个事件到来。`on-schedule` 和 `host::schedule` 定时器到点会激活插件,但不会让它一直存活。不要在内存里保存 `activate` 中无法重建的东西。 ```rust use openidea_plugin::{Context, Error, EventKind, Plugin, host}; @@ -50,6 +50,7 @@ impl Plugin for MyPlugin { | `action-performed` | `events.input` | 执行了某个 IDE 操作:id、标题、来源(键盘、菜单、工具栏等)、快捷键 | | `input-mode-changed` | `events.input` | 焦点编辑器的 Vim 模式变化(API 1.4) | | `scheduled` | 无 | `on-schedule` 的周期到了 | +| `timer` | 无 | 插件用 `host::schedule` 设的定时器到点(API 1.21),无需订阅 | | `run-exited`、`terminal-exited`、`content-tab-action` | 无 | 本插件启动的运行、终端或内容标签页结束或发来操作(API 1.4) | 在代码中用 `host::subscribe(EventKind::…)` 订阅(在整个会话内有效,空闲回收后仍然保留),或者声明 `activation = ["on-event:"]`,在首次使用前就能收到事件。`host::subscribe_paths(kind, globs)`(API 1.3)可以把 `file-opened`、`file-saved` 和 `files-changed` 限定到项目相对路径的 glob;宿主会在唤醒插件之前完成过滤。 diff --git a/docs/zh/plugins/versioning.mdx b/docs/zh/plugins/versioning.mdx index 9a5efd2533..da9625b988 100644 --- a/docs/zh/plugins/versioning.mdx +++ b/docs/zh/plugins/versioning.mdx @@ -9,30 +9,30 @@ description: "engines.openidea、插件 API 从 1.0 到 1.23 的各个版本, ## 版本历史 -| API | 随哪个版本发布 | 主要内容 | -| ------ | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| 1.0.0 | OpenIDEA 0.1.36 | 基础 API:命令、事件、存储、任务、项目和编辑器访问、VCS、诊断、网络与密钥、进程、声明式视图和自定义编辑器、设置、编辑器 provider、syntax provider | -| 1.1.0 | OpenIDEA 0.1.37 | `vcs.remotes`、`ui.copy-to-clipboard`、`ui.open-url`,从视图中打开项目文件的指定行 | -| 1.2.0 | OpenIDEA 0.1.38 | 后台文档索引器;选择器、输入框和确认框;插件自定义的 `when` 上下文键;项目视图中选中的文件;清单 `icon`;`viewItem.context` 菜单 | -| 1.3.0 | OpenIDEA 0.1.39 | 提交信息和提交前检查、Services 详情面板、输入时诊断、悬停、内嵌提示、语义 token、改动文件的代码操作、HTTP 端点、项目外文件(`fs.read`/`fs.write`、`project.write`、插件私有目录)、批量 `files-changed` 事件和路径过滤、工作区符号、长时间运行的进程、带按钮的通知、翻译、多页设置、文件模板变量、Web 视图 PTY、日志标签页和内容标签页 | -| 1.4.0 | OpenIDEA 0.1.40 | `net.http:`、`ipc:`、`ide.commands` 和 `database.sources` 能力;编辑器与项目快照、装饰、文本搜索、问题视图、Git log/blame/diff;输出通道;OAuth 回环;运行、终端会话、运行配置、测试结果解析和运行目标;格式化等语言功能;嵌入语言;代码片段;更多菜单位置;数据库数据源;MCP 工具 | -| 1.5.0 | OpenIDEA 0.1.41 | `Project::notify`(只在某个项目的窗口中显示通知)、`net:ask` 能力、运行目标启动前校验、运行目标按命令设置工作目录参数 | -| 1.6.0 | OpenIDEA 0.1.43 | 面向事件流插件、受容量限制且绑定项目的后台 WebSocket | -| 1.7.0 | OpenIDEA 0.1.44 | `views.open-diff`:在差异查看器中对比两段文本,例如评审中某个文件的修改前后 | -| 1.8.0 | OpenIDEA 0.1.45 | `problems-changed` 工作台事件:宿主按文件保存每个生产者的诊断,注解跟着文件走,而不是跟着调用它的窗口 | -| 1.9.0 | OpenIDEA 0.1.46 | 带环境变量和调试器的运行配置、向正在运行的语言服务器发送请求(`lsp:`)、交给插件处理的服务器命令、编辑器面板 | -| 1.10.0 | OpenIDEA 0.1.47 | `build.dependencies`:IDE 已解析的 Maven / Gradle 依赖图(`build.read`) | -| 1.11.0 | OpenIDEA 0.1.48 | `ui.read-clipboard`:在用户运行的命令中读取剪贴板的文本和图片(`clipboard.read`) | -| 1.12.0 | OpenIDEA 0.1.49 | `ui.set-console-rules`:Run/Debug 控制台输出的高亮规则(正则、调色板颜色、文本样式) | -| 1.13.0 | OpenIDEA 0.1.49 | 新增 `search-provider` 导出和 `searchCategories` 贡献点:可取消查询的全局搜索自定义分类 | -| 1.14.0 | OpenIDEA 0.1.50 | 可选 `hover-actions` 导出:行内侧 hover 显示的左侧操作,带锚定行和包含式触发行范围; `[[contributes.javaAgents]]` 的 `vmOptions` / `jdk`:在 `-javaagent:` 之前注入 JVM 参数(可选仅 JetBrains Runtime);`ui.set-status-item-menu` / `set-window-status-item-menu`:状态栏项菜单 | -| 1.15.0 | OpenIDEA 0.1.51 | `caret-moved` 事件;声明式 `[[contributes.skills]]`(`path = "skills//SKILL.md"`),在插件包中打包代理技能 | -| 1.16.0 | OpenIDEA 0.1.52 | 可选 `completion-list-provider` 导出:标记为不完整的补全在继续输入时再次询问,不会重新询问语言服务器和其他插件;`decorations.set-markdown`:悬停显示 Markdown 卡片的行尾装饰 | -| 1.17.0 | OpenIDEA 0.1.53 | `decorations.set-styled`:自带 `#rrggbb` / `#rrggbbaa` 前景色和背景色的编辑器装饰,用于主题调色板之外的颜色 | -| 1.18.0 | OpenIDEA 0.1.54 | `[[contributes.overlays]]`:悬浮在工作台上方、从不抢占键盘焦点的插件网页,可通过 `openidea.overlay` 移动和调整大小;`[[contributes.dialogs]]`:插件网页显示在可调整大小的模态对话框中,用 `views.reveal` 打开,关闭时发 `closed` 视图事件,页面可调用 `openidea.dialog.close()`;`events.subscribe-paths-with-options`(`debounce-ms`)、`workspace.project.generation` 与 `FilesChanged` 的 `project`/`generation` 字段、过期运行目标/配置拒绝以及 `project-closed` 生命周期事件;`execution-configurations`、`run.start-with-options` 与 `runDetectors.outputMode`:插件运行配置的控制台输出方式(`pipes` 或 `pty`);`[[contributes.runAnything]]` 与 `run-anything-provider` 导出:以插件前缀开头的 Run Anything 行;`views.open-terminal-session-in`:在项目子目录中打开带 key 的终端;`workspace.invoking-project`:本次调用所服务窗口的项目,`gutter-actions` 和 `hover-actions` 中也可用;`events.watch-paths` 与 `watched-files-changed` 事件:监听项目之外、`fs.read` 授权范围内的文件和目录;`run-configuration-completion` 导出:补全插件自己运行配置的“实参”字段;`services.context` 和 `services.toolbar` 菜单:作用于 IDE 自带的 Services 节点,命令参数是选中的服务;`[[contributes.javaAgents]]` 的 `executor`:运行和调试旁边的“使用 \ 运行/调试 '\'”,只有经它启动时才加载该代理,插件自己的命令也可用配置 id 经它启动;需授权的 `agents.fork-session`:把录制的原生 agent 会话(`claude`、`codex` 或 `copilot`)派生为调用窗口项目中的新任务(`agents` 能力),宿主自行校验会话并构造 fork 调用 | -| 1.19.0 | OpenIDEA 0.1.56 | `[capabilities.reasons]`:插件用一句话说明为什么需要某个能力,显示在授权对话框和 设置 › 插件 中宿主说明的下方;`settings.open` / `settings.open-permissions`:打开设置并定位到插件自己的页面或它的权限;`net.fetch-stream`:边到达边读取响应体(服务器推送事件 SSE、模型的流式回复),SDK 提供 `host::fetch_stream` 和 `sse` 解析器;`editor.open-as-text`:即使文件被自定义编辑器认领,也用内置文本编辑器打开(SDK 的 `host::open_editor_as_text`);菜单点 `openIn`:编辑器、标签页和项目视图的 **打开方式** 子菜单 | -| 1.20.0 | OpenIDEA 0.1.57 | 数据库表的上下文菜单和只读表结构查看(`database.schema`)。可选的 `syntax-decorations-provider` 导出:用主题 token `rainbow-1` … `rainbow-5` 或自带的深色/浅色主题 `#rrggbb` 颜色,给打开的文本编辑器中的范围涂前景色,依据编辑器语法树的有界片段。 | -| 1.21.0 | `main` 上开发中 | 运行配置与运行生命周期扩展:`run-started` 事件与用户启动配置时的 `run-exited`、`run.stop`、`attach-child` 支持 `"java"`、`prepareCommand` 传入 `mode`(`"run"` / `"debug"`)并支持回环 `javaDebug` 附加 JDWP 调试器、`run.upsert-configuration`、`run.open-edit-configurations`、`ownsBeforeLaunch`、控制台日志文件实时标签页 `logFiles`(按 `project.read` / `fs.read` 授权)以及 `runConsole.toolbar` 菜单位置。设置控件:`presentation`(`radio`、`segmented`、`slider`、`color`、`checkbox-list`),为 `enum` 值提供标签、说明和图标的 `enumOptions`,`minimum` / `maximum` / `step`,以及隐藏设置的 `when` 条件。`build.read` 新增 `build.sdks` 与 `build.artifacts`:在受信任项目中读取已安装的 JDK / Maven / 工具链(带项目当前选中的 `active` 标记)以及构建模型 Maven/Gradle WAR 产物和 Project Structure › Artifacts 定义(含 `id`、`origin` 与 `tool`)。`editor.read` 下的 `TextEditor::visible_lines`:命令或事件触发时屏幕上显示的首行和末行。`[[contributes.dialogs]]` 的 `popup = true`:轻量弹出层,点击外部或窗口失去焦点时关闭。`cloneSources`:Clone Repository 对话框来源列表中的插件页面。受信任项目中的数据库发现与 SQL 执行:`database.schema` 新增 `database.connected-sources`、`database.list-schemas`、`database.list-tables`;新增独立高风险能力 `database.query` 与有界的 `database.execute-query`。 运行设备:`[[contributes.devices]]` 在标题栏的设备选择器中列出模拟器和手机,用于其适用的运行配置。Project 视图窗格(`[[contributes.projectViewPanes]]`、`project-view-provider` 导出、`project-view.refresh` / `select-in`、`projectViewContext` 菜单项),需要 `project.read`;`git.branches.popup` / `git.branch.context` 菜单、`invocation.git-action-context` 与 `views.open-revision-comparison`,需要 `vcs.read`。`views.set-badge`(`host::set_view_badge`):按窗口为插件声明的 `[[contributes.views]]` 设置边栏徽章(最多 4 个字符,`> 99` 显示为 `"99+"`,禁用/重载/卸载时自动清除)。`customEditor.toolbar` 菜单位置:在插件分屏或预览自定义编辑器的文本编辑区上方显示 SVG 命令工具栏。`project.read` 新增 `decorations.set-actionable`:样式化装饰的 Markdown 悬浮卡片可带最多 4 个按钮,运行插件自己声明的命令。`agents` 能力新增 `agents.start-task`:在调用窗口的项目中创建新任务,只预填提示词、不代为发送,任务在 Agents 窗口中打开,由用户审阅后发送;可选按 `fork-session` 的规则续接录制的原生会话。 | +| API | 随哪个版本发布 | 主要内容 | +| ------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| 1.0.0 | OpenIDEA 0.1.36 | 基础 API:命令、事件、存储、任务、项目和编辑器访问、VCS、诊断、网络与密钥、进程、声明式视图和自定义编辑器、设置、编辑器 provider、syntax provider | +| 1.1.0 | OpenIDEA 0.1.37 | `vcs.remotes`、`ui.copy-to-clipboard`、`ui.open-url`,从视图中打开项目文件的指定行 | +| 1.2.0 | OpenIDEA 0.1.38 | 后台文档索引器;选择器、输入框和确认框;插件自定义的 `when` 上下文键;项目视图中选中的文件;清单 `icon`;`viewItem.context` 菜单 | +| 1.3.0 | OpenIDEA 0.1.39 | 提交信息和提交前检查、Services 详情面板、输入时诊断、悬停、内嵌提示、语义 token、改动文件的代码操作、HTTP 端点、项目外文件(`fs.read`/`fs.write`、`project.write`、插件私有目录)、批量 `files-changed` 事件和路径过滤、工作区符号、长时间运行的进程、带按钮的通知、翻译、多页设置、文件模板变量、Web 视图 PTY、日志标签页和内容标签页 | +| 1.4.0 | OpenIDEA 0.1.40 | `net.http:`、`ipc:`、`ide.commands` 和 `database.sources` 能力;编辑器与项目快照、装饰、文本搜索、问题视图、Git log/blame/diff;输出通道;OAuth 回环;运行、终端会话、运行配置、测试结果解析和运行目标;格式化等语言功能;嵌入语言;代码片段;更多菜单位置;数据库数据源;MCP 工具 | +| 1.5.0 | OpenIDEA 0.1.41 | `Project::notify`(只在某个项目的窗口中显示通知)、`net:ask` 能力、运行目标启动前校验、运行目标按命令设置工作目录参数 | +| 1.6.0 | OpenIDEA 0.1.43 | 面向事件流插件、受容量限制且绑定项目的后台 WebSocket | +| 1.7.0 | OpenIDEA 0.1.44 | `views.open-diff`:在差异查看器中对比两段文本,例如评审中某个文件的修改前后 | +| 1.8.0 | OpenIDEA 0.1.45 | `problems-changed` 工作台事件:宿主按文件保存每个生产者的诊断,注解跟着文件走,而不是跟着调用它的窗口 | +| 1.9.0 | OpenIDEA 0.1.46 | 带环境变量和调试器的运行配置、向正在运行的语言服务器发送请求(`lsp:`)、交给插件处理的服务器命令、编辑器面板 | +| 1.10.0 | OpenIDEA 0.1.47 | `build.dependencies`:IDE 已解析的 Maven / Gradle 依赖图(`build.read`) | +| 1.11.0 | OpenIDEA 0.1.48 | `ui.read-clipboard`:在用户运行的命令中读取剪贴板的文本和图片(`clipboard.read`) | +| 1.12.0 | OpenIDEA 0.1.49 | `ui.set-console-rules`:Run/Debug 控制台输出的高亮规则(正则、调色板颜色、文本样式) | +| 1.13.0 | OpenIDEA 0.1.49 | 新增 `search-provider` 导出和 `searchCategories` 贡献点:可取消查询的全局搜索自定义分类 | +| 1.14.0 | OpenIDEA 0.1.50 | 可选 `hover-actions` 导出:行内侧 hover 显示的左侧操作,带锚定行和包含式触发行范围; `[[contributes.javaAgents]]` 的 `vmOptions` / `jdk`:在 `-javaagent:` 之前注入 JVM 参数(可选仅 JetBrains Runtime);`ui.set-status-item-menu` / `set-window-status-item-menu`:状态栏项菜单 | +| 1.15.0 | OpenIDEA 0.1.51 | `caret-moved` 事件;声明式 `[[contributes.skills]]`(`path = "skills//SKILL.md"`),在插件包中打包代理技能 | +| 1.16.0 | OpenIDEA 0.1.52 | 可选 `completion-list-provider` 导出:标记为不完整的补全在继续输入时再次询问,不会重新询问语言服务器和其他插件;`decorations.set-markdown`:悬停显示 Markdown 卡片的行尾装饰 | +| 1.17.0 | OpenIDEA 0.1.53 | `decorations.set-styled`:自带 `#rrggbb` / `#rrggbbaa` 前景色和背景色的编辑器装饰,用于主题调色板之外的颜色 | +| 1.18.0 | OpenIDEA 0.1.54 | `[[contributes.overlays]]`:悬浮在工作台上方、从不抢占键盘焦点的插件网页,可通过 `openidea.overlay` 移动和调整大小;`[[contributes.dialogs]]`:插件网页显示在可调整大小的模态对话框中,用 `views.reveal` 打开,关闭时发 `closed` 视图事件,页面可调用 `openidea.dialog.close()`;`events.subscribe-paths-with-options`(`debounce-ms`)、`workspace.project.generation` 与 `FilesChanged` 的 `project`/`generation` 字段、过期运行目标/配置拒绝以及 `project-closed` 生命周期事件;`execution-configurations`、`run.start-with-options` 与 `runDetectors.outputMode`:插件运行配置的控制台输出方式(`pipes` 或 `pty`);`[[contributes.runAnything]]` 与 `run-anything-provider` 导出:以插件前缀开头的 Run Anything 行;`views.open-terminal-session-in`:在项目子目录中打开带 key 的终端;`workspace.invoking-project`:本次调用所服务窗口的项目,`gutter-actions` 和 `hover-actions` 中也可用;`events.watch-paths` 与 `watched-files-changed` 事件:监听项目之外、`fs.read` 授权范围内的文件和目录;`run-configuration-completion` 导出:补全插件自己运行配置的“实参”字段;`services.context` 和 `services.toolbar` 菜单:作用于 IDE 自带的 Services 节点,命令参数是选中的服务;`[[contributes.javaAgents]]` 的 `executor`:运行和调试旁边的“使用 \ 运行/调试 '\'”,只有经它启动时才加载该代理,插件自己的命令也可用配置 id 经它启动;需授权的 `agents.fork-session`:把录制的原生 agent 会话(`claude`、`codex` 或 `copilot`)派生为调用窗口项目中的新任务(`agents` 能力),宿主自行校验会话并构造 fork 调用 | +| 1.19.0 | OpenIDEA 0.1.56 | `[capabilities.reasons]`:插件用一句话说明为什么需要某个能力,显示在授权对话框和 设置 › 插件 中宿主说明的下方;`settings.open` / `settings.open-permissions`:打开设置并定位到插件自己的页面或它的权限;`net.fetch-stream`:边到达边读取响应体(服务器推送事件 SSE、模型的流式回复),SDK 提供 `host::fetch_stream` 和 `sse` 解析器;`editor.open-as-text`:即使文件被自定义编辑器认领,也用内置文本编辑器打开(SDK 的 `host::open_editor_as_text`);菜单点 `openIn`:编辑器、标签页和项目视图的 **打开方式** 子菜单 | +| 1.20.0 | OpenIDEA 0.1.57 | 数据库表的上下文菜单和只读表结构查看(`database.schema`)。可选的 `syntax-decorations-provider` 导出:用主题 token `rainbow-1` … `rainbow-5` 或自带的深色/浅色主题 `#rrggbb` 颜色,给打开的文本编辑器中的范围涂前景色,依据编辑器语法树的有界片段。 | +| 1.21.0 | `main` 上开发中 | 运行配置与运行生命周期扩展:`run-started` 事件与用户启动配置时的 `run-exited`、`run.stop`、`attach-child` 支持 `"java"`、`prepareCommand` 传入 `mode`(`"run"` / `"debug"`)并支持回环 `javaDebug` 附加 JDWP 调试器、`run.upsert-configuration`、`run.open-edit-configurations`、`ownsBeforeLaunch`、控制台日志文件实时标签页 `logFiles`(按 `project.read` / `fs.read` 授权)以及 `runConsole.toolbar` 菜单位置。设置控件:`presentation`(`radio`、`segmented`、`slider`、`color`、`checkbox-list`),为 `enum` 值提供标签、说明和图标的 `enumOptions`,`minimum` / `maximum` / `step`,以及隐藏设置的 `when` 条件。`build.read` 新增 `build.sdks` 与 `build.artifacts`:在受信任项目中读取已安装的 JDK / Maven / 工具链(带项目当前选中的 `active` 标记)以及构建模型 Maven/Gradle WAR 产物和 Project Structure › Artifacts 定义(含 `id`、`origin` 与 `tool`)。`editor.read` 下的 `TextEditor::visible_lines`:命令或事件触发时屏幕上显示的首行和末行。`[[contributes.dialogs]]` 的 `popup = true`:轻量弹出层,点击外部或窗口失去焦点时关闭。`cloneSources`:Clone Repository 对话框来源列表中的插件页面。受信任项目中的数据库发现与 SQL 执行:`database.schema` 新增 `database.connected-sources`、`database.list-schemas`、`database.list-tables`;新增独立高风险能力 `database.query` 与有界的 `database.execute-query`。 运行设备:`[[contributes.devices]]` 在标题栏的设备选择器中列出模拟器和手机,用于其适用的运行配置。Project 视图窗格(`[[contributes.projectViewPanes]]`、`project-view-provider` 导出、`project-view.refresh` / `select-in`、`projectViewContext` 菜单项),需要 `project.read`;`git.branches.popup` / `git.branch.context` 菜单、`invocation.git-action-context` 与 `views.open-revision-comparison`,需要 `vcs.read`。`views.set-badge`(`host::set_view_badge`):按窗口为插件声明的 `[[contributes.views]]` 设置边栏徽章(最多 4 个字符,`> 99` 显示为 `"99+"`,禁用/重载/卸载时自动清除)。`customEditor.toolbar` 菜单位置:在插件分屏或预览自定义编辑器的文本编辑区上方显示 SVG 命令工具栏。`project.read` 新增 `decorations.set-actionable`:样式化装饰的 Markdown 悬浮卡片可带最多 4 个按钮,运行插件自己声明的命令。`agents` 能力新增 `agents.start-task`:在调用窗口的项目中创建新任务,只预填提示词、不代为发送,任务在 Agents 窗口中打开,由用户审阅后发送;可选按 `fork-session` 的规则续接录制的原生会话。`events.schedule` / `events.cancel-schedule`(`host::schedule`):插件给自己设的一次性定时器(250 毫秒到 24 小时,最多 16 个待触发,同 id 替换),到点在设置它的窗口送达 `timer` 事件,无需能力。 | 每个版本新增内容的完整列表见 [`plugins/README.md`](https://github.com/l0ng-ai/openidea/blob/main/plugins/README.md)。 diff --git a/plugins/official/ai-completion/dist/plugin.wasm b/plugins/official/ai-completion/dist/plugin.wasm index 0716f7101d..6b6834c757 100644 Binary files a/plugins/official/ai-completion/dist/plugin.wasm and b/plugins/official/ai-completion/dist/plugin.wasm differ diff --git a/plugins/official/ai-completion/dist/plugin.wasm.sources b/plugins/official/ai-completion/dist/plugin.wasm.sources index 8f0579d8d1..25d13cd5ee 100644 --- a/plugins/official/ai-completion/dist/plugin.wasm.sources +++ b/plugins/official/ai-completion/dist/plugin.wasm.sources @@ -1 +1 @@ -4114c1fa6bf70eb90eab6b95a9405c41a08ef529e7c5dcd62fc9e53814be7cdd +ea55623acc40ce9fe25970ddaeb8f5c38583799d05877d4b0856228f8307f313 diff --git a/plugins/official/blame-annotations/dist/plugin.wasm b/plugins/official/blame-annotations/dist/plugin.wasm index 960b4f9996..7b537356e8 100644 Binary files a/plugins/official/blame-annotations/dist/plugin.wasm and b/plugins/official/blame-annotations/dist/plugin.wasm differ diff --git a/plugins/official/blame-annotations/dist/plugin.wasm.sources b/plugins/official/blame-annotations/dist/plugin.wasm.sources index c72ab02b26..17d956eba1 100644 --- a/plugins/official/blame-annotations/dist/plugin.wasm.sources +++ b/plugins/official/blame-annotations/dist/plugin.wasm.sources @@ -1 +1 @@ -1c93f2dc6820ca0e25338f5bd8cbe508f362794365e4b1fc0118ac4d7d465272 +b56e7d2d72b65c597f949e33e4ef03b51420e1156a11a461fd87be4a83e80f9f diff --git a/plugins/official/checkstyle/dist/plugin.wasm b/plugins/official/checkstyle/dist/plugin.wasm index 86c3e128c2..c4e8556f57 100644 Binary files a/plugins/official/checkstyle/dist/plugin.wasm and b/plugins/official/checkstyle/dist/plugin.wasm differ diff --git a/plugins/official/checkstyle/dist/plugin.wasm.sources b/plugins/official/checkstyle/dist/plugin.wasm.sources index bd41d62414..a52a52420c 100644 --- a/plugins/official/checkstyle/dist/plugin.wasm.sources +++ b/plugins/official/checkstyle/dist/plugin.wasm.sources @@ -1 +1 @@ -c25e0a30245fa6bd377ae0d971aee640461a932e41b9e68918703c0ac6bcf5c9 +e1f408e8813beeee950280ca5f7d4ebb6ea3051b944ad23dfab5725b03cdf737 diff --git a/plugins/official/container-runner/dist/plugin.wasm b/plugins/official/container-runner/dist/plugin.wasm index a654583a52..b8af2f2484 100644 Binary files a/plugins/official/container-runner/dist/plugin.wasm and b/plugins/official/container-runner/dist/plugin.wasm differ diff --git a/plugins/official/container-runner/dist/plugin.wasm.sources b/plugins/official/container-runner/dist/plugin.wasm.sources index 252f278582..745639d2e2 100644 --- a/plugins/official/container-runner/dist/plugin.wasm.sources +++ b/plugins/official/container-runner/dist/plugin.wasm.sources @@ -1 +1 @@ -2ce86c3cc40be5e8ed29c1cf3ab306c46fac9ee10a4db7ebb7a14357f09db4de +0f6eae3e8bfa788b09fc7355a001de1385080b3005f848f288135bca2fec0923 diff --git a/plugins/official/csv-editor/dist/plugin.wasm b/plugins/official/csv-editor/dist/plugin.wasm index ed31f4ca17..9b1f72134f 100644 Binary files a/plugins/official/csv-editor/dist/plugin.wasm and b/plugins/official/csv-editor/dist/plugin.wasm differ diff --git a/plugins/official/csv-editor/dist/plugin.wasm.sources b/plugins/official/csv-editor/dist/plugin.wasm.sources index 13dc8d432a..90d244fe39 100644 --- a/plugins/official/csv-editor/dist/plugin.wasm.sources +++ b/plugins/official/csv-editor/dist/plugin.wasm.sources @@ -1 +1 @@ -063bebebede8153bcc9122bbd0c06cc88546b62facbd9a65563d0100e7082db7 +b26d3ea39f00f3375b47a42cc3ee86ad537a96c5d9cb3b6c267dbf9c9652e04e diff --git a/plugins/official/git-toolbox/dist/plugin.wasm b/plugins/official/git-toolbox/dist/plugin.wasm index 52bc73799a..622c0aa1a7 100644 Binary files a/plugins/official/git-toolbox/dist/plugin.wasm and b/plugins/official/git-toolbox/dist/plugin.wasm differ diff --git a/plugins/official/git-toolbox/dist/plugin.wasm.sources b/plugins/official/git-toolbox/dist/plugin.wasm.sources index 12956419de..1cc456ece6 100644 --- a/plugins/official/git-toolbox/dist/plugin.wasm.sources +++ b/plugins/official/git-toolbox/dist/plugin.wasm.sources @@ -1 +1 @@ -08c42627d0795581d97993f04e789fa473d1d193899c29d9473a81b4f122e74d +68b51aae87f44982368b53dadbfff62db25e2c7bad1ea509cbc5c17153091525 diff --git a/plugins/official/graphviz/dist/plugin.wasm b/plugins/official/graphviz/dist/plugin.wasm index 819eb539db..e9a56b84e0 100644 Binary files a/plugins/official/graphviz/dist/plugin.wasm and b/plugins/official/graphviz/dist/plugin.wasm differ diff --git a/plugins/official/graphviz/dist/plugin.wasm.sources b/plugins/official/graphviz/dist/plugin.wasm.sources index 0809df97d5..aeae7150d2 100644 --- a/plugins/official/graphviz/dist/plugin.wasm.sources +++ b/plugins/official/graphviz/dist/plugin.wasm.sources @@ -1 +1 @@ -6bff92acb12ea72cb432ea0bff3737b94885c477f00f283035e78b06c160a012 +3c2b58a6ebfaaa20c686cc521fd6cdedd7003295bcecbe955f99159144a15e3e diff --git a/plugins/official/key-promoter/dist/plugin.wasm b/plugins/official/key-promoter/dist/plugin.wasm index 8eeb2d08ca..2303bbfc6b 100644 Binary files a/plugins/official/key-promoter/dist/plugin.wasm and b/plugins/official/key-promoter/dist/plugin.wasm differ diff --git a/plugins/official/key-promoter/dist/plugin.wasm.sources b/plugins/official/key-promoter/dist/plugin.wasm.sources index 392a167dfe..4705751370 100644 --- a/plugins/official/key-promoter/dist/plugin.wasm.sources +++ b/plugins/official/key-promoter/dist/plugin.wasm.sources @@ -1 +1 @@ -829e573d57291f7b8bbc19baaf0efb83e50f45f274e08ce525f941dd6ad1fe00 +b58aa00ea5aa14ace374f7be4bf1f99ab302db3da635b7cecb02e0edd99e522a diff --git a/plugins/official/license-header/dist/plugin.wasm b/plugins/official/license-header/dist/plugin.wasm index e720e47d39..09092d0b0a 100644 Binary files a/plugins/official/license-header/dist/plugin.wasm and b/plugins/official/license-header/dist/plugin.wasm differ diff --git a/plugins/official/license-header/dist/plugin.wasm.sources b/plugins/official/license-header/dist/plugin.wasm.sources index 2fa508879a..3768523694 100644 --- a/plugins/official/license-header/dist/plugin.wasm.sources +++ b/plugins/official/license-header/dist/plugin.wasm.sources @@ -1 +1 @@ -74082afeaf1cba06952a27dbc6c553dc74cebd5a9d34de4eb55d5f09eaba43df +2a74589c1ffd304ef2a7c9f2603c03292ae1c2f8b7c08ad9f8d4ca27924582e9 diff --git a/plugins/official/mybatis/dist/plugin.wasm b/plugins/official/mybatis/dist/plugin.wasm index 2bd12b1331..3a1ce610f1 100644 Binary files a/plugins/official/mybatis/dist/plugin.wasm and b/plugins/official/mybatis/dist/plugin.wasm differ diff --git a/plugins/official/mybatis/dist/plugin.wasm.sources b/plugins/official/mybatis/dist/plugin.wasm.sources index 039225238f..77936befd9 100644 --- a/plugins/official/mybatis/dist/plugin.wasm.sources +++ b/plugins/official/mybatis/dist/plugin.wasm.sources @@ -1 +1 @@ -db17bfc9ab08d649c7a8b9e995474d9f080da53a87918fd8500d0c636adaaa9f +bbda8deda2f58fd7c3c1fa932a051e162cfdccb5d5f844db2a02e15034d8a165 diff --git a/plugins/official/regex-tester/dist/plugin.wasm b/plugins/official/regex-tester/dist/plugin.wasm index ad29c31e42..540b9a65da 100644 Binary files a/plugins/official/regex-tester/dist/plugin.wasm and b/plugins/official/regex-tester/dist/plugin.wasm differ diff --git a/plugins/official/regex-tester/dist/plugin.wasm.sources b/plugins/official/regex-tester/dist/plugin.wasm.sources index 5b752e6250..33f40c4b2e 100644 --- a/plugins/official/regex-tester/dist/plugin.wasm.sources +++ b/plugins/official/regex-tester/dist/plugin.wasm.sources @@ -1 +1 @@ -298a38890d48ee556d54469c81568c31289d76f509f6fe97afb0337cb1e8bfd9 +7219985e64b39d9f64502b99cc57e0839965197d91186eaa296ed65520a2c1ac diff --git a/plugins/official/solidity/dist/plugin.wasm b/plugins/official/solidity/dist/plugin.wasm index 7ab6d450bd..ce27b2212c 100644 Binary files a/plugins/official/solidity/dist/plugin.wasm and b/plugins/official/solidity/dist/plugin.wasm differ diff --git a/plugins/official/solidity/dist/plugin.wasm.sources b/plugins/official/solidity/dist/plugin.wasm.sources index b755acc172..847888f3ad 100644 --- a/plugins/official/solidity/dist/plugin.wasm.sources +++ b/plugins/official/solidity/dist/plugin.wasm.sources @@ -1 +1 @@ -3264d0de685f81b4c3b652b00c1e9d2e7760365c2a0d372eccc52bbdab811dd4 +11ee64039bf0092494535a73d298a9b9ac7554653da3bf52b7252795370e15ee diff --git a/plugins/official/string-tools/dist/plugin.wasm b/plugins/official/string-tools/dist/plugin.wasm index 053d9f3a86..f9abd4cd5f 100644 Binary files a/plugins/official/string-tools/dist/plugin.wasm and b/plugins/official/string-tools/dist/plugin.wasm differ diff --git a/plugins/official/string-tools/dist/plugin.wasm.sources b/plugins/official/string-tools/dist/plugin.wasm.sources index 59981f3b17..8af38ee440 100644 --- a/plugins/official/string-tools/dist/plugin.wasm.sources +++ b/plugins/official/string-tools/dist/plugin.wasm.sources @@ -1 +1 @@ -00040f6a4ec565f8783cc0a2ad2f8c5a53be83f25cd962033c7e344c5ec0eeaa +27489171942f64821d2d60f53ce81d03fca492392e9c7614a3e38245b4453ccd diff --git a/plugins/official/test-runner/dist/plugin.wasm b/plugins/official/test-runner/dist/plugin.wasm index da982f2d3b..b0be68f01a 100644 Binary files a/plugins/official/test-runner/dist/plugin.wasm and b/plugins/official/test-runner/dist/plugin.wasm differ diff --git a/plugins/official/test-runner/dist/plugin.wasm.sources b/plugins/official/test-runner/dist/plugin.wasm.sources index 8c27089e3d..5e6123802c 100644 --- a/plugins/official/test-runner/dist/plugin.wasm.sources +++ b/plugins/official/test-runner/dist/plugin.wasm.sources @@ -1 +1 @@ -64077a09543736956abbd856c032d9bbf79e45be3ce2122e1f26a6c3ceffa63e +5712edd88470c9e72a6e2294ce81597330ed24cf61806816abcb24beffcfdc84 diff --git a/plugins/official/todo-finder/dist/plugin.wasm b/plugins/official/todo-finder/dist/plugin.wasm index b8ed9b2ec9..f9d76e7198 100644 Binary files a/plugins/official/todo-finder/dist/plugin.wasm and b/plugins/official/todo-finder/dist/plugin.wasm differ diff --git a/plugins/official/todo-finder/dist/plugin.wasm.sources b/plugins/official/todo-finder/dist/plugin.wasm.sources index d8dc6c35f8..214f25d5e7 100644 --- a/plugins/official/todo-finder/dist/plugin.wasm.sources +++ b/plugins/official/todo-finder/dist/plugin.wasm.sources @@ -1 +1 @@ -eac9143bf593b68b506a5054218aa76298c7c2f3ab94f1233b40d2ebf0d1de83 +6e651b2f104e185df2bef56dc113e6f20603dfb874063a8400ab818d9c26c237 diff --git a/sdk/rust/openidea-plugin/src/host.rs b/sdk/rust/openidea-plugin/src/host.rs index 7f7d1a61f9..83a22be0a1 100644 --- a/sdk/rust/openidea-plugin/src/host.rs +++ b/sdk/rust/openidea-plugin/src/host.rs @@ -713,6 +713,14 @@ mod imp { wit::events::unsubscribe(k.name()) } + pub fn schedule(id: &str, after_ms: u32) -> Result<(), Error> { + wit::events::schedule(id, after_ms).map_err(error) + } + + pub fn cancel_schedule(id: &str) { + wit::events::cancel_schedule(id) + } + pub fn begin_task(title: &str, cancellable: bool) -> TaskRes { wit::tasks::begin(title, cancellable) } @@ -2496,6 +2504,24 @@ pub fn watch_paths(paths: &[&str]) -> Result<(), Error> { imp::watch_paths(paths) } +/// Wakes this plugin once, `after_ms` milliseconds from now (API 1.21): an +/// [`crate::Event::Timer`] with `id` arrives in the window of the call that set it. +/// Setting an `id` again replaces it, so backoff is the plugin's own: set the next +/// delay when the timer fires. An idle plugin is activated for it. +/// +/// `after_ms` is 250 to 86,400,000 (a day); `id` is 1-128 bytes without control +/// characters; at most 16 timers are pending per plugin (`Invalid` past that). Timers +/// end when they fire, on [`cancel_schedule`], when the window closes, or when the +/// plugin stops; idle reclaim keeps them. Needs no capability. +pub fn schedule(id: &str, after_ms: u32) -> Result<(), Error> { + imp::schedule(id, after_ms) +} + +/// Cancels the pending [`schedule`] timer `id` (API 1.21); an unknown id does nothing. +pub fn cancel_schedule(id: &str) { + imp::cancel_schedule(id) +} + /// Files outside the open projects, for a program the plugin integrates with /// or a tool installed elsewhere. Outside [`fs::plugin_dir`] and the plugin's /// install directory (read-only), paths need an `fs.read:` (reading) or diff --git a/sdk/rust/openidea-plugin/src/mock.rs b/sdk/rust/openidea-plugin/src/mock.rs index 7ed923c0db..a48de5d2a0 100644 --- a/sdk/rust/openidea-plugin/src/mock.rs +++ b/sdk/rust/openidea-plugin/src/mock.rs @@ -144,6 +144,8 @@ struct State { project_generations: BTreeMap, debounce_ms: BTreeMap, watched_paths: Vec, + /// Pending [`crate::host::schedule`] timers: id → delay in milliseconds. + timers: BTreeMap, tasks: Vec, vcs: Option, repositories: Vec, @@ -664,6 +666,17 @@ impl MockHost { self.state.borrow().watched_paths.clone() } + /// The pending [`crate::host::schedule`] timers: id → the delay they were set with. + pub fn timers(&self) -> BTreeMap { + self.state.borrow().timers.clone() + } + + /// Fires timer `id` as the IDE would: it is no longer pending, and the event to hand + /// to the plugin's handler is returned (`None` when no such timer is pending). + pub fn fire_timer(&self, id: &str) -> Option { + self.state.borrow_mut().timers.remove(id).map(|_| crate::Event::Timer(id.to_owned())) + } + pub fn subscriptions(&self) -> BTreeSet { self.state.borrow().subscriptions.clone() } @@ -2678,6 +2691,28 @@ pub mod current { }); } + pub fn schedule(id: &str, after_ms: u32) -> Result<(), Error> { + with(|s| { + if id.is_empty() || id.len() > 128 || id.chars().any(char::is_control) { + return Err(Error::Invalid("timer id must be 1-128 bytes without control characters".into())); + } + if !(250..=86_400_000).contains(&after_ms) { + return Err(Error::Invalid("a timer fires 250 ms to 86400000 ms from now".into())); + } + if !s.timers.contains_key(id) && s.timers.len() >= 16 { + return Err(Error::Invalid("at most 16 timers may be pending: cancel one first".into())); + } + s.timers.insert(id.to_owned(), after_ms); + Ok(()) + }) + } + + pub fn cancel_schedule(id: &str) { + with(|s| { + s.timers.remove(id); + }); + } + pub fn project_find(p: &ProjectRes, glob: &str, limit: u32) -> Result, Error> { with(|s| { require(s, "project.read")?; diff --git a/sdk/rust/openidea-plugin/src/types.rs b/sdk/rust/openidea-plugin/src/types.rs index d31760cd7f..39fb88eeff 100644 --- a/sdk/rust/openidea-plugin/src/types.rs +++ b/sdk/rust/openidea-plugin/src/types.rs @@ -616,6 +616,8 @@ pub enum Event { VcsChanged(String), /// The `on-schedule` period elapsed. Scheduled, + /// A timer set with [`crate::host::schedule`] fired (API 1.21): its id. + Timer(String), /// A project was closed (or its window closed): the project root path. ProjectClosed(String), /// Paths watched with [`crate::host::watch_paths`] changed (API 1.18): absolute @@ -903,6 +905,11 @@ impl Event { { return Self::WatchedFilesChanged(batch); } + if kind == "timer" + && let Ok(id) = serde_json::from_str(&data) + { + return Self::Timer(id); + } Self::Other { kind, data } } } diff --git a/sdk/rust/openidea-plugin/tests/api21_schedule.rs b/sdk/rust/openidea-plugin/tests/api21_schedule.rs new file mode 100644 index 0000000000..8e4a57a4e2 --- /dev/null +++ b/sdk/rust/openidea-plugin/tests/api21_schedule.rs @@ -0,0 +1,33 @@ +use openidea_plugin::{Error, Event, host, mock::MockHost}; + +#[test] +fn schedule_replaces_cancels_and_fires_once() { + let mock = MockHost::install(); + // No capability: a plugin only wakes itself. + host::schedule("retry", 2_000).unwrap(); + host::schedule("poll", 250).unwrap(); + // The same id again replaces it: the plugin paces its own backoff. + host::schedule("retry", 4_000).unwrap(); + assert_eq!(mock.timers(), [("poll".to_owned(), 250), ("retry".to_owned(), 4_000)].into()); + + host::cancel_schedule("poll"); + host::cancel_schedule("unknown"); + assert_eq!(mock.timers().len(), 1); + assert_eq!(mock.fire_timer("retry"), Some(Event::Timer("retry".into()))); + assert_eq!(mock.fire_timer("retry"), None, "a timer fires once"); + assert_eq!(Event::from_other("timer".into(), "\"retry\"".into()), Event::Timer("retry".into())); +} + +#[test] +fn schedule_bounds() { + let mock = MockHost::install(); + for (id, after) in [("", 1_000), ("a\nb", 1_000), (&*"x".repeat(129), 1_000), ("ok", 249), ("ok", 86_400_001)] { + assert!(matches!(host::schedule(id, after), Err(Error::Invalid(_))), "{id:?} {after}"); + } + for i in 0..16 { + host::schedule(&format!("t{i}"), 1_000).unwrap(); + } + assert!(matches!(host::schedule("t16", 1_000), Err(Error::Invalid(_)))); + host::schedule("t0", 86_400_000).unwrap(); + assert_eq!(mock.timers().len(), 16); +} diff --git a/sdk/rust/openidea-plugin/wit/events.wit b/sdk/rust/openidea-plugin/wit/events.wit index 24a5681289..ddac2548c4 100644 --- a/sdk/rust/openidea-plugin/wit/events.wit +++ b/sdk/rust/openidea-plugin/wit/events.wit @@ -90,6 +90,17 @@ interface events { /// that serves a window's project (a command or event). watch-paths: func(paths: list) -> result<_, error>; unsubscribe: func(kind: string); + /// Wakes this plugin once, `after-ms` milliseconds from now (API 1.21), for retries, + /// backoff and polling the plugin paces itself: a `timer` event (JSON string: `id`) + /// arrives through `other`, in the window of the call that scheduled it. Scheduling an + /// `id` again replaces it, so the next delay is the plugin's own choice. An idle plugin + /// is activated for it. `after-ms` is 250 ms to 24 h; `id` is 1-128 bytes; at most 16 + /// timers are pending per plugin. They end when they fire, on `cancel-schedule`, when + /// the window closes, or when the plugin stops (disabled, updated, uninstalled); idle + /// reclaim keeps them. No capability: a plugin only wakes itself. + schedule: func(id: string, after-ms: u32) -> result<_, error>; + /// Cancels the pending `schedule` with this `id` (API 1.21); an unknown id does nothing. + cancel-schedule: func(id: string); } /// Long-running work with a progress indicator. While a task is open, the diff --git a/wit/events.wit b/wit/events.wit index 24a5681289..ddac2548c4 100644 --- a/wit/events.wit +++ b/wit/events.wit @@ -90,6 +90,17 @@ interface events { /// that serves a window's project (a command or event). watch-paths: func(paths: list) -> result<_, error>; unsubscribe: func(kind: string); + /// Wakes this plugin once, `after-ms` milliseconds from now (API 1.21), for retries, + /// backoff and polling the plugin paces itself: a `timer` event (JSON string: `id`) + /// arrives through `other`, in the window of the call that scheduled it. Scheduling an + /// `id` again replaces it, so the next delay is the plugin's own choice. An idle plugin + /// is activated for it. `after-ms` is 250 ms to 24 h; `id` is 1-128 bytes; at most 16 + /// timers are pending per plugin. They end when they fire, on `cancel-schedule`, when + /// the window closes, or when the plugin stops (disabled, updated, uninstalled); idle + /// reclaim keeps them. No capability: a plugin only wakes itself. + schedule: func(id: string, after-ms: u32) -> result<_, error>; + /// Cancels the pending `schedule` with this `id` (API 1.21); an unknown id does nothing. + cancel-schedule: func(id: string); } /// Long-running work with a progress indicator. While a task is open, the