vscode-file-templates-ext icon indicating copy to clipboard operation
vscode-file-templates-ext copied to clipboard

Allow multiple variables

Open taylonr opened this issue 7 years ago • 2 comments

If the template file has multiple variable declarations, the user was only asked to supply the last variable. Because only one variable was asked to be defined, the Promise.all never gets resolved and the file doesn't get created.

By extracting to a recursive function, the user will now be prompted to enter a value for every variable, and only after they're all supplied will the file be written.

An example template file used to test this:

#{another_test}
function a() {
    #{test1}

    #{test2}
    var z = 1;
    var y = 2;
    var x = z;
    let b = x + y;
    console.log(b);
    return b;
}

taylonr avatar Apr 02 '17 23:04 taylonr

Thanks @taylonr, I'll test it as I'm having exactly the same problem

brunetton avatar Feb 26 '18 11:02 brunetton

Is there any excepted date to the next release with this feature?

alexnum avatar Mar 28 '18 20:03 alexnum