diff --git a/crates/ide-host/src/plugins/api.rs b/crates/ide-host/src/plugins/api.rs index 374f703f60..52a01a634c 100644 --- a/crates/ide-host/src/plugins/api.rs +++ b/crates/ide-host/src/plugins/api.rs @@ -129,6 +129,15 @@ pub trait PluginWorkspace: Send + Sync { fn build_graph(&self, _root: &Path) -> Result { Ok(super::BuildGraph::default()) } + /// Installed interpreters / JDKs / toolchains relevant to `root` (API 1.21). + fn sdks(&self, _root: &Path, kind: Option<&str>) -> Result, HostError> { + super::build_graph::parse_sdk_kind_list(kind)?; + Ok(Vec::new()) + } + /// Project Structure › Artifacts definitions of the project at `root` (API 1.21). + fn artifacts(&self, _root: &Path) -> Result, HostError> { + Ok(Vec::new()) + } /// Current index of the project rooted at `root`; never reads disk or calls LSP. fn symbols( &self, @@ -2949,6 +2958,24 @@ impl HostApi for PluginApi { super::build_graph::dependency_nodes(&workspace.build_graph(root)?, module) } + fn build_sdks(&self, root: &Path, kind: Option<&str>) -> Result, HostError> { + self.require_api("`build.sdks`", 21)?; + let workspace = self.shared.workspace().ok_or_else(|| HostError::NotFound("no project is open".into()))?; + if !workspace.trusted(root) { + return Err(HostError::Denied("project is not trusted".into())); + } + workspace.sdks(root, kind) + } + + fn build_artifacts(&self, root: &Path) -> Result, HostError> { + self.require_api("`build.artifacts`", 21)?; + let workspace = self.shared.workspace().ok_or_else(|| HostError::NotFound("no project is open".into()))?; + if !workspace.trusted(root) { + return Err(HostError::Denied("project is not trusted".into())); + } + workspace.artifacts(root) + } + fn find_files(&self, root: &Path, glob: &str, limit: usize) -> Result, HostError> { let matcher = globset::GlobBuilder::new(glob) .literal_separator(true) @@ -4234,6 +4261,22 @@ impl PluginWorkspace for HostWorkspace { crate::ops::build::analyzed_dependencies(&project, &host.config_dir, root).map_err(failed) } + fn sdks(&self, root: &Path, kind: Option<&str>) -> Result, HostError> { + let host = self.0.upgrade().ok_or(HostError::Cancelled)?; + let project = HostWorkspace::project_covering(self, root) + .ok_or_else(|| HostError::NotFound("the project is no longer open".into()))?; + let settings = project.settings.effective(); + super::build_graph::discover_sdks(&host, &project.root, &settings, kind) + } + + fn artifacts(&self, root: &Path) -> Result, HostError> { + let project = HostWorkspace::project_covering(self, root) + .ok_or_else(|| HostError::NotFound("the project is no longer open".into()))?; + let settings = project.settings.effective(); + let model = crate::ops::build::load(&project.root, &project.build_cache_dir(), &settings); + Ok(super::build_graph::discover_artifacts(&project.root, &model, &settings)) + } + fn trusted(&self, root: &Path) -> bool { // A workspace member is as trusted as the group's project it was opened with. HostWorkspace::project_covering(self, root).is_some_and(|p| p.is_trusted()) @@ -5897,4 +5940,29 @@ mod workbench_tests { api.vcs_diff(&root, None, None, &cancel).unwrap(); assert!(!marker.exists()); } + + #[test] + fn build_sdks_and_artifacts_gate_api_version_and_trust() { + let dir = tempfile::tempdir().unwrap(); + let root = dunce::canonicalize(dir.path()).unwrap(); + + // Older plugin (`^1.4`) cannot call API 1.21 build.sdks / build.artifacts. + let old = api(&root, true, None); + assert!(matches!(old.build_sdks(&root, None), Err(HostError::Invalid(_)))); + assert!(matches!(old.build_artifacts(&root), Err(HostError::Invalid(_)))); + + let manifest21 = ide_extension::Manifest::parse( + "id = \"test\"\nname = \"Test\"\nversion = \"1.0.0\"\nengines.openidea = \"^1.21\"\n", + ) + .unwrap(); + let new = PluginApi { pkg: Package::new(manifest21.clone(), root.clone()), shared: old.shared.clone() }; + assert!(new.build_sdks(&root, Some("jdk")).unwrap().is_empty()); + assert!(matches!(new.build_sdks(&root, Some("cobol")), Err(HostError::Invalid(_)))); + assert!(new.build_artifacts(&root).unwrap().is_empty()); + + let untrusted = api(&root, false, None); + let new_untrusted = PluginApi { pkg: Package::new(manifest21, root.clone()), shared: untrusted.shared.clone() }; + assert!(matches!(new_untrusted.build_sdks(&root, None), Err(HostError::Denied(_)))); + assert!(matches!(new_untrusted.build_artifacts(&root), Err(HostError::Denied(_)))); + } } diff --git a/crates/ide-host/src/plugins/build_graph.rs b/crates/ide-host/src/plugins/build_graph.rs index f79f11e4e6..a2f6ab69f0 100644 --- a/crates/ide-host/src/plugins/build_graph.rs +++ b/crates/ide-host/src/plugins/build_graph.rs @@ -1,8 +1,12 @@ //! `build.dependencies`: the Dependency Analyzer's Maven / Gradle trees as the flat //! list the plugin API passes (records can't nest), each module a root. -use ide_build::{GradleDependency, GradleReport, MavenDependency, MavenProject, Omission}; -use ide_plugin::{DependencyNode, DependencyStatus, HostError}; +use ide_build::{BuildModel, GradleDependency, GradleReport, MavenDependency, MavenProject, Omission}; +use ide_core::ipc_path::to_ipc; +use ide_core::settings::{ArtifactKind as SettingsArtifactKind, Settings}; +use ide_plugin::{ArtifactInfo, ArtifactKind, ArtifactOrigin, DependencyNode, DependencyStatus, HostError, SdkInfo}; +use ide_sdk::SdkKind; +use std::path::{Path, PathBuf}; /// Most nodes one call returns. const MAX_NODES: usize = 100_000; @@ -62,6 +66,135 @@ pub fn dependency_nodes(graph: &BuildGraph, module: Option<&str>) -> Result) -> Result, HostError> { + match kind { + None => Ok(ALL_SDK_KINDS.to_vec()), + Some(raw) => ALL_SDK_KINDS + .iter() + .copied() + .find(|(name, _)| *name == raw) + .map(|pair| vec![pair]) + .ok_or_else(|| HostError::Invalid(format!("unknown SDK kind `{raw}`"))), + } +} + +fn normalized_path(p: &Path) -> PathBuf { + std::fs::canonicalize(p).unwrap_or_else(|_| p.to_path_buf()) +} + +fn active_sdk_path(root: &Path, settings: &Settings, kind: SdkKind) -> Option { + match kind { + SdkKind::Jdk => ide_sdk::apply::project_jdk(root, settings).map(|j| j.home), + SdkKind::Maven => ide_sdk::apply::setting_path(root, &settings.languages.java.maven.home), + SdkKind::Python => ide_sdk::apply::python_interpreter(root, settings), + SdkKind::Node => ide_sdk::apply::setting_path(root, &settings.languages.node.interpreter), + SdkKind::Php => ide_sdk::apply::setting_path(root, &settings.languages.php.interpreter), + SdkKind::PackageManager => ide_sdk::apply::setting_path(root, &settings.languages.node.package_manager), + SdkKind::Rust => ide_sdk::apply::setting_path(root, &settings.languages.rust.toolchain), + SdkKind::Go => ide_sdk::apply::setting_path(root, &settings.languages.go.goroot), + SdkKind::TypeScript => ide_sdk::apply::tsdk(root, settings), + SdkKind::Ruby => ide_sdk::apply::ruby_interpreter(root, settings), + SdkKind::Zig => ide_sdk::apply::setting_path(root, &settings.languages.zig.zig), + SdkKind::Dotnet => None, + SdkKind::Flutter => ide_sdk::apply::setting_path(root, &settings.languages.flutter.sdk), + SdkKind::Xcode => ide_sdk::apply::setting_path(root, &settings.languages.swift.xcode), + } + .map(|p| normalized_path(&p)) +} + +/// Discovers installed SDKs / toolchains relevant to the project at `root`, +/// marking the active configured selection per kind. +pub fn discover_sdks( + host: &crate::Host, + root: &Path, + settings: &Settings, + kind: Option<&str>, +) -> Result, HostError> { + let kinds = parse_sdk_kind_list(kind)?; + if kinds.iter().any(|(_, k)| *k == SdkKind::Jdk) { + host.apply_added_jdks(); + } + let mut out = Vec::new(); + for (kind_name, sdk_kind) in kinds { + let active = active_sdk_path(root, settings, sdk_kind); + let mut sdks = ide_sdk::detect(sdk_kind, Some(root)); + if sdk_kind == SdkKind::Python + && let Some(py_path) = ide_sdk::apply::python_interpreter(root, settings) + && !sdks.iter().any(|s| normalized_path(&s.path) == normalized_path(&py_path)) + && let Some(sdk) = ide_sdk::python_interpreter_sdk(&py_path, Some(root)) + { + sdks.push(sdk); + } + for sdk in sdks { + let is_active = active.as_ref().is_some_and(|act| { + normalized_path(&sdk.path) == *act || sdk.home.as_deref().is_some_and(|h| normalized_path(h) == *act) + }); + out.push(SdkInfo { + kind: kind_name.to_owned(), + name: sdk.name, + path: to_ipc(&sdk.path), + version: sdk.version, + source: sdk.source, + home: sdk.home.as_deref().map(to_ipc), + active: is_active, + }); + } + } + Ok(out) +} + +/// Returns deployable WAR modules discovered from the project's build model +/// followed by user-configured `projectStructure.artifacts`. +pub fn discover_artifacts(root: &Path, model: &BuildModel, settings: &Settings) -> Vec { + let mut out: Vec = ide_build::web::artifacts(root, model) + .into_iter() + .map(|a| ArtifactInfo { + id: a.id, + origin: ArtifactOrigin::BuildModel, + tool: a.tool, + name: a.name, + kind: ArtifactKind::War, + module: a.module, + output_directory: String::new(), + main_class: String::new(), + include_libraries: Vec::new(), + }) + .collect(); + out.extend(settings.project_structure.artifacts.iter().map(|a| ArtifactInfo { + id: format!("project:{}", a.name), + origin: ArtifactOrigin::ProjectStructure, + tool: "project".into(), + name: a.name.clone(), + kind: match a.kind { + SettingsArtifactKind::Jar => ArtifactKind::Jar, + SettingsArtifactKind::War => ArtifactKind::War, + SettingsArtifactKind::WarExploded => ArtifactKind::WarExploded, + }, + module: a.module.clone(), + output_directory: a.output_directory.clone(), + main_class: a.main_class.clone(), + include_libraries: a.include_libraries.clone(), + })); + out +} + struct Nodes(Vec); impl Nodes { @@ -334,4 +467,90 @@ mod tests { assert!(!exact_version(v), "{v}"); } } + + #[test] + fn sdk_kinds_and_artifacts() { + assert_eq!(parse_sdk_kind_list(None).unwrap().len(), 14); + assert_eq!(parse_sdk_kind_list(Some("jdk")).unwrap(), vec![("jdk", SdkKind::Jdk)]); + assert!(matches!(parse_sdk_kind_list(Some("unknown")), Err(HostError::Invalid(_)))); + + let mut maven = ide_build::MavenModel::default(); + maven.projects = vec![ + MavenProject { + pom: "app/pom.xml".into(), + dir: "app".into(), + artifact_id: "demo-app".into(), + packaging: "war".into(), + ..Default::default() + }, + MavenProject { + pom: "core/pom.xml".into(), + dir: "core".into(), + artifact_id: "core".into(), + packaging: "jar".into(), + ..Default::default() + }, + ]; + let model = BuildModel { + maven: Some(maven), + gradle: vec![ide_build::GradleModel { + projects: vec![ide_build::GradleProject { + path: ":web".into(), + name: "web".into(), + dir: "web".into(), + tasks: vec![ide_build::GradleTask { name: "war".into(), group: "build".into(), description: None }], + ..Default::default() + }], + ..Default::default() + }], + sbt: Vec::new(), + }; + let mut settings = Settings::default(); + settings.project_structure.artifacts.push(ide_core::settings::ArtifactConfig { + name: "app:war exploded".into(), + kind: SettingsArtifactKind::WarExploded, + module: "web".into(), + output_directory: "web/target/app".into(), + main_class: String::new(), + include_libraries: vec!["spring".into()], + }); + assert_eq!( + discover_artifacts(Path::new("/project"), &model, &settings), + vec![ + ArtifactInfo { + id: "maven:app/pom.xml".into(), + origin: ArtifactOrigin::BuildModel, + tool: "maven".into(), + name: "demo-app".into(), + kind: ArtifactKind::War, + module: "app".into(), + output_directory: String::new(), + main_class: String::new(), + include_libraries: Vec::new(), + }, + ArtifactInfo { + id: "gradle::web".into(), + origin: ArtifactOrigin::BuildModel, + tool: "gradle".into(), + name: "web".into(), + kind: ArtifactKind::War, + module: "web".into(), + output_directory: String::new(), + main_class: String::new(), + include_libraries: Vec::new(), + }, + ArtifactInfo { + id: "project:app:war exploded".into(), + origin: ArtifactOrigin::ProjectStructure, + tool: "project".into(), + name: "app:war exploded".into(), + kind: ArtifactKind::WarExploded, + module: "web".into(), + output_directory: "web/target/app".into(), + main_class: String::new(), + include_libraries: vec!["spring".into()], + }, + ] + ); + } } diff --git a/crates/ide-plugin/src/runtime.rs b/crates/ide-plugin/src/runtime.rs index 85fa84e105..59870ea852 100644 --- a/crates/ide-plugin/src/runtime.rs +++ b/crates/ide-plugin/src/runtime.rs @@ -135,6 +135,10 @@ pub trait HostApi: Send + Sync { /// (of the module `module` only, when given), as the IDE last resolved it; never runs /// a build tool. fn build_dependencies(&self, root: &Path, module: Option<&str>) -> Result, HostError>; + /// Installed SDKs / toolchains relevant to `root`, optionally narrowed by `kind` (API 1.21). + fn build_sdks(&self, root: &Path, kind: Option<&str>) -> Result, HostError>; + /// Project Structure › Artifacts definitions of `root` (API 1.21). + fn build_artifacts(&self, root: &Path) -> Result, HostError>; /// Stdio argv only; no URL or bearer token. fn mcp_stdio_command(&self, client: &str) -> Option>; /// What other plugins contributed to `point`, as (plugin id, JSON). Only the diff --git a/crates/ide-plugin/src/types.rs b/crates/ide-plugin/src/types.rs index 26a7dd008f..7f68932dd2 100644 --- a/crates/ide-plugin/src/types.rs +++ b/crates/ide-plugin/src/types.rs @@ -1178,6 +1178,47 @@ pub struct DependencyNode { pub parent: Option, } +/// One installed interpreter, JDK, or toolchain returned by `build.sdks` (API 1.21). +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct SdkInfo { + pub kind: String, + pub name: String, + pub path: String, + pub version: Option, + pub source: String, + pub home: Option, + pub active: bool, +} + +/// Origin of an artifact returned by `build.artifacts` (API 1.21). +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum ArtifactOrigin { + BuildModel, + ProjectStructure, +} + +/// Packaging kind of an artifact (API 1.21). +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum ArtifactKind { + Jar, + War, + WarExploded, +} + +/// One deployable WAR module or Project Structure › Artifacts definition returned by `build.artifacts` (API 1.21). +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct ArtifactInfo { + pub id: String, + pub origin: ArtifactOrigin, + pub tool: String, + pub name: String, + pub kind: ArtifactKind, + pub module: String, + pub output_directory: String, + pub main_class: String, + pub include_libraries: Vec, +} + /// Non-secret settings of a plugin-owned project database source (API 1.4). #[derive(Clone, Debug, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)] #[serde(rename_all = "camelCase")] diff --git a/crates/ide-plugin/src/wit_host.rs b/crates/ide-plugin/src/wit_host.rs index 4a9727da64..00c9e9c5c0 100644 --- a/crates/ide-plugin/src/wit_host.rs +++ b/crates/ide-plugin/src/wit_host.rs @@ -1566,6 +1566,64 @@ impl build::Host for StoreData { }) .map_err(to_wit)) } + + fn sdks(&mut self, project: Resource, kind: Option) -> Fallible> { + if let Err(e) = self.require(Capability::BuildRead) { + return Ok(Err(e)); + } + let root = self.table.get(&project)?.root.clone(); + Ok(self + .host + .build_sdks(&root, kind.as_deref()) + .map(|sdks| { + sdks.into_iter() + .map(|s| build::SdkInfo { + kind: s.kind, + name: s.name, + path: s.path, + version: s.version, + source: s.source, + home: s.home, + active: s.active, + }) + .collect() + }) + .map_err(to_wit)) + } + + fn artifacts(&mut self, project: Resource) -> Fallible> { + if let Err(e) = self.require(Capability::BuildRead) { + return Ok(Err(e)); + } + let root = self.table.get(&project)?.root.clone(); + Ok(self + .host + .build_artifacts(&root) + .map(|artifacts| { + artifacts + .into_iter() + .map(|a| build::ArtifactInfo { + id: a.id, + origin: match a.origin { + crate::ArtifactOrigin::BuildModel => build::ArtifactOrigin::BuildModel, + crate::ArtifactOrigin::ProjectStructure => build::ArtifactOrigin::ProjectStructure, + }, + tool: a.tool, + name: a.name, + kind: match a.kind { + crate::ArtifactKind::Jar => build::ArtifactKind::Jar, + crate::ArtifactKind::War => build::ArtifactKind::War, + crate::ArtifactKind::WarExploded => build::ArtifactKind::WarExploded, + }, + module: a.module, + output_directory: a.output_directory, + main_class: a.main_class, + include_libraries: a.include_libraries, + }) + .collect() + }) + .map_err(to_wit)) + } } impl commit::Host for StoreData { diff --git a/crates/ide-plugin/tests/fixtures/api14/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/api14/dist/plugin.wasm index 7431b10265..545151e9e9 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 2860352c4b..04bd55e907 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 @@ -5e1b98e6beb51fdacc358ac9a16eece3d696bc5f3cb17f8278b060c8d186d425 +391e0b78cbb610ca32b7b74b6b2026376557554ee3d9e607579173157d6505c0 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 b2a3eb6c28..61e2bb2c6b 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 ce4d4609c2..b40d885d6b 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 @@ -27cd36ae025d3b93a179c9957f770a5a00746239e34964fd95cacd9fa12796e0 +28ae86e361923f5603829368d4e51f9c11323e9871b348191b046b171a455837 diff --git a/crates/ide-plugin/tests/fixtures/clipboard/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/clipboard/dist/plugin.wasm index 84ee066133..3203c2391d 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 ba589229be..8c8562e5aa 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 @@ -ba8adc3daa979ef7d7cae161537ebc9726ee640d5a0c4fb3201a472c6804e00d +885e682ee7bdab8c44257cefb0266c31582fbd76a1a00c867697379b57ebf431 diff --git a/crates/ide-plugin/tests/fixtures/commit/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/commit/dist/plugin.wasm index 849461dcb0..0947edeef7 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 f1e6f11bf7..5605d1b216 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 @@ -cdca6f0307b4c29829979ccfaafdcd818e5230e3435bc46a43a05790975f4c06 +25de09055141345b3de8939a43dad4f79d57304b140367097a1016ed076ca4fc 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 039b7aeb7c..3aed40e0a8 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 138831582c..d03ddef07e 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 @@ -01f27475af238667dce111d6a21d88456eaff48652326b9eb3094d9c7e0a1504 +c84299a4bdeade40350fffb6020bfb5378f824d96651045c82ddcc121f6a9547 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 89b62db6a7..2eac77463f 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 fc0b03b57e..088bedfbbd 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 @@ -67b3228c72a6c1170ba62b188cef4053f2a45b3bd4cfced1ad6f59b00e278c5a +65ea37261173e1100f6a5a650e95c0c07ddce0f81cba737d277c385196c5674b diff --git a/crates/ide-plugin/tests/fixtures/decorations/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/decorations/dist/plugin.wasm index adaf33997d..8856784059 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 33bc62e07f..7c3f2cec2f 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 @@ -cccf85d92a5feb9b4f116166ac889c25cc3969678473e8d832cff0eeb9620402 +44e139c052f87ec409eb7ac36240a22272d9f2b0bd41a37ff6c01e726457e424 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 908a0a802b..cf27484bf6 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 b7f60fe77f..9ff9a214d3 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 @@ -40a6302b80c7dfbcf8f8e5906184de0765d91e47dd4f3410e81ad0f087591534 +c59d0f0d1fb4abc052a2e978201a8b149ace29699d38d1924720b77e9ee41d92 diff --git a/crates/ide-plugin/tests/fixtures/diagnostics/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/diagnostics/dist/plugin.wasm index 854b39ad07..16433493a9 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 03d87fafd4..76eb7c72b3 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 @@ -2b161461eb58c94a54bd21de9718a716475a61d5a91d4f960fe501d769343033 +47fe447ccb9f76d69cffe69713a2177fceca1b69eb039f13bb912b80578e6126 diff --git a/crates/ide-plugin/tests/fixtures/endpoints/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/endpoints/dist/plugin.wasm index a777b85aca..910bf4d8cb 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 e0ede4e4a2..4e7f8f58ae 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 @@ -ce643e66bd66b48c889a1676f56b964a0682493e2087c83fead51fb2c3a2265b +925e17f44beeb4ba34b1e60466299101b3e8dbd025f7e011ec335839b5e1077c 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 112bd47021..032137b64e 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 16afe0b65b..3695ce94ed 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 @@ -4b63b56f0d43b03bf3f762818585baa566e2164acb0112d26e4576adc5a88ee3 +2602908184d78bcad536606ce9af2bcc893067f2fce8f78273beef523a470b73 diff --git a/crates/ide-plugin/tests/fixtures/execution/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/execution/dist/plugin.wasm index 0fb94a81ed..65a4025595 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 cecfc63196..bcd00f3021 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 @@ -85290a12beeaa7114a278c25cc9e888ad4098cabf17b8749e068e6ae5fa2bfc6 +36de99a64635a3536433b328c787578593435f82c5f8e714b185ea2af6d08f60 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 940622b5ed..5ea60c6666 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 3ad3fb1009..606160735a 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 @@ -d057138fa90fdca49af5658515a8feb674ddaca0f31330d54ae6d9b3bd15b414 +51f6a7efff3b6d48e2ee37aa830f3ff79fa12adbfbe39407d56edb1149e8c55a 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 59627b28e5..f566202abe 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 4cd4a7cfdc..2f8b56cd0d 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 @@ -7751a98efbfca99c6be8fa1f75863be07196aeab0ca362e2a5c5c93738530dd2 +0d75629cdc43f130ba3628b068caf36dacac07e26ef55c89b999e8bafc13ebc0 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 0df48b33c6..a574d22569 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 5de1ce413d..299b4917f8 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 @@ -a57186830e59d8c3a17867f9d1c1f583d5de7aeb787ea06a88be7544b2d62ce5 +0972b15707c35be7e27846e6d219cd4d02c0ae3fef91d414f521a2f4f6ca96ff 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 32933f3ec2..e003da6e24 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 2d7e15ec4f..f5320b9036 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 @@ -a6872f8d50dcb5e5915ead3fcd37ca5fa3aa6f4c1fed76feba0997e2e73b70ab +23fc8f3a0c7920d91e0cf90ec4a58e82ff6deb92159e197a971fd47a280810a6 diff --git a/crates/ide-plugin/tests/fixtures/hello/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/hello/dist/plugin.wasm index 64553e546b..33791122be 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 2fb7f54dad..b3d04eae43 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 @@ -b23f34bc00919244a4a6a3bdb5438f50c94704143c9fcc8e7462e2b7d3a92db3 +491b3794111b43a0c6408fb3399d1a9ac080df213d962ef04adebee411e9def1 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 bbc64862ab..06714da76d 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 7f3d362a96..85fdc503b8 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 @@ -7c9a41e4f23fa994c288bd99357bb6f5ef0388c45458c86c973c1b341b90b4a0 +b887aa0ed1908edf6dc684d4d84a15209f14c7dfb1c7fdf6d2c3e7f61ff2d720 diff --git a/crates/ide-plugin/tests/fixtures/hover/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/hover/dist/plugin.wasm index 6226b4f032..1744e81b93 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 6fe54db751..de9192d5d4 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 @@ -b8342aeaea7dd0ab19cce6dff845b5771a5cb880f081f612f80372e3e2c0467c +e31e18cb72f04e852f246b71f7b789ade9dad8148de8cc5b9aa449c1a101a743 diff --git a/crates/ide-plugin/tests/fixtures/indexer/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/indexer/dist/plugin.wasm index b0712a6e63..0e7882b3e6 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 2bf3d7fb15..fe346b993f 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 @@ -a3ff38ef3f229564c96fe4857bb872c5afb2e75c36eaf349aa85308bdb9a65f8 +9929514bef85155c849854d97fc6a9a45c0ad51b9d3fdcaae631a6359d9d42f9 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 5112569a51..3f1768856b 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 9cc0758805..c53d7a3688 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 @@ -166391164173750184924f130ec2b70adc8ea9a957169076104b652178223d3b +3e481672018f10fd4a34fb78e5e88f387f6e9725f16a7947a177ae26bab4473f diff --git a/crates/ide-plugin/tests/fixtures/jobs/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/jobs/dist/plugin.wasm index e7773a7eac..018777cc12 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 c86d9bc220..cd5716a843 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 @@ -cb276ac498e1d75b87f77e6f9e9ea1fc640f97ff176463f2c6d9fbabafbe22fc +cb23d0a4d417f447df9f25966e3da6b3adf2d029bbd727bde84a1faae7678814 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 e4df3bf63e..348993da59 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 a25dd187f8..385e7f1611 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 @@ -4505efe4856656ae46462d51e10b089afed337edd58d375c7e78645ca440d356 +8933abce0c2a1cb10294d27556ebea6bfe135253fc0843c84c93e60842087103 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 5a0a9bb1a3..c6a5337f5b 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 017ee39ba1..819ea6ce6f 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 @@ -ad33d221f82ded6638f11f99916987df52159f34ff7fbfc0e42962e98c19fe7b +16e0ff152c05bb80798289c9e7177c1a4330f929f4547b61bbe0672010eff021 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 05d929edc6..531efd6a60 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 @@ -07cd3eca9e69a715b8dfc673d1afc7b349d55308a9f2a74420473a61724ecb11 +f6a63dec9001b61ba344dcdacb3b4b691b8d1573bf2238b5717d7fc8426c1631 diff --git a/crates/ide-plugin/tests/fixtures/net-setting/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/net-setting/dist/plugin.wasm index 3d6344edab..fd50bde77d 100644 Binary files a/crates/ide-plugin/tests/fixtures/net-setting/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/net-setting/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/net-setting/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/net-setting/dist/plugin.wasm.sources index 205661de39..4f22ad09b0 100644 --- a/crates/ide-plugin/tests/fixtures/net-setting/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/net-setting/dist/plugin.wasm.sources @@ -1 +1 @@ -381947871c93014b874637df7d9e4c43ffc7cda1fa6f07529537ef668c5dcef2 +629c57f6b44d3f68fef666b308c8514ba4a30706c8db8455264e6f968646bc98 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 3cbbe25446..9ead2471c7 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 f90fa934e7..59d779461a 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 @@ -b8f44941ea1f94f46061bf5f56a68a61e588fd329d70be34b42fd1aa9e980726 +4703155f9e9a2b4223e6051e0fa42a2c80eeb5fc5fbf65e2f6d8afc725b50a7a 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 16b5248442..a01a12e452 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 00490ba16b..b35a921711 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 @@ -f70e1408d3013bb59317374e11a11a867b34517e2eedda800bc12548e8623655 +8af5461eac6516304f489e206ff0025254e97a6609e56c99683678c82eb0c1d8 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 8f088561ce..65601ae51b 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 f11330cfc0..a76e007afc 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 @@ -9ac7b763f03e03f472ff08f683a98d76caa1fbd3b49d449873ca207269ee659d +e1a56f411e1d0832b29ba0222ea75b12f46d7707fff37657761fe07202165788 diff --git a/crates/ide-plugin/tests/fixtures/search/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/search/dist/plugin.wasm index 3f63cb0a82..8793663890 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 bb1eb6756b..7613cb186d 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 @@ -e7588bb30941795431305e5f678348a2d2349c7bf66e19e8df1c169855f4329f +57ab2fdf586569182cd20ccb4545e98ad6397245548df8179eac9c8be5f8b671 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 841e023e80..2303ff3b8e 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 90bc16ee98..112f6c7abe 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 @@ -a832705b29530f10d25167d25280f0555d63ad130daa63aa46d3f64109354273 +30c1eb52773e246d5cd8962496a94d2b8ac0d82d4270d5ea344d70e845cf199c 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 4abd42f79e..73c2e5de1a 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 0bd6dfa743..f78ff7993a 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 @@ -f0af669dae3115839b8ff04e1c54ab008691341e1394b5221f4554cb0c416b6f +a027b038cb64534a912b193b01385aac5ba211c0b12b9be5159c6c03e729a571 diff --git a/crates/ide-plugin/tests/fixtures/storage/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/storage/dist/plugin.wasm index 053100777b..e09179f119 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 f2eb3fdb7b..8a649fba98 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 @@ -225f929842a16a34268788f1287ee725c0fa777ba45a9af910b757bfb32092b0 +650b3808c5b1b5754c7234956f86bf019f5e90aa0e24dfd7892a8bb75cd2b7f5 diff --git a/crates/ide-plugin/tests/fixtures/symbols/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/symbols/dist/plugin.wasm index 57fce26305..25f424d9e5 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 687f45517f..4a3524c576 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 @@ -acfc88e278837cde7175b443c3f37a51317831ce12415763dc38c75fafcff577 +3b48734ff47c29a1b2fb2e9874af51bc0def268e4dd806acbd1058293fd0a273 diff --git a/crates/ide-plugin/tests/fixtures/syntax-decorations/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/syntax-decorations/dist/plugin.wasm index f81b272e89..91ac300231 100644 Binary files a/crates/ide-plugin/tests/fixtures/syntax-decorations/dist/plugin.wasm and b/crates/ide-plugin/tests/fixtures/syntax-decorations/dist/plugin.wasm differ diff --git a/crates/ide-plugin/tests/fixtures/syntax-decorations/dist/plugin.wasm.sources b/crates/ide-plugin/tests/fixtures/syntax-decorations/dist/plugin.wasm.sources index 256a2f73e1..2118ffbec4 100644 --- a/crates/ide-plugin/tests/fixtures/syntax-decorations/dist/plugin.wasm.sources +++ b/crates/ide-plugin/tests/fixtures/syntax-decorations/dist/plugin.wasm.sources @@ -1 +1 @@ -67f398a57d565be17f521e3f4100a99606555e57cc008e0f8e4ee6b7b96fce7f +94d998d39ee416368f54d5cb80fc36748cc4f6ddd7e87665298bd909d6163d0f diff --git a/crates/ide-plugin/tests/fixtures/tables/dist/plugin.wasm b/crates/ide-plugin/tests/fixtures/tables/dist/plugin.wasm index a7cdd7f55e..8f6c225c43 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 bc0c60f906..ce9a1b7d80 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 @@ -46f8d086f1e384c7984db3ce3a2df58595b4ab513b6ae62181c64a5f075f40a4 +60a68dc591eb93835230294126ae7ff2ab4af64841d2d4edac2139c72bf9f183 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 bd121def98..663df58914 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 7393886ca5..46c971f30a 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 @@ -3cf9a0a6983597598d36dd7be7c4f618827738d8b0946e94d7a6983bd22e9c0c +31cff1565b566a95eb8900142c6f305f992b1a54cd51fb4bebcd11db90334cf9 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 70c954d3c5..6eaee6764c 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 832339ebdf..6a778e4228 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 @@ -7409ab4737467131056c631e81b8a5aa0f7698ae67935870572cba163770719b +e7daf6caa658dbdad3612de14afbe7734a05f8e2970b87f92b2d14cb2161c018 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 9d1c768d5b..9cf46f45d7 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 321fefbd4f..5bd77028ad 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 @@ -52cda09f68c3368b0b123435d5c9e52a8f74f1118c717a7664ba77504a64d781 +b9d10203717998684946e01d513915ba385d745c7ff6599d708189ffcc084bc9 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 83232b697e..d0611b967e 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 679fbdb006..d3c8eaae6e 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 @@ -529a1b6e1a3c06dadd09a143f36650cc697bfb26a0dd53ad958e1ebcafbbc1a5 +9e59e5374e230da448032a6cd528f8279c9d24d14d5e1f5ba3f0d95d9f26333d diff --git a/docs/en/plugins/capabilities.mdx b/docs/en/plugins/capabilities.mdx index 8fa3802e78..9fae2b80c6 100644 --- a/docs/en/plugins/capabilities.mdx +++ b/docs/en/plugins/capabilities.mdx @@ -49,34 +49,34 @@ Later: ## Capability reference -| Capability | Risk | Unlocks | API | -| ------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | -| `project.read` | Low | `Project::root`, `read_file`, `find_files`, `symbols`, `search_text`, `host::projects`, publishing diagnostics, `problems`, opening editors, decorations | 1.0 | -| `project.write` | High | `Project::write_file`: creates and replaces text files inside the open projects, never git's own files (`.git`) | 1.3 | -| `editor.read` | Low | `TextEditor::document`, `selections`, `host::open_editors` | 1.0 | -| `editor.write` | Medium | `TextEditor::apply_edits` | 1.0 | -| `vcs.read` | Low | `vcs_status`, `vcs_remotes`, `vcs_log`, `vcs_blame`, `vcs_diff`, the pending commit, before-commit checks | 1.0 | -| `vcs.write` | Medium | `vcs_fetch` (trusted projects only), `host::set_commit_message` | 1.0 | -| `build.read` | Low | `build_dependencies`: the Maven / Gradle dependency graph the IDE resolved; trusted projects only | 1.10 | -| `storage` | Low | `host::storage`, 64 MiB per plugin | 1.0 | -| `events` | Low | File opened, closed and saved, files changed, editor focused, repository changed, settings changed | 1.0 | -| `events.input` | Medium | `action-performed` and `input-mode-changed` events (keystrokes and editor input) | 1.0 | -| `clipboard` | Medium | `host::copy_to_clipboard` and the clipboard API in the plugin's web views | 1.0 | -| `clipboard.read` | Medium | `host::read_clipboard`: the clipboard's text and image, only in commands and view actions the user ran (event handlers and other unattended calls are denied) | 1.11 | -| `agents` | Medium | `host::fork_agent_session`: fork a recorded native agent session (`claude`, `codex`, or `copilot`) into a new task in the invoking window's project; trusted projects only | 1.18 | -| `secrets` | Medium | `{{secret:}}` in request headers, `secret_is_set`, `secret_set`, `secret_delete` | 1.0 | -| `net:` | Medium | `host::fetch` / `host::fetch_stream` over HTTPS (and loopback HTTP) to that host; `*.example.com` matches subdomains | 1.0 | -| `net:ask` | Medium | Ask the user at the first request to an HTTPS host that isn't declared | 1.5 | -| `net.http:` | Medium | Unencrypted HTTP to that host | 1.4 | -| `database.sources` | Medium | Manage only the plugin's own project database sources and write their credentials; trusted projects only | 1.4 | -| `database.schema` | Medium | Read table schema from connected project data sources, including user-created sources; trusted projects only. No credentials or row data. | 1.20 | -| `fs.read:` | High | `host::fs` reads outside the projects, under that path | 1.0 (the `fs` interface: 1.3) | -| `fs.write:` | High | `host::fs` writes outside the projects, under that path; does not imply reading | 1.3 | -| `process:` | High | Run that program: `run_process`, `run_command`, `start`, terminals, language servers, debug adapters, runs | 1.0 | -| `lsp:` | High | Send that running language server its own requests (`language_server_request`); trusted projects only | 1.9 | -| `java.agent` | High | Run the plugin's Java agent inside the Java applications you start (see [Java agents](#java-agents)) | 1.10 | -| `ipc:` | High | Local Unix sockets or Windows named pipes on the project machine | 1.4 | -| `ide.commands` | High | Run any IDE action or another plugin's command as if the user chose it, including running programs, committing and pushing. The plugin's own commands are exempt. | 1.4 | +| Capability | Risk | Unlocks | API | +| ------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | +| `project.read` | Low | `Project::root`, `read_file`, `find_files`, `symbols`, `search_text`, `host::projects`, publishing diagnostics, `problems`, opening editors, decorations | 1.0 | +| `project.write` | High | `Project::write_file`: creates and replaces text files inside the open projects, never git's own files (`.git`) | 1.3 | +| `editor.read` | Low | `TextEditor::document`, `selections`, `host::open_editors` | 1.0 | +| `editor.write` | Medium | `TextEditor::apply_edits` | 1.0 | +| `vcs.read` | Low | `vcs_status`, `vcs_remotes`, `vcs_log`, `vcs_blame`, `vcs_diff`, the pending commit, before-commit checks | 1.0 | +| `vcs.write` | Medium | `vcs_fetch` (trusted projects only), `host::set_commit_message` | 1.0 | +| `build.read` | Low | `build_dependencies`, `sdks` (API 1.21), `artifacts` (API 1.21): Maven / Gradle dependency graph, installed SDKs/toolchains, and deployable build-model WAR / Project Structure artifacts; trusted projects only | 1.10 | +| `storage` | Low | `host::storage`, 64 MiB per plugin | 1.0 | +| `events` | Low | File opened, closed and saved, files changed, editor focused, repository changed, settings changed | 1.0 | +| `events.input` | Medium | `action-performed` and `input-mode-changed` events (keystrokes and editor input) | 1.0 | +| `clipboard` | Medium | `host::copy_to_clipboard` and the clipboard API in the plugin's web views | 1.0 | +| `clipboard.read` | Medium | `host::read_clipboard`: the clipboard's text and image, only in commands and view actions the user ran (event handlers and other unattended calls are denied) | 1.11 | +| `agents` | Medium | `host::fork_agent_session`: fork a recorded native agent session (`claude`, `codex`, or `copilot`) into a new task in the invoking window's project; trusted projects only | 1.18 | +| `secrets` | Medium | `{{secret:}}` in request headers, `secret_is_set`, `secret_set`, `secret_delete` | 1.0 | +| `net:` | Medium | `host::fetch` / `host::fetch_stream` over HTTPS (and loopback HTTP) to that host; `*.example.com` matches subdomains | 1.0 | +| `net:ask` | Medium | Ask the user at the first request to an HTTPS host that isn't declared | 1.5 | +| `net.http:` | Medium | Unencrypted HTTP to that host | 1.4 | +| `database.sources` | Medium | Manage only the plugin's own project database sources and write their credentials; trusted projects only | 1.4 | +| `database.schema` | Medium | Read table schema from connected project data sources, including user-created sources; trusted projects only. No credentials or row data. | 1.20 | +| `fs.read:` | High | `host::fs` reads outside the projects, under that path | 1.0 (the `fs` interface: 1.3) | +| `fs.write:` | High | `host::fs` writes outside the projects, under that path; does not imply reading | 1.3 | +| `process:` | High | Run that program: `run_process`, `run_command`, `start`, terminals, language servers, debug adapters, runs | 1.0 | +| `lsp:` | High | Send that running language server its own requests (`language_server_request`); trusted projects only | 1.9 | +| `java.agent` | High | Run the plugin's Java agent inside the Java applications you start (see [Java agents](#java-agents)) | 1.10 | +| `ipc:` | High | Local Unix sockets or Windows named pipes on the project machine | 1.4 | +| `ide.commands` | High | Run any IDE action or another plugin's command as if the user chose it, including running programs, committing and pushing. The plugin's own commands are exempt. | 1.4 | The **API** column is the oldest plugin API the manifest may admit when it declares the capability. For example, a manifest with `net.http:` must require `engines.openidea = "^1.4"` or later; installing and `openidea-plugin check` refuse it otherwise. diff --git a/docs/en/plugins/versioning.mdx b/docs/en/plugins/versioning.mdx index cca90869bb..335ff1154c 100644 --- a/docs/en/plugins/versioning.mdx +++ b/docs/en/plugins/versioning.mdx @@ -35,7 +35,7 @@ The plugin API has one version number: the version of the WIT package in [`wit/` | 1.18.0 | OpenIDEA 0.1.54 | `[[contributes.overlays]]`: a package web page floating over the workbench that never takes the keyboard focus, placed and resized through `openidea.overlay`; `[[contributes.dialogs]]`: a package web page in a modal, resizable IDE dialog opened with `views.reveal`, with a `closed` view event and `openidea.dialog.close()`; `events.subscribe-paths-with-options` (`debounce-ms`), `workspace.project.generation` and `FilesChanged` project/generation fields, stale run target/configuration rejection, and the `project-closed` lifecycle event; `execution-configurations`, `run.start-with-options` and `runDetectors.outputMode`: `pipes` or `pty` console output for plugin run configurations; `[[contributes.runAnything]]` with the `run-anything-provider` export: Run Anything lines starting with the plugin's prefix; `views.open-terminal-session-in`: a keyed terminal in a project directory; `workspace.invoking-project`: the project of the window a call serves, also in `gutter-actions` and `hover-actions`; `events.watch-paths` and the `watched-files-changed` event: files and directories outside the project, within `fs.read` grants; the `run-configuration-completion` export: completion in the Arguments field of the plugin's own run configurations; `services.context` and `services.toolbar` menus on the IDE's own Services nodes, with the selected services as the command argument; `executor` on `[[contributes.javaAgents]]`: "Run/Debug '' with " beside Run and Debug, the only launches that get that agent, also startable from the plugin's own commands with a configuration id; grant-scoped `agents.fork-session`: fork a recorded native agent session (`claude`, `codex`, or `copilot`) into a new task in the invoking window's project (`agents` capability), with the host validating the session and building the fork invocation itself | | 1.19.0 | OpenIDEA 0.1.56 | `[capabilities.reasons]`: the plugin's own sentence on why it asks for a capability, shown below the host's description in the permission dialog and Settings › Plugins; `settings.open` / `settings.open-permissions`: open Settings at one of the plugin's own pages or at its permissions; `net.fetch-stream`: a response whose body is read as it arrives (server-sent events, streamed model replies), with the SDK's `host::fetch_stream` and `sse` parser; `editor.open-as-text`: open a file in the built-in text editor even when a custom editor claims it (the SDK's `host::open_editor_as_text`); the `openIn` menu: the **Open In** submenu of the editor, its tab and the Project view | | 1.20.0 | OpenIDEA 0.1.57 | Database table context menus and read-only table schema inspection (`database.schema`). Optional `syntax-decorations-provider` export: foreground marks on an open text editor, in the theme tokens `rainbow-1` … `rainbow-5` or its own `#rrggbb` colours for dark and light themes, and a bounded slice of the editor's syntax tree. | -| 1.21.0 | In development | Run lifecycle & Run Config extensions: `run-started` event, `run-exited` for user-launched plugin runs, `run.stop`, `"java"` in `attach-child`, `prepareCommand` `mode` (`"run"` / `"debug"`) and loopback `javaDebug` JDWP attach, `run.upsert-configuration`, `run.open-edit-configurations`, `ownsBeforeLaunch`, transient `logFiles` log-tail tabs (`project.read` / `fs.read`), and the `runConsole.toolbar` menu. Settings controls: `presentation` (`radio`, `segmented`, `slider`, `color`, `checkbox-list`), `enumOptions` labels, hints and icons for `enum` values, `minimum` / `maximum` / `step`, and `when` conditions that hide a setting. | +| 1.21.0 | In development | Run lifecycle & Run Config extensions: `run-started` event, `run-exited` for user-launched plugin runs, `run.stop`, `"java"` in `attach-child`, `prepareCommand` `mode` (`"run"` / `"debug"`) and loopback `javaDebug` JDWP attach, `run.upsert-configuration`, `run.open-edit-configurations`, `ownsBeforeLaunch`, transient `logFiles` log-tail tabs (`project.read` / `fs.read`), and the `runConsole.toolbar` menu. Settings controls: `presentation` (`radio`, `segmented`, `slider`, `color`, `checkbox-list`), `enumOptions` labels, hints and icons for `enum` values, `minimum` / `maximum` / `step`, and `when` conditions that hide a setting. `build.sdks` and `build.artifacts` under `build.read`: read installed JDKs/Maven/toolchains (`active` marking the project selection), build-model Maven/Gradle WAR artifacts, and Project Structure › Artifacts definitions (with `id`, `origin`, and `tool`) in trusted projects. | 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/capabilities.mdx b/docs/zh/plugins/capabilities.mdx index 048333ee09..a8b05e1a9b 100644 --- a/docs/zh/plugins/capabilities.mdx +++ b/docs/zh/plugins/capabilities.mdx @@ -49,34 +49,34 @@ optional = ["net:127.0.0.1", "clipboard.read"] ## 能力一览 -| 能力 | 风险 | 解锁 | API | -| ------------------- | ---- | --------------------------------------------------------------------------------------------------------------------------------- | -------------------------- | -| `project.read` | 低 | `Project::root`、`read_file`、`find_files`、`symbols`、`search_text`、`host::projects`、发布诊断、`problems`、打开编辑器、装饰 | 1.0 | -| `project.write` | 高 | `Project::write_file`:在打开的项目中创建和替换文本文件,但不能写 git 自己的文件(`.git`) | 1.3 | -| `editor.read` | 低 | `TextEditor::document`、`selections`、`host::open_editors` | 1.0 | -| `editor.write` | 中 | `TextEditor::apply_edits` | 1.0 | -| `vcs.read` | 低 | `vcs_status`、`vcs_remotes`、`vcs_log`、`vcs_blame`、`vcs_diff`、待提交的内容、提交前检查 | 1.0 | -| `vcs.write` | 中 | `vcs_fetch`(仅受信任项目)、`host::set_commit_message` | 1.0 | -| `build.read` | 低 | `build_dependencies`:IDE 已解析的 Maven / Gradle 依赖图;仅限受信任的项目 | 1.10 | -| `storage` | 低 | `host::storage`,每个插件 64 MiB | 1.0 | -| `events` | 低 | 文件打开、关闭、保存,文件变化,编辑器焦点变化,仓库变化,设置变化 | 1.0 | -| `events.input` | 中 | `action-performed` 和 `input-mode-changed` 事件(按键和编辑器输入) | 1.0 | -| `clipboard` | 中 | `host::copy_to_clipboard`,以及插件 Web 视图中的剪贴板 API | 1.0 | -| `clipboard.read` | 中 | `host::read_clipboard`:读取剪贴板的文本和图片,仅限用户运行的命令和视图操作(事件处理器等无人值守的调用会被拒绝) | 1.11 | -| `agents` | 中 | `host::fork_agent_session`:把录制的原生 agent 会话(`claude`、`codex` 或 `copilot`)派生为当前窗口项目中的新任务;仅限受信任项目 | 1.18 | -| `secrets` | 中 | 请求头中的 `{{secret:<name>}}`、`secret_is_set`、`secret_set`、`secret_delete` | 1.0 | -| `net:<host>` | 中 | `host::fetch` / `host::fetch_stream` 通过 HTTPS(以及回环地址的 HTTP)访问该主机;`*.example.com` 匹配子域名 | 1.0 | -| `net:ask` | 中 | 第一次请求未声明的 HTTPS 主机时询问用户 | 1.5 | -| `net.http:<host>` | 中 | 通过未加密的 HTTP 访问该主机 | 1.4 | -| `database.sources` | 中 | 只管理插件自己的项目数据源并写入其凭据;仅限受信任项目 | 1.4 | -| `database.schema` | 中 | 读取已连接的项目数据源(包括用户创建的数据源)的表结构;仅限受信任项目,不返回凭据或表数据。 | 1.20 | -| `fs.read:<path>` | 高 | 通过 `host::fs` 读取项目外、该路径下的文件 | 1.0(`fs` interface:1.3) | -| `fs.write:<path>` | 高 | 通过 `host::fs` 写入项目外、该路径下的文件;不包含读权限 | 1.3 | -| `process:<program>` | 高 | 运行该程序:`run_process`、`run_command`、`start`、终端、语言服务器、调试适配器、运行配置 | 1.0 | -| `lsp:<server>` | 高 | 向正在运行的该语言服务器发送它自己的请求(`language_server_request`);仅限受信任的项目 | 1.9 | -| `java.agent` | 高 | 在你启动的 Java 应用中运行插件的 Java 代理(见下文“Java 代理”) | 1.10 | -| `ipc:<path>` | 高 | 项目所在机器上的本地 Unix 套接字或 Windows 命名管道 | 1.4 | -| `ide.commands` | 高 | 像用户亲自选择一样运行任意 IDE 操作或其他插件的命令,包括运行程序、提交和推送。插件自己的命令不受此限制。 | 1.4 | +| 能力 | 风险 | 解锁 | API | +| ------------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------- | +| `project.read` | 低 | `Project::root`、`read_file`、`find_files`、`symbols`、`search_text`、`host::projects`、发布诊断、`problems`、打开编辑器、装饰 | 1.0 | +| `project.write` | 高 | `Project::write_file`:在打开的项目中创建和替换文本文件,但不能写 git 自己的文件(`.git`) | 1.3 | +| `editor.read` | 低 | `TextEditor::document`、`selections`、`host::open_editors` | 1.0 | +| `editor.write` | 中 | `TextEditor::apply_edits` | 1.0 | +| `vcs.read` | 低 | `vcs_status`、`vcs_remotes`、`vcs_log`、`vcs_blame`、`vcs_diff`、待提交的内容、提交前检查 | 1.0 | +| `vcs.write` | 中 | `vcs_fetch`(仅受信任项目)、`host::set_commit_message` | 1.0 | +| `build.read` | 低 | `build_dependencies`、`sdks`(1.21)、`artifacts`(1.21):Maven / Gradle 依赖图、已安装的 SDK/工具链与构建模型 WAR / Project Structure 产物配置;仅限受信任的项目 | 1.10 | +| `storage` | 低 | `host::storage`,每个插件 64 MiB | 1.0 | +| `events` | 低 | 文件打开、关闭、保存,文件变化,编辑器焦点变化,仓库变化,设置变化 | 1.0 | +| `events.input` | 中 | `action-performed` 和 `input-mode-changed` 事件(按键和编辑器输入) | 1.0 | +| `clipboard` | 中 | `host::copy_to_clipboard`,以及插件 Web 视图中的剪贴板 API | 1.0 | +| `clipboard.read` | 中 | `host::read_clipboard`:读取剪贴板的文本和图片,仅限用户运行的命令和视图操作(事件处理器等无人值守的调用会被拒绝) | 1.11 | +| `agents` | 中 | `host::fork_agent_session`:把录制的原生 agent 会话(`claude`、`codex` 或 `copilot`)派生为当前窗口项目中的新任务;仅限受信任项目 | 1.18 | +| `secrets` | 中 | 请求头中的 `{{secret:<name>}}`、`secret_is_set`、`secret_set`、`secret_delete` | 1.0 | +| `net:<host>` | 中 | `host::fetch` / `host::fetch_stream` 通过 HTTPS(以及回环地址的 HTTP)访问该主机;`*.example.com` 匹配子域名 | 1.0 | +| `net:ask` | 中 | 第一次请求未声明的 HTTPS 主机时询问用户 | 1.5 | +| `net.http:<host>` | 中 | 通过未加密的 HTTP 访问该主机 | 1.4 | +| `database.sources` | 中 | 只管理插件自己的项目数据源并写入其凭据;仅限受信任项目 | 1.4 | +| `database.schema` | 中 | 读取已连接的项目数据源(包括用户创建的数据源)的表结构;仅限受信任项目,不返回凭据或表数据。 | 1.20 | +| `fs.read:<path>` | 高 | 通过 `host::fs` 读取项目外、该路径下的文件 | 1.0(`fs` interface:1.3) | +| `fs.write:<path>` | 高 | 通过 `host::fs` 写入项目外、该路径下的文件;不包含读权限 | 1.3 | +| `process:<program>` | 高 | 运行该程序:`run_process`、`run_command`、`start`、终端、语言服务器、调试适配器、运行配置 | 1.0 | +| `lsp:<server>` | 高 | 向正在运行的该语言服务器发送它自己的请求(`language_server_request`);仅限受信任的项目 | 1.9 | +| `java.agent` | 高 | 在你启动的 Java 应用中运行插件的 Java 代理(见下文“Java 代理”) | 1.10 | +| `ipc:<path>` | 高 | 项目所在机器上的本地 Unix 套接字或 Windows 命名管道 | 1.4 | +| `ide.commands` | 高 | 像用户亲自选择一样运行任意 IDE 操作或其他插件的命令,包括运行程序、提交和推送。插件自己的命令不受此限制。 | 1.4 | **API** 一列是声明该能力时清单最低可以兼容的插件 API。例如声明了 `net.http:` 的清单必须要求 `engines.openidea = "^1.4"` 或更高,否则安装和 `openidea-plugin check` 都会拒绝。 diff --git a/docs/zh/plugins/versioning.mdx b/docs/zh/plugins/versioning.mdx index 33e63b9f6f..75b10b3441 100644 --- a/docs/zh/plugins/versioning.mdx +++ b/docs/zh/plugins/versioning.mdx @@ -32,7 +32,7 @@ description: "engines.openidea、插件 API 从 1.0 到 1.21 的各个版本, | 1.18.0 | OpenIDEA 0.1.54 | `[[contributes.overlays]]`:悬浮在工作台上方、从不抢占键盘焦点的插件网页,可通过 `openidea.overlay` 移动和调整大小;`[[contributes.dialogs]]`:插件网页显示在可调整大小的模态对话框中,用 `views.reveal` 打开,关闭时发 `closed` 视图事件,页面可调用 `openidea.dialog.close()`;`events.subscribe-paths-with-options`(`debounce-ms`)、`workspace.project.generation` 与 `FilesChanged` 的 `project`/`generation` 字段、过期运行目标/配置拒绝以及 `project-closed` 生命周期事件;`execution-configurations`、`run.start-with-options` 与 `runDetectors.outputMode`:插件运行配置的控制台输出方式(`pipes` 或 `pty`);`[[contributes.runAnything]]` 与 `run-anything-provider` 导出:以插件前缀开头的 Run Anything 行;`views.open-terminal-session-in`:在项目子目录中打开带 key 的终端;`workspace.invoking-project`:本次调用所服务窗口的项目,`gutter-actions` 和 `hover-actions` 中也可用;`events.watch-paths` 与 `watched-files-changed` 事件:监听项目之外、`fs.read` 授权范围内的文件和目录;`run-configuration-completion` 导出:补全插件自己运行配置的“实参”字段;`services.context` 和 `services.toolbar` 菜单:作用于 IDE 自带的 Services 节点,命令参数是选中的服务;`[[contributes.javaAgents]]` 的 `executor`:运行和调试旁边的“使用 <title> 运行/调试 '<name>'”,只有经它启动时才加载该代理,插件自己的命令也可用配置 id 经它启动;需授权的 `agents.fork-session`:把录制的原生 agent 会话(`claude`、`codex` 或 `copilot`)派生为调用窗口项目中的新任务(`agents` 能力),宿主自行校验会话并构造 fork 调用 | | 1.19.0 | OpenIDEA 0.1.56 | `[capabilities.reasons]`:插件用一句话说明为什么需要某个能力,显示在授权对话框和 设置 › 插件 中宿主说明的下方;`settings.open` / `settings.open-permissions`:打开设置并定位到插件自己的页面或它的权限;`net.fetch-stream`:边到达边读取响应体(服务器推送事件 SSE、模型的流式回复),SDK 提供 `host::fetch_stream` 和 `sse` 解析器;`editor.open-as-text`:即使文件被自定义编辑器认领,也用内置文本编辑器打开(SDK 的 `host::open_editor_as_text`);菜单点 `openIn`:编辑器、标签页和项目视图的 **打开方式** 子菜单 | | 1.20.0 | OpenIDEA 0.1.57 | 数据库表的上下文菜单和只读表结构查看(`database.schema`)。可选的 `syntax-decorations-provider` 导出:用主题 token `rainbow-1` … `rainbow-5` 或自带的深色/浅色主题 `#rrggbb` 颜色,给打开的文本编辑器中的范围涂前景色,依据编辑器语法树的有界片段。 | -| 1.21.0 | `main` 上开发中 | 运行配置与运行生命周期扩展:`run-started` 事件与用户启动配置时的 `run-exited`、`run.stop`、`attach-child` 支持 `"java"`、`prepareCommand` 传入 `mode`(`"run"` / `"debug"`)并支持回环 `javaDebug` 附加 JDWP 调试器、`run.upsert-configuration`、`run.open-edit-configurations`、`ownsBeforeLaunch`、控制台日志文件实时标签页 `logFiles`(按 `project.read` / `fs.read` 授权)以及 `runConsole.toolbar` 菜单位置。设置控件:`presentation`(`radio`、`segmented`、`slider`、`color`、`checkbox-list`),为 `enum` 值提供标签、说明和图标的 `enumOptions`,`minimum` / `maximum` / `step`,以及隐藏设置的 `when` 条件。 | +| 1.21.0 | `main` 上开发中 | 运行配置与运行生命周期扩展:`run-started` 事件与用户启动配置时的 `run-exited`、`run.stop`、`attach-child` 支持 `"java"`、`prepareCommand` 传入 `mode`(`"run"` / `"debug"`)并支持回环 `javaDebug` 附加 JDWP 调试器、`run.upsert-configuration`、`run.open-edit-configurations`、`ownsBeforeLaunch`、控制台日志文件实时标签页 `logFiles`(按 `project.read` / `fs.read` 授权)以及 `runConsole.toolbar` 菜单位置。设置控件:`presentation`(`radio`、`segmented`、`slider`、`color`、`checkbox-list`),为 `enum` 值提供标签、说明和图标的 `enumOptions`,`minimum` / `maximum` / `step`,以及隐藏设置的 `when` 条件。`build.read` 新增 `build.sdks` 与 `build.artifacts`:在受信任项目中读取已安装的 JDK / Maven / 工具链(带项目当前选中的 `active` 标记)以及构建模型 Maven/Gradle WAR 产物和 Project Structure › Artifacts 定义(含 `id`、`origin` 与 `tool`)。 | 每个版本新增内容的完整列表见 [`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 9ce00c5905..25992ee2a7 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -352,35 +352,35 @@ installing (or when a new version asks for more). Low-risk capabilities are listed; high-risk ones are called out as equivalent to running code on the machine. Users can revoke optional capabilities in Settings › Plugins. -| Capability | Risk | Unlocks today | -| ------------------------ | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ide.commands` | high | Run any IDE action or other plugins' commands as if you chose them, including running programs, committing and pushing. API 1.4; declared own commands are exempt. | -| `database.sources` | medium | API 1.4: manage only the plugin's own project database sources, write their secure credentials and request connection; trusted projects only. | -| `project.read` | low | `Project::root`, `read_file`, `read_bytes`, `find_files`, `symbols`, `search_text`, `host::projects`, `publish_diagnostics`, `problems`, editor opening and decorations | -| `project.write` | high | `Project::write_file` — creates and replaces text files inside the open projects, the settings and build scripts a trusted project runs included | -| `fs.read:<path>` | high | `host::fs::read_file`, `read_bytes`, `stat`, `read_dir` — files outside the projects, under the grant's directory | -| `fs.write:<path>` | high | `host::fs::write_file`, `write_bytes` — files under that path; doesn't imply reading | -| `editor.read` | low | `TextEditor::document`, `selections`, `host::open_editors` | -| `editor.write` | medium | `TextEditor::apply_edits` | -| `vcs.read` | low | `Project::vcs_status`, `vcs_remotes`, `vcs_log`, `vcs_blame`, `vcs_diff` (new reads require trust), `host::pending_commit`, before-commit checks | -| `vcs.write` | medium | `Project::vcs_fetch` (trusted projects only), `host::set_commit_message` | -| `build.read` | low | API 1.10: `Project::build_dependencies`, the Maven / Gradle dependency graph the IDE resolved; trusted projects only | -| `storage` | low | `host::storage` (64 MiB per plugin, counting UTF-8 bytes of keys and values) | -| `events` | low | file opened/saved, editor focused, repository changed events | -| `events.input` | medium | `action-performed` and `input-mode-changed` events | -| `process:<program>` | high | `Project::run_process`, language servers, debug adapters, runs | -| `lsp:<server>` | high | API 1.9: `Project::language_server_request` / `language_server_notify` to that running language server (its name in the language definition); trusted projects only | -| `java.agent` | high | API 1.10: the `[[contributes.javaAgents]]` jar runs inside the Java applications you start; derived from that declaration, never listed | -| `net:<host>` | medium | `host::fetch` over HTTPS (also loopback HTTP); `*.example.com` matches subdomains | -| `net:ask` | medium | Ask the user at the first request to an HTTPS (or loopback) host that is not declared; one answer per host, revocable; API 1.5 | -| `net.http:<host>` | medium | Unencrypted HTTP to that host; API 1.4, same wildcard rules as `net:` | -| `net:setting:<key>` | medium | API 1.18: the host of the plugin's `string` setting `<key>` over HTTPS (also loopback HTTP), approved when the user applies the value in Settings; bare host or URL | -| `net.http:setting:<key>` | medium | API 1.18: the same setting's host over unencrypted HTTP, approved the same way | -| `ipc:<path>` | high | Local Unix sockets or Windows named pipes on the project machine; API 1.4 | -| `secrets` | medium | `{{secret:<name>}}` in request headers, `host::secret_is_set`, `secret_set`, `secret_delete` | -| `clipboard` | medium | `host::copy_to_clipboard` and the clipboard API in the plugin's web views | -| `clipboard.read` | medium | API 1.11: `host::read_clipboard`, the clipboard's text and image, only in commands and view actions the user ran | -| `agents` | medium | API 1.18: `host::fork_agent_session`, fork a recorded native agent session into a new task in the project; trusted projects only | +| Capability | Risk | Unlocks today | +| ------------------------ | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ide.commands` | high | Run any IDE action or other plugins' commands as if you chose them, including running programs, committing and pushing. API 1.4; declared own commands are exempt. | +| `database.sources` | medium | API 1.4: manage only the plugin's own project database sources, write their secure credentials and request connection; trusted projects only. | +| `project.read` | low | `Project::root`, `read_file`, `read_bytes`, `find_files`, `symbols`, `search_text`, `host::projects`, `publish_diagnostics`, `problems`, editor opening and decorations | +| `project.write` | high | `Project::write_file` — creates and replaces text files inside the open projects, the settings and build scripts a trusted project runs included | +| `fs.read:<path>` | high | `host::fs::read_file`, `read_bytes`, `stat`, `read_dir` — files outside the projects, under the grant's directory | +| `fs.write:<path>` | high | `host::fs::write_file`, `write_bytes` — files under that path; doesn't imply reading | +| `editor.read` | low | `TextEditor::document`, `selections`, `host::open_editors` | +| `editor.write` | medium | `TextEditor::apply_edits` | +| `vcs.read` | low | `Project::vcs_status`, `vcs_remotes`, `vcs_log`, `vcs_blame`, `vcs_diff` (new reads require trust), `host::pending_commit`, before-commit checks | +| `vcs.write` | medium | `Project::vcs_fetch` (trusted projects only), `host::set_commit_message` | +| `build.read` | low | API 1.10 (`build_dependencies`), API 1.21 (`sdks`, `artifacts`): Maven / Gradle dependency graph, installed SDKs/toolchains, and Project Structure artifacts; trusted projects only | +| `storage` | low | `host::storage` (64 MiB per plugin, counting UTF-8 bytes of keys and values) | +| `events` | low | file opened/saved, editor focused, repository changed events | +| `events.input` | medium | `action-performed` and `input-mode-changed` events | +| `process:<program>` | high | `Project::run_process`, language servers, debug adapters, runs | +| `lsp:<server>` | high | API 1.9: `Project::language_server_request` / `language_server_notify` to that running language server (its name in the language definition); trusted projects only | +| `java.agent` | high | API 1.10: the `[[contributes.javaAgents]]` jar runs inside the Java applications you start; derived from that declaration, never listed | +| `net:<host>` | medium | `host::fetch` over HTTPS (also loopback HTTP); `*.example.com` matches subdomains | +| `net:ask` | medium | Ask the user at the first request to an HTTPS (or loopback) host that is not declared; one answer per host, revocable; API 1.5 | +| `net.http:<host>` | medium | Unencrypted HTTP to that host; API 1.4, same wildcard rules as `net:` | +| `net:setting:<key>` | medium | API 1.18: the host of the plugin's `string` setting `<key>` over HTTPS (also loopback HTTP), approved when the user applies the value in Settings; bare host or URL | +| `net.http:setting:<key>` | medium | API 1.18: the same setting's host over unencrypted HTTP, approved the same way | +| `ipc:<path>` | high | Local Unix sockets or Windows named pipes on the project machine; API 1.4 | +| `secrets` | medium | `{{secret:<name>}}` in request headers, `host::secret_is_set`, `secret_set`, `secret_delete` | +| `clipboard` | medium | `host::copy_to_clipboard` and the clipboard API in the plugin's web views | +| `clipboard.read` | medium | API 1.11: `host::read_clipboard`, the clipboard's text and image, only in commands and view actions the user ran | +| `agents` | medium | API 1.18: `host::fork_agent_session`, fork a recorded native agent session into a new task in the project; trusted projects only | `process:` capabilities are also derived from what the contributions start: a language's `language-servers` and `debugger` commands and a run detector's @@ -946,6 +946,8 @@ then run `openidea-plugin check`. | `Project::vcs_log(path, limit)` | `vcs.log` | API 1.4: newest first, at most 1000 commits, optional file history. Requires `vcs.read` and trust. | | `Project::vcs_blame(path)` | `vcs.blame` | API 1.4: attribution including unsaved editor text. Requires `vcs.read` and trust. | | `Project::build_dependencies(module)` | `build.dependencies` | API 1.10: the Maven / Gradle dependency graph the IDE resolved, flat, each module a root; nothing is resolved for the call. Requires `build.read` and trust. | +| `Project::sdks(kind)` | `build.sdks` | API 1.21: installed interpreters, JDKs, and toolchains visible to the IDE (optional `kind` filter, `active = true` for the project selection). Requires `build.read` and trust. | +| `Project::artifacts()` | `build.artifacts` | API 1.21: deployable Maven/Gradle WAR artifacts from the build model and Project Structure › Artifacts entries (`id`, `origin`, `tool`). Requires `build.read` and trust. | | `Project::vcs_diff(path, against)` | `vcs.diff` | API 1.4: disk working tree against HEAD/revision, optionally one file. None outside Git; fails above 4 MiB. Requires `vcs.read` and trust. | | `TextEditor::apply_edits(version, edits)` | `editor.text-editor.apply-edits` | One undoable change, only if the document is still at `version` — else `Error::Stale` and nothing changes. `transform_selections` retries once. | | `Project::root()`, `read_file(path)` | `workspace.project` | Absolute or project-relative; `..`/symlinks escaping the root are rejected; UTF-8 only, ≤ 16 MiB; unsaved editor contents win; a missing path is `Error::NotFound`. | @@ -1160,9 +1162,11 @@ for (i, node) in graph.iter().enumerate() { } ``` -| SDK | WIT | Notes | -| ------------------------------------- | ------------------------------------- | --------------------------------------------- | -| `Project::build_dependencies(module)` | `build.dependencies(project, module)` | A flat `list<dependency-node>`, modules first | +| SDK | WIT | Notes | +| ------------------------------------- | ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `Project::build_dependencies(module)` | `build.dependencies(project, module)` | A flat `list<dependency-node>`, modules first | +| `Project::sdks(kind)` | `build.sdks(project, kind)` | API 1.21: `list<sdk-info>` installed SDKs/toolchains, optional `kind` filter | +| `Project::artifacts()` | `build.artifacts(project)` | API 1.21: `list<artifact-info>` build-model WAR modules and Project Structure › Artifacts entries (`id`, `origin`, `tool`) | - WIT records can't nest, so the graph is a flat list. Each module is a root (`parent` none, empty `scope`) — a Maven module by its `groupId:artifactId`, a diff --git a/plugins/official/ai-completion/dist/plugin.wasm b/plugins/official/ai-completion/dist/plugin.wasm index dde0fb9d10..29b3468bb4 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 3c9a215576..f5b9509b9f 100644 --- a/plugins/official/ai-completion/dist/plugin.wasm.sources +++ b/plugins/official/ai-completion/dist/plugin.wasm.sources @@ -1 +1 @@ -68d378fa7322f1ff12ff5654fdc8d371a33863110dd14067d7085f66e43f7807 +9550f8b917b596af31b7eb2566f3953873a2449d33c44ad843a3965e71f6ea59 diff --git a/plugins/official/blame-annotations/dist/plugin.wasm b/plugins/official/blame-annotations/dist/plugin.wasm index e699ce0fa5..273d267feb 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 5c737f84a9..2d4040cd59 100644 --- a/plugins/official/blame-annotations/dist/plugin.wasm.sources +++ b/plugins/official/blame-annotations/dist/plugin.wasm.sources @@ -1 +1 @@ -a2d9dd25d6ba47fca10d982064708341b53cfc9791d890c241efb38488cf5c65 +522d29bbbc6876a30a40994e650276492db6b830e3f74c4064da50e63c522bd6 diff --git a/plugins/official/checkstyle/dist/plugin.wasm b/plugins/official/checkstyle/dist/plugin.wasm index 31df3a48e3..35383350e8 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 1efc21c530..890aef2106 100644 --- a/plugins/official/checkstyle/dist/plugin.wasm.sources +++ b/plugins/official/checkstyle/dist/plugin.wasm.sources @@ -1 +1 @@ -0fa644f4fea5049f5b887b3805150ee67f7808cf6abd77cecfc4ecb30acded1f +2e655148d562d2c44b073d1151f162fa13e291f441a179069128dd819329629f diff --git a/plugins/official/container-runner/dist/plugin.wasm b/plugins/official/container-runner/dist/plugin.wasm index 5fe4ae919b..4e7fa733c8 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 95470b0274..d3606f58aa 100644 --- a/plugins/official/container-runner/dist/plugin.wasm.sources +++ b/plugins/official/container-runner/dist/plugin.wasm.sources @@ -1 +1 @@ -f79fd774efea2d0ebf15a66b890959880b675ef091271c2167f943163fe84e49 +061f7136d157566c4dfa44f30e7cb9e2fbed32d3455e77d67d2a26795ac58c7e diff --git a/plugins/official/csv-editor/dist/plugin.wasm b/plugins/official/csv-editor/dist/plugin.wasm index c19ea1525a..194793ea2f 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 c934010f4f..045ec61558 100644 --- a/plugins/official/csv-editor/dist/plugin.wasm.sources +++ b/plugins/official/csv-editor/dist/plugin.wasm.sources @@ -1 +1 @@ -11794e3ce437a5d82774206c5d6833bc0078a0c161aef5378e8a7abaf8aa396d +bb8b8163965326ec5b6c70b1bdae4a0e4580225ca7c3b2b71da13677ffe2ab70 diff --git a/plugins/official/git-toolbox/dist/plugin.wasm b/plugins/official/git-toolbox/dist/plugin.wasm index 35690fc813..8962c281ec 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 fdb11f1349..69c8440341 100644 --- a/plugins/official/git-toolbox/dist/plugin.wasm.sources +++ b/plugins/official/git-toolbox/dist/plugin.wasm.sources @@ -1 +1 @@ -3eefb6eb47688c2b57f6a4aad2e90d7dd0d4805586aa523dea4312fb33725330 +aab989c91244b8ea58e3f7da6273722b6858194cc53f1b86df934671982c239f diff --git a/plugins/official/graphviz/dist/plugin.wasm b/plugins/official/graphviz/dist/plugin.wasm index e872478831..f1eb65ad7f 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 a6d5511426..ea7d5ffa92 100644 --- a/plugins/official/graphviz/dist/plugin.wasm.sources +++ b/plugins/official/graphviz/dist/plugin.wasm.sources @@ -1 +1 @@ -7e1c74f797f5f7d968d29bf621709802c3fc0e2e4610bf38b2225e79b0b978dc +ce2fe21dbef305e6c0e6a041cfa63beb3398a19d62bc6cfa66df896e09c21b75 diff --git a/plugins/official/key-promoter/dist/plugin.wasm b/plugins/official/key-promoter/dist/plugin.wasm index 460c5908de..2096169917 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 3f517a316c..cfcc1a26bb 100644 --- a/plugins/official/key-promoter/dist/plugin.wasm.sources +++ b/plugins/official/key-promoter/dist/plugin.wasm.sources @@ -1 +1 @@ -0cb361ffacdae717e11921e59d7915f3a80cf20e6ddda255b2ae9b99489694af +48364d8da995a758d0bb9cbe7372737b942fd46a45349e9c251800f57ca190db diff --git a/plugins/official/license-header/dist/plugin.wasm b/plugins/official/license-header/dist/plugin.wasm index e5b04c4461..b915ebdae6 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 4aa04d1483..1d3729240d 100644 --- a/plugins/official/license-header/dist/plugin.wasm.sources +++ b/plugins/official/license-header/dist/plugin.wasm.sources @@ -1 +1 @@ -4252673a11e47da25c28443cfdd0ad35729ab29bbb4adf516b489dbffa3b8267 +5b1dcf5a9a01a08bb606ce87d33dc435d0d9cb987e79a86d5acc19931ca8eaaf diff --git a/plugins/official/mybatis/dist/plugin.wasm b/plugins/official/mybatis/dist/plugin.wasm index 1ca95fc199..c4e7c38ca4 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 b2bfc6ee45..91da0ffd07 100644 --- a/plugins/official/mybatis/dist/plugin.wasm.sources +++ b/plugins/official/mybatis/dist/plugin.wasm.sources @@ -1 +1 @@ -641273bdb39963cad33932c52d63672735180896fb41ac53c045c4b9ec1ccde7 +c7cf2105f07ba33e3a7dbd6f1e33a700403ac80b2f86cec76877a440d5b1d79e diff --git a/plugins/official/regex-tester/dist/plugin.wasm b/plugins/official/regex-tester/dist/plugin.wasm index bc9f90553d..013d2928ad 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 dc51efb36a..c2aedcb34a 100644 --- a/plugins/official/regex-tester/dist/plugin.wasm.sources +++ b/plugins/official/regex-tester/dist/plugin.wasm.sources @@ -1 +1 @@ -192d3e7ac64bbcd6aba3e362340c515eb2b9c5dbd2ad6ea361a7831628fdd48a +d32cd7906abd3db8da1c432b43d43222caa98697a3a04844c43cb23a94b5895b diff --git a/plugins/official/solidity/dist/plugin.wasm b/plugins/official/solidity/dist/plugin.wasm index 850d018121..0cb7df65e5 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 83a47145f2..e80cc1e5d7 100644 --- a/plugins/official/solidity/dist/plugin.wasm.sources +++ b/plugins/official/solidity/dist/plugin.wasm.sources @@ -1 +1 @@ -7e02a7f1da3dcec45131af5613e91730b590ccf301ead1f7a84936eb36f54335 +84c6c04319244557454cecbce6912b8adbe16ba993efa3bef8cc93dc94f1b218 diff --git a/plugins/official/string-tools/dist/plugin.wasm b/plugins/official/string-tools/dist/plugin.wasm index 0cb929887a..4571fc2c63 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 28413d66aa..e9983b1ff6 100644 --- a/plugins/official/string-tools/dist/plugin.wasm.sources +++ b/plugins/official/string-tools/dist/plugin.wasm.sources @@ -1 +1 @@ -f61634fbb7a00f46820038ca71633664fd36edc7db9bd86ec7705606d5921ca6 +6dbdeb34ea1b122bd49024f3353ba848dc3c9a6146e887a13daac57372c0dc5e diff --git a/plugins/official/test-runner/dist/plugin.wasm b/plugins/official/test-runner/dist/plugin.wasm index 0aa6fd2986..26248702f4 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 09f40f2d71..7b021be6d0 100644 --- a/plugins/official/test-runner/dist/plugin.wasm.sources +++ b/plugins/official/test-runner/dist/plugin.wasm.sources @@ -1 +1 @@ -e9a12343170c53abf50e126adabd5f6956fae445f31f24ae4dff763c53220391 +b9c5322028eaeb9d0851f05b34b31f0d6c199a69183235c9e67522b8c1281534 diff --git a/plugins/official/todo-finder/dist/plugin.wasm b/plugins/official/todo-finder/dist/plugin.wasm index e543b40093..3de864df8a 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 dff1bbc784..ecb785925c 100644 --- a/plugins/official/todo-finder/dist/plugin.wasm.sources +++ b/plugins/official/todo-finder/dist/plugin.wasm.sources @@ -1 +1 @@ -8c7d46f44e87a400ca5a2bb205cf813ee3cff9eb659ad35f7bb024327834ae6e +7b75c91d2f354fc65c75b9c47d1adb66dd55620354d3382e823897d7b9010470 diff --git a/sdk/rust/openidea-plugin/src/host.rs b/sdk/rust/openidea-plugin/src/host.rs index 292dd64d69..54b09ae572 100644 --- a/sdk/rust/openidea-plugin/src/host.rs +++ b/sdk/rust/openidea-plugin/src/host.rs @@ -1042,6 +1042,51 @@ mod imp { }) .map_err(error) } + pub fn build_sdks(project: &ProjectRes, kind: Option<&str>) -> Result<Vec<SdkInfo>, Error> { + wit::build::sdks(project, kind) + .map(|sdks| { + sdks.into_iter() + .map(|s| SdkInfo { + kind: s.kind, + name: s.name, + path: s.path, + version: s.version, + source: s.source, + home: s.home, + active: s.active, + }) + .collect() + }) + .map_err(error) + } + pub fn build_artifacts(project: &ProjectRes) -> Result<Vec<ArtifactInfo>, Error> { + use wit::build::{ArtifactKind as K, ArtifactOrigin as O}; + wit::build::artifacts(project) + .map(|artifacts| { + artifacts + .into_iter() + .map(|a| ArtifactInfo { + id: a.id, + origin: match a.origin { + O::BuildModel => ArtifactOrigin::BuildModel, + O::ProjectStructure => ArtifactOrigin::ProjectStructure, + }, + tool: a.tool, + name: a.name, + kind: match a.kind { + K::Jar => ArtifactKind::Jar, + K::War => ArtifactKind::War, + K::WarExploded => ArtifactKind::WarExploded, + }, + module: a.module, + output_directory: a.output_directory, + main_class: a.main_class, + include_libraries: a.include_libraries, + }) + .collect() + }) + .map_err(error) + } pub fn mcp_stdio_command() -> Option<Vec<String>> { wit::mcp::stdio_command() } @@ -1399,6 +1444,20 @@ impl Project { imp::build_dependencies(&self.inner, module) } + /// Installed interpreters, JDKs, or toolchains relevant to this project, optionally + /// narrowed by `kind` (`jdk`, `maven`, `python`, `node`, `php`, `package-manager`, + /// `rust`, `go`, `typescript`, `ruby`, `zig`, `dotnet`, `flutter`, `xcode`) (API 1.21). + /// Requires `build.read` and a trusted project. + pub fn sdks(&self, kind: Option<&str>) -> Result<Vec<SdkInfo>, Error> { + imp::build_sdks(&self.inner, kind) + } + + /// Project Structure › Artifacts definitions of this project (API 1.21). + /// Requires `build.read` and a trusted project. + pub fn artifacts(&self) -> Result<Vec<ArtifactInfo>, Error> { + imp::build_artifacts(&self.inner) + } + /// Find in Files with unsaved text, project excludes, cancellation and a 10,000 match cap. /// Requires project.read; locations use zero-based lines and UTF-16 columns. pub fn search_text(&self, query: &TextQuery, limit: u32) -> Result<TextSearch, Error> { diff --git a/sdk/rust/openidea-plugin/src/mock.rs b/sdk/rust/openidea-plugin/src/mock.rs index f9264396c1..e9d6388186 100644 --- a/sdk/rust/openidea-plugin/src/mock.rs +++ b/sdk/rust/openidea-plugin/src/mock.rs @@ -168,6 +168,8 @@ struct State { search: Option<SearchHandler>, commits: Vec<CommitInfo>, build_graph: Vec<DependencyNode>, + sdks: Vec<SdkInfo>, + artifacts: Vec<ArtifactInfo>, blame: BTreeMap<String, Vec<BlameLine>>, patch: Option<String>, restricted: bool, @@ -348,6 +350,14 @@ impl MockHost { pub fn set_build_dependencies(&self, nodes: Vec<DependencyNode>) { self.state.borrow_mut().build_graph = nodes; } + /// Installed interpreters, JDKs, or toolchains returned by [`crate::Project::sdks`]. + pub fn set_sdks(&self, sdks: Vec<SdkInfo>) { + self.state.borrow_mut().sdks = sdks; + } + /// Project Structure › Artifacts definitions returned by [`crate::Project::artifacts`]. + pub fn set_artifacts(&self, artifacts: Vec<ArtifactInfo>) { + self.state.borrow_mut().artifacts = artifacts; + } /// Simulates Restricted Mode for new VCS read APIs. pub fn set_restricted(&self, restricted: bool) { self.state.borrow_mut().restricted = restricted; @@ -2891,6 +2901,45 @@ pub mod current { } }) } + pub fn build_sdks(_project: &ProjectRes, kind: Option<&str>) -> Result<Vec<SdkInfo>, Error> { + const VALID_KINDS: [&str; 14] = [ + "jdk", + "maven", + "python", + "node", + "php", + "package-manager", + "rust", + "go", + "typescript", + "ruby", + "zig", + "dotnet", + "flutter", + "xcode", + ]; + if let Some(k) = kind + && !VALID_KINDS.contains(&k) + { + return Err(Error::Invalid(format!("unknown SDK kind `{k}`"))); + } + with(|s| { + require(s, "build.read")?; + if s.restricted { + return Err(Error::Denied("project is not trusted".into())); + } + Ok(s.sdks.iter().filter(|sdk| kind.is_none_or(|k| sdk.kind == k)).cloned().collect()) + }) + } + pub fn build_artifacts(_project: &ProjectRes) -> Result<Vec<ArtifactInfo>, Error> { + with(|s| { + require(s, "build.read")?; + if s.restricted { + return Err(Error::Denied("project is not trusted".into())); + } + Ok(s.artifacts.clone()) + }) + } pub fn lsp_notify(_project: &ProjectRes, server: &str, method: &str, params: Option<&str>) -> Result<(), Error> { with(|s| { let message = lsp_message(s, server, method, params)?; diff --git a/sdk/rust/openidea-plugin/src/types.rs b/sdk/rust/openidea-plugin/src/types.rs index 75d508ccb0..c8444c0ff8 100644 --- a/sdk/rust/openidea-plugin/src/types.rs +++ b/sdk/rust/openidea-plugin/src/types.rs @@ -974,6 +974,48 @@ pub struct DependencyNode { pub parent: Option<u32>, } +/// One installed interpreter, JDK, or toolchain returned by [`crate::Project::sdks`] (API 1.21). +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct SdkInfo { + pub kind: String, + pub name: String, + pub path: String, + pub version: Option<String>, + pub source: String, + pub home: Option<String>, + pub active: bool, +} + +/// Origin of an artifact returned by [`crate::Project::artifacts`] (API 1.21). +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum ArtifactOrigin { + BuildModel, + ProjectStructure, +} + +/// Packaging kind of an artifact (API 1.21). +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum ArtifactKind { + Jar, + War, + WarExploded, +} + +/// One deployable WAR module or Project Structure › Artifacts definition returned by +/// [`crate::Project::artifacts`] (API 1.21). +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct ArtifactInfo { + pub id: String, + pub origin: ArtifactOrigin, + pub tool: String, + pub name: String, + pub kind: ArtifactKind, + pub module: String, + pub output_directory: String, + pub main_class: String, + pub include_libraries: Vec<String>, +} + /// Non-secret settings of a plugin-owned project database source (API 1.4). #[derive(Clone, Debug, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)] #[serde(rename_all = "camelCase")] diff --git a/sdk/rust/openidea-plugin/tests/build_dependencies.rs b/sdk/rust/openidea-plugin/tests/build_dependencies.rs index 4f9b3f0c9e..3a4165bb4f 100644 --- a/sdk/rust/openidea-plugin/tests/build_dependencies.rs +++ b/sdk/rust/openidea-plugin/tests/build_dependencies.rs @@ -1,4 +1,6 @@ -use openidea_plugin::{DependencyNode, DependencyStatus, Error, mock::MockHost}; +use openidea_plugin::{ + ArtifactInfo, ArtifactKind, ArtifactOrigin, DependencyNode, DependencyStatus, Error, SdkInfo, mock::MockHost, +}; fn node(group: &str, artifact: &str, version: &str, scope: &str, parent: Option<u32>) -> DependencyNode { DependencyNode { @@ -49,3 +51,73 @@ fn the_graph_of_one_module_or_all_behind_the_grant() { mock.set_restricted(true); assert!(matches!(p.build_dependencies(None), Err(Error::Denied(_)))); } + +#[test] +fn sdks_and_artifacts_respect_build_read_and_trust() { + let mock = MockHost::install().with_capabilities(&[]); + mock.set_sdks(vec![ + SdkInfo { + kind: "jdk".into(), + name: "Temurin 21".into(), + path: "/Library/Java/21".into(), + version: Some("21.0.2".into()), + source: "system".into(), + home: Some("/Library/Java/21".into()), + active: true, + }, + SdkInfo { + kind: "maven".into(), + name: "Maven 3.9.6".into(), + path: "/opt/maven/bin/mvn".into(), + version: Some("3.9.6".into()), + source: "homebrew".into(), + home: Some("/opt/maven".into()), + active: false, + }, + ]); + mock.set_artifacts(vec![ + ArtifactInfo { + id: "maven:app/pom.xml".into(), + origin: ArtifactOrigin::BuildModel, + tool: "maven".into(), + name: "demo-app".into(), + kind: ArtifactKind::War, + module: "app".into(), + output_directory: String::new(), + main_class: String::new(), + include_libraries: Vec::new(), + }, + ArtifactInfo { + id: "project:demo:war exploded".into(), + origin: ArtifactOrigin::ProjectStructure, + tool: "project".into(), + name: "demo:war exploded".into(), + kind: ArtifactKind::WarExploded, + module: ".".into(), + output_directory: "target/demo".into(), + main_class: String::new(), + include_libraries: vec!["lib".into()], + }, + ]); + let p = mock.invocation().project().unwrap(); + assert!(matches!(p.sdks(None), Err(Error::Denied(c)) if c == "build.read")); + assert!(matches!(p.artifacts(), Err(Error::Denied(c)) if c == "build.read")); + + let mock = mock.with_capabilities(&["build.read"]); + assert_eq!(p.sdks(None).unwrap().len(), 2); + let jdks = p.sdks(Some("jdk")).unwrap(); + assert_eq!(jdks.len(), 1); + assert!(jdks[0].active); + assert!(matches!(p.sdks(Some("cobol")), Err(Error::Invalid(_)))); + let artifacts = p.artifacts().unwrap(); + assert_eq!(artifacts.len(), 2); + assert_eq!(artifacts[0].id, "maven:app/pom.xml"); + assert_eq!(artifacts[0].origin, ArtifactOrigin::BuildModel); + assert_eq!(artifacts[0].tool, "maven"); + assert_eq!(artifacts[1].origin, ArtifactOrigin::ProjectStructure); + assert_eq!(artifacts[1].kind, ArtifactKind::WarExploded); + + mock.set_restricted(true); + assert!(matches!(p.sdks(None), Err(Error::Denied(_)))); + assert!(matches!(p.artifacts(), Err(Error::Denied(_)))); +} diff --git a/sdk/rust/openidea-plugin/wit/workspace.wit b/sdk/rust/openidea-plugin/wit/workspace.wit index a828cb3064..962b4330b7 100644 --- a/sdk/rust/openidea-plugin/wit/workspace.wit +++ b/sdk/rust/openidea-plugin/wit/workspace.wit @@ -318,4 +318,62 @@ interface build { /// At most 100,000 nodes (else `failed`: ask for one module). Trusted /// projects only; requires `build.read`. dependencies: func(project: borrow<project>, module: option<string>) -> result<list<dependency-node>, error>; + + /// One installed interpreter, JDK, or toolchain visible to the IDE (API 1.21). + record sdk-info { + /// SDK kind (`jdk`, `maven`, `python`, `node`, `php`, `package-manager`, + /// `rust`, `go`, `typescript`, `ruby`, `zig`, `dotnet`, `flutter`, `xcode`). + kind: string, + name: string, + /// Executable or home directory path. + path: string, + version: option<string>, + /// Origin (`system`, `venv`, `pyenv`, `mise`, `homebrew`, `user`, …). + source: string, + home: option<string>, + /// True when currently selected for the open project. + active: bool, + } + + /// Origin of an artifact returned by `build.artifacts` (API 1.21). + enum artifact-origin { + /// WAR module discovered from a Maven or Gradle build model (`id` is + /// `maven:<pom>` or `gradle:<path>`). + build-model, + /// Entry configured in **Project Structure › Artifacts** (`id` is + /// `project:<name>`). + project-structure, + } + + /// Packaging kind of an artifact (API 1.21). + enum artifact-kind { + jar, + war, + war-exploded, + } + + /// One deployable WAR module or Project Structure › Artifacts definition (API 1.21). + record artifact-info { + /// Run-configuration artifact identifier (`maven:<pom>`, `gradle:<path>`, + /// or `project:<name>`). + id: string, + origin: artifact-origin, + /// Source build tool (`maven`, `gradle`, or `project`). + tool: string, + name: string, + kind: artifact-kind, + /// Module path relative to project root (`"."` or `""` for root module). + module: string, + output-directory: string, + main-class: string, + include-libraries: list<string>, + } + + /// Installed SDKs / toolchains relevant to this project, optionally narrowed by + /// `kind` (API 1.21). Trusted projects only; requires `build.read`. + sdks: func(project: borrow<project>, kind: option<string>) -> result<list<sdk-info>, error>; + + /// Deployable WAR modules from the build model and Project Structure › Artifacts + /// definitions of this project (API 1.21). Trusted projects only; requires `build.read`. + artifacts: func(project: borrow<project>) -> result<list<artifact-info>, error>; } diff --git a/wit/workspace.wit b/wit/workspace.wit index a828cb3064..962b4330b7 100644 --- a/wit/workspace.wit +++ b/wit/workspace.wit @@ -318,4 +318,62 @@ interface build { /// At most 100,000 nodes (else `failed`: ask for one module). Trusted /// projects only; requires `build.read`. dependencies: func(project: borrow<project>, module: option<string>) -> result<list<dependency-node>, error>; + + /// One installed interpreter, JDK, or toolchain visible to the IDE (API 1.21). + record sdk-info { + /// SDK kind (`jdk`, `maven`, `python`, `node`, `php`, `package-manager`, + /// `rust`, `go`, `typescript`, `ruby`, `zig`, `dotnet`, `flutter`, `xcode`). + kind: string, + name: string, + /// Executable or home directory path. + path: string, + version: option<string>, + /// Origin (`system`, `venv`, `pyenv`, `mise`, `homebrew`, `user`, …). + source: string, + home: option<string>, + /// True when currently selected for the open project. + active: bool, + } + + /// Origin of an artifact returned by `build.artifacts` (API 1.21). + enum artifact-origin { + /// WAR module discovered from a Maven or Gradle build model (`id` is + /// `maven:<pom>` or `gradle:<path>`). + build-model, + /// Entry configured in **Project Structure › Artifacts** (`id` is + /// `project:<name>`). + project-structure, + } + + /// Packaging kind of an artifact (API 1.21). + enum artifact-kind { + jar, + war, + war-exploded, + } + + /// One deployable WAR module or Project Structure › Artifacts definition (API 1.21). + record artifact-info { + /// Run-configuration artifact identifier (`maven:<pom>`, `gradle:<path>`, + /// or `project:<name>`). + id: string, + origin: artifact-origin, + /// Source build tool (`maven`, `gradle`, or `project`). + tool: string, + name: string, + kind: artifact-kind, + /// Module path relative to project root (`"."` or `""` for root module). + module: string, + output-directory: string, + main-class: string, + include-libraries: list<string>, + } + + /// Installed SDKs / toolchains relevant to this project, optionally narrowed by + /// `kind` (API 1.21). Trusted projects only; requires `build.read`. + sdks: func(project: borrow<project>, kind: option<string>) -> result<list<sdk-info>, error>; + + /// Deployable WAR modules from the build model and Project Structure › Artifacts + /// definitions of this project (API 1.21). Trusted projects only; requires `build.read`. + artifacts: func(project: borrow<project>) -> result<list<artifact-info>, error>; }