export async function activate()

in vscode-extension/src/extension.ts [23:69]


export async function activate(context: vscode.ExtensionContext): Promise<void> {

    // let disposable = vscode.commands.registerCommand('azps-tools.selectVersion', async () => {
    //     //TODO: build one selection quickbox
    // });

    //start the logger
    const log = new Logger();

    //check for existence of powershell
    const powershellExistence = checkPowershell(log);
    if (!powershellExistence) {
        return;
    }

    //select azureRmVersion and azVersion(hard code)
    const azureRmVersion = "6.13.1";

    //start a powershell process
    try {
        powershell.start();
        log.write("Start powershell successed!");
    }
    catch (e) {
        log.writeError("Can't start the powershell : " + e.message);
    }

    //check for existence of module
    const moduleExistence = await checkModule(powershell, log);
    if (moduleExistence) { log.write('The module exist!'); }
    else {
        return;
    }

    //build the diagnastic
    const diagcCollection = vscode.languages.createDiagnosticCollection('azps-tools');

    registerHandlers(context, diagcCollection, azureRmVersion, log);

    //quick fix action
    const quickFixProvider = new QuickFixProvider();
    context.subscriptions.push(
        vscode.languages.registerCodeActionsProvider({ language: 'powershell' }, quickFixProvider, {
            providedCodeActionKinds: QuickFixProvider.providedCodeActionKinds
        })
    );
}