Can I have multiple variables?
Opened this issue · 3 comments
Hi extension works fine. I want to add more that one variables can it be possible right now if something like this it only asks for one variable.
import React, {Component} from 'react';
import {View, Text} from 'react-native';
class #{component_name} extends Component {
render() {
return (
<View>
<Text>#{label_name}</Text>
</View>
);
}
}
export default #{component_name};
I think this is a vscode bug, extension itself has support for multiple placeholders but the vscode.window.showInputBox command doesn't play nice when in Promise chain (only the first input is shown for some reason).
The only way I've managed to get around that is by having input accept all the variables at once (enter the substitution words separated by space)
Here is a gist that fixes multiple variables (fileFromTemplateCommand.js) https://gist.github.com/avionbg/b268b764ddae16a1dcb7aaf352059989
Thanks for this gist.
Wouldn't it be possible to ask variables one by one ?
- when there's many variables, this is hard to visually match "what variable am I filling ? Where am I in the list ?"
- how to enter variables values with spaces ?
For some reason when I was playing with it that didn't work as expected. If you would have multiple variables, they would be chained with promises, and that didn't work.. only the first input was shown.