-
Notifications
You must be signed in to change notification settings - Fork 524
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Debug telemetry reporter * Adjust to ui changes * Fix dependence
- Loading branch information
1 parent
6657cf4
commit 084db32
Showing
5 changed files
with
24 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,14 @@ | ||
import vscode = require('vscode'); | ||
import TelemetryReporter from 'vscode-extension-telemetry'; | ||
|
||
export let reporter: TelemetryReporter; | ||
|
||
export class Reporter extends vscode.Disposable { | ||
|
||
constructor(ctx: vscode.ExtensionContext) { | ||
|
||
super(() => reporter.dispose()); | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
let packageInfo = getPackageInfo(ctx); | ||
reporter = packageInfo && new TelemetryReporter(packageInfo.name, packageInfo.version, packageInfo.aiKey); | ||
|
||
} | ||
} | ||
import vscode = require('vscode'); | ||
import { createTelemetryReporter, ITelemetryReporter } from 'vscode-azureextensionui'; | ||
import { ext } from '../extensionVariables'; | ||
|
||
interface IPackageInfo { | ||
name: string; | ||
version: string; | ||
aiKey: string; | ||
} | ||
export let reporter: ITelemetryReporter; | ||
|
||
function getPackageInfo(context: vscode.ExtensionContext): IPackageInfo { | ||
// tslint:disable-next-line:non-literal-require | ||
let extensionPackage = require(context.asAbsolutePath('./package.json')); | ||
if (extensionPackage) { | ||
return { | ||
name: extensionPackage.name, | ||
version: extensionPackage.version, | ||
aiKey: extensionPackage.aiKey | ||
}; | ||
} | ||
return; | ||
export function initializeTelemetryReporter(newReporter: ITelemetryReporter): void { | ||
reporter = newReporter; | ||
} |