提交 919580fd 编写于 作者: K Kai Maetzel 提交者: Matt Bierner

Upgrade telemetry package used by TS and markdown extensions. (#20971)

* upgrade telemetry used by TS ext

* upgrade telemetry used by markdown ext
上级 c94be6c5
......@@ -3,9 +3,9 @@
"version": "0.2.0",
"dependencies": {
"applicationinsights": {
"version": "0.15.6",
"from": "applicationinsights@0.15.6",
"resolved": "https://registry.npmjs.org/applicationinsights/-/applicationinsights-0.15.6.tgz"
"version": "0.18.0",
"from": "applicationinsights@0.18.0",
"resolved": "https://registry.npmjs.org/applicationinsights/-/applicationinsights-0.18.0.tgz"
},
"argparse": {
"version": "1.0.9",
......@@ -58,14 +58,14 @@
"resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.3.tgz"
},
"vscode-extension-telemetry": {
"version": "0.0.5",
"from": "vscode-extension-telemetry@>=0.0.5 <0.0.6",
"resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.5.tgz"
"version": "0.0.6",
"from": "vscode-extension-telemetry@>=0.0.6 <0.0.7",
"resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.6.tgz"
},
"winreg": {
"version": "0.0.13",
"from": "winreg@0.0.13",
"resolved": "https://registry.npmjs.org/winreg/-/winreg-0.0.13.tgz"
"version": "1.2.3",
"from": "winreg@1.2.3",
"resolved": "https://registry.npmjs.org/winreg/-/winreg-1.2.3.tgz"
}
}
}
......@@ -177,7 +177,7 @@
"highlight.js": "^9.3.0",
"markdown-it": "^8.2.2",
"markdown-it-named-headers": "0.0.4",
"vscode-extension-telemetry": "^0.0.5"
"vscode-extension-telemetry": "^0.0.6"
},
"devDependencies": {
"@types/node": "^7.0.4"
......
......@@ -30,6 +30,9 @@ var telemetryReporter: TelemetryReporter | null;
export function activate(context: vscode.ExtensionContext) {
const packageInfo = getPackageInfo();
telemetryReporter = packageInfo && new TelemetryReporter(packageInfo.name, packageInfo.version, packageInfo.aiKey);
if (telemetryReporter) {
context.subscriptions.push(telemetryReporter);
}
const engine = new MarkdownEngine();
......
declare module 'vscode-extension-telemetry' {
export default class TelemetryReporter {
constructor(extensionId: string, extensionVersion: string, key: string);
sendTelemetryEvent(eventName: string, properties?: { [key: string]: string }, measures?: { [key: string]: number }): void;
}
}
\ No newline at end of file
......@@ -3,9 +3,9 @@
"version": "0.10.1",
"dependencies": {
"applicationinsights": {
"version": "0.15.6",
"from": "applicationinsights@0.15.6",
"resolved": "https://registry.npmjs.org/applicationinsights/-/applicationinsights-0.15.6.tgz"
"version": "0.18.0",
"from": "applicationinsights@0.18.0",
"resolved": "https://registry.npmjs.org/applicationinsights/-/applicationinsights-0.18.0.tgz"
},
"semver": {
"version": "4.3.6",
......@@ -13,14 +13,14 @@
"resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz"
},
"typescript": {
"version": "typescript@2.2.1-insiders.20170217",
"version": "2.2.1-insiders.20170217",
"from": "typescript@typescript@2.2.1-insiders.20170217",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-2.2.1-insiders.20170217.tgz"
},
"vscode-extension-telemetry": {
"version": "0.0.5",
"from": "vscode-extension-telemetry@>=0.0.5 <0.0.6",
"resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.5.tgz"
"version": "0.0.6",
"from": "vscode-extension-telemetry@>=0.0.6 <0.0.7",
"resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.6.tgz"
},
"vscode-nls": {
"version": "2.0.1",
......@@ -28,9 +28,9 @@
"resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-2.0.1.tgz"
},
"winreg": {
"version": "0.0.13",
"from": "winreg@0.0.13",
"resolved": "https://registry.npmjs.org/winreg/-/winreg-0.0.13.tgz"
"version": "1.2.3",
"from": "winreg@1.2.3",
"resolved": "https://registry.npmjs.org/winreg/-/winreg-1.2.3.tgz"
}
}
}
......@@ -12,7 +12,7 @@
},
"dependencies": {
"semver": "4.3.6",
"vscode-extension-telemetry": "^0.0.5",
"vscode-extension-telemetry": "^0.0.6",
"vscode-nls": "^2.0.1",
"typescript": "typescript@2.2.1-insiders.20170217"
},
......
......@@ -408,7 +408,7 @@ class TypeScriptServiceClientHost implements ITypescriptServiceClientHost {
configFileWatcher.onDidDelete(handleProjectCreateOrDelete, this, this.disposables);
configFileWatcher.onDidChange(handleProjectChange, this, this.disposables);
this.client = new TypeScriptServiceClient(this, storagePath, globalState, workspaceState);
this.client = new TypeScriptServiceClient(this, storagePath, globalState, workspaceState, this.disposables);
this.languages = [];
this.languagePerId = Object.create(null);
for (const description of descriptions) {
......
......@@ -12,7 +12,7 @@ import * as fs from 'fs';
import * as electron from './utils/electron';
import { Reader } from './utils/wireProtocol';
import { workspace, window, Uri, CancellationToken, OutputChannel, Memento, MessageItem, QuickPickItem, EventEmitter, Event, commands, WorkspaceConfiguration } from 'vscode';
import { workspace, window, Uri, CancellationToken, Disposable, OutputChannel, Memento, MessageItem, QuickPickItem, EventEmitter, Event, commands, WorkspaceConfiguration } from 'vscode';
import * as Proto from './protocol';
import { ITypescriptServiceClient, ITypescriptServiceClientHost, API } from './typescriptService';
......@@ -125,7 +125,7 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient
private telemetryReporter: TelemetryReporter;
constructor(host: ITypescriptServiceClientHost, storagePath: string | undefined, globalState: Memento, private workspaceState: Memento) {
constructor(host: ITypescriptServiceClientHost, storagePath: string | undefined, globalState: Memento, private workspaceState: Memento, disposables: Disposable[]) {
this.host = host;
this.storagePath = storagePath;
this.globalState = globalState;
......@@ -155,7 +155,7 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient
this._apiVersion = new API('1.0.0');
this._checkGlobalTSCVersion = true;
this.trace = this.readTrace();
workspace.onDidChangeConfiguration(() => {
disposables.push(workspace.onDidChangeConfiguration(() => {
this.trace = this.readTrace();
let oldglobalTsdk = this.globalTsdk;
let oldLocalTsdk = this.localTsdk;
......@@ -167,9 +167,10 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient
if (this.servicePromise === null && (oldglobalTsdk !== this.globalTsdk || oldLocalTsdk !== this.localTsdk)) {
this.startService();
}
});
}));
if (this.packageInfo && this.packageInfo.aiKey) {
this.telemetryReporter = new TelemetryReporter(this.packageInfo.name, this.packageInfo.version, this.packageInfo.aiKey);
disposables.push(this.telemetryReporter);
}
this.startService();
}
......
declare module 'vscode-extension-telemetry' {
export default class TelemetryReporter {
constructor(extensionId: string, extensionVersion: string, key: string);
sendTelemetryEvent(eventName: string, properties?: { [key: string]: string }, measures?: { [key: string]: number }): void;
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册