Open workspace from vscode:// url (fix #133976)

This commit is contained in:
Benjamin Pasero
2021-09-28 12:37:06 +02:00
parent 7e10fab4fd
commit bce732b7fc

View File

@@ -846,9 +846,13 @@ export class CodeApplication extends Disposable {
// File path
if (uri.authority === Schemas.file) {
// we configure as fileUri, but later validation will
// make sure to open as folder or workspace if possible
return { fileUri: URI.file(uri.fsPath) };
const fileUri = URI.file(uri.fsPath);
if (hasWorkspaceFileExtension(fileUri)) {
return { workspaceUri: fileUri };
}
return { fileUri };
}
// Remote path
@@ -864,11 +868,14 @@ export class CodeApplication extends Disposable {
if (hasWorkspaceFileExtension(path)) {
return { workspaceUri: remoteUri };
} else if (/:[\d]+$/.test(path)) { // path with :line:column syntax
return { fileUri: remoteUri };
} else {
return { folderUri: remoteUri };
}
if (/:[\d]+$/.test(path)) {
// path with :line:column syntax
return { fileUri: remoteUri };
}
return { folderUri: remoteUri };
}
}