@@ -15,7 +15,7 @@ import { ConfigurationModel, ConfigurationChangeEvent, mergeChanges } from 'vs/p
15
15
import { IConfigurationChangeEvent , ConfigurationTarget , IConfigurationOverrides , isConfigurationOverrides , IConfigurationData , IConfigurationValue , IConfigurationChange , ConfigurationTargetToString , IConfigurationUpdateOverrides , isConfigurationUpdateOverrides , IConfigurationService , IConfigurationUpdateOptions } from 'vs/platform/configuration/common/configuration' ;
16
16
import { IPolicyConfiguration , NullPolicyConfiguration , PolicyConfiguration } from 'vs/platform/configuration/common/configurations' ;
17
17
import { Configuration } from 'vs/workbench/services/configuration/common/configurationModels' ;
18
- import { FOLDER_CONFIG_FOLDER_NAME , defaultSettingsSchemaId , userSettingsSchemaId , workspaceSettingsSchemaId , folderSettingsSchemaId , IConfigurationCache , machineSettingsSchemaId , LOCAL_MACHINE_SCOPES , IWorkbenchConfigurationService , RestrictedSettings , PROFILE_SCOPES , LOCAL_MACHINE_PROFILE_SCOPES , profileSettingsSchemaId , APPLY_ALL_PROFILES_SETTING } from 'vs/workbench/services/configuration/common/configuration' ;
18
+ import { FOLDER_CONFIG_FOLDER_NAME , defaultSettingsSchemaId , userSettingsSchemaId , workspaceSettingsSchemaId , folderSettingsSchemaId , IConfigurationCache , machineSettingsSchemaId , LOCAL_MACHINE_SCOPES , IWorkbenchConfigurationService , RestrictedSettings , PROFILE_SCOPES , LOCAL_MACHINE_PROFILE_SCOPES , profileSettingsSchemaId , APPLY_ALL_PROFILES_SETTING , TASKS_CONFIGURATION_KEY , LAUNCH_CONFIGURATION_KEY } from 'vs/workbench/services/configuration/common/configuration' ;
19
19
import { Registry } from 'vs/platform/registry/common/platform' ;
20
20
import { IConfigurationRegistry , Extensions , allSettings , windowSettings , resourceSettings , applicationSettings , machineSettings , machineOverridableSettings , ConfigurationScope , IConfigurationPropertySchema , keyFromOverrideIdentifiers , OVERRIDE_PROPERTY_PATTERN , resourceLanguageSettingsSchemaId , configurationDefaultsSchemaId } from 'vs/platform/configuration/common/configurationRegistry' ;
21
21
import { IStoredWorkspaceFolder , isStoredWorkspaceFolder , IWorkspaceFolderCreationData , getStoredWorkspaceFolder , toWorkspaceFolders } from 'vs/platform/workspaces/common/workspaces' ;
@@ -1331,39 +1331,37 @@ class ConfigurationTelemetryContribution extends Disposable implements IWorkbenc
1331
1331
1332
1332
constructor (
1333
1333
@IConfigurationService private readonly configurationService : WorkspaceService ,
1334
- @ITelemetryService private readonly telemetryService : ITelemetryService ,
1334
+ @ITelemetryService telemetryService : ITelemetryService ,
1335
1335
) {
1336
1336
super ( ) ;
1337
-
1338
1337
const { user, workspace } = configurationService . keys ( ) ;
1339
- for ( const key of user ) {
1340
- this . reportConfiguration ( key , ConfigurationTarget . USER_LOCAL ) ;
1338
+ const updatedUserSettings : { [ key : string ] : any } = { } ;
1339
+ for ( const k of user ) {
1340
+ if ( ! k . startsWith ( `${ TASKS_CONFIGURATION_KEY } .` ) && ! k . startsWith ( `${ LAUNCH_CONFIGURATION_KEY } .` ) ) {
1341
+ updatedUserSettings [ k ] = this . getValueToReport ( k , ConfigurationTarget . USER_LOCAL ) ?? '' ;
1342
+ }
1341
1343
}
1342
- for ( const key of workspace ) {
1343
- this . reportConfiguration ( key , ConfigurationTarget . WORKSPACE ) ;
1344
+ const updatedWorkspaceSettings : { [ key : string ] : any } = { } ;
1345
+ for ( const k of workspace ) {
1346
+ if ( ! k . startsWith ( `${ TASKS_CONFIGURATION_KEY } .` ) && ! k . startsWith ( `${ LAUNCH_CONFIGURATION_KEY } .` ) ) {
1347
+ updatedWorkspaceSettings [ k ] = this . getValueToReport ( k , ConfigurationTarget . WORKSPACE ) ?? '' ;
1348
+ }
1344
1349
}
1345
- }
1346
-
1347
- private reportConfiguration ( key : string , target : ConfigurationTarget ) : void {
1348
- type UpdateConfigurationClassification = {
1350
+ type UpdatedSettingsClassification = {
1349
1351
owner : 'sandy081' ;
1350
- comment : 'Event which fires for updated configurations' ;
1351
- source : { classification : 'SystemMetaData' ; purpose : 'FeatureInsight' ; comment : 'What configuration file was updated i.e user or workspace' } ;
1352
- key : { classification : 'SystemMetaData' ; purpose : 'FeatureInsight' ; comment : 'What configuration key was updated' } ;
1353
- value ?: { classification : 'SystemMetaData' ; purpose : 'FeatureInsight' ; comment : 'Value of the key that was updated' } ;
1352
+ comment : 'Event reporting updated settings' ;
1353
+ settings : { classification : 'SystemMetaData' ; purpose : 'FeatureInsight' ; comment : 'stringified updated settings object' } ;
1354
1354
} ;
1355
- type UpdateConfigurationEvent = {
1356
- source : string ;
1357
- key : string ;
1358
- value ?: any ;
1355
+ type UpdatedSettingsEvent = {
1356
+ settings : string ;
1359
1357
} ;
1360
- this . telemetryService . publicLog2 < UpdateConfigurationEvent , UpdateConfigurationClassification > ( 'updateConfiguration' , {
1361
- source : ConfigurationTargetToString ( target ) ,
1362
- key,
1363
- value : this . getValueToReport ( key , target )
1364
- } ) ;
1358
+ telemetryService . publicLog2 < UpdatedSettingsEvent , UpdatedSettingsClassification > ( 'updatedsettings:user' , { settings : JSON . stringify ( updatedUserSettings ) } ) ;
1359
+ telemetryService . publicLog2 < UpdatedSettingsEvent , UpdatedSettingsClassification > ( 'updatedsettings:workspace' , { settings : JSON . stringify ( updatedWorkspaceSettings ) } ) ;
1365
1360
}
1366
1361
1362
+ /**
1363
+ * Report value of a setting only if it is an enum, boolean, or number or an array of those.
1364
+ */
1367
1365
private getValueToReport ( key : string , target : ConfigurationTarget ) : any {
1368
1366
const schema = this . configurationRegistry . getConfigurationProperties ( ) [ key ] ;
1369
1367
if ( ! schema ) {
0 commit comments