【发布时间】:2019-04-04 01:30:30
【问题描述】:
我正在尝试创建一个文件作为我扩展程序中命令之一的一部分,但似乎无法正确完成。
let wsedit = new vscode.WorkspaceEdit();
const file_path = vscode.Uri.file(value + '/' + value + '.md');
vscode.window.showInformationMessage(file_path.toString());
wsedit.createFile(file_path, {ignoreIfExists: true});
vscode.workspace.applyEdit(wsedit);
vscode.window.showInformationMessage('Created a new file: ' value + '/' + value + '.md);
value 是用户输入的字符串。代码执行,但据我所知,没有创建文件。如何正确创建文件?
【问题讨论】:
标签: visual-studio-code vscode-extensions