Skip to content

Commit

Permalink
Merge pull request microsoft#96211 from microsoft/weinand-patch-95957
Browse files Browse the repository at this point in the history
selectively propagate debugging arguments for payload
  • Loading branch information
weinand authored Apr 27, 2020
2 parents 18528b3 + 329b0a0 commit cfa8b26
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions src/vs/workbench/services/host/browser/browserHostService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,34 @@ export class BrowserHostService extends Disposable implements IHostService {
const openable = toOpen[i];
openable.label = openable.label || this.getRecentLabel(openable);

// selectively copy payload: for now only extension debugging properties are considered
const originalPayload = this.workspaceProvider.payload;
let newPayload: Array<unknown> | undefined = undefined;
if (originalPayload && Array.isArray(originalPayload)) {
for (let pair of originalPayload) {
if (Array.isArray(pair) && pair.length === 2) {
switch (pair[0]) {
case 'extensionDevelopmentPath':
case 'debugId':
case 'inspect-brk-extensions':
if (!newPayload) {
newPayload = new Array();
}
newPayload.push(pair);
break;
}
}
}
}

// Folder
if (isFolderToOpen(openable)) {
this.workspaceProvider.open({ folderUri: openable.folderUri }, { reuse: this.shouldReuse(options, false /* no file */) });
this.workspaceProvider.open({ folderUri: openable.folderUri }, { reuse: this.shouldReuse(options, false /* no file */), payload: newPayload });
}

// Workspace
else if (isWorkspaceToOpen(openable)) {
this.workspaceProvider.open({ workspaceUri: openable.workspaceUri }, { reuse: this.shouldReuse(options, false /* no file */) });
this.workspaceProvider.open({ workspaceUri: openable.workspaceUri }, { reuse: this.shouldReuse(options, false /* no file */), payload: newPayload });
}

// File
Expand Down

0 comments on commit cfa8b26

Please sign in to comment.