提交 86814043 编写于 作者: M Martin Aeschlimann

`vscode.openFolder`: treat missing URI schema gracefully (for #55891)

上级 b133355c
......@@ -49,7 +49,8 @@ export class OpenFolderAPICommand {
return executor.executeCommand('_files.pickFolderAndOpen', forceNewWindow);
}
if (!uri.scheme) {
throw new Error(`Invalid URI, schema required: '${uri.toString()}'.`);
console.warn('`vscode.openFolder` command invoked with an invalid URI (scheme missing): `${uri}`. Converted to a `file://` URI.');
uri = URI.file(uri.fsPath);
}
return executor.executeCommand('_files.windowOpen', [uri], forceNewWindow);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册