Skip to content

Conversation

@ScottCarda-MS
Copy link
Contributor

@ScottCarda-MS ScottCarda-MS commented Sep 30, 2025

Adds a Refactor Code Action for creating parameterless wrappers for operations that have parameters. The wrapper will assign default values to each of the parameters, where it can, and call the original operation with those defaults, encouraging the user to fill in their desired values for these parameters.

For example:

operation Bar<'T>(q1 : Qubit, q2 : (Qubit, Qubit[]), d : Double, g : 'T) : Unit { ... }

will produce a wrapper:

operation BarWithDefaults() : Unit {
    // TODO: Fill out the values for the parameters
    use q1 = Qubit();
    use q2_q0 = Qubit();
    use q2_qs0 = Qubit[1];
    let q2 = (q2_q0, q2_qs0);
    let d = 0.0;
    // TODO: provide value for g (Generic parameter 'T)

    // Call original operation
    Bar(q1, q2, d, _);
}

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

devskim found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@ScottCarda-MS ScottCarda-MS changed the title Sccarda/circuit code action Code Action for Parameterless Wrappers Sep 30, 2025
@ScottCarda-MS ScottCarda-MS marked this pull request as ready for review September 30, 2025 22:25
@ScottCarda-MS ScottCarda-MS added this pull request to the merge queue Oct 6, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Oct 7, 2025
@ScottCarda-MS ScottCarda-MS added this pull request to the merge queue Oct 7, 2025
Merged via the queue into main with commit adb6682 Oct 7, 2025
18 checks passed
@ScottCarda-MS ScottCarda-MS deleted the sccarda/CircuitCodeAction branch October 7, 2025 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants