@@ -13,10 +13,18 @@ import { Registry } from 'vs/platform/registry/common/platform';
13
13
import { IStorageService , StorageScope , StorageTarget } from 'vs/platform/storage/common/storage' ;
14
14
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry' ;
15
15
import { TelemetryChannelClient } from 'vs/server/common/telemetry' ;
16
+ import { getOptions } from 'vs/server/common/util' ;
16
17
import 'vs/workbench/contrib/localizations/browser/localizations.contribution' ;
17
18
import 'vs/workbench/services/localizations/browser/localizationsService' ;
18
19
import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService' ;
19
20
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
+
20
28
class TelemetryService extends TelemetryChannelClient {
21
29
public constructor (
22
30
@IRemoteAgentService remoteAgentService : IRemoteAgentService ,
@@ -25,26 +33,6 @@ class TelemetryService extends TelemetryChannelClient {
25
33
}
26
34
}
27
35
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
-
48
36
const TELEMETRY_SECTION_ID = 'telemetry' ;
49
37
Registry . as < IConfigurationRegistry > ( Extensions . Configuration ) . registerConfiguration ( {
50
38
'id' : TELEMETRY_SECTION_ID ,
0 commit comments