Skip to content

Seanmcm/telemetry fix#1494

Merged
sean-mcmanus merged 6 commits into
masterfrom
seanmcm/telemetryFix
Jan 29, 2018
Merged

Seanmcm/telemetry fix#1494
sean-mcmanus merged 6 commits into
masterfrom
seanmcm/telemetryFix

Conversation

@sean-mcmanus

Copy link
Copy Markdown
Contributor

No description provided.

previousCppSettings[key] = val;
result[key] = (key === "clang_format_path") ? "..." : String(previousCppSettings[key]);
switch (key.toLowerCase()) {
case "clang_format_path": {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should just remove clang_format_path from telemetry

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps the above if-expression should be if (filter(key, val, settings) && isTelemetryAllowed(key, val)) and then move all of the special cases to a new function isTelemetryAllowed and filter them there so that this function can remain simple.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by "remove clang_format_path from telemetry"? Do you mean just use "..." like we were doing before?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant to just filter it out completely (never send that property)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I stopped sending it.

Comment thread Extension/src/LanguageServer/client.ts Outdated
break;
}
default: {
if (val.startsWith("{") && val.endsWith("}")) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this distinction necessary? can we just send "..." for anything that doesn't match one of the enum values?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

Comment thread Extension/src/LanguageServer/client.ts Outdated
switch (key.toLowerCase()) {
case "clang_format_path": {
if (val) {
switch (val.toLowerCase()) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

val is any, so I don't think you can safely call this without converting to string first.

Comment thread Extension/src/LanguageServer/client.ts Outdated
case "clang_format_style":
case "clang_format_fallbackstyle": {
if (val) {
switch (val.toLowerCase()) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as above. val must be confirmed to be a string before this can be called on it.

Comment thread Extension/src/LanguageServer/client.ts Outdated
case "webkit":
case "file":
case "none": {
result[key] = String(previousCppSettings[key]);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember also that we have to rename the keys since we are making a change to what is logged for these settings.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yeah, I forgot.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a 2 at the end.

@sean-mcmanus sean-mcmanus merged commit 3512cb3 into master Jan 29, 2018
@sean-mcmanus sean-mcmanus deleted the seanmcm/telemetryFix branch January 29, 2018 21:01
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants