Файли
openidea/plugins/official/container-runner
Ainul YaqinтаAkin01 e08531c458 feat(plugins): project-scoped debounce and supersession for plugin refresh work (API 1.18) (#5002)
events.subscribe-paths-with-options adds an optional debounce-ms (up to 5 s) that coalesces files-changed deltas on the host, so bursts of edits don't run a plugin's discovery again and again. workspace.project.generation returns a project's state generation, which moves on every file change; FilesChanged carries the project root and generation. Registering run targets or run configurations computed for a superseded generation fails with Error::Stale. A new project-closed event tells subscribed plugins a project closed after its queued events are dropped and its run targets and configurations are withdrawn.

On top of the contributor's work: closing one project no longer cancels a plugin instance's in-flight work for other projects (an instance serves every project; results for the closed one are refused because its generation moved on), the generation is bumped on close, the generation is attached only for plugins declaring API 1.18 so older plugins' registrations are never refused, and the API now ships as part of 1.18 with the components rebuilt.

Closes #4760

Co-authored-by: Akin01 <[email protected]>
2026-11-26 20:41:06 +08:00
..
2026-11-09 08:40:40 +08:00

container-runner — API 1.4 example

Put this directory on PATH before installing/granting the plugin, so process:openidea-example-wrapper resolves to the included executable. Run Example: Register Container Wrapper in a trusted project. It registers a project run target, opens a keyed terminal, writes an Output channel and sets a window status item. The owned terminal-exited event updates that window. Disable withdraws the target; terminal/output lifetimes follow the host rules. The fake wrapper just executes argv locally and exits its demo terminal.

To adapt it to DDEV, declare process:ddev, change program to ddev, args to ["exec"], and use command overrides such as ("composer", ["composer"]). For Lando declare process:lando and supply its CLI's command prefixes. Only approved executables run; selecting one in Settings › Plugins reapproves/pins it. No shell command strings are evaluated. For mapped working directories set container_root and workdir_args using your wrapper's documented argv convention (for example --cwd {cwd}), or let the wrapper manage cwd. Environment forwarding also belongs to that wrapper.

Build from the repository root:

plugins/build.sh official/container-runner
cargo test --manifest-path plugins/official/container-runner/Cargo.toml
cargo run -p ide-host --bin openidea-plugin -- check plugins/official/container-runner

Install the built package folder through Settings › Plugins › Install from Disk. See the plugin guide and official/community policy.

On Windows, supply an equivalent approved executable; the included demo script requires a POSIX shell. The host API itself is cross-platform.