diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts index b5789b0a3a1..06e27d5d39b 100644 --- a/src/vs/code/electron-main/app.ts +++ b/src/vs/code/electron-main/app.ts @@ -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 }; } }