Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function registerUiVariables(context: vscode.ExtensionContext) {
// Register ui extension variables is required to be done for telemetry to start flowing for extension activation and other events.
// It also facilitates registering command and called events telemetry.
extensionVariables.outputChannel = vscode.window.createOutputChannel('Azure Pipelines');
context.subscriptions.push(extensionVariables.outputChannel);
extensionVariables.context = context;
extensionVariables.ui = new AzureUserInput(context.globalState);
registerUIExtensionVariables(extensionVariables);
}
function initializeTreeView(context: vscode.ExtensionContext) {
const telemetryReporter = new TelemetryClientWrapper("IoTHub.");
const outputChannel = createAzExtOutputChannel("Azure IoT Hub", "azure-iot-toolkit");
const uiExtensionVariables = {
context,
outputChannel,
reporter: telemetryReporter,
ui: new AzureUserInput(context.globalState),
};
registerUIExtensionVariables(uiExtensionVariables);
activateDps(context, outputChannel);
const azureIoTExplorer = activateIoTHub(context, outputChannel);
const deviceTree = new DeviceTree(context);
vscode.window.registerTreeDataProvider("iotHubDevices", deviceTree);
return { azureIoTExplorer, deviceTree };
}
export async function activateInternal(context: vscode.ExtensionContext, perfStats: { loadStartTime: number, loadEndTime: number }): Promise {
ext.context = context;
ext.reporter = createTelemetryReporter(context);
ext.outputChannel = vscode.window.createOutputChannel("Azure Resource Manager Tools");
ext.ui = new AzureUserInput(context.globalState);
registerUIExtensionVariables(ext);
await callWithTelemetryAndErrorHandling('activate', async function (this: IActionContext): Promise {
this.properties.isActivationEvent = 'true';
this.measurements.mainFileLoad = (perfStats.loadEndTime - perfStats.loadStartTime) / 1000;
context.subscriptions.push(new AzureRMTools(context));
});
}
ext.context = context;
const outputChannel = vscode.window.createOutputChannel("Azure Logic Apps");
ext.outputChannel = outputChannel;
context.subscriptions.push(outputChannel);
let reporter: TelemetryReporter | undefined;
try {
const { aiKey, name, version } = readJson(context.asAbsolutePath("./package.json"));
reporter = new TelemetryReporter(name, version, aiKey);
ext.reporter = reporter;
context.subscriptions.push(reporter);
} catch (error) {
}
const ui = new AzureUserInput(context.globalState);
ext.ui = ui;
await callWithTelemetryAndErrorHandling("azureLogicApps.activate", async function activateCallback(this: IActionContext): Promise {
this.properties.isActivationEvent = "true";
const logicAppsProvider = new LogicAppsProvider();
const tree = new AzureTreeDataProvider(logicAppsProvider, "azureLogicApps.loadMore");
context.subscriptions.push(tree);
context.subscriptions.push(vscode.window.registerTreeDataProvider("azureLogicAppsExplorer", tree));
const logicAppEditor = new LogicAppEditor();
context.subscriptions.push(logicAppEditor);
registerCommand("azureLogicApps.addBuildDefinitionToProject", async (uri?: vscode.Uri) => {
if (uri) {
const workspaceFolder = vscode.workspace.getWorkspaceFolder(uri);