Skip to content

Mark non-required inputs as resolved if all required inputs are resolved #317

Open
@imagejan

Description

@imagejan

As reported by @cniedwor, see this discussion on the forum.

Consider the following Groovy script:

#@ ScriptService scripts

script = """
\n#@ String (required = true, persist = false) text1
\n#@ String (value = "not required", required = false, persist = false) text2

println text1
println text2
"""

scripts.run("Foo.groovy", script, true).get() // displays dialog, as expected
scripts.run("Foo.groovy", script, true, ["text1": "Bar"]).get() // should not display dialog
scripts.run("Foo.groovy", script, true, ["text1": "Bar", "text2": "Really?"]).get() // doesn't display, as expected

null

To be consistent with IJ1 macro behavior (where default parameters get automatically filled when not included in an option string of run("Some Plugin", "")), the second scripts.run call in the above script should not display a dialog.

We need some logic to mark all remaining (non-required) inputs as resolved as soon as all required inputs are resolved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions