@@ -715,6 +715,7 @@ or removing a command fails until the table changes in the same commit.
715715| ` runConfig.editorForm ` | Describe the editor fields and current values of a built-in run configuration |
716716| ` runConfig.saveConfiguration ` | Validate an editor form's values and return field errors or the file changes that save it |
717717| ` runConfig.deleteConfiguration ` | Return the file changes that delete a saved user configuration |
718+ | ` runConfig.beforeLaunch ` | Expand the built-in process runs a configuration starts first, and say whether the user must confirm them |
718719| ` runConfig.createLaunchPlan ` | Project one effective configuration into a platform-neutral Run or Debug plan |
719720| ` runConfig.providerLaunchInputs ` | Resolve user choices for a provider-owned launch |
720721| ` git.status ` | Resolve the repository, current branch, and working-tree changes |
@@ -3885,6 +3886,57 @@ extension namespaces the editor does not show are kept.
38853886returns ` {changes} ` that remove the saved ` user: ` configuration from every layer.
38863887Generated entries cannot be deleted.
38873888
3889+ #### Steps before launch
3890+
3891+ A configuration of any provider may name ` beforeLaunch ` , an ordered list of at
3892+ most 16 ` {configuration} ` steps. Each step is the ID of a built-in process run
3893+ of the same project, which starts and must exit with 0 before the next step,
3894+ and the configuration itself, starts (IntelliJ IDEA's "Before launch: Run
3895+ Another Configuration"). A shell script that compiles a module or a program
3896+ that generates sources is saved as a process run and named as a step, so a step
3897+ has the interpreter, arguments, working directory, environment and launch plan
3898+ a process run already has. A layer replaces the whole list: an empty list in the
3899+ local layer hides the steps the project layer names. A step that names the
3900+ configuration itself makes the configuration unavailable
3901+ (` invalidConfiguration ` ); a step whose target is missing or cannot run is
3902+ reported when the configuration starts, so the list still resolves.
3903+
3904+ ` runConfig.beforeLaunch ` accepts ` {root, configurationId, localDocument?} ` and
3905+ replies ` {status: "ok", steps, confirmation} ` or `{status: "rejected", refusal:
3906+ {code, configurationId}}` . ` steps` are the runs to start, in order, each
3907+ ` {configurationId, name, summary} ` ; ` summary ` is one line naming what it starts
3908+ (the program or script and its arguments) for the confirmation. A step whose run
3909+ names steps of its own starts them first, as starting that run alone would; at
3910+ most 32 steps are expanded. ` refusal.code ` is ` notFound ` (no such
3911+ configuration), ` notAllowed ` (not a built-in process run), ` unavailable ` (the
3912+ run cannot start, see its ` availability ` ), ` cycle ` (a step leads back to a
3913+ configuration being started) or ` tooLong ` ; ` configurationId ` names the step.
3914+
3915+ ` confirmation ` is ` {fingerprint} ` when the project layer names any of the
3916+ expanded lists, and ` null ` otherwise. Those steps run code from the repository
3917+ that nobody chose on this machine, so the host asks the user before running
3918+ them, showing each step's name and summary, and remembers the fingerprint per
3919+ project in its own storage, never in the project. The fingerprint is a SHA-256
3920+ over the lists and the definitions of the runs they start, so changing either
3921+ asks again; it does not cover the contents of a script file a step runs. A list
3922+ the local layer names, including one that starts runs the project defines, was
3923+ chosen on this machine and needs no confirmation. The host runs each step
3924+ through ` runConfig.createLaunchPlan ` , writes its output to the console of the
3925+ configuration that starts, stops it with that configuration, and does not start
3926+ the configuration when a step fails or is stopped. Run and Debug both run the
3927+ steps.
3928+
3929+ ` runConfig.editorForm ` adds a ` beforeLaunch ` field to every process run with
3930+ ` candidates: [{id, name}] ` , the runnable process runs other than the edited one;
3931+ its value is the list of IDs. ` runConfig.saveConfiguration ` checks it like
3932+ ` runConfig.beforeLaunch ` and reports ` {field: "beforeLaunch", code} ` with
3933+ ` notFound ` , ` notAllowed ` , ` unavailable ` , ` conflict ` (a cycle) or ` tooLong ` .
3934+ ` runConfig.updateOptions ` and ` runConfig.saveEditorChanges ` accept an optional
3935+ ` beforeLaunch ` list of IDs for any configuration: omission keeps the saved
3936+ steps, an empty list removes them from the edited layer (and in the local layer
3937+ hides the project's), and a list that cannot run is ` invalid_request ` with
3938+ ` beforeLaunch: <code> ` in the details.
3939+
38883940` runConfig.createLaunchPlan ` accepts ` root ` , ` configurationId ` , optional
38893941` localDocument ` and optional ` inlineScriptBase ` . It resolves the configuration
38903942through the same layers and rejects a missing, disabled or unavailable one.
0 commit comments