Skip to content

Commit 327c89a

Browse files
authored
exthost: preserve worker name when creating nested workers (microsoft#204169)
This allows js-debug to identify which workers should be debugged Fixes microsoft#204114, along with corresponding js-debug tweaks
1 parent 2b9070c commit 327c89a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/vs/workbench/api/worker/extensionHostWorker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { URI } from 'vs/base/common/uri';
2121
//#region --- Define, capture, and override some globals
2222

2323
declare function postMessage(data: any, transferables?: Transferable[]): void;
24-
24+
declare const name: string; // https://developer.mozilla.org/en-US/docs/Web/API/DedicatedWorkerGlobalScope/name
2525
declare type _Fetch = typeof fetch;
2626

2727
declare namespace self {
@@ -137,7 +137,7 @@ if ((<any>self).Worker) {
137137

138138
const js = `(${bootstrapFnSource}('${stringUrl}'))`;
139139
options = options || {};
140-
options.name = options.name || path.basename(stringUrl.toString());
140+
options.name = `${name} -> ${options.name || path.basename(stringUrl.toString())}`;
141141
const blob = new Blob([js], { type: 'application/javascript' });
142142
const blobUrl = URL.createObjectURL(blob);
143143
return new _Worker(blobUrl, options);

0 commit comments

Comments
 (0)