Reputation:
How do you ask for a user input and store it in a variable in VSCode Extension? For example, something like below (I know it does not work)
const userResponse = vscode.window.input("Type in your response")
Upvotes: 0
Views: 1798
Reputation: 29337
You can use window.showInputBox
.
import { window } from 'vscode';
const userResponse = await window.showInputBox({
placeHolder: 'Type in your response'
});
console.log(userResponse);
Upvotes: 1