diff --git a/AGENTS.md b/AGENTS.md index 02a191f1..f781fe0e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -18,9 +18,12 @@ Visual style: dark, low-contrast greys, one cool accent - `src/ui/` — design-system primitives. `src/features//` — one feature each, exporting `activate()` registered in `src/features/index.ts`. - `languages/.toml` — language definitions (detection, comments, LSP, DAP). -- `crates/ide-host` — the `openidea-server` binary for remote development. -- `wit/` — plugin interface definitions; `plugins/` — sample and bundled plugins; - `templates/` — plugin starter templates. +- `crates/ide-host` — the `openidea-server` binary for remote development and the + `openidea-plugin` CLI (plugin starter templates live in its `templates.rs`). +- `wit/` — plugin interface definitions; `plugins/` — sample and bundled plugins. + Plugin docs: `plugins/README.md`, `docs/plugins/themes.md`. +- `java/` — JDT LS extension bundles (`java-usages`, `kotlin-bridge`) and the patched + Lombok agent, embedded into the app by `ide-sdk` / `ide-tools`. - `e2e/` — Playwright UI tests (`pnpm e2e`). `fixtures/` — sample projects per language for manual and automated testing. diff --git a/THIRD_PARTY_LICENSES.md b/THIRD_PARTY_LICENSES.md index ad504787..6c0c117a 100644 --- a/THIRD_PARTY_LICENSES.md +++ b/THIRD_PARTY_LICENSES.md @@ -2,12 +2,12 @@ ## Project Lombok -`plugins/lombok/lombok-1.18.48-openidea.2.jar` contains Project Lombok v1.18.48 with the Equinox +`java/lombok/lombok-1.18.48-openidea.2.jar` contains Project Lombok v1.18.48 with the Equinox classloader fix from [projectlombok/lombok#4059](https://github.com/projectlombok/lombok/pull/4059) and the ECJ constructor-call fix from [projectlombok/lombok#4089](https://github.com/projectlombok/lombok/pull/4089). Copyright (C) 2009-2021 The Project Lombok Authors. MIT license and bundled component -notices are retained in [plugins/lombok/LICENSE](plugins/lombok/LICENSE) and inside the jar. -Source tag, patch commits and build instructions: [plugins/lombok/README.md](plugins/lombok/README.md). +notices are retained in [java/lombok/LICENSE](java/lombok/LICENSE) and inside the jar. +Source tag, patch commits and build instructions: [java/lombok/README.md](java/lombok/README.md). ## JetBrains IntelliJ Platform icons diff --git a/crates/ide-lsp/src/jdtls/hierarchy.rs b/crates/ide-lsp/src/jdtls/hierarchy.rs index abcdb667..55430784 100644 --- a/crates/ide-lsp/src/jdtls/hierarchy.rs +++ b/crates/ide-lsp/src/jdtls/hierarchy.rs @@ -1,5 +1,5 @@ //! Pull Members Up / Push Members Down through the app-owned JDT extension -//! (`plugins/java-usages`). The server checks the move and computes the edit; the UI +//! (`java/java-usages`). The server checks the move and computes the edit; the UI //! shows its problems and applies the edit itself. use super::COMMAND_TIMEOUT; use crate::types::{HierarchyChoice, HierarchyMembers, HierarchyRefactored, HierarchyRefactoring, RefactoringProblem}; diff --git a/crates/ide-plugin/tests/fixtures/hello/src/lib.rs b/crates/ide-plugin/tests/fixtures/hello/src/lib.rs index 26f75410..414c223e 100644 --- a/crates/ide-plugin/tests/fixtures/hello/src/lib.rs +++ b/crates/ide-plugin/tests/fixtures/hello/src/lib.rs @@ -1,5 +1,5 @@ //! Sample OpenIDEA plugin, written with the `openidea-plugin` SDK. -//! Build with `openidea-plugin build plugins/hello` (see plugins/README.md). +//! Build with `openidea-plugin build crates/ide-plugin/tests/fixtures/hello` (see plugins/README.md). use openidea_plugin::views::{Body, Button, TreeItem, View, ViewEvent, Viewport, Views}; use openidea_plugin::{Context, Error, Invocation, LogLevel, NotificationLevel, Plugin, host, register_plugin}; diff --git a/crates/ide-sdk/src/java.rs b/crates/ide-sdk/src/java.rs index c5c35aec..b1b51273 100644 --- a/crates/ide-sdk/src/java.rs +++ b/crates/ide-sdk/src/java.rs @@ -1128,7 +1128,7 @@ mod tests { /// The same jar supplies the JDT command and the private Maven output redirector. pub fn kotlin_bridge_bundle(data_dir: &Path) -> Option { let extension = data_dir.join("kotlin-bridge-1.0.0.jar"); - let bytes = include_bytes!("../../../plugins/kotlin-bridge/openidea-kotlin-bridge.jar"); + let bytes = include_bytes!("../../../java/kotlin-bridge/openidea-kotlin-bridge.jar"); if std::fs::read(&extension).is_ok_and(|old| old == bytes) { return Some(extension); } @@ -1171,7 +1171,7 @@ mod kotlin_bridge_bundle_tests { /// Installs the app-owned JDT LS command bundle, falling back to ordinary LSP on IO failure. pub fn usages_bundle(data_dir: &Path) -> Option { let extension = data_dir.join("java-usages-1.3.0.jar"); - let bytes = include_bytes!("../../../plugins/java-usages/openidea-java-usages.jar"); + let bytes = include_bytes!("../../../java/java-usages/openidea-java-usages.jar"); if std::fs::read(&extension).is_ok_and(|old| old == bytes) { clean_usages_bundles(data_dir, &extension); return Some(extension); @@ -1256,10 +1256,7 @@ mod usages_bundle_tests { fn installs_the_exact_bundle_and_reuses_it() { let dir = tempfile::tempdir().unwrap(); let jar = super::usages_bundle(dir.path()).unwrap(); - assert_eq!( - std::fs::read(&jar).unwrap(), - include_bytes!("../../../plugins/java-usages/openidea-java-usages.jar") - ); + assert_eq!(std::fs::read(&jar).unwrap(), include_bytes!("../../../java/java-usages/openidea-java-usages.jar")); assert_eq!(super::usages_bundle(dir.path()), Some(jar)); assert_eq!(std::fs::read_dir(dir.path()).unwrap().count(), 1); } diff --git a/crates/ide-tools/src/registry.rs b/crates/ide-tools/src/registry.rs index 116dbfc8..a912052f 100644 --- a/crates/ide-tools/src/registry.rs +++ b/crates/ide-tools/src/registry.rs @@ -641,11 +641,11 @@ pub static TOOLS: &[ToolSpec] = &[ // ECJ 3.46.200 keeps the constructor call in a constructor's statements, which // @SneakyThrows / @NonNull must not wrap or precede (lombok#4089). // Return to Maven Central once an official release includes both. - // Source commit, build instructions and checksum: plugins/lombok/README.md. + // Source commit, build instructions and checksum: java/lombok/README.md. method: Method::Bundled { filename: "lombok-1.18.48-openidea.2.jar", version: "1.18.48-openidea.2", - bytes: include_bytes!("../../../plugins/lombok/lombok-1.18.48-openidea.2.jar"), + bytes: include_bytes!("../../../java/lombok/lombok-1.18.48-openidea.2.jar"), }, fallback: None, version: V, diff --git a/crates/ide-tools/src/tests.rs b/crates/ide-tools/src/tests.rs index be6878be..b992f218 100644 --- a/crates/ide-tools/src/tests.rs +++ b/crates/ide-tools/src/tests.rs @@ -71,7 +71,7 @@ fn bundled_lombok_is_available_offline_and_repairs_missing_or_corrupt_files() { let env = Env::new(); let data = env.root.parent().unwrap(); let agent = managed_bundle(data, "lombok").unwrap(); - let checksum = include_str!("../../../plugins/lombok/SHA256SUMS").split_whitespace().next().unwrap(); + let checksum = include_str!("../../../java/lombok/SHA256SUMS").split_whitespace().next().unwrap(); assert_eq!(sources::sha256_file(&agent).unwrap(), checksum); for contents in [None, Some(b"incomplete jar".as_slice())] { if let Some(contents) = contents { @@ -93,7 +93,7 @@ fn concurrent_windows_get_the_same_complete_bundled_lombok() { let windows: Vec<_> = (0..8).map(|_| scope.spawn(|| managed_bundle(data, "lombok").unwrap())).collect(); let paths: Vec<_> = windows.into_iter().map(|window| window.join().unwrap()).collect(); assert!(paths.iter().all(|path| path == &paths[0])); - let checksum = include_str!("../../../plugins/lombok/SHA256SUMS").split_whitespace().next().unwrap(); + let checksum = include_str!("../../../java/lombok/SHA256SUMS").split_whitespace().next().unwrap(); assert_eq!(sources::sha256_file(&paths[0]).unwrap(), checksum); }); } diff --git a/e2e/hierarchyRefactor.spec.ts b/e2e/hierarchyRefactor.spec.ts index 2ca991c1..1c6ed491 100644 --- a/e2e/hierarchyRefactor.spec.ts +++ b/e2e/hierarchyRefactor.spec.ts @@ -1,6 +1,6 @@ /** * Pull Members Up / Push Members Down. The language server is stubbed at the IPC layer: the - * Java side is covered by plugins/java-usages/tests/hierarchy.py against a real JDT LS. + * Java side is covered by java/java-usages/tests/hierarchy.py against a real JDT LS. */ import type { Page } from "@playwright/test"; import { expect, openFromTree, test } from "./fixtures"; diff --git a/plugins/java-usages/CONFIGURATION.md b/java/java-usages/CONFIGURATION.md similarity index 96% rename from plugins/java-usages/CONFIGURATION.md rename to java/java-usages/CONFIGURATION.md index f0965bcd..11d122a0 100644 --- a/plugins/java-usages/CONFIGURATION.md +++ b/java/java-usages/CONFIGURATION.md @@ -95,10 +95,10 @@ runtime or resolve profile/precedence rules. Use the JDT LS distribution / Java version documented in [README](README.md). ```sh -python3 plugins/java-usages/build.py /path/to/jdtls -python3 plugins/java-usages/tests/configuration.py /path/to/jdtls -OPENIDEA_CONFIGURATION_STRESS=1 python3 plugins/java-usages/tests/configuration.py /path/to/jdtls -OPENIDEA_SPRING_BOOT_JAR=/path/to/spring-boot-autoconfigure.jar python3 plugins/java-usages/tests/configuration.py /path/to/jdtls +python3 java/java-usages/build.py /path/to/jdtls +python3 java/java-usages/tests/configuration.py /path/to/jdtls +OPENIDEA_CONFIGURATION_STRESS=1 python3 java/java-usages/tests/configuration.py /path/to/jdtls +OPENIDEA_SPRING_BOOT_JAR=/path/to/spring-boot-autoconfigure.jar python3 java/java-usages/tests/configuration.py /path/to/jdtls cargo test -p ide-language -p ide-lsp ``` diff --git a/plugins/java-usages/MANIFEST.MF b/java/java-usages/MANIFEST.MF similarity index 100% rename from plugins/java-usages/MANIFEST.MF rename to java/java-usages/MANIFEST.MF diff --git a/plugins/java-usages/README.md b/java/java-usages/README.md similarity index 95% rename from plugins/java-usages/README.md rename to java/java-usages/README.md index ec738cda..f5d7b242 100644 --- a/plugins/java-usages/README.md +++ b/java/java-usages/README.md @@ -78,7 +78,7 @@ Version 1.3.0 adds the class-hierarchy refactoring commands; its reproducible SH ```sh export PATH=/path/to/jdk25/bin:$PATH -python3 plugins/java-usages/build.py /path/to/jdtls +python3 java/java-usages/build.py /path/to/jdtls ``` ## Manual upgrades @@ -100,10 +100,10 @@ not rebuild this jar. A maintainer must: ## Real server verification ```sh -python3 plugins/java-usages/tests/verify.py /path/to/jdtls /path/to/lombok.jar -python3 plugins/java-usages/tests/read-write.py /path/to/jdtls /path/to/lombok.jar > /tmp/read-write.json -OPENIDEA_USAGES_INDEX_STRESS=1 python3 plugins/java-usages/tests/read-write.py /path/to/jdtls /path/to/lombok.jar > /tmp/read-write-indexed.json -python3 plugins/java-usages/tests/hierarchy.py /path/to/jdtls +python3 java/java-usages/tests/verify.py /path/to/jdtls /path/to/lombok.jar +python3 java/java-usages/tests/read-write.py /path/to/jdtls /path/to/lombok.jar > /tmp/read-write.json +OPENIDEA_USAGES_INDEX_STRESS=1 python3 java/java-usages/tests/read-write.py /path/to/jdtls /path/to/lombok.jar > /tmp/read-write-indexed.json +python3 java/java-usages/tests/hierarchy.py /path/to/jdtls ``` The harnesses select the JDT LS configuration for the current platform. The first diff --git a/plugins/java-usages/build-dependencies.sha256 b/java/java-usages/build-dependencies.sha256 similarity index 100% rename from plugins/java-usages/build-dependencies.sha256 rename to java/java-usages/build-dependencies.sha256 diff --git a/plugins/java-usages/build.py b/java/java-usages/build.py similarity index 100% rename from plugins/java-usages/build.py rename to java/java-usages/build.py diff --git a/plugins/java-usages/openidea-java-usages.jar b/java/java-usages/openidea-java-usages.jar similarity index 100% rename from plugins/java-usages/openidea-java-usages.jar rename to java/java-usages/openidea-java-usages.jar diff --git a/plugins/java-usages/plugin.xml b/java/java-usages/plugin.xml similarity index 100% rename from plugins/java-usages/plugin.xml rename to java/java-usages/plugin.xml diff --git a/plugins/java-usages/src/ai/openidea/configuration/ConfigurationCommand.java b/java/java-usages/src/ai/openidea/configuration/ConfigurationCommand.java similarity index 100% rename from plugins/java-usages/src/ai/openidea/configuration/ConfigurationCommand.java rename to java/java-usages/src/ai/openidea/configuration/ConfigurationCommand.java diff --git a/plugins/java-usages/src/ai/openidea/hierarchy/HierarchyCommand.java b/java/java-usages/src/ai/openidea/hierarchy/HierarchyCommand.java similarity index 100% rename from plugins/java-usages/src/ai/openidea/hierarchy/HierarchyCommand.java rename to java/java-usages/src/ai/openidea/hierarchy/HierarchyCommand.java diff --git a/plugins/java-usages/src/ai/openidea/usages/UsageAccess.java b/java/java-usages/src/ai/openidea/usages/UsageAccess.java similarity index 100% rename from plugins/java-usages/src/ai/openidea/usages/UsageAccess.java rename to java/java-usages/src/ai/openidea/usages/UsageAccess.java diff --git a/plugins/java-usages/src/ai/openidea/usages/UsagesCommand.java b/java/java-usages/src/ai/openidea/usages/UsagesCommand.java similarity index 100% rename from plugins/java-usages/src/ai/openidea/usages/UsagesCommand.java rename to java/java-usages/src/ai/openidea/usages/UsagesCommand.java diff --git a/plugins/java-usages/tests/REPRODUCE.md b/java/java-usages/tests/REPRODUCE.md similarity index 98% rename from plugins/java-usages/tests/REPRODUCE.md rename to java/java-usages/tests/REPRODUCE.md index aad80dc6..7dc2d013 100644 --- a/plugins/java-usages/tests/REPRODUCE.md +++ b/java/java-usages/tests/REPRODUCE.md @@ -73,7 +73,7 @@ checks cancellation. No Maven download is needed for this harness. ```sh export PATH=/path/to/jdk25/bin:$PATH -python3 plugins/java-usages/tests/read-write.py /path/to/jdtls /path/to/lombok.jar > /tmp/read-write.json +python3 java/java-usages/tests/read-write.py /path/to/jdtls /path/to/lombok.jar > /tmp/read-write.json ``` Then launch the desktop app with `pnpm tauri dev` and open the same Java/Lombok diff --git a/plugins/java-usages/tests/ReadWrite.java b/java/java-usages/tests/ReadWrite.java similarity index 100% rename from plugins/java-usages/tests/ReadWrite.java rename to java/java-usages/tests/ReadWrite.java diff --git a/plugins/java-usages/tests/configuration.py b/java/java-usages/tests/configuration.py similarity index 100% rename from plugins/java-usages/tests/configuration.py rename to java/java-usages/tests/configuration.py diff --git a/plugins/java-usages/tests/hierarchy.py b/java/java-usages/tests/hierarchy.py similarity index 100% rename from plugins/java-usages/tests/hierarchy.py rename to java/java-usages/tests/hierarchy.py diff --git a/plugins/java-usages/tests/read-write.py b/java/java-usages/tests/read-write.py similarity index 100% rename from plugins/java-usages/tests/read-write.py rename to java/java-usages/tests/read-write.py diff --git a/plugins/java-usages/tests/verify.py b/java/java-usages/tests/verify.py similarity index 100% rename from plugins/java-usages/tests/verify.py rename to java/java-usages/tests/verify.py diff --git a/plugins/kotlin-bridge/MANIFEST.MF b/java/kotlin-bridge/MANIFEST.MF similarity index 100% rename from plugins/kotlin-bridge/MANIFEST.MF rename to java/kotlin-bridge/MANIFEST.MF diff --git a/plugins/kotlin-bridge/README.md b/java/kotlin-bridge/README.md similarity index 94% rename from plugins/kotlin-bridge/README.md rename to java/kotlin-bridge/README.md index a1eb4bf2..afc2ee41 100644 --- a/plugins/kotlin-bridge/README.md +++ b/java/kotlin-bridge/README.md @@ -47,8 +47,8 @@ for the JDT command and Java 8 target for the Maven participant. Use Java 25 to run the build compiler. Archive order and timestamps are deterministic. ```sh -python3 plugins/kotlin-bridge/build.py /path/to/jdtls /path/to/maven -shasum -a 256 plugins/kotlin-bridge/openidea-kotlin-bridge.jar +python3 java/kotlin-bridge/build.py /path/to/jdtls /path/to/maven +shasum -a 256 java/kotlin-bridge/openidea-kotlin-bridge.jar ``` Committed jar SHA-256: @@ -61,7 +61,7 @@ data directory, and includes it in JDT LS initialization bundles. ```sh # `java` on PATH must satisfy JDT LS; JAVA_HOME selects Maven's project JDK. -JAVA_HOME=/path/to/project/jdk python3 plugins/kotlin-bridge/tests/verify.py /path/to/jdtls +JAVA_HOME=/path/to/project/jdk python3 java/kotlin-bridge/tests/verify.py /path/to/jdtls ``` Requires Maven on PATH and access to Kotlin 2.0.10 and the fixture's Maven diff --git a/plugins/kotlin-bridge/build-dependencies.sha256 b/java/kotlin-bridge/build-dependencies.sha256 similarity index 100% rename from plugins/kotlin-bridge/build-dependencies.sha256 rename to java/kotlin-bridge/build-dependencies.sha256 diff --git a/plugins/kotlin-bridge/build.py b/java/kotlin-bridge/build.py similarity index 100% rename from plugins/kotlin-bridge/build.py rename to java/kotlin-bridge/build.py diff --git a/plugins/kotlin-bridge/components.xml b/java/kotlin-bridge/components.xml similarity index 100% rename from plugins/kotlin-bridge/components.xml rename to java/kotlin-bridge/components.xml diff --git a/plugins/kotlin-bridge/maven/ai/openidea/kotlin/IsolatedOutput.java b/java/kotlin-bridge/maven/ai/openidea/kotlin/IsolatedOutput.java similarity index 100% rename from plugins/kotlin-bridge/maven/ai/openidea/kotlin/IsolatedOutput.java rename to java/kotlin-bridge/maven/ai/openidea/kotlin/IsolatedOutput.java diff --git a/plugins/kotlin-bridge/openidea-kotlin-bridge.jar b/java/kotlin-bridge/openidea-kotlin-bridge.jar similarity index 100% rename from plugins/kotlin-bridge/openidea-kotlin-bridge.jar rename to java/kotlin-bridge/openidea-kotlin-bridge.jar diff --git a/plugins/kotlin-bridge/plugin.xml b/java/kotlin-bridge/plugin.xml similarity index 100% rename from plugins/kotlin-bridge/plugin.xml rename to java/kotlin-bridge/plugin.xml diff --git a/plugins/kotlin-bridge/src/ai/openidea/kotlin/KotlinLibraries.java b/java/kotlin-bridge/src/ai/openidea/kotlin/KotlinLibraries.java similarity index 100% rename from plugins/kotlin-bridge/src/ai/openidea/kotlin/KotlinLibraries.java rename to java/kotlin-bridge/src/ai/openidea/kotlin/KotlinLibraries.java diff --git a/plugins/kotlin-bridge/tests/verify.py b/java/kotlin-bridge/tests/verify.py similarity index 100% rename from plugins/kotlin-bridge/tests/verify.py rename to java/kotlin-bridge/tests/verify.py diff --git a/plugins/lombok/LICENSE b/java/lombok/LICENSE similarity index 100% rename from plugins/lombok/LICENSE rename to java/lombok/LICENSE diff --git a/plugins/lombok/README.md b/java/lombok/README.md similarity index 97% rename from plugins/lombok/README.md rename to java/lombok/README.md index 33b513f5..4959509c 100644 --- a/plugins/lombok/README.md +++ b/java/lombok/README.md @@ -52,7 +52,7 @@ git fetch https://github.com/Rawi01/lombok.git eclipse-constructor-call-statemen git cherry-pick 2d535482a913de46c27d06c5b0b294918ede3f9c 3098f4dd78b5349c2f382e7310e64db810dd380b git cherry-pick 7832faa49b35c839088866daf865384c82cd555f 3f3a80b857a969839ab1baba12767aec4965ac32 ant dist -cp dist/lombok.jar /path/to/openidea/plugins/lombok/lombok-1.18.48-openidea.2.jar +cp dist/lombok.jar /path/to/openidea/java/lombok/lombok-1.18.48-openidea.2.jar ``` The changelog context conflicts because the first commit adds a release-note line under the @@ -96,7 +96,7 @@ On macOS arm64 with JDT LS 1.63.0 / Equinox 3.25.0, server OpenJDK 25 and projec programs ran with identical output, and `@NonNull` checks run after the constructor call again. - Real JDT LS `java/buildWorkspace(true)` of the same sources with the agent: `openidea.1` reported Failed with three internal errors and wrote no classes; `openidea.2` Succeeded with all classes. -- `plugins/java-usages/tests/verify.py` and `read-write.py` passed with `openidea.2`. +- `java/java-usages/tests/verify.py` and `read-write.py` passed with `openidea.2`. Windows and Linux runtime validation has not been performed. Rust tests cover source selection for both supported architectures on all three OS variants, offline provisioning, corruption diff --git a/plugins/lombok/SHA256SUMS b/java/lombok/SHA256SUMS similarity index 100% rename from plugins/lombok/SHA256SUMS rename to java/lombok/SHA256SUMS diff --git a/plugins/lombok/lombok-1.18.48-openidea.2.jar b/java/lombok/lombok-1.18.48-openidea.2.jar similarity index 100% rename from plugins/lombok/lombok-1.18.48-openidea.2.jar rename to java/lombok/lombok-1.18.48-openidea.2.jar