mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
vscode.openFolder: treat missing URI schema gracefully (for #55891)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user