message

用于展示提示性消息,出现在编辑器右下角,而不是顶部或右上角。

console类似,提供了普通消息、警告消息、错误消息。

vscode.window.showInformationMessage('普通消息');
vscode.window.showWarningMessage('警告消息');
vscode.window.showErrorMessage('错误消息');

消息也支持交互按钮,当选中按钮时返回的是按钮本身:

vscode.window.showErrorMessage(`与starling的远程交互依赖vscode-starling.sid配置项`, '打开配置项').then(selection => {
  if (selection === '打开配置项') {
    vscode.commands.executeCommand('workbench.action.openSettings');
  }
});

© 2017~ 随风逐叶 all right reserved,powered by Gitbook文章修订时间: 2021-10-20 16:11:46

results matching ""

    No results matching ""