Skip to content

Commit 9f3a6ff

Browse files
committed
Extension Development Host window doesn't matching window
1 parent 1fd399e commit 9f3a6ff

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

src/vs/code/electron-main/windows.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,12 +1151,12 @@ export class WindowsManager implements IWindowsMainService {
11511151
return { openFolderInNewWindow: !!openFolderInNewWindow, openFilesInNewWindow };
11521152
}
11531153

1154-
openExtensionDevelopmentHostWindow(openConfig: IOpenConfiguration): void {
1154+
openExtensionDevelopmentHostWindow(extensionDevelopmentPath: string, openConfig: IOpenConfiguration): void {
11551155

11561156
// Reload an existing extension development host window on the same path
11571157
// We currently do not allow more than one extension development window
11581158
// on the same extension path.
1159-
const existingWindow = openConfig.cli.extensionDevelopmentPath && findWindowOnExtensionDevelopmentPath(WindowsManager.WINDOWS, openConfig.cli.extensionDevelopmentPath);
1159+
const existingWindow = findWindowOnExtensionDevelopmentPath(WindowsManager.WINDOWS, extensionDevelopmentPath);
11601160
if (existingWindow) {
11611161
this.reload(existingWindow, openConfig.cli);
11621162
existingWindow.focus(); // make sure it gets focus and is restored
@@ -1205,6 +1205,12 @@ export class WindowsManager implements IWindowsMainService {
12051205
openConfig.cli['folder-uri'] = folderUris;
12061206
openConfig.cli['file-uri'] = fileUris;
12071207

1208+
const match = extensionDevelopmentPath.match(/^vscode-remote:\/\/([^\/]+)/);
1209+
if (match) {
1210+
openConfig.cli['remote'] = match[1];
1211+
console.log(match[1]);
1212+
}
1213+
12081214
// Open it
12091215
this.open({ context: openConfig.context, cli: openConfig.cli, forceNewWindow: true, forceEmpty: !cliArgs.length && !folderUris.length && !fileUris.length, userEnv: openConfig.userEnv });
12101216
}

src/vs/platform/launch/electron-main/launchService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export class LaunchService implements ILaunchService {
165165

166166
// Special case extension development
167167
if (!!args.extensionDevelopmentPath) {
168-
this.windowsMainService.openExtensionDevelopmentHostWindow({ context, cli: args, userEnv });
168+
this.windowsMainService.openExtensionDevelopmentHostWindow(args.extensionDevelopmentPath, { context, cli: args, userEnv });
169169
}
170170

171171
// Start without file/folder arguments

src/vs/platform/windows/electron-main/windows.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export interface IWindowsMainService {
9797
enterWorkspace(win: ICodeWindow, path: URI): Promise<IEnterWorkspaceResult | undefined>;
9898
closeWorkspace(win: ICodeWindow): void;
9999
open(openConfig: IOpenConfiguration): ICodeWindow[];
100-
openExtensionDevelopmentHostWindow(openConfig: IOpenConfiguration): void;
100+
openExtensionDevelopmentHostWindow(extensionDevelopmentPath: string, openConfig: IOpenConfiguration): void;
101101
pickFileFolderAndOpen(options: INativeOpenDialogOptions): void;
102102
pickFolderAndOpen(options: INativeOpenDialogOptions): void;
103103
pickFileAndOpen(options: INativeOpenDialogOptions): void;

0 commit comments

Comments
 (0)