@@ -13,10 +13,18 @@ import { Registry } from 'vs/platform/registry/common/platform';
1313import { IStorageService , StorageScope , StorageTarget } from 'vs/platform/storage/common/storage' ;
1414import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry' ;
1515import { TelemetryChannelClient } from 'vs/server/common/telemetry' ;
16+ import { getOptions } from 'vs/server/common/util' ;
1617import 'vs/workbench/contrib/localizations/browser/localizations.contribution' ;
1718import 'vs/workbench/services/localizations/browser/localizationsService' ;
1819import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService' ;
1920
21+ /**
22+ * All client-side customization to VS Code should live in this file when
23+ * possible.
24+ */
25+
26+ const options = getOptions < Options > ( ) ;
27+
2028class TelemetryService extends TelemetryChannelClient {
2129 public constructor (
2230 @IRemoteAgentService remoteAgentService : IRemoteAgentService ,
@@ -25,26 +33,6 @@ class TelemetryService extends TelemetryChannelClient {
2533 }
2634}
2735
28- /**
29- * Remove extra slashes in a URL.
30- */
31- export const normalize = ( url : string , keepTrailing = false ) : string => {
32- return url . replace ( / \/ \/ + / g, '/' ) . replace ( / \/ + $ / , keepTrailing ? '/' : '' ) ;
33- } ;
34-
35- /**
36- * Get options embedded in the HTML.
37- */
38- export const getOptions = < T extends Options > ( ) : T => {
39- try {
40- return JSON . parse ( document . getElementById ( 'coder-options' ) ! . getAttribute ( 'data-settings' ) ! ) ;
41- } catch ( error ) {
42- return { } as T ;
43- }
44- } ;
45-
46- const options = getOptions ( ) ;
47-
4836const TELEMETRY_SECTION_ID = 'telemetry' ;
4937Registry . as < IConfigurationRegistry > ( Extensions . Configuration ) . registerConfiguration ( {
5038 'id' : TELEMETRY_SECTION_ID ,
0 commit comments