diff --git a/extensions/json-language-features/client/src/jsonMain.ts b/extensions/json-language-features/client/src/jsonMain.ts index 5fcccab60d4..ec0d6905d0c 100644 --- a/extensions/json-language-features/client/src/jsonMain.ts +++ b/extensions/json-language-features/client/src/jsonMain.ts @@ -143,12 +143,6 @@ export function activate(context: ExtensionContext) { let disposable = client.start(); toDispose.push(disposable); client.onReady().then(() => { - disposable = client.onTelemetry(e => { - if (telemetryReporter) { - telemetryReporter.sendTelemetryEvent(e.key, e.data); - } - }); - const schemaDocuments: { [uri: string]: boolean } = {}; // handle content request @@ -162,6 +156,14 @@ export function activate(context: ExtensionContext) { return Promise.reject(error); }); } else { + if (telemetryReporter && uri.authority === 'schema.management.azure.com') { + /* __GDPR__ + "json.schema" : { + "schemaURL" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } + } + */ + telemetryReporter.sendTelemetryEvent('json.schema', { schemaURL: uriPath }); + } const headers = { 'Accept-Encoding': 'gzip, deflate' }; return xhr({ url: uriPath, followRedirects: 5, headers }).then(response => { return response.responseText; diff --git a/extensions/json-language-features/server/src/jsonServerMain.ts b/extensions/json-language-features/server/src/jsonServerMain.ts index 0fa1de87d32..0fa9b164090 100644 --- a/extensions/json-language-features/server/src/jsonServerMain.ts +++ b/extensions/json-language-features/server/src/jsonServerMain.ts @@ -58,7 +58,7 @@ const workspaceContext = { return URL.resolve(resource, relativePath); } }; -function getSchemaRequestService(handledSchemas: { [schema: string]: boolean }) { +function getSchemaRequestService(handledSchemas: { [schema: string]: boolean } = {}) { return (uri: string): Thenable => { const protocol = uri.substr(0, uri.indexOf(':')); @@ -72,19 +72,6 @@ function getSchemaRequestService(handledSchemas: { [schema: string]: boolean }) }); }); } else if (protocol === 'http' || protocol === 'https') { - if (uri.indexOf('//schema.management.azure.com/') !== -1) { - /* __GDPR__ - "json.schema" : { - "schemaURL" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } - } - */ - connection.telemetry.logEvent({ - key: 'json.schema', - value: { - schemaURL: uri - } - }); - } const headers = { 'Accept-Encoding': 'gzip, deflate' }; return xhr({ url: uri, followRedirects: 5, headers }).then(response => { return response.responseText;