提交 60595b62 编写于 作者: M Martin Aeschlimann

CLI: --add stops working. Fixes #68595

上级 9b5c1277
......@@ -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));
}
......
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册