How to use the vscode-azureextensionui.AzureUserInput function in vscode-azureextensionui

To help you get started, we’ve selected a few vscode-azureextensionui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / azure-pipelines-vscode / src / extension.ts View on Github external
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);
}
github microsoft / vscode-azure-iot-toolkit / src / extension.ts View on Github external
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 };
}
github microsoft / vscode-azurearmtools / src / AzureRMTools.ts View on Github external
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));
    });
}
github microsoft / vscode-azurelogicapps / src / extension.ts View on Github external
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);