Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cdad8a7

Browse files
committedMay 3, 2021
Remove dead client code
1 parent c3a42c9 commit cdad8a7

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed
 

‎lib/vscode/src/vs/server/browser/client.ts

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as path from 'vs/base/common/path';
2-
import { URI } from 'vs/base/common/uri';
32
import { Options } from 'vs/ipc';
43
import { localize } from 'vs/nls';
54
import { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions';
@@ -209,37 +208,3 @@ export const initialize = async (services: ServiceCollection): Promise<void> =>
209208
when: ContextKeyExpr.has('code-server.authed')
210209
});
211210
};
212-
213-
export interface Query {
214-
[key: string]: string | undefined;
215-
}
216-
217-
/**
218-
* Split a string up to the delimiter. If the delimiter doesn't exist the first
219-
* item will have all the text and the second item will be an empty string.
220-
*/
221-
export const split = (str: string, delimiter: string): [string, string] => {
222-
const index = str.indexOf(delimiter);
223-
return index !== -1 ? [str.substring(0, index).trim(), str.substring(index + 1)] : [str, ''];
224-
};
225-
226-
/**
227-
* Return the URL modified with the specified query variables. It's pretty
228-
* stupid so it probably doesn't cover any edge cases. Undefined values will
229-
* unset existing values. Doesn't allow duplicates.
230-
*/
231-
export const withQuery = (url: string, replace: Query): string => {
232-
const uri = URI.parse(url);
233-
const query = { ...replace };
234-
uri.query.split('&').forEach((kv) => {
235-
const [key, value] = split(kv, '=');
236-
if (!(key in query)) {
237-
query[key] = value;
238-
}
239-
});
240-
return uri.with({
241-
query: Object.keys(query)
242-
.filter((k) => typeof query[k] !== 'undefined')
243-
.map((k) => `${k}=${query[k]}`).join('&'),
244-
}).toString(true);
245-
};

0 commit comments

Comments
 (0)
Please sign in to comment.