diff --git a/crates/ide-host/src/plugins/commands.rs b/crates/ide-host/src/plugins/commands.rs index 19ba8a7cc3..8a09607c20 100644 --- a/crates/ide-host/src/plugins/commands.rs +++ b/crates/ide-host/src/plugins/commands.rs @@ -82,6 +82,22 @@ pub async fn plugin_run_anything_run( host.blocking(move || plugins.run_anything_run(&plugin_id, &window_id, root, &prefix, &line)).await } +/// Completions for a field of a plugin's own run configuration (API 1.18). +#[command(trust = trusted)] +pub async fn plugin_run_configuration_complete( + host: &Host, + plugins: &Arc, + window: &str, + config_id: String, + field: String, + text: String, + caret: u32, +) -> IdeResult> { + let (plugins, window_id) = (plugins.clone(), window.to_owned()); + let root = host.project(window)?.root.clone(); + host.blocking(move || plugins.run_configuration_complete(&window_id, &root, &config_id, &field, &text, caret)).await +} + /// The UI language (BCP 47) that plugin code reads with `ui.locale()`. #[command(trust = always)] pub async fn plugin_set_ui_locale(plugins: &Arc, tag: String) -> IdeResult<()> { @@ -350,6 +366,7 @@ ide_command::domain!( plugin_run_anything_run, plugin_run_anything_suggest, plugin_run_command, + plugin_run_configuration_complete, plugin_select_tests, plugin_set_active_file, plugin_set_ui_locale, diff --git a/crates/ide-host/src/plugins/mod.rs b/crates/ide-host/src/plugins/mod.rs index c701737c40..f632b74ef7 100644 --- a/crates/ide-host/src/plugins/mod.rs +++ b/crates/ide-host/src/plugins/mod.rs @@ -1486,6 +1486,53 @@ impl PluginHost { }) } + /// Completions (API 1.18) for `field` of the plugin run configuration `config_id` + /// (`plugin::`, also a user's override of one), as `window`'s project + /// currently has it, for the field's `text` and UTF-16 `caret`: from what the owning + /// plugin already knows, within 300 ms. + pub fn run_configuration_complete( + &self, + window: &str, + root: &Path, + config_id: &str, + field: &str, + text: &str, + caret: u32, + ) -> IdeResult> { + if text.len() > 16 * 1024 || caret as usize > text.encode_utf16().count() || field.len() > 64 { + return Err(IdeError::invalid("the field text or caret is out of range")); + } + if !self.run_detection().detect(root).iter().any(|c| c.id == config_id && c.kind == "plugin") { + return Err(IdeError::not_found("this plugin configuration is no longer provided")); + } + let owner = self + .plugins + .read() + .keys() + .filter(|id| { + config_id.strip_prefix(ide_run::EXTERNAL_PREFIX).is_some_and(|rest| rest.starts_with(&format!("{id}:"))) + }) + .max_by_key(|id| id.len()) + .cloned() + .ok_or_else(|| IdeError::not_found("the plugin owning this configuration is not loaded"))?; + let own = config_id[ide_run::EXTERNAL_PREFIX.len() + owner.len() + 1..].to_owned(); + let invocation = Invocation { + client: Some(window.to_owned()), + workspace_root: Some(root.to_path_buf()), + ..Default::default() + }; + let (field, text) = (field.to_owned(), text.to_owned()); + let budget = Duration::from_millis(300); + self.code_call_with_budget( + &owner, + invocation, + "completing a run configuration field", + None, + Some(budget), + move |rt, inv| rt.run_configuration_complete(&own, &field, &text, caret, inv, budget), + ) + } + fn declared_run_anything(&self, id: &str, prefix: &str) -> IdeResult<()> { if self.ui.items(ui_points::RUN_ANYTHING, Some(id)).iter().any(|d| d.key == prefix) { Ok(()) diff --git a/crates/ide-host/tests/plugin_run_anything.rs b/crates/ide-host/tests/plugin_run_anything.rs index 0410257198..f93c1c289a 100644 --- a/crates/ide-host/tests/plugin_run_anything.rs +++ b/crates/ide-host/tests/plugin_run_anything.rs @@ -39,3 +39,45 @@ fn the_plugin_suggests_and_claims_lines_of_its_prefix() { let ran = p.run_command(ID, "ran", None, invocation).unwrap(); assert_eq!(ran.as_deref(), Some("build\ndocs:serve")); } + +#[test] +fn the_plugins_configuration_completes_only_the_argument_under_the_caret() { + let tmp = tempfile::tempdir().unwrap(); + let base = dunce::canonicalize(tmp.path()).unwrap(); + let (root, other) = (base.join("project"), base.join("other")); + std::fs::create_dir_all(&root).unwrap(); + std::fs::create_dir_all(&other).unwrap(); + std::fs::write(root.join("Taskfile.yml"), "version: '3'\n").unwrap(); + let p = plugins(&base); + let config = "plugin:test.run-anything:tasks"; + // Not provided until its program is approved. + assert!(p.run_configuration_complete("main", &root, config, "arguments", "b", 1).is_err()); + p.choose_program(ID, "process:task", Some(&root), Some(Path::new("/bin/echo"))).unwrap(); + assert!(p.run_detection().detect(&root).iter().any(|c| c.id == config)); + let complete = |text: &str, caret: u32| -> Vec<(String, String, u32, u32)> { + p.run_configuration_complete("main", &root, config, "arguments", text, caret) + .unwrap() + .into_iter() + .map(|c| (c.label, c.insert, c.replace_start, c.replace_end)) + .collect() + }; + // Options, quoted values and the task's own arguments after `--` stay outside the range. + let text = "--dry 'a b' d -- x"; + assert_eq!(complete(text, 13), [("docs:serve".into(), "docs:serve".into(), 12, 13)]); + assert!(complete(text, 18).is_empty(), "after `--` the arguments are the task's"); + assert!(complete(text, 3).is_empty(), "an option is not a task"); + // UTF-16 offsets. + assert_eq!(complete("é b", 3), [("build".into(), "build".into(), 2, 3)]); + assert_eq!(complete("", 0).len(), 3); + assert!(p.run_configuration_complete("main", &root, config, "env", "b", 1).unwrap().is_empty()); + // Out-of-range carets, other configurations and projects without it are refused. + assert!(p.run_configuration_complete("main", &root, config, "arguments", "b", 2).is_err()); + assert!( + p.run_configuration_complete("main", &root, "plugin:test.run-anything:other", "arguments", "b", 1).is_err() + ); + assert!(p.run_configuration_complete("main", &root, "npm:dev", "arguments", "b", 1).is_err()); + assert!(p.run_configuration_complete("main", &other, config, "arguments", "b", 1).is_err()); + // Revoking the program withdraws the configuration, and with it the completion. + p.set_capability(ID, "process:task", false).unwrap(); + assert!(p.run_configuration_complete("main", &root, config, "arguments", "b", 1).is_err()); +} diff --git a/crates/ide-plugin/src/runtime.rs b/crates/ide-plugin/src/runtime.rs index 749a4d9e98..63c7530618 100644 --- a/crates/ide-plugin/src/runtime.rs +++ b/crates/ide-plugin/src/runtime.rs @@ -21,6 +21,7 @@ use crate::wit_host::hover_actions_bindings::exports::openidea::plugin::hover_ac use crate::wit_host::injections_bindings::exports::openidea::plugin::injections as wit_inj; use crate::wit_host::language_features_bindings::exports::openidea::plugin::language_features as wit_lf; use crate::wit_host::run_anything_bindings::exports::openidea::plugin::run_anything_provider as wit_ra; +use crate::wit_host::run_config_completion_bindings::exports::openidea::plugin::run_configuration_completion as wit_rcc; use crate::wit_host::run_target_validation_bindings::exports::openidea::plugin::run_target_validation as wit_rtv; use crate::wit_host::search_bindings::exports::openidea::plugin::search_provider as wit_search; use crate::wit_host::{ @@ -908,6 +909,7 @@ pub struct Runtime { struct Exports { run_target_validation: Option, run_anything: Option, + run_config_completion: Option, language_features: Option, injections: Option, plugin: bindings::Plugin, @@ -1094,6 +1096,7 @@ impl Runtime { let tests_indices = wit_tests::GuestIndices::new(&pre).ok(); let validation_indices = wit_rtv::GuestIndices::new(&pre).ok(); let run_anything_indices = wit_ra::GuestIndices::new(&pre).ok(); + let run_config_completion_indices = wit_rcc::GuestIndices::new(&pre).ok(); let lf_indices = wit_lf::GuestIndices::new(&pre).ok(); let inj_indices = wit_inj::GuestIndices::new(&pre).ok(); let mcp_indices = @@ -1112,6 +1115,8 @@ impl Runtime { let run_target_validation = validation_indices.map(|i| i.load(&mut store, &instance)).transpose().map_err(api_hint)?; let run_anything = run_anything_indices.map(|i| i.load(&mut store, &instance)).transpose().map_err(api_hint)?; + let run_config_completion = + run_config_completion_indices.map(|i| i.load(&mut store, &instance)).transpose().map_err(api_hint)?; let plugin = plugin_indices.load(&mut store, &instance).map_err(api_hint)?; let syntax = match syntax_indices { Some(indices) => Some(indices.load(&mut store, &instance).map_err(api_hint)?), @@ -1171,6 +1176,7 @@ impl Runtime { exports: Exports { run_target_validation, run_anything, + run_config_completion, language_features, injections, plugin, @@ -1245,6 +1251,39 @@ impl Runtime { self.call(invocation, timeout, |e, store| e.run_anything.as_ref().unwrap().call_run(store, &root, prefix, line)) } + /// Completions for `field` of this plugin's configuration `config` (API 1.18); none + /// without the export. Items whose range falls outside `text` are dropped. + pub fn run_configuration_complete( + &mut self, + config: &str, + field: &str, + text: &str, + caret: u32, + invocation: Invocation, + timeout: Duration, + ) -> Result, CallError> { + if self.exports.run_config_completion.is_none() { + return Ok(Vec::new()); + } + let root = invocation.workspace_root.as_deref().map(to_ipc).unwrap_or_default(); + let items = self.call(invocation, timeout, |e, store| { + e.run_config_completion.as_ref().unwrap().call_complete(store, &root, config, field, text, caret) + })?; + let len = text.encode_utf16().count() as u32; + Ok(items + .into_iter() + .filter(|i| i.replace_start <= i.replace_end && i.replace_end <= len) + .take(crate::MAX_RUN_CONFIG_COMPLETIONS) + .map(|i| crate::RunConfigCompletion { + insert: clip(i.insert.unwrap_or_else(|| i.label.clone()), 4096), + label: clip(i.label, MAX_TITLE), + detail: i.detail.map(|d| clip(d, MAX_TITLE)), + replace_start: i.replace_start, + replace_end: i.replace_end, + }) + .collect()) + } + pub fn has_run_target_validation(&self) -> bool { self.exports.run_target_validation.is_some() } diff --git a/crates/ide-plugin/src/types.rs b/crates/ide-plugin/src/types.rs index d78648afba..c3101c4b2a 100644 --- a/crates/ide-plugin/src/types.rs +++ b/crates/ide-plugin/src/types.rs @@ -1142,3 +1142,18 @@ pub struct RunAnythingItem { /// The line Tab completes and Enter runs; `label` when absent. pub line: Option, } + +/// Most completions kept from one `run-configuration-completion.complete` answer. +pub const MAX_RUN_CONFIG_COMPLETIONS: usize = 200; + +/// A completion for a field of a plugin's own run configuration (API 1.18). +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Type)] +#[serde(rename_all = "camelCase")] +pub struct RunConfigCompletion { + pub label: String, + pub detail: Option, + /// Replaces the UTF-16 range `[replace_start, replace_end)` of the field's text. + pub insert: String, + pub replace_start: u32, + pub replace_end: u32, +} diff --git a/crates/ide-plugin/src/wit_host.rs b/crates/ide-plugin/src/wit_host.rs index 4e359e860a..a9c24f0288 100644 --- a/crates/ide-plugin/src/wit_host.rs +++ b/crates/ide-plugin/src/wit_host.rs @@ -3336,6 +3336,11 @@ pub(crate) mod run_anything_bindings { wasmtime::component::bindgen!({ world: "run-anything-exports", path: "../../wit" }); } +/// The optional `run-configuration-completion` export (API 1.18), bound on its own when present. +pub(crate) mod run_config_completion_bindings { + wasmtime::component::bindgen!({ world: "run-configuration-completion-exports", path: "../../wit" }); +} + pub(crate) mod run_target_validation_bindings { wasmtime::component::bindgen!({ world: "run-target-validator", path: "../../wit" }); } diff --git a/crates/ide-plugin/tests/fixtures/api14/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/api14/dist/plugin.wasm index 086771eacd..c0094a2657 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 ac7640a1d8..597183bb66 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 @@ -99d690532f1d31fd1abfa9f827c488a03ec13a9a5b64d5805f9c3569f65a8f6f +9857fa3a9b1d22d3b2c91a58fbf2c948267d87a6586ade7e0362fd6b6f4dd2ab 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 b7fda4c776..bac3d68b42 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 463db134a6..8994e660a7 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 @@ -a892e79a21575fb0e755f1dc2a181403ec857789a80679489b113fcf8bf4f84b +ba19f794de91eeac3a2509a9495b443ab7b0c90404156d8e4049e5eae777ab66 diff --git a/crates/ide-plugin/tests/fixtures/clipboard/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/clipboard/dist/plugin.wasm index 2748f4f5b7..919674f6f4 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 343b588e2f..9187f97fd7 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 @@ -a0c3e4344024c7ec74a959670613f6f9e80b4a74a1c1b7801153e436a8db7b06 +0692fd551f6cc80338f8f655ad2384f37aef5c9498a0396532afa0e54a25f477 diff --git a/crates/ide-plugin/tests/fixtures/commit/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/commit/dist/plugin.wasm index 0c9c7160de..121a726e92 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 6f6c2cf846..8885e8bd5a 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 @@ -025151dc36746c6099113a7505cfb4a86420c0f0ff67fb16a4a798ab0ca0cacf +6a25f9c9f9486468f1885cf81bccd90240014009ba3c507e478ce9b32468d594 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 6c19966acc..799812ea3c 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 a16aa204fc..02d1acbaa7 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 @@ -eb6f32492301a263ab9a2949f7dfca1120c383536394601f26636926415c1825 +84bb08e094ec85d49abe713df02ac03a47dc7dbb6d8dfc754491083e0d0c46f5 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 c6cd6158b1..5d1654a880 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 764cef016e..f991d17fac 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 @@ -bc5e4599cb4c9814e5b682c6c96b2a4814a478fc26e8324739de7b6f41dd4cac +958ef1f5cd54a9b4c6fb99ee8e02793ca70a81698620da9ddf2b1b3f25b535c8 diff --git a/crates/ide-plugin/tests/fixtures/decorations/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/decorations/dist/plugin.wasm index b8b125d96d..4cc96de874 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 7077f15432..da710a6b43 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 @@ -bccf0e0aea699c29a1f2ac9a28eddbca664678c78477f64a1a7e10793fe40009 +a846c18a1282242e25f0b61624c319fe10bdf322c224276a4a8edffd470ef940 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 7d6c28a8a1..8bfa94d530 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 d6c4a4e5ce..5c023cab04 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 @@ -3b5a8aeeeb7706a07dd5f5e36f3d1c291bd5add259411ae5ca62a0529ae45c76 +35f393de3ed681d206885612ae085b69dfef81ff8baa701a737c1914ac1412fb diff --git a/crates/ide-plugin/tests/fixtures/diagnostics/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/diagnostics/dist/plugin.wasm index 5105bbb94b..9d31870223 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 720af8d055..f848f31bab 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 @@ -728a5651af7082db08f70515a1d6211f95f00ec69671cc4f190a250d09da41ed +e75dad45fb2a6bb8823b8edfb41b29403ec77f8e6e533bad42d0ae0cb1d68286 diff --git a/crates/ide-plugin/tests/fixtures/endpoints/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/endpoints/dist/plugin.wasm index 328c09b312..e974866ef1 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 75acc13aab..a67d8c6c02 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 @@ -8e4897c52dbba37d3bc0d361aeae9e3ccc46e32ac099a0b967d145432303400f +2cb47ff4fb3d401e95b742d78e026b872200dc503bf933ff9ce31d0557d69426 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 b1d909ea66..b0fb32d925 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 ca7d78c701..58069fc197 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 @@ -51282b7767d0e339b616f0cbc86ef72eac33a76605bd21793ecc021a62a25ff0 +e121d0fd2cc841ebb911904ada80921d01af392ccaa295b2fe0b2e7f4f51c58c diff --git a/crates/ide-plugin/tests/fixtures/execution/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/execution/dist/plugin.wasm index bf978723b5..879589a06e 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 52398546cd..5625531071 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 @@ -9729be3c12cd95d0b60c08b2179727f7290c38a984785bc7f9d8803109862efb +c0ebc0e6b8601044ab88eba4929c8c73ab1278d3401b6594df35407f1a93cc24 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 57f68ac7bc..edced1df7d 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 c3fc8aa3b5..0b73cace1f 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 @@ -b188b5f103fc01a9cc5db57ef235c94980be39268afb65d933fa6329253ceea8 +cea7369e69efee782e6a7b62736832e90890cd7af089884f3ed6e144542e0589 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 b0993a20d5..c42eb35f92 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 819b47591f..6e0c021d81 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 @@ -168933a0a65612f4710e8f86dd397a639640395283ad90b6c5066d2304343ea9 +f348c5ee1ce6d911ae53ea4aff185bdb6079729aee83561d3adb9d13eeb376fb 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 8a3a7edbb8..0ecd31685f 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 54ed42ba23..5b7654183c 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 @@ -b41f219db5b29fb0ebbceeaf2c038b1f7c2c833adb71298ffd438282c4df1cd8 +5cd09b0da42f015faae666fbe210203b7ced9cf19d6ee542dadd236b7926b77b 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 11646babcd..7a26f20b91 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 f67696a98d..79071ee779 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 @@ -58604dfb4be6b9c63466fac6ab065a2d961de105cfac623e75512a2852cd49bb +ff2d1eac3fe4a2856e6310f36ed29d9a2ccffc8eeb41ded729dd01eadc244857 diff --git a/crates/ide-plugin/tests/fixtures/hello/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/hello/dist/plugin.wasm index d78bd517b5..f51f8612b6 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 d526ee9c3b..a5970d9b7b 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 @@ -98b22bbd2bed239e4e2ea61403667f4e5eecdaeaa79180728b54da76267aa151 +e37a64052eef340a8482d8129badc50f29e8949316a33e6172a64e1a00f0718c 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 81232a98de..f06f7815c4 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 180770c8ba..bd2903b852 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 @@ -b98a3534c134661aca0fc442617ef000e44a57288c8ecde4afcdf4b2e0b0879e +5f4dfb76c879bbbeb38f7c1b45c88818517743d742129a147e185bc7d2db7abc diff --git a/crates/ide-plugin/tests/fixtures/hover/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/hover/dist/plugin.wasm index 5774750e35..513258d73c 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 cdcba04c61..39ae74f5f4 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 @@ -830ee16ccf22bebe4a1d8c8f11ae83ef0d9b0f28cf55c1a6f5d5ceac0d63d531 +efe6d6c88d0bab2484f90cef6affe256c480297731ce585a5e3441e2648d9392 diff --git a/crates/ide-plugin/tests/fixtures/indexer/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/indexer/dist/plugin.wasm index 92377917fe..d9df8ca705 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 4848667888..f168188647 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 @@ -d338f3f6b191aef5975936b69d282ce7c5c342d0d8dd35ef79b60a7ea250c21f +7b606308ee272adb1f659e7fd21069409b3bdbf12cd54b93232205bc8213f52a 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 bf26d2eef9..883af0da38 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 d69bd5ff85..f8a2750443 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 @@ -b6b55ca65106d7c18d0f7bf56e8d392350fe130db44829a8886243978947c122 +6be054362a3c1f3545fdfba5c9b66d9eadcbeea3b160952068494c02bce3a4a1 diff --git a/crates/ide-plugin/tests/fixtures/jobs/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/jobs/dist/plugin.wasm index effa82b26c..1c3441e8cd 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 5c6fc39383..88e6589ae4 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 @@ -85d8eccfe82fb067a018bd5eaabd3293405373e81e981a993386173c28d6bb13 +3cd84b9876d2e5a5294877ac14d69b18319be3208c192f67b6c3848039c48a79 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 9382d5f13d..4cece283e6 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 9663aa10f1..e015b4112c 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 @@ -e2de91a5ad6b5d94d7534b1f6066a0a24bcf5938dbf074323219ee7da407bf43 +e2c282bd0add6de51b6b275d16b950213fcdd24d1d882895b7d3099b0a7d569a 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 ad5ae494f7..e7d54c1678 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 5e8e4004ae..cec2040664 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 @@ -cee60971f3a115768fdf17498973cc6ded1acc891e2d0195aec15d99ef879f77 +84739ec73aa6b7b27d7a5062b78645d7342729806bc728f35a7b97c945c1a4fd 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 ce7c62a540..1fee0dfded 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 @@ -66cb8f9ed58ace06546c391d5b23aff96a9476011a6dc09ed002e6536e42cd5d +ad43fa07182ff3d90154fdd788599d60db5fe0ab736dad03c6ae2cc2a1055eff 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 9b1e56efb1..ffe2685eba 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 65b2c7fdc3..d99ed7cced 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 @@ -b0ebc1d11f3e159e8870b261014f81c3ee402a35bf8d4ccd70bf61daa9d60ea4 +639a93e98dd0fe3114ef7be3597ab559b69e4c54fdb5e96951cb19b894a020b9 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 ca8c0cf583..9c61334423 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 004387e8c9..56a9d34acd 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 @@ -c4963f0e4516b2c6cfbf1c0bc425d406028429a02a73f8a031ef987453a3efdf +20aa26598608efac79c941531d4b5cd26b4e71a9b09e261560bc086410eb5c83 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 efa83fa088..aa189f66dd 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 3a9d63a83f..9dceeb79e1 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 @@ -99d364abd638bb9953e37c2e3358b6b02813201d36db0e6f19361b8d585d3be8 +ca76bdb76b364ec445e06b893fdfb56cad1f05e4a1ff10affaa116b34c3160ec diff --git a/crates/ide-plugin/tests/fixtures/run-anything/plugin.toml b/crates/ide-plugin/tests/fixtures/run-anything/plugin.toml index bd622b3b0a..f796d70922 100644 --- a/crates/ide-plugin/tests/fixtures/run-anything/plugin.toml +++ b/crates/ide-plugin/tests/fixtures/run-anything/plugin.toml @@ -1,7 +1,7 @@ id = "test.run-anything" name = "Run Anything fixture" version = "0.1.0" -description = "Test fixture for [[contributes.runAnything]] and the run-anything-provider export (API 1.18)." +description = "Test fixture for [[contributes.runAnything]], the run-anything-provider export and run configuration completion (API 1.18)." engines.openidea = "^1.18" wasm = "dist/plugin.wasm" @@ -12,3 +12,12 @@ title = "Tasks" [[contributes.commands]] id = "ran" title = "Tasks Run So Far" + +[capabilities] +optional = ["process:task"] + +[[contributes.runDetectors]] +id = "tasks" +name = "Task" +files = ["Taskfile.yml"] +command = "task" diff --git a/crates/ide-plugin/tests/fixtures/run-anything/src/lib.rs b/crates/ide-plugin/tests/fixtures/run-anything/src/lib.rs index e3c4fd4283..9e09ddbd43 100644 --- a/crates/ide-plugin/tests/fixtures/run-anything/src/lib.rs +++ b/crates/ide-plugin/tests/fixtures/run-anything/src/lib.rs @@ -1,6 +1,10 @@ //! API 1.18 fixture for `[[contributes.runAnything]]`: `task ` lines are -//! suggested from a fixed task list and claimed when the task exists. -use openidea_plugin::{Error, Invocation, Plugin, RunAnything, RunAnythingItem, register_plugin}; +//! suggested from a fixed task list and claimed when the task exists. The `tasks` +//! run configuration completes task names in its Arguments field. +use openidea_plugin::{ + Error, Invocation, Plugin, RunAnything, RunAnythingItem, RunConfigurationCompletion, + RunConfigurationCompletionItem, register_plugin, +}; const TASKS: [&str; 3] = ["build", "test", "docs:serve"]; @@ -43,4 +47,45 @@ impl RunAnything for Fixture { } } -register_plugin!(Fixture, run_anything); +impl RunConfigurationCompletion for Fixture { + /// Task names for the argument under the caret, replacing only that argument; nothing + /// after `--` (the task's own arguments) or for another field or configuration. + fn complete( + &mut self, + _project: &str, + config: &str, + field: &str, + text: &str, + caret: u32, + ) -> Vec { + if config != "tasks" || field != "arguments" { + return Vec::new(); + } + let units: Vec = text.encode_utf16().collect(); + let caret = (caret as usize).min(units.len()); + let is_space = |u: u16| u == b' ' as u16 || u == b'\t' as u16; + let start = units[..caret].iter().rposition(|&u| is_space(u)).map_or(0, |i| i + 1); + let end = units[caret..].iter().position(|&u| is_space(u)).map_or(units.len(), |i| caret + i); + let before = String::from_utf16_lossy(&units[..start]); + if before.split_whitespace().any(|w| w == "--") { + return Vec::new(); + } + let typed = String::from_utf16_lossy(&units[start..caret]); + if typed.starts_with('-') { + return Vec::new(); + } + TASKS + .iter() + .filter(|t| t.starts_with(typed.as_str())) + .map(|t| RunConfigurationCompletionItem { + label: (*t).into(), + detail: Some("Taskfile.yml".into()), + insert: None, + replace_start: start as u32, + replace_end: end as u32, + }) + .collect() + } +} + +register_plugin!(Fixture, run_anything, run_configuration_completion); diff --git a/crates/ide-plugin/tests/fixtures/search/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/search/dist/plugin.wasm index 73a1dae9f7..87b51e0ed1 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 aca79e0b7f..cdbdb73022 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 @@ -e00c8836362098a6a84cf24a3a2949c849894289ba52405fae85eccaeced4bb8 +7307879ddca36b6a944bb3b5d3011916a3074e50d7f187aa258394c8c5123d91 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 8b8f5d8db7..d6f3575e07 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 a34c5a58c7..ca7d04bff1 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 @@ -e6098c22fa5cc77cc07f342e0416e3cdc5340e464d7006d791e783bc41855ffe +82a408bddf01af0e7a34a585a60d165e12ad5982e7843d6091a2f4e6fac15c55 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 bc29266952..a568005ba8 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 6d5ea12427..569b2112d8 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 @@ -f65a0616a010b78e18e6eda8b329b2711136f0943d051cc36028ce1c5356560d +04b1807c79763f6e2f74503d545007dbdb478f7aae010dd8330e768c1dc3a9ad diff --git a/crates/ide-plugin/tests/fixtures/storage/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/storage/dist/plugin.wasm index ee7cc7ea19..69799c2d11 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 1a5c33aa53..f62290414d 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 @@ -7abe942edc15ff9d3e9f26c3e1b5bb7789d1546b15611a846e4043be2cff065a +53e4f47e38a8622e2ef0d03e4ed2369fb906e941d9e9734ed9d57fe5cbc5ead3 diff --git a/crates/ide-plugin/tests/fixtures/symbols/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/symbols/dist/plugin.wasm index fc587eac03..03edc05f7e 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 25dcb3bcd3..86fe4da29e 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 @@ -81f6ef485fb7550ca75df1143254516ee9bfec4d3602d03c20a9a4ae4819f9df +d6bd0b261c6db62d04197c28b251a03acc5f32cb21c5133ac3aaeb3e37fe5eab diff --git a/crates/ide-plugin/tests/fixtures/tables/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/tables/dist/plugin.wasm index 46bf1d90b2..e2ae99203c 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 4f8a06965e..dc2da5e5aa 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 @@ -b1fa889c36b58981a5089f4891cfe6df05321ddd59bf25c3022120a7a502ddf5 +a7728793d40c78dc5ebfd74c013425358c888da87a2cce15a5e8c306ab5b6b30 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 945019b721..8ca6fe86ce 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 6ce456dbd5..099402687b 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 @@ -e396ef5d0ba37f0ae46b59b07636b9972417f77cf27fc7b47d35a70ab0cad03f +1fca4a563944897ea1e55c49533c157f005e5efbc1aeabac65037cad1f05c2ba 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 bc5fbcdb76..b74dd56d6d 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 c764b9fe81..20919566a6 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 @@ -2bfb86ad46638bcf98e40470b012a892e0e155d73773403b3f8e2a2ec39a7428 +2be637ed5d3c72adf1a8b92aaea86602ab81ffaeeff99a719f6f67c244b82137 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 ee455693c8..ef266e6217 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 2efecd59cf..fe4453dfea 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 @@ -c875e5ed8d6d2f0fce73211c3c340501ff1908be100438ddb1a5e3702928d326 +3a1aad965fa557b13e2aab2b714c68845d1890a6e98ab9155ccfc952ab2c64d5 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 f7f423c062..16745710a9 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 5e9458c974..a6ef4040a5 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 @@ -a16c71f3fc05ac2d2bfc6fb91e5b85c4ae5fbb07fbf6eec40d4d6307394ae78c +0ad7071e1674170ae360d873fda38656dbba6740514c7bfca642e7881cbd9c18 diff --git a/docs/en/plugins/api/index.mdx b/docs/en/plugins/api/index.mdx index 7c75245370..da88075ed0 100644 --- a/docs/en/plugins/api/index.mdx +++ b/docs/en/plugins/api/index.mdx @@ -58,34 +58,35 @@ The plugin calls these. Most are gated by a [capability](/en/plugins/capabilitie The IDE calls these. The first three are in every code plugin; the rest are optional and each comes with its own world. -| Interface | File | Summary | -| -------------------------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------- | -| `lifecycle` | [exports.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/exports.wit) | `activate` and `deactivate` of an instance | -| `commands` | [exports.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/exports.wit) | Runs one of the plugin's declared commands | -| `event-handler` | [exports.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/exports.wit) | Receives batches of subscribed events | -| `syntax-provider` | [exports.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/exports.wit) | Highlighting, outline and folding for plugin languages without a grammar | -| `run-target-validation` | [exports.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/exports.wit) | Checks a launch through one of the plugin's run targets before it starts (API 1.5) | -| `providers` | [providers.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/providers.wit) | Completion, inline completion, code actions, navigation and line markers for declared languages | -| `language-features` | [language-features.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/language-features.wit) | Formatting, signature help, highlights, links, code lenses, folds, colours, symbols, gutter actions and more (API 1.4) | -| `completion-list-provider` | [completion-list.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/completion-list.wit) | Completion whose list can be marked incomplete, asked again while typing on (API 1.16) | -| `injections` | [injections.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/injections.wit) | Ranges of embedded languages inside a document (API 1.4) | -| `hover-provider` | [hover.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/hover.wit) | Markdown added to the hover of any language | -| `hover-actions` | [hover-actions.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/hover-actions.wit) | Hover-revealed line actions at the left edge of a line (API 1.14): anchor line and inclusive trigger line range | -| `inlay-hints-provider` | [inlay.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/inlay.wit) | Inline hints in any language | -| `semantic-tokens-provider` | [semantic.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/semantic.wit) | Semantic colouring in any language | -| `diagnostics-provider` | [diagnostics.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/diagnostics.wit) | Problems in the current, possibly unsaved document | -| `file-actions` | [file-actions.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/file-actions.wit) | Quick fixes and refactorings that create, rename or delete files | -| `document-indexer` | [indexing.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/indexing.wit) | Cross-file definitions, references and gutter markers, indexed in the background | -| `endpoints-provider` | [endpoints.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/endpoints.wit) | A project's HTTP endpoints for Search Everywhere and the HTTP client | -| `search-provider` | [search.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/search.wit) | Cancellable queries for a plugin-defined Search Everywhere tab (API 1.14) | -| `view-provider` | [views.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/views.wit) | Content and events of declared views and custom editors | -| `detail-provider` | [details.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/details.wit) | The detail pane of the plugin's nodes in the Services tool window | -| `commit-checker` | [commit.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/commit.wit) | Before-commit checks | -| `run-configurations` | [run.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/run.wit) | Dynamic run configurations for a project (API 1.4) | -| `launch-configurations` | [run.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/run.wit) | Run configurations with an environment and a debugger (API 1.9) | -| `execution-configurations` | [run.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/run.wit) | Run configurations with environment, debugger, and default output mode (API 1.18) | -| `test-results` | [run.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/run.wit) | Parsing test output and selecting tests to rerun (API 1.4) | -| `mcp-provider` | [mcp.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/mcp.wit) | Tools the plugin contributes to the built-in MCP server (API 1.4) | +| Interface | File | Summary | +| ------------------------------ | ------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------- | +| `lifecycle` | [exports.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/exports.wit) | `activate` and `deactivate` of an instance | +| `commands` | [exports.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/exports.wit) | Runs one of the plugin's declared commands | +| `event-handler` | [exports.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/exports.wit) | Receives batches of subscribed events | +| `syntax-provider` | [exports.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/exports.wit) | Highlighting, outline and folding for plugin languages without a grammar | +| `run-target-validation` | [exports.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/exports.wit) | Checks a launch through one of the plugin's run targets before it starts (API 1.5) | +| `providers` | [providers.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/providers.wit) | Completion, inline completion, code actions, navigation and line markers for declared languages | +| `language-features` | [language-features.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/language-features.wit) | Formatting, signature help, highlights, links, code lenses, folds, colours, symbols, gutter actions and more (API 1.4) | +| `completion-list-provider` | [completion-list.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/completion-list.wit) | Completion whose list can be marked incomplete, asked again while typing on (API 1.16) | +| `injections` | [injections.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/injections.wit) | Ranges of embedded languages inside a document (API 1.4) | +| `hover-provider` | [hover.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/hover.wit) | Markdown added to the hover of any language | +| `hover-actions` | [hover-actions.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/hover-actions.wit) | Hover-revealed line actions at the left edge of a line (API 1.14): anchor line and inclusive trigger line range | +| `inlay-hints-provider` | [inlay.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/inlay.wit) | Inline hints in any language | +| `semantic-tokens-provider` | [semantic.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/semantic.wit) | Semantic colouring in any language | +| `diagnostics-provider` | [diagnostics.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/diagnostics.wit) | Problems in the current, possibly unsaved document | +| `file-actions` | [file-actions.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/file-actions.wit) | Quick fixes and refactorings that create, rename or delete files | +| `document-indexer` | [indexing.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/indexing.wit) | Cross-file definitions, references and gutter markers, indexed in the background | +| `endpoints-provider` | [endpoints.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/endpoints.wit) | A project's HTTP endpoints for Search Everywhere and the HTTP client | +| `search-provider` | [search.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/search.wit) | Cancellable queries for a plugin-defined Search Everywhere tab (API 1.14) | +| `view-provider` | [views.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/views.wit) | Content and events of declared views and custom editors | +| `detail-provider` | [details.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/details.wit) | The detail pane of the plugin's nodes in the Services tool window | +| `commit-checker` | [commit.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/commit.wit) | Before-commit checks | +| `run-configurations` | [run.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/run.wit) | Dynamic run configurations for a project (API 1.4) | +| `launch-configurations` | [run.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/run.wit) | Run configurations with an environment and a debugger (API 1.9) | +| `execution-configurations` | [run.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/run.wit) | Run configurations with environment, debugger, and default output mode (API 1.18) | +| `run-configuration-completion` | [exports.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/exports.wit) | Completion in the Arguments field of the plugin's own run configurations (API 1.18) | +| `test-results` | [run.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/run.wit) | Parsing test output and selecting tests to rerun (API 1.4) | +| `mcp-provider` | [mcp.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/mcp.wit) | Tools the plugin contributes to the built-in MCP server (API 1.4) | ## Other languages diff --git a/docs/en/plugins/guides/run-targets.mdx b/docs/en/plugins/guides/run-targets.mdx index e8e7c3967a..420cb291fa 100644 --- a/docs/en/plugins/guides/run-targets.mdx +++ b/docs/en/plugins/guides/run-targets.mdx @@ -13,6 +13,7 @@ every start. On top of that, a plugin can: | Compute the project's configurations in code | `[[contributes.runConfigurations]]` + `run-configurations` export | 1.4 | | Give configurations an environment and a debugger | `launch-configurations` export | 1.9 | | Set a default PTY or piped output mode on configurations | `execution-configurations` export / `runDetectors.outputMode` | 1.18 | +| Complete the Arguments field of its configurations | `run-configuration-completion` export | 1.18 | | Turn test output into the IDE's test tree | `test-results` export, `framework = "plugin"` | 1.4 | | Start one of its configurations from a command | `host::start_run` / `host::start_run_with_options` (`run` WIT) | 1.4 / 1.18 | | Make every run of the project go through a wrapper (DDEV, a container) | `host::register_run_target` (WIT `run-targets`) | 1.4 | @@ -205,10 +206,20 @@ per-invocation `output_mode`, which wins over the plugin's configured default. D combinations (`test` configurations, `debug` launches requesting `Pty`, remote run targets, and `stdin` file redirection) are rejected with `Invalid`. +## Completing arguments + +Export `run-configuration-completion` (`RunConfigurationCompletion`, registered as +`run_configuration_completion`) to complete the Arguments field of your configurations in +**Run | Edit Configurations…**, such as task names for a task runner. The IDE passes the +configuration's id, `field = "arguments"`, the text and a UTF-16 caret offset while the user +types (or presses Ctrl+Space). Each item replaces the UTF-16 range it names, so the other +options, quoted values and arguments after `--` stay as typed. Answer from what the plugin +already knows: the IDE keeps 200 items and drops answers slower than 300 ms or for text that +has changed since. + - Ordinary pseudo-terminals (PTYs) combine `stdout` and `stderr` into a single output stream - and can change buffering, input handling, and terminal behavior (line endings, echo, and - ANSI control sequences). + Ordinary pseudo-terminals (PTYs) combine `stdout` and `stderr` into a single output stream and can change buffering, + input handling, and terminal behavior (line endings, echo, and ANSI control sequences). ## Run targets diff --git a/docs/en/plugins/versioning.mdx b/docs/en/plugins/versioning.mdx index e3f2beca8b..1b054be36f 100644 --- a/docs/en/plugins/versioning.mdx +++ b/docs/en/plugins/versioning.mdx @@ -12,27 +12,27 @@ 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 | In development on `main` | `ui.read-clipboard`: the clipboard's text and image in commands the user ran (`clipboard.read`) | -| 1.12.0 | In development on `main` | `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 | In development on `main` | 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 | In development on `main` | `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 | In development on `main` | `[[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 | +| 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 | In development on `main` | `ui.read-clipboard`: the clipboard's text and image in commands the user ran (`clipboard.read`) | +| 1.12.0 | In development on `main` | `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 | In development on `main` | 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 | In development on `main` | `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 | In development on `main` | `[[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 | 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/api/index.mdx b/docs/zh/plugins/api/index.mdx index add0ff3e2e..eb9dbdca77 100644 --- a/docs/zh/plugins/api/index.mdx +++ b/docs/zh/plugins/api/index.mdx @@ -58,34 +58,35 @@ description: "openidea:plugin WIT 包中的每个 interface:一句话说明及 由 IDE 调用。前三个是每个代码插件都有的;其余都是可选的,各自对应一个 world。 -| Interface | 文件 | 说明 | -| -------------------------- | ------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------- | -| `lifecycle` | [exports.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/exports.wit) | 实例的 `activate` 和 `deactivate` | -| `commands` | [exports.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/exports.wit) | 执行插件声明的某个命令 | -| `event-handler` | [exports.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/exports.wit) | 接收订阅事件的批次 | -| `syntax-provider` | [exports.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/exports.wit) | 为没有语法定义的插件语言提供高亮、大纲和折叠 | -| `run-target-validation` | [exports.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/exports.wit) | 通过插件的运行目标启动前进行检查(API 1.5) | -| `providers` | [providers.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/providers.wit) | 为声明的语言提供补全、行内补全、代码操作、导航和行标记 | -| `language-features` | [language-features.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/language-features.wit) | 格式化、签名帮助、高亮、链接、代码透镜、折叠、颜色、符号、装订区操作等(API 1.4) | -| `completion-list-provider` | [completion-list.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/completion-list.wit) | 可标记为不完整的补全列表,继续输入时再次询问(API 1.16) | -| `injections` | [injections.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/injections.wit) | 文档中嵌入语言的范围(API 1.4) | -| `hover-provider` | [hover.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/hover.wit) | 向任意语言的悬停追加 Markdown | -| `hover-actions` | [hover-actions.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/hover-actions.wit) | 行左侧边缘的 hover 操作(API 1.14):锚定行和包含式触发行范围 | -| `inlay-hints-provider` | [inlay.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/inlay.wit) | 任意语言中的内嵌提示 | -| `semantic-tokens-provider` | [semantic.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/semantic.wit) | 任意语言中的语义着色 | -| `diagnostics-provider` | [diagnostics.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/diagnostics.wit) | 当前文档(可能未保存)中的问题 | -| `file-actions` | [file-actions.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/file-actions.wit) | 创建、重命名或删除文件的快速修复和重构 | -| `document-indexer` | [indexing.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/indexing.wit) | 在后台索引的跨文件定义、引用和装订区标记 | -| `endpoints-provider` | [endpoints.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/endpoints.wit) | 项目的 HTTP 端点,供 随处搜索 和 HTTP 客户端使用 | -| `search-provider` | [search.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/search.wit) | 插件自定义全局搜索分类的可取消查询(API 1.14) | -| `view-provider` | [views.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/views.wit) | 声明的视图和自定义编辑器的内容与事件 | -| `detail-provider` | [details.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/details.wit) | Services 工具窗口中插件节点的详情面板 | -| `commit-checker` | [commit.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/commit.wit) | 提交前检查 | -| `run-configurations` | [run.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/run.wit) | 项目的动态运行配置(API 1.4) | -| `launch-configurations` | [run.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/run.wit) | 带环境变量和调试器的运行配置(API 1.9) | -| `execution-configurations` | [run.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/run.wit) | 带环境变量、调试器和默认输出模式的运行配置(API 1.18) | -| `test-results` | [run.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/run.wit) | 解析测试输出、选择要重新运行的测试(API 1.4) | -| `mcp-provider` | [mcp.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/mcp.wit) | 插件为内置 MCP 服务器提供的工具(API 1.4) | +| Interface | 文件 | 说明 | +| ------------------------------ | ------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------- | +| `lifecycle` | [exports.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/exports.wit) | 实例的 `activate` 和 `deactivate` | +| `commands` | [exports.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/exports.wit) | 执行插件声明的某个命令 | +| `event-handler` | [exports.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/exports.wit) | 接收订阅事件的批次 | +| `syntax-provider` | [exports.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/exports.wit) | 为没有语法定义的插件语言提供高亮、大纲和折叠 | +| `run-target-validation` | [exports.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/exports.wit) | 通过插件的运行目标启动前进行检查(API 1.5) | +| `providers` | [providers.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/providers.wit) | 为声明的语言提供补全、行内补全、代码操作、导航和行标记 | +| `language-features` | [language-features.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/language-features.wit) | 格式化、签名帮助、高亮、链接、代码透镜、折叠、颜色、符号、装订区操作等(API 1.4) | +| `completion-list-provider` | [completion-list.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/completion-list.wit) | 可标记为不完整的补全列表,继续输入时再次询问(API 1.16) | +| `injections` | [injections.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/injections.wit) | 文档中嵌入语言的范围(API 1.4) | +| `hover-provider` | [hover.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/hover.wit) | 向任意语言的悬停追加 Markdown | +| `hover-actions` | [hover-actions.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/hover-actions.wit) | 行左侧边缘的 hover 操作(API 1.14):锚定行和包含式触发行范围 | +| `inlay-hints-provider` | [inlay.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/inlay.wit) | 任意语言中的内嵌提示 | +| `semantic-tokens-provider` | [semantic.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/semantic.wit) | 任意语言中的语义着色 | +| `diagnostics-provider` | [diagnostics.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/diagnostics.wit) | 当前文档(可能未保存)中的问题 | +| `file-actions` | [file-actions.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/file-actions.wit) | 创建、重命名或删除文件的快速修复和重构 | +| `document-indexer` | [indexing.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/indexing.wit) | 在后台索引的跨文件定义、引用和装订区标记 | +| `endpoints-provider` | [endpoints.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/endpoints.wit) | 项目的 HTTP 端点,供 随处搜索 和 HTTP 客户端使用 | +| `search-provider` | [search.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/search.wit) | 插件自定义全局搜索分类的可取消查询(API 1.14) | +| `view-provider` | [views.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/views.wit) | 声明的视图和自定义编辑器的内容与事件 | +| `detail-provider` | [details.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/details.wit) | Services 工具窗口中插件节点的详情面板 | +| `commit-checker` | [commit.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/commit.wit) | 提交前检查 | +| `run-configurations` | [run.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/run.wit) | 项目的动态运行配置(API 1.4) | +| `launch-configurations` | [run.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/run.wit) | 带环境变量和调试器的运行配置(API 1.9) | +| `execution-configurations` | [run.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/run.wit) | 带环境变量、调试器和默认输出模式的运行配置(API 1.18) | +| `run-configuration-completion` | [exports.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/exports.wit) | 补全插件自己运行配置的“实参”字段(API 1.18) | +| `test-results` | [run.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/run.wit) | 解析测试输出、选择要重新运行的测试(API 1.4) | +| `mcp-provider` | [mcp.wit](https://github.com/l0ng-ai/openidea/blob/main/wit/mcp.wit) | 插件为内置 MCP 服务器提供的工具(API 1.4) | ## 其他语言 diff --git a/docs/zh/plugins/guides/run-targets.mdx b/docs/zh/plugins/guides/run-targets.mdx index e2c4636cdd..d15bfabadd 100644 --- a/docs/zh/plugins/guides/run-targets.mdx +++ b/docs/zh/plugins/guides/run-targets.mdx @@ -12,6 +12,7 @@ description: "贡献运行配置,把测试输出解析进测试树,从代码 | 在代码中计算项目的运行配置 | `[[contributes.runConfigurations]]` + `run-configurations` 导出 | 1.4 | | 给配置加上环境变量和调试器 | `launch-configurations` 导出 | 1.9 | | 为配置设置默认的 PTY 或管道输出模式 | `execution-configurations` 导出 / `runDetectors.outputMode` | 1.18 | +| 补全自己配置的“实参”字段 | `run-configuration-completion` 导出 | 1.18 | | 把测试输出转成 IDE 的测试树 | `test-results` 导出,`framework = "plugin"` | 1.4 | | 从命令中启动自己的某个配置 | `host::start_run` / `host::start_run_with_options`(`run` WIT) | 1.4 / 1.18 | | 让项目的所有运行都经过包装程序(DDEV、容器等) | `host::register_run_target`(WIT `run-targets`) | 1.4 | @@ -180,6 +181,14 @@ fn run_command(&mut self, _id: &str, _ctx: &Invocation, arg: Option<&str>) -> Re > 普通伪终端(PTY)会将 `stdout` 和 `stderr` 合并为同一输出流,并可能改变缓冲、输入处理及终端行为(换行、回显与 ANSI 控制序列)。 +## 补全实参 + +导出 `run-configuration-completion`(实现 `RunConfigurationCompletion`,注册为 `run_configuration_completion`), +就能在 **运行 | 编辑配置…** 中补全自己配置的“实参”字段,比如任务运行器的任务名。用户输入(或按 Ctrl+Space)时, +IDE 传入配置 id、`field = "arguments"`、字段文本和以 UTF-16 计的光标位置。每一项只替换它给出的 UTF-16 区间, +其他选项、带引号的值和 `--` 之后的参数保持原样。请根据插件已经掌握的信息作答:IDE 最多保留 200 项, +超过 300 ms 或文本已经变化后的回答会被丢弃。 + ## 运行目标 运行目标是项目级的包装程序:选用它的每一次运行、测试、脚本和解释器启动,都会被改写为通过插件所有的程序执行, diff --git a/docs/zh/plugins/versioning.mdx b/docs/zh/plugins/versioning.mdx index 7fcc432b9f..6b21535f16 100644 --- a/docs/zh/plugins/versioning.mdx +++ b/docs/zh/plugins/versioning.mdx @@ -9,27 +9,27 @@ description: "engines.openidea、插件 API 从 1.0 到 1.13 的各个版本, ## 版本历史 -| 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 | `main` 上开发中 | `ui.read-clipboard`:在用户运行的命令中读取剪贴板的文本和图片(`clipboard.read`) | -| 1.12.0 | `main` 上开发中 | `ui.set-console-rules`:Run/Debug 控制台输出的高亮规则(正则、调色板颜色、文本样式) | -| 1.13.0 | OpenIDEA 0.1.49 | 新增 `search-provider` 导出和 `searchCategories` 贡献点:可取消查询的全局搜索自定义分类 | -| 1.14.0 | `main` 上开发中 | 可选 `hover-actions` 导出:行内侧 hover 显示的左侧操作,带锚定行和包含式触发行范围; `[[contributes.javaAgents]]` 的 `vmOptions` / `jdk`:在 `-javaagent:` 之前注入 JVM 参数(可选仅 JetBrains Runtime);`ui.set-status-item-menu` / `set-window-status-item-menu`:状态栏项菜单 | -| 1.15.0 | `main` 上开发中 | `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 | `main` 上开发中 | `[[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` 授权范围内的文件和目录 | +| 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 | `main` 上开发中 | `ui.read-clipboard`:在用户运行的命令中读取剪贴板的文本和图片(`clipboard.read`) | +| 1.12.0 | `main` 上开发中 | `ui.set-console-rules`:Run/Debug 控制台输出的高亮规则(正则、调色板颜色、文本样式) | +| 1.13.0 | OpenIDEA 0.1.49 | 新增 `search-provider` 导出和 `searchCategories` 贡献点:可取消查询的全局搜索自定义分类 | +| 1.14.0 | `main` 上开发中 | 可选 `hover-actions` 导出:行内侧 hover 显示的左侧操作,带锚定行和包含式触发行范围; `[[contributes.javaAgents]]` 的 `vmOptions` / `jdk`:在 `-javaagent:` 之前注入 JVM 参数(可选仅 JetBrains Runtime);`ui.set-status-item-menu` / `set-window-status-item-menu`:状态栏项菜单 | +| 1.15.0 | `main` 上开发中 | `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 | `main` 上开发中 | `[[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` 导出:补全插件自己运行配置的“实参”字段 | 每个版本新增内容的完整列表见 [`plugins/README.md`](https://github.com/l0ng-ai/openidea/blob/main/plugins/README.md)。 diff --git a/plugins/README.md b/plugins/README.md index ceab0b83ab..182c9479e5 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -470,6 +470,12 @@ matching SDK. Plugins for 1.17 and earlier keep working. New in 1.18: launches can pass a per-invocation override via `host::start_run_with_options` (`run.start-with-options`). User-saved overrides win over per-invocation overrides, which win over plugin defaults. +- **Completion in a configuration's Arguments field.** The optional + `run-configuration-completion` export (`RunConfigurationCompletion`, registration + `run_configuration_completion`) completes the Arguments field of the plugin's own + run configurations in **Run | Edit Configurations…**: each item replaces one UTF-16 + range, so the other arguments stay as typed. See + [Completing configuration arguments](#completing-configuration-arguments). PTY is rejected for `test` configurations, `debug` launches requesting `Pty`, remote run targets, and redirected `stdin` files. See [Output transport: pipes or PTY](#output-transport-pipes-or-pty-api-118). @@ -973,6 +979,7 @@ then run `openidea-plugin check`. | `RunConfigurations::configurations(root)` | export `run-configurations.configurations` | API 1.4: optional `plugin-run-configurations` world; SDK registration `run_configurations`. Full project list, refreshed on configuration listing. | | `LaunchConfigurations::launch_configurations(root)` | export `launch-configurations` | API 1.9: optional `plugin-launch-configurations` world; SDK registration `launch_configurations`. The same list with `env` and `debugger`; preferred over `run-configurations`. | | `ExecutionConfigurations::execution_configurations(root)` | export `execution-configurations` | API 1.18: optional `plugin-execution-configurations` world; SDK registration `execution_configurations`. Adds a default `output_mode` (`Pipes` or `Pty`); preferred over `launch-configurations` and `run-configurations`. | +| `RunConfigurationCompletion::complete(project, config, field, text, caret)` | export `run-configuration-completion` | API 1.18: optional `plugin-run-configuration-completion` world; SDK registration `run_configuration_completion`. Completes the Arguments field (`field = "arguments"`) of the plugin's own configurations; items replace a UTF-16 range; 200 items, 300 ms. | | `TestResults::parse(config, chunk)` | export `test-results.parse` | API 1.4: optional `plugin-test-results` world; SDK registration `test_results`. Bounded output batches for `framework = "plugin"`; failures use built-in parsers. | | `TestResults::select_tests(config, tests)` | export `test-results.select-tests` | API 1.4: full replacement argv for test-tree name paths, or `None` when unsupported (the SDK default). Enables rerunning failed tests and running tree selections. | | `host::open_location(path, line, column)` | `views.open-location` | Opens a file inside the project in an editor of the invoking window, the caret at `line`/`column` (0-based, UTF-16): a view's links to code. Needs `project.read`. | @@ -1492,6 +1499,39 @@ with an older generation after the project generation has moved forward, the reg a project closes, in-flight work and queued events for that project are cancelled and dropped, run targets and configurations under that root are withdrawn, and `project-closed` (`Event::ProjectClosed`) is delivered to subscribed plugins. +### Completing configuration arguments + +A configuration a plugin provides (a `[[contributes.runDetectors]]` entry or one from a +configurations export) can have its Arguments field completed by that plugin in +**Run | Edit Configurations…**, also after the user overrode it there. Export +`run-configuration-completion` (API 1.18): + +```rust +impl RunConfigurationCompletion for MyPlugin { + fn complete(&mut self, project: &str, config: &str, field: &str, text: &str, caret: u32) + -> Vec { + if field != "arguments" { return Vec::new(); } + // Find the argument under `caret` (UTF-16 offsets) and offer task names for it. + // … + } +} +register_plugin!(MyPlugin, run_configuration_completion); +``` + +- **What the plugin gets.** `config` is the configuration's id as the plugin reported it, + `field` is `arguments` (answer none for a field you don't know: later IDEs may ask for more), + `text` is the field as typed and `caret` a UTF-16 offset into it. The field splits like a + shell command line: whitespace separates arguments, `'` and `"` quote. +- **What it answers.** Each item has a `label`, an optional `detail` (grey, such as the file a + task comes from), an optional `insert` (default: `label`) and the UTF-16 range + `replace_start..replace_end` it replaces. Replace only the argument being completed, so the + other options, quoted values and the arguments after `--` stay as they are. +- **Limits.** The IDE asks while the user types (and on Ctrl+Space). Answer from what the plugin + already knows, without starting a process per keystroke. It keeps the first 200 items, drops + items whose range is outside the text, and drops an answer slower than 300 ms or one for text + that has changed since. A configuration the plugin no longer provides for the project (its + program revoked, the plugin stopped) is not completed. A failure leaves the field as it is. + ### Watching paths outside the project A build tool's configuration often includes files from outside the project (a shared Taskfile, a diff --git a/plugins/official/ai-completion/dist/plugin.wasm b/plugins/official/ai-completion/dist/plugin.wasm index 39751b4021..f04eab0b6b 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 f24bc6571c..7732761d3e 100644 --- a/plugins/official/ai-completion/dist/plugin.wasm.sources +++ b/plugins/official/ai-completion/dist/plugin.wasm.sources @@ -1 +1 @@ -fba23503b3a73d9d20277f5347f3421c44f109e0d07c5bb212345ba180bbe3dd +81f868bbdc6d1962a210d80c0bcc3d308aae4778074a7c0fc186f63c2ff61eac diff --git a/plugins/official/blame-annotations/dist/plugin.wasm b/plugins/official/blame-annotations/dist/plugin.wasm index bd02abde26..12c6cdd570 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 e934e35902..0ae4703fa2 100644 --- a/plugins/official/blame-annotations/dist/plugin.wasm.sources +++ b/plugins/official/blame-annotations/dist/plugin.wasm.sources @@ -1 +1 @@ -fe0829e3c34b2a2a3dcf8fc15fe5f204dcb8b1cb3b0ad8d69433313f2f7cbbe0 +f7fe1f6c6dd7d0ca6d6d00822e9befb2be9dac290e43857fa34e25da58ea3404 diff --git a/plugins/official/checkstyle/dist/plugin.wasm b/plugins/official/checkstyle/dist/plugin.wasm index 5359b3bf45..562800618f 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 a3caae38ef..01296cd7fb 100644 --- a/plugins/official/checkstyle/dist/plugin.wasm.sources +++ b/plugins/official/checkstyle/dist/plugin.wasm.sources @@ -1 +1 @@ -dfb8ad40626f5595425618c62382d25aa374110927c8839124959e3fcc27e61e +160dc378e930f137643b36a28a6eba4da6c1fa67e15348e82df93904a8cd6eeb diff --git a/plugins/official/container-runner/dist/plugin.wasm b/plugins/official/container-runner/dist/plugin.wasm index babe3594a3..aa7ad34160 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 8e48dadc3e..97928d3c26 100644 --- a/plugins/official/container-runner/dist/plugin.wasm.sources +++ b/plugins/official/container-runner/dist/plugin.wasm.sources @@ -1 +1 @@ -4a579b4009c1da637b91946137dff03c576a9b5116ece590de4c98c1dadf9aa0 +84c49b6c40314c5b8f4f366d51575abda6b3645d60010a2f6492bba9e18fa62a diff --git a/plugins/official/csv-editor/dist/plugin.wasm b/plugins/official/csv-editor/dist/plugin.wasm index f971d573ca..7383cd2824 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 46884d093d..b91558c6fe 100644 --- a/plugins/official/csv-editor/dist/plugin.wasm.sources +++ b/plugins/official/csv-editor/dist/plugin.wasm.sources @@ -1 +1 @@ -918b5e2700a36a63af100203b04654fbedfc7e244c89de4fc916fae448b34e00 +50d106a7b96c240652da5f25f0e2fc083a135c587879080687eb72a5b3d90769 diff --git a/plugins/official/git-toolbox/dist/plugin.wasm b/plugins/official/git-toolbox/dist/plugin.wasm index b30d47a121..0a39487a5e 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 01dc601b03..3109e56493 100644 --- a/plugins/official/git-toolbox/dist/plugin.wasm.sources +++ b/plugins/official/git-toolbox/dist/plugin.wasm.sources @@ -1 +1 @@ -b051ab889e8d784c5bb486dd5d790306aa5e465eeb42596ab62fe76ba372a945 +6c3045316db235e129cc211040dd62ba4e3ed9bfc6c997aba61c5946929100b2 diff --git a/plugins/official/graphviz/dist/plugin.wasm b/plugins/official/graphviz/dist/plugin.wasm index fdcee8a6cd..b3dac25449 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 d76675fcab..658f0d6c44 100644 --- a/plugins/official/graphviz/dist/plugin.wasm.sources +++ b/plugins/official/graphviz/dist/plugin.wasm.sources @@ -1 +1 @@ -8e96b787bc2f872ad873cece29f6b7e288fc0ffea8a236668d3e7b0db77d3731 +006ecb56f6657044b54e8752c95fb3dbcaf98384124042f25298d27ab5c66773 diff --git a/plugins/official/key-promoter/dist/plugin.wasm b/plugins/official/key-promoter/dist/plugin.wasm index 2f28864bb9..49433dd242 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 d6f9bed143..06e0105112 100644 --- a/plugins/official/key-promoter/dist/plugin.wasm.sources +++ b/plugins/official/key-promoter/dist/plugin.wasm.sources @@ -1 +1 @@ -27361e13e27bc71739eebaa5762bf072e721bd6fe5aeb16261af964c9637353e +2c749192ea33f65d0396103371d3f8f21d4ce467268efb821705d806aa45973e diff --git a/plugins/official/license-header/dist/plugin.wasm b/plugins/official/license-header/dist/plugin.wasm index 99a9dcefa8..d09145f162 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 90ba7b95c1..a87b7b1339 100644 --- a/plugins/official/license-header/dist/plugin.wasm.sources +++ b/plugins/official/license-header/dist/plugin.wasm.sources @@ -1 +1 @@ -65dccba5e841e42e29f59ce5e74d9fc710462fb80b8093f1cd1d6cb481fabed7 +3d8838b8444bd7191d33d11b2e1e40b3f88b96b3bddd8ecf5e4936bac299437d diff --git a/plugins/official/mybatis/dist/plugin.wasm b/plugins/official/mybatis/dist/plugin.wasm index 7225ba5d86..c04777256c 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 e95073306b..3699b68051 100644 --- a/plugins/official/mybatis/dist/plugin.wasm.sources +++ b/plugins/official/mybatis/dist/plugin.wasm.sources @@ -1 +1 @@ -8c32ff79d0cf0127c6505ba30826840eb1c77a1c49a86b0ebe465b749cad2ae3 +2e788c8bd398ee5386e92e0ff8747e8470e12cb37eb6f8ca1cea9c9c79fc3366 diff --git a/plugins/official/regex-tester/dist/plugin.wasm b/plugins/official/regex-tester/dist/plugin.wasm index c8f17ddc7e..e87f3e8c05 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 0777c751d7..318f62ec55 100644 --- a/plugins/official/regex-tester/dist/plugin.wasm.sources +++ b/plugins/official/regex-tester/dist/plugin.wasm.sources @@ -1 +1 @@ -758e3aac4efeeee2361ad35556374c7936ba7d4fe813a7bce09022aeaef1fc8c +ba45d5376905a5602c1badb0ec94b351447b4eaf57cd0f19628b13ba59da961f diff --git a/plugins/official/solidity/dist/plugin.wasm b/plugins/official/solidity/dist/plugin.wasm index 5398e387a2..bf14886d13 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 bfcf59a768..fba71d026b 100644 --- a/plugins/official/solidity/dist/plugin.wasm.sources +++ b/plugins/official/solidity/dist/plugin.wasm.sources @@ -1 +1 @@ -0b6616e67cd9d65a3523daad2891800ae0ab4e5474377d2288626da8f3e83e30 +5ec6de5a1d9a00e5f57fcf1ee6e6f04115061c08c4db6f9c1c7d83611caccc65 diff --git a/plugins/official/string-tools/dist/plugin.wasm b/plugins/official/string-tools/dist/plugin.wasm index 7335ed8fd1..66abce39f2 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 6bdf28f218..33673ef829 100644 --- a/plugins/official/string-tools/dist/plugin.wasm.sources +++ b/plugins/official/string-tools/dist/plugin.wasm.sources @@ -1 +1 @@ -074170f3bb8812c839b6b88a1b16fd623e938838a823badf3fbf322e893ad7d6 +4234fcfd105b5c6413372f4eca1bf707f912888d051ebed21f3959389c261def diff --git a/plugins/official/test-runner/dist/plugin.wasm b/plugins/official/test-runner/dist/plugin.wasm index a8294787de..0b4352bb94 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 dcf7055cb4..f75d156f64 100644 --- a/plugins/official/test-runner/dist/plugin.wasm.sources +++ b/plugins/official/test-runner/dist/plugin.wasm.sources @@ -1 +1 @@ -28558e9d57c110982ba1dc46ca4db4bd32595ea3a5a48de3513e8ce636e0c61d +70fbad5fc1d16069629e670fce2b4076113dd13cac3c794723d551dfdd500ce3 diff --git a/plugins/official/todo-finder/dist/plugin.wasm b/plugins/official/todo-finder/dist/plugin.wasm index de3818ea18..37b1f10407 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 2879adf0cf..9a28a76459 100644 --- a/plugins/official/todo-finder/dist/plugin.wasm.sources +++ b/plugins/official/todo-finder/dist/plugin.wasm.sources @@ -1 +1 @@ -bbe7009d2386b9dac4a5be400e6589357c6e4c4d3068164f25a955f487403967 +d38a8314d156e1a4143cb1eb9dccb2fe01d3add4760570af4152f346307df297 diff --git a/sdk/rust/openidea-plugin/src/execution.rs b/sdk/rust/openidea-plugin/src/execution.rs index fd2567e6fd..d77ff09479 100644 --- a/sdk/rust/openidea-plugin/src/execution.rs +++ b/sdk/rust/openidea-plugin/src/execution.rs @@ -374,3 +374,39 @@ pub trait RunTargetValidation { /// Refuse with a user-facing explanation, or allow with `Ok(())`. fn validate(&mut self, project: &str, target_id: &str, launch: &RunTargetLaunch) -> Result<(), String>; } + +/// A completion for a field of one of the plugin's own run configurations (API 1.18). +#[derive(Clone, Debug, Default, PartialEq, Eq)] +pub struct RunConfigurationCompletionItem { + /// What the list shows, such as `build`. + pub label: String, + /// Grey text after the label, such as the file the entry comes from. + pub detail: Option, + /// The text replacing `replace_start..replace_end`; `label` when `None`. + pub insert: Option, + /// UTF-16 offsets into the field's text; the caret ends after the inserted text. + pub replace_start: u32, + pub replace_end: u32, +} + +/// Completion in the fields of the plugin's own run configurations, in the Run/Debug +/// Configurations dialog (API 1.18); register with +/// `register_plugin!(T, …, run_configuration_completion)`. +pub trait RunConfigurationCompletion { + /// Completions for `field` (`"arguments"` today; answer none for a field you don't + /// know) of the configuration `config` (its id as the plugin reported it) in + /// `project`. `text` is the field as typed: whitespace separates arguments and `'` + /// or `"` quote, as in a shell. `caret` is a UTF-16 offset into it. Replace only the + /// token being completed, so other options, quoted values and arguments after `--` + /// stay. Called while the user types: answer from what the plugin already knows. + /// The IDE keeps the first 200 items, drops those whose range is outside `text`, and + /// drops answers slower than 300 ms. + fn complete( + &mut self, + project: &str, + config: &str, + field: &str, + text: &str, + caret: u32, + ) -> Vec; +} diff --git a/sdk/rust/openidea-plugin/src/lib.rs b/sdk/rust/openidea-plugin/src/lib.rs index 4324ce5007..4cd23b8b15 100644 --- a/sdk/rust/openidea-plugin/src/lib.rs +++ b/sdk/rust/openidea-plugin/src/lib.rs @@ -337,6 +337,7 @@ macro_rules! register_plugin { macro_rules! __optional_exports { (run_target_validation, $plugin:ty, $component:ident) => { $crate::__run_target_validation_exports!($plugin, $component); }; (run_anything, $plugin:ty, $component:ident) => { $crate::__run_anything_exports!($plugin, $component); }; + (run_configuration_completion, $plugin:ty, $component:ident) => { $crate::__run_configuration_completion_exports!($plugin, $component); }; (injections, $plugin:ty, $component:ident) => { $crate::__injections_exports!($plugin, $component); }; (language_features, $plugin:ty, $component:ident) => { $crate::__language_features_exports!($plugin, $component); }; (mcp, $plugin:ty, $component:ident) => { $crate::__mcp_exports!($plugin, $component); }; @@ -1266,6 +1267,27 @@ pub mod __rt { with::(|p| p.run(project, prefix, line)) } + pub fn run_configuration_complete( + project: &str, + config: &str, + field: &str, + text: &str, + caret: u32, + ) -> Vec +{ + use crate::run_configuration_completion_bindings::exports::openidea::plugin::run_configuration_completion::CompletionItem as I; + with::(|p| p.complete(project, config, field, text, caret)) + .into_iter() + .map(|i| I { + label: i.label, + detail: i.detail, + insert: i.insert, + replace_start: i.replace_start, + replace_end: i.replace_end, + }) + .collect() + } + pub fn validate_run_target( root: &str, target: &str, @@ -1328,7 +1350,7 @@ pub mod __rt { pub fn execution_configurations( root: &str, ) -> Vec - { +{ use crate::bindings::openidea::plugin::run::OutputMode as WitMode; use crate::execution_configurations_bindings::exports::openidea::plugin::execution_configurations as w; use crate::execution_configurations_bindings::openidea::plugin::launch_configurations as w_launch; @@ -1756,6 +1778,26 @@ pub mod run_anything_bindings { export_macro_name: "__export_run_anything_world", default_bindings_module: "openidea_plugin::run_anything_bindings" }); } +#[cfg(target_arch = "wasm32")] +#[doc(hidden)] +pub mod run_configuration_completion_bindings { + wit_bindgen::generate!({ world: "run-configuration-completion-exports", path: "wit", pub_export_macro: true, + export_macro_name: "__export_run_configuration_completion_world", + default_bindings_module: "openidea_plugin::run_configuration_completion_bindings" }); +} +#[doc(hidden)] +#[macro_export] +macro_rules! __run_configuration_completion_exports { + ($plugin:ty, $component:ident) => { + impl $crate::run_configuration_completion_bindings::exports::openidea::plugin::run_configuration_completion::Guest for $component { + fn complete(project: String, config: String, field: String, text: String, caret: u32) -> Vec<$crate::run_configuration_completion_bindings::exports::openidea::plugin::run_configuration_completion::CompletionItem> { + $crate::__rt::run_configuration_complete::<$plugin>(&project, &config, &field, &text, caret) + } + } + $crate::run_configuration_completion_bindings::__export_run_configuration_completion_world!($component with_types_in $crate::run_configuration_completion_bindings); + }; +} + #[doc(hidden)] #[macro_export] macro_rules! __run_anything_exports { diff --git a/sdk/rust/openidea-plugin/wit/exports.wit b/sdk/rust/openidea-plugin/wit/exports.wit index 4da67be642..cbf4272e27 100644 --- a/sdk/rust/openidea-plugin/wit/exports.wit +++ b/sdk/rust/openidea-plugin/wit/exports.wit @@ -98,6 +98,33 @@ interface run-anything-provider { run: func(project: string, prefix: string, line: string) -> bool; } +/// Optional completion in the fields of this plugin's own run configurations, in +/// the Run/Debug Configurations dialog (API 1.18). +interface run-configuration-completion { + record completion-item { + /// What the list shows, such as `build`. + label: string, + /// Grey text after the label, such as the file the entry comes from. + detail: option, + /// The text that replaces `[replace-start, replace-end)` (default: `label`). + insert: option, + /// UTF-16 offsets into `text`; the caret ends after the inserted text. + replace-start: u32, + replace-end: u32, + } + /// Completions for `field` of the configuration `config` (its id as this plugin + /// reported it) in `project`. `field` is `arguments` today: the field splits like a + /// shell command line (whitespace separates arguments, `'` and `"` quote). Later + /// IDEs may ask for other fields, so answer none for a field you don't know. + /// `text` is the field as typed and `caret` a UTF-16 offset into it. Replace only + /// the token being completed, so the other options, quoted values and arguments + /// after `--` stay as they are. Answer from what the plugin already knows (no + /// process per keystroke): the IDE asks while the user types, keeps the first 200 + /// items, drops an item whose range is outside `text`, and drops an answer that + /// comes after the text changed or takes longer than 300 ms. + complete: func(project: string, config: string, field: string, text: string, caret: u32) -> list; +} + /// Optional pre-launch gate for targets owned by this plugin (API 1.5). interface run-target-validation { enum operation { run, test } diff --git a/sdk/rust/openidea-plugin/wit/plugin.wit b/sdk/rust/openidea-plugin/wit/plugin.wit index 6686e5c17e..8cc725b88d 100644 --- a/sdk/rust/openidea-plugin/wit/plugin.wit +++ b/sdk/rust/openidea-plugin/wit/plugin.wit @@ -222,6 +222,11 @@ world plugin-run-anything { include plugin; export run-anything-provider; } /// Export-only Run Anything provider, composed with the base plugin world. world run-anything-exports { export run-anything-provider; } +/// A plugin completing fields of its own run configurations (API 1.18). +world plugin-run-configuration-completion { include plugin; export run-configuration-completion; } +/// Export-only run configuration completion, composed with the base plugin world. +world run-configuration-completion-exports { export run-configuration-completion; } + /// A plugin with custom Search Everywhere categories. world plugin-search { include plugin; export search-provider; } /// Optional export composed with the base plugin by the SDK. diff --git a/src-tauri/tests/commands.snap b/src-tauri/tests/commands.snap index b3b62de1ef..f2543fe1f6 100644 --- a/src-tauri/tests/commands.snap +++ b/src-tauri/tests/commands.snap @@ -497,6 +497,7 @@ plugin_roll_back outside_restricted desktop bin plugin_run_anything_run trusted project_host bindings async plugin_run_anything_suggest trusted project_host bindings async plugin_run_command trusted project_host bindings async +plugin_run_configuration_complete trusted project_host bindings async plugin_run_targets trusted project_host bindings async plugin_search trusted project_host bindings async plugin_secrets trusted desktop bindings async diff --git a/src/bindings.ts b/src/bindings.ts index 1122865d47..f81fd81438 100644 --- a/src/bindings.ts +++ b/src/bindings.ts @@ -1325,6 +1325,8 @@ export const commands = { language: string, selections: Range[], } | null, paths: string[] | null, settingsScope: "global" | "project" | null, commandChain: string[] | null, request: number | null) => typedError(__TAURI_INVOKE("plugin_run_command", { pluginId, commandId, arg, editor, paths, settingsScope, commandChain, request })), + /** Completions for a field of a plugin's own run configuration (API 1.18). */ + pluginRunConfigurationComplete: (configId: string, field: string, text: string, caret: number) => typedError(__TAURI_INVOKE("plugin_run_configuration_complete", { configId, field, text, caret })), pluginRunTargets: () => typedError(__TAURI_INVOKE("plugin_run_targets")), /** * One page of `plugin_id`'s results for its search `category`. Cancellable with @@ -12425,6 +12427,16 @@ export type RunAttach_Serialize = { export type RunConfig = RunConfig_Serialize | RunConfig_Deserialize; +/** A completion for a field of a plugin's own run configuration (API 1.18). */ +export type RunConfigCompletion = { + label: string, + detail: string | null, + /** Replaces the UTF-16 range `[replace_start, replace_end)` of the field's text. */ + insert: string, + replaceStart: number, + replaceEnd: number, +}; + export type RunConfig_Deserialize = { /** Stable id, e.g. `npm:dev`, `cargo:run:app`, or a uuid for user-defined. */ id: string, diff --git a/src/features/run/ConfigForm.tsx b/src/features/run/ConfigForm.tsx index 7c8c26f78b..1c6606e525 100644 --- a/src/features/run/ConfigForm.tsx +++ b/src/features/run/ConfigForm.tsx @@ -57,6 +57,8 @@ import { } from "./configs"; import { gradleContainsModule } from "./gradleRun"; import { EnvDialog } from "./EnvDialog"; +import { PluginArgsInput } from "./PluginArgsInput"; +import { pluginOwnedConfig } from "./pluginArgsCompletion"; import { useBuildModel } from "@/platform/buildModel"; import { COMPOUND, formParams, terminalApplies, withParams } from "./types"; import { TomcatSettings } from "./TomcatSettings"; @@ -346,6 +348,12 @@ export function ConfigForm({ config, all, type, errors, template, onChange, modi }); const [shown, setShown] = useState>(() => new Set()); const [argsText, setArgsText] = useState(null); + const setArgs = (text: string) => { + setArgsText(text); + const args = parseArgs(text); + const module = parseJavaArgs(args).mainClass === parseJavaArgs(config.args).mainClass ? config.module : undefined; + update({ args, params: {}, module }); + }; const [envText, setEnvText] = useState(null); const [envFilesText, setEnvFilesText] = useState(null); const [envOpen, setEnvOpen] = useState(false); @@ -622,21 +630,22 @@ export function ConfigForm({ config, all, type, errors, template, onChange, modi /> - { - setArgsText(e.target.value); - const args = parseArgs(e.target.value); - const module = - parseJavaArgs(args).mainClass === parseJavaArgs(config.args).mainClass - ? config.module - : undefined; - update({ args, params: {}, module }); - }} - /> + {pluginOwnedConfig(config) ? ( + + ) : ( + setArgs(e.target.value)} + /> + )} )} diff --git a/src/features/run/PluginArgsInput.test.tsx b/src/features/run/PluginArgsInput.test.tsx new file mode 100644 index 0000000000..b8dbb81aab --- /dev/null +++ b/src/features/run/PluginArgsInput.test.tsx @@ -0,0 +1,102 @@ +import { afterEach, describe, expect, it, vi } from "vitest"; +import { act, cleanup, fireEvent, render, screen, waitFor } from "@testing-library/react"; +import { useState } from "react"; +import type { RunConfigCompletion } from "@/platform/ipc"; +import { PluginArgsInput } from "./PluginArgsInput"; +import { applyCompletion, pluginOwnedConfig } from "./pluginArgsCompletion"; + +afterEach(cleanup); + +const item = (label: string, replaceStart: number, replaceEnd: number, insert = label): RunConfigCompletion => ({ + label, + detail: "Taskfile.yml", + insert, + replaceStart, + replaceEnd, +}); + +describe("applyCompletion", () => { + it("replaces only the item's range and puts the caret after it", () => { + expect(applyCompletion("--dry 'a b' d -- x", item("docs:serve", 12, 13))).toEqual({ + text: "--dry 'a b' docs:serve -- x", + caret: 22, + }); + // UTF-16 offsets, as the plugin reports them. + expect(applyCompletion("é 😀 b", item("build", 5, 6))).toEqual({ text: "é 😀 build", caret: 10 }); + // A range past the end is clamped rather than duplicating text. + expect(applyCompletion("b", item("build", 0, 9))).toEqual({ text: "build", caret: 5 }); + }); + + it("knows a plugin's configuration, also when the user overrode it", () => { + expect(pluginOwnedConfig({ id: "plugin:go-task:tasks", kind: "plugin" })).toBe(true); + expect(pluginOwnedConfig({ id: "npm:dev", kind: "npm" })).toBe(false); + expect(pluginOwnedConfig({ id: "user:1", kind: "plugin" })).toBe(false); + }); +}); + +function Field({ + complete, + onKeyDown, +}: { + complete: (id: string, text: string, caret: number) => Promise; + onKeyDown?: () => void; +}) { + const [value, setValue] = useState("--dry "); + return ( +
+ +
+ ); +} + +describe("PluginArgsInput", () => { + it("asks the plugin as the user types and applies the chosen item", async () => { + const complete = vi.fn(async (_id: string, text: string, caret: number) => + text.slice(6, caret) === "b" ? [item("build", 6, caret)] : [], + ); + render(); + const input = screen.getByRole("combobox", { name: "Arguments" }) as HTMLInputElement; + fireEvent.change(input, { target: { value: "--dry b", selectionStart: 7 } }); + expect(complete).toHaveBeenLastCalledWith("plugin:go-task:tasks", "--dry b", 7); + await screen.findByText("build"); + fireEvent.keyDown(input, { key: "Enter" }); + expect(input.value).toBe("--dry build"); + expect(screen.queryByText("build")).toBeNull(); + }); + + it("drops an answer for text that has changed since", async () => { + let resolveFirst: (items: RunConfigCompletion[]) => void = () => {}; + const complete = vi + .fn() + .mockImplementationOnce(() => new Promise((resolve) => (resolveFirst = resolve))) + .mockImplementation(async () => [item("test", 6, 7)]); + render(); + const input = screen.getByRole("combobox", { name: "Arguments" }); + fireEvent.change(input, { target: { value: "--dry b", selectionStart: 7 } }); + fireEvent.change(input, { target: { value: "--dry t", selectionStart: 7 } }); + await screen.findByText("test"); + await act(async () => resolveFirst([item("build", 6, 7)])); + expect(screen.queryByText("build")).toBeNull(); + expect(screen.getByText("test")).toBeTruthy(); + }); + + it("closes on Escape without leaving the field, and stays usable when the plugin answers nothing", async () => { + const complete = vi.fn(async () => [item("build", 6, 7), item("bench", 6, 7)]); + // The dialog around the field closes on Escape: the popup takes it first. + const dialog = vi.fn(); + render(); + const input = screen.getByRole("combobox", { name: "Arguments" }) as HTMLInputElement; + fireEvent.change(input, { target: { value: "--dry b", selectionStart: 7 } }); + await screen.findByText("bench"); + fireEvent.keyDown(input, { key: "Escape" }); + await waitFor(() => expect(screen.queryByText("bench")).toBeNull()); + expect(dialog).not.toHaveBeenCalled(); + fireEvent.keyDown(input, { key: "Escape" }); + expect(dialog).toHaveBeenCalledTimes(1); + complete.mockResolvedValue([]); + fireEvent.change(input, { target: { value: "--dry bx", selectionStart: 8 } }); + await waitFor(() => expect(complete).toHaveBeenCalledTimes(2)); + expect(input.value).toBe("--dry bx"); + expect(screen.queryByRole("listbox")).toBeNull(); + }); +}); diff --git a/src/features/run/PluginArgsInput.tsx b/src/features/run/PluginArgsInput.tsx new file mode 100644 index 0000000000..f7ac0d41ff --- /dev/null +++ b/src/features/run/PluginArgsInput.tsx @@ -0,0 +1,146 @@ +/** + * The Arguments field of a plugin's own run configuration, completed by that plugin + * (plugin API 1.18): suggestions follow the caret as the user types (or on Ctrl+Space), + * and choosing one replaces only the argument the plugin names, so the other options, + * quoted values and arguments after `--` stay as they are. + */ +import { useId, useLayoutEffect, useRef, useState, type KeyboardEvent } from "react"; +import { Input, List, Popup, listNavigate } from "@/ui"; +import { useRowHeight } from "@/ui/density"; +import { useTx } from "@/platform/i18n"; +import type { RunConfigCompletion } from "@/platform/ipc"; +import { applyCompletion, completeArguments } from "./pluginArgsCompletion"; +import styles from "./Run.module.css"; + +const ROW_HEIGHT = 22; +const MAX_ROWS = 10; + +export function PluginArgsInput({ + configId, + value, + onChange, + placeholder, + complete = completeArguments, +}: { + configId: string; + value: string; + onChange: (text: string) => void; + /** Untranslated; the input translates it. */ + placeholder?: string; + /** The completion source (tests replace it). */ + complete?: typeof completeArguments; +}) { + const tx = useTx(); + const id = useId(); + const rowHeight = useRowHeight(ROW_HEIGHT); + const input = useRef(null); + const generation = useRef(0); + const pendingCaret = useRef(null); + const [items, setItems] = useState([]); + const [active, setActive] = useState(0); + + useLayoutEffect(() => { + if (pendingCaret.current === null || !input.current) return; + input.current.setSelectionRange(pendingCaret.current, pendingCaret.current); + pendingCaret.current = null; + }); + + const close = () => { + generation.current += 1; + setItems([]); + }; + /** Asks the plugin for `text`; an answer for older text or another caret is dropped. */ + const request = (text: string, caret: number) => { + const mine = ++generation.current; + void complete(configId, text, caret).then((answer) => { + if (mine !== generation.current) return; + setItems(answer); + setActive(0); + }); + }; + const choose = (item: RunConfigCompletion | undefined) => { + if (!item) return; + const next = applyCompletion(value, item); + pendingCaret.current = next.caret; + close(); + onChange(next.text); + input.current?.focus(); + }; + const shown = items.length > 0; + const onKeyDown = (e: KeyboardEvent) => { + if (e.nativeEvent.isComposing) return; + if (e.key === " " && e.ctrlKey) { + e.preventDefault(); + request(value, e.currentTarget.selectionStart ?? value.length); + return; + } + if (!shown) return; + if (e.key === "Enter" || e.key === "Tab") { + e.preventDefault(); + e.stopPropagation(); + choose(items[active]); + } else if (e.key === "Escape") { + e.preventDefault(); + e.stopPropagation(); + close(); + } else if (e.key === "ArrowDown" || e.key === "ArrowUp") { + const next = listNavigate(e.key, { items, active, wrap: true }); + if (next === null) return; + e.preventDefault(); + setActive(next); + } + }; + return ( + <> + { + onChange(e.target.value); + request(e.target.value, e.target.selectionStart ?? e.target.value.length); + }} + onKeyDown={onKeyDown} + onBlur={close} + /> + +
+ `${item.label}\u0000${item.detail ?? ""}\u0000${item.insert}`} + activeIndex={active} + onActiveChange={setActive} + onActivate={choose} + focusable={false} + hoverSelects + rowHeight={rowHeight} + aria-label={tx("Argument completions")} + className={styles.argsList} + renderItem={(item) => ( + + {item.label} + {item.detail && {item.detail}} + + )} + /> +
+
+ + ); +} diff --git a/src/features/run/Run.module.css b/src/features/run/Run.module.css index 9a65b63b27..d0a8a04497 100644 --- a/src/features/run/Run.module.css +++ b/src/features/run/Run.module.css @@ -1768,3 +1768,43 @@ color: var(--danger); flex: none; } + +/* Completion popup of a plugin run configuration's Arguments field. */ +.argsPopup { + min-width: 260px; + max-width: min(640px, 70vw); + display: flex; + flex-direction: column; + overflow: hidden; +} +.argsListWrap { + display: flex; + flex-direction: column; + min-height: 0; + padding: 4px 0; + box-sizing: content-box; +} +.argsList { + flex: 1; +} +.argsRow { + flex: 1; + min-width: 0; + display: flex; + align-items: baseline; + gap: var(--space-2); +} +.argsLabel { + font-family: var(--font-mono); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.argsDetail { + margin-left: auto; + color: var(--fg-subtle); + font-size: var(--fs-small); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} diff --git a/src/features/run/pluginArgsCompletion.ts b/src/features/run/pluginArgsCompletion.ts new file mode 100644 index 0000000000..d4d1126be1 --- /dev/null +++ b/src/features/run/pluginArgsCompletion.ts @@ -0,0 +1,27 @@ +/** + * Completion in the Arguments field of a plugin's own run configuration (plugin API 1.18): + * the owning plugin answers for the text and caret, and each item replaces one UTF-16 range. + */ +import { call, commands, type RunConfig, type RunConfigCompletion } from "@/platform/ipc"; + +/** A configuration a plugin provides (`plugin::`), also a user's override of one. */ +export function pluginOwnedConfig(config: Pick): boolean { + return config.kind === "plugin" && config.id.startsWith("plugin:"); +} + +/** `text` with `item` applied, and where the caret goes (both in UTF-16 units, as JS strings are). */ +export function applyCompletion(text: string, item: RunConfigCompletion): { text: string; caret: number } { + const start = Math.min(item.replaceStart, text.length); + const end = Math.max(start, Math.min(item.replaceEnd, text.length)); + return { text: text.slice(0, start) + item.insert + text.slice(end), caret: start + item.insert.length }; +} + +/** The plugin's completions for the Arguments field; none when it has none or fails. */ +export async function completeArguments(configId: string, text: string, caret: number): Promise { + try { + return await call(commands.pluginRunConfigurationComplete(configId, "arguments", text, caret)); + } catch { + // The field stays usable when the provider fails or the configuration is gone. + return []; + } +} diff --git a/src/platform/locales/text/zh.json b/src/platform/locales/text/zh.json index 3d048b771e..e8798cc0b4 100644 --- a/src/platform/locales/text/zh.json +++ b/src/platform/locales/text/zh.json @@ -1206,6 +1206,7 @@ "Apply Patch…": "应用补丁…", "Apply Stash": "应用储藏", "Arguments": "实参", + "Argument completions": "参数补全", "Arrow function": "箭头函数", "As new branch:": "作为新分支:", "As typed": "按输入", diff --git a/wit/exports.wit b/wit/exports.wit index 4da67be642..cbf4272e27 100644 --- a/wit/exports.wit +++ b/wit/exports.wit @@ -98,6 +98,33 @@ interface run-anything-provider { run: func(project: string, prefix: string, line: string) -> bool; } +/// Optional completion in the fields of this plugin's own run configurations, in +/// the Run/Debug Configurations dialog (API 1.18). +interface run-configuration-completion { + record completion-item { + /// What the list shows, such as `build`. + label: string, + /// Grey text after the label, such as the file the entry comes from. + detail: option, + /// The text that replaces `[replace-start, replace-end)` (default: `label`). + insert: option, + /// UTF-16 offsets into `text`; the caret ends after the inserted text. + replace-start: u32, + replace-end: u32, + } + /// Completions for `field` of the configuration `config` (its id as this plugin + /// reported it) in `project`. `field` is `arguments` today: the field splits like a + /// shell command line (whitespace separates arguments, `'` and `"` quote). Later + /// IDEs may ask for other fields, so answer none for a field you don't know. + /// `text` is the field as typed and `caret` a UTF-16 offset into it. Replace only + /// the token being completed, so the other options, quoted values and arguments + /// after `--` stay as they are. Answer from what the plugin already knows (no + /// process per keystroke): the IDE asks while the user types, keeps the first 200 + /// items, drops an item whose range is outside `text`, and drops an answer that + /// comes after the text changed or takes longer than 300 ms. + complete: func(project: string, config: string, field: string, text: string, caret: u32) -> list; +} + /// Optional pre-launch gate for targets owned by this plugin (API 1.5). interface run-target-validation { enum operation { run, test } diff --git a/wit/plugin.wit b/wit/plugin.wit index 6686e5c17e..8cc725b88d 100644 --- a/wit/plugin.wit +++ b/wit/plugin.wit @@ -222,6 +222,11 @@ world plugin-run-anything { include plugin; export run-anything-provider; } /// Export-only Run Anything provider, composed with the base plugin world. world run-anything-exports { export run-anything-provider; } +/// A plugin completing fields of its own run configurations (API 1.18). +world plugin-run-configuration-completion { include plugin; export run-configuration-completion; } +/// Export-only run configuration completion, composed with the base plugin world. +world run-configuration-completion-exports { export run-configuration-completion; } + /// A plugin with custom Search Everywhere categories. world plugin-search { include plugin; export search-provider; } /// Optional export composed with the base plugin by the SDK.