Skip to content

Commit c21ca53

Browse files
author
Benjamin Pasero
committed
web - remove legacy environment support
1 parent 6e18f02 commit c21ca53

2 files changed

Lines changed: 0 additions & 95 deletions

File tree

src/vs/workbench/contrib/debug/browser/extensionHostDebugService.ts

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,6 @@ class BrowserExtensionHostDebugService extends ExtensionHostDebugChannelClient i
6565

6666
openExtensionDevelopmentHostWindow(args: string[], env: IProcessEnvironment): Promise<void> {
6767

68-
if (!this.workspaceProvider.payload) {
69-
// TODO@Ben remove me once environment is adopted
70-
return this.openExtensionDevelopmentHostWindowLegacy(args);
71-
}
72-
7368
// Find out which workspace to open debug window on
7469
let debugWorkspace: IWorkspace = undefined;
7570
const folderUriArg = this.findArgument('folder-uri', args);
@@ -117,66 +112,6 @@ class BrowserExtensionHostDebugService extends ExtensionHostDebugChannelClient i
117112
});
118113
}
119114

120-
private openExtensionDevelopmentHostWindowLegacy(args: string[]): Promise<void> {
121-
// we pass the "args" as query parameters of the URL
122-
123-
let newAddress = `${document.location.origin}${document.location.pathname}?`;
124-
let gotFolder = false;
125-
126-
const addQueryParameter = (key: string, value: string) => {
127-
const lastChar = newAddress.charAt(newAddress.length - 1);
128-
if (lastChar !== '?' && lastChar !== '&') {
129-
newAddress += '&';
130-
}
131-
newAddress += `${key}=${encodeURIComponent(value)}`;
132-
};
133-
134-
const findArgument = (key: string) => {
135-
for (let a of args) {
136-
const k = `--${key}=`;
137-
if (a.indexOf(k) === 0) {
138-
return a.substr(k.length);
139-
}
140-
}
141-
return undefined;
142-
};
143-
144-
const f = findArgument('folder-uri');
145-
if (f) {
146-
const u = URI.parse(f);
147-
gotFolder = true;
148-
addQueryParameter('folder', u.path);
149-
}
150-
if (!gotFolder) {
151-
// request empty window
152-
addQueryParameter('ew', 'true');
153-
}
154-
155-
const ep = findArgument('extensionDevelopmentPath');
156-
if (ep) {
157-
addQueryParameter('extensionDevelopmentPath', ep);
158-
}
159-
160-
const etp = findArgument('extensionTestsPath');
161-
if (etp) {
162-
addQueryParameter('extensionTestsPath', etp);
163-
}
164-
165-
const di = findArgument('debugId');
166-
if (di) {
167-
addQueryParameter('debugId', di);
168-
}
169-
170-
const ibe = findArgument('inspect-brk-extensions');
171-
if (ibe) {
172-
addQueryParameter('inspect-brk-extensions', ibe);
173-
}
174-
175-
window.open(newAddress);
176-
177-
return Promise.resolve();
178-
}
179-
180115
private findArgument(key: string, args: string[]): string | undefined {
181116
for (const a of args) {
182117
const k = `--${key}=`;

src/vs/workbench/services/environment/browser/environmentService.ts

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -308,36 +308,6 @@ export class BrowserWorkbenchEnvironmentService implements IWorkbenchEnvironment
308308
break;
309309
}
310310
}
311-
} else {
312-
// TODO@Ben remove me once environment is adopted
313-
if (document && document.location && document.location.search) {
314-
const map = new Map<string, string>();
315-
const query = document.location.search.substring(1);
316-
const vars = query.split('&');
317-
for (let p of vars) {
318-
const pair = p.split('=');
319-
if (pair.length >= 2) {
320-
map.set(pair[0], decodeURIComponent(pair[1]));
321-
}
322-
}
323-
324-
const edp = map.get('extensionDevelopmentPath');
325-
if (edp) {
326-
extensionHostDebugEnvironment.extensionDevelopmentLocationURI = [URI.parse(edp)];
327-
extensionHostDebugEnvironment.isExtensionDevelopment = true;
328-
}
329-
330-
const di = map.get('debugId');
331-
if (di) {
332-
extensionHostDebugEnvironment.params.debugId = di;
333-
}
334-
335-
const ibe = map.get('inspect-brk-extensions');
336-
if (ibe) {
337-
extensionHostDebugEnvironment.params.port = parseInt(ibe);
338-
extensionHostDebugEnvironment.params.break = false;
339-
}
340-
}
341311
}
342312

343313
return extensionHostDebugEnvironment;

0 commit comments

Comments
 (0)