我的要求其實很簡單,我想寫一個文件並在vscode中打開它。但我不能得到這個工作:VSCode擴展寫入和打開文件
var content = rec[rt.fields[field]];
var filePath = path.join(vscode.workspace.rootPath, selected.label + '.' + field);
fs.writeFileSync(filePath, content, 'utf8');
var openPath = vscode.Uri.parse(filePath);
vscode.workspace.openTextDocument(openPath).then(doc => {
vscode.window.showTextDocument(doc);
});
我收到以下錯誤信息,而且不知道什麼應該意味着:
無法打開C:%5CUsers%5Cmak%5C.sneditor %5Csoftpointdev1.service-now.com%5CRMCostPlanHelper.js。詳細信息:沒有使用uri'c:%5CUsers%5Cmak%5C.sneditor%5Csoftpointdev1.service-now.com%5CRMCostPlanHelper.js'的模型,也不是方案'c'的解析器。