Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* Fix for microsoft/vscode-extension-telemetry#7 .
* Filter out settings values that don't match enum values.
  • Loading branch information
sean-mcmanus authored Jan 30, 2018
1 parent 3512cb3 commit 42ddf18
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 16 deletions.
46 changes: 31 additions & 15 deletions Extension/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@
"tmp": "~0.0.33",
"vscode-debugadapter": "~1.24.0",
"vscode-debugprotocol": "~1.24.0",
"vscode-extension-telemetry": "~0.0.10",
"vscode-extension-telemetry": "~0.0.11",
"vscode-languageclient": "~3.4.5",
"yauzl": "~2.8.0"
},
Expand Down
9 changes: 9 additions & 0 deletions Extension/src/LanguageServer/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,15 @@ function collectSettingsForTelemetry(filter: (key: string, val: string, settings
if (val instanceof Object) {
continue; // ignore settings that are objects since tostring on those is not useful (e.g. navigation.length)
}

// Skip values that don't match the setting's enum.
let curSetting: any = util.packageJson.contributes.configuration.properties["C_Cpp." + key];
if (curSetting) {
let curEnum: any[] = curSetting["enum"];
if (curEnum && curEnum.indexOf(val) === -1)
continue;
}

if (filter(key, val, settings)) {
previousCppSettings[key] = val;
switch (String(key).toLowerCase()) {
Expand Down

0 comments on commit 42ddf18

Please sign in to comment.