How to create a custom dialog in vscode?

隐身守侯 提交于 2020-01-01 04:28:05

问题


I'm developing an extension for vscode, and I want to display a custom dialog to help the user configure an ini file.
It's possible to create a custom dialog, with labels and inputs?


回答1:


You cannot create new UI elements, but if you want to get inputs from the user you can use code like below:

let options: InputBoxOptions = {
    prompt: "Label: ",
    placeHolder: "(placeholder)"
}

window.showInputBox(options).then(value => {
    if (!value) return;
    answer1 = value;
    // show the next dialog, etc.
});

This will use the same UI as the command palette (when you press Ctrl+P, or any of the other commands that open the input box at the top).



来源:https://stackoverflow.com/questions/39481386/how-to-create-a-custom-dialog-in-vscode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!