update auth extensions to use packageJSON property instead

上级 a1b4b8d3
......@@ -38,7 +38,7 @@ export class GitHubAuthenticationProvider implements vscode.AuthenticationProvid
private _disposable: vscode.Disposable;
constructor(private context: vscode.ExtensionContext, private type: AuthProviderType) {
const { name, version, aiKey } = require('../package.json') as { name: string, version: string, aiKey: string };
const { name, version, aiKey } = context.extension.packageJSON as { name: string, version: string, aiKey: string };
this._telemetryReporter = new ExperimentationTelemetry(context, new TelemetryReporter(name, version, aiKey));
this._keychain = new Keychain(context, `${type}.auth`);
......
......@@ -10,7 +10,7 @@ import TelemetryReporter from 'vscode-extension-telemetry';
export const DEFAULT_SCOPES = 'https://management.core.windows.net/.default offline_access';
export async function activate(context: vscode.ExtensionContext) {
const { name, version, aiKey } = require('../package.json') as { name: string, version: string, aiKey: string };
const { name, version, aiKey } = context.extension.packageJSON as { name: string, version: string, aiKey: string };
const telemetryReporter = new TelemetryReporter(name, version, aiKey);
const loginService = new AzureActiveDirectoryService(context);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册