From 60595b62854f3b6452398e88bfceee2ff88da94e Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Wed, 13 Feb 2019 22:15:56 +0100 Subject: [PATCH] CLI: --add stops working. Fixes #68595 --- src/vs/code/electron-main/windows.ts | 4 ++-- src/vs/platform/remote/common/remoteHosts.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/code/electron-main/windows.ts b/src/vs/code/electron-main/windows.ts index a74632ce0f2..4e4f11e7026 100644 --- a/src/vs/code/electron-main/windows.ts +++ b/src/vs/code/electron-main/windows.ts @@ -511,7 +511,7 @@ export class WindowsManager implements IWindowsMainService { // Handle folders to add by looking for the last active workspace (not on initial startup) if (!openConfig.initialStartup && foldersToAdd.length > 0) { const authority = getRemoteAuthority(foldersToAdd[0]); - const lastActiveWindow = authority ? this.getLastActiveWindowForAuthority(authority) : undefined; + const lastActiveWindow = this.getLastActiveWindowForAuthority(authority); if (lastActiveWindow) { usedWindows.push(this.doAddFoldersToExistingWindow(lastActiveWindow, foldersToAdd)); } @@ -1550,7 +1550,7 @@ export class WindowsManager implements IWindowsMainService { return getLastActiveWindow(WindowsManager.WINDOWS); } - getLastActiveWindowForAuthority(remoteAuthority: string): ICodeWindow | undefined { + getLastActiveWindowForAuthority(remoteAuthority: string | undefined): ICodeWindow | undefined { return getLastActiveWindow(WindowsManager.WINDOWS.filter(w => w.remoteAuthority === remoteAuthority)); } diff --git a/src/vs/platform/remote/common/remoteHosts.ts b/src/vs/platform/remote/common/remoteHosts.ts index 0114939f09b..77f32902f72 100644 --- a/src/vs/platform/remote/common/remoteHosts.ts +++ b/src/vs/platform/remote/common/remoteHosts.ts @@ -7,6 +7,6 @@ import { URI } from 'vs/base/common/uri'; export const REMOTE_HOST_SCHEME = 'vscode-remote'; -export function getRemoteAuthority(uri: URI) { +export function getRemoteAuthority(uri: URI): string | undefined { return uri.scheme === REMOTE_HOST_SCHEME ? uri.authority : undefined; } \ No newline at end of file -- GitLab