* Defer importing ./configure/activate - azure-arm-websites takes really long to import for some reason
* Defer extension activation
This commit is contained in:
Winston Liu 2020-10-19 14:28:36 -04:00 коммит произвёл GitHub
Родитель 44c5d7f1d2
Коммит 29dffa995e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 6 добавлений и 5 удалений

Просмотреть файл

@ -37,7 +37,9 @@
"CI/CD"
],
"activationEvents": [
"*"
"onLanguage:azure-pipelines",
"onCommand:configure-pipeline",
"onCommand:browse-pipeline"
],
"main": "./out/extension",
"contributes": {

Просмотреть файл

@ -8,7 +8,6 @@ import * as vscode from 'vscode';
import { createTelemetryReporter, callWithTelemetryAndErrorHandling, IActionContext, AzureUserInput, registerUIExtensionVariables } from 'vscode-azureextensionui';
import * as languageclient from 'vscode-languageclient';
import { activateConfigurePipeline } from './configure/activate';
import { extensionVariables } from './configure/model/models';
import * as logger from './logger';
import { SchemaAssociationService, SchemaAssociationNotification } from './schema-association-service';
@ -16,12 +15,11 @@ import { schemaContributor, CUSTOM_SCHEMA_REQUEST, CUSTOM_CONTENT_REQUEST } from
import { telemetryHelper } from './configure/helper/telemetryHelper';
import { TelemetryKeys } from './configure/resources/telemetryKeys';
const configurePipelineEnabled: boolean = vscode.workspace.getConfiguration('[azure-pipelines]', null).get('configure') ? true : false;
export async function activate(context: vscode.ExtensionContext) {
extensionVariables.reporter = createTelemetryReporter(context);
registerUiVariables(context);
const configurePipelineEnabled = vscode.workspace.getConfiguration('[azure-pipelines]').get<boolean>('configure', true);
await callWithTelemetryAndErrorHandling('azurePipelines.activate', async (activateContext: IActionContext) => {
activateContext.telemetry.properties.isActivationEvent = 'true';
telemetryHelper.initialize(activateContext, 'activate');
@ -30,6 +28,7 @@ export async function activate(context: vscode.ExtensionContext) {
async () => {
await activateYmlContributor(context);
if (configurePipelineEnabled) {
const { activateConfigurePipeline } = await import('./configure/activate');
await activateConfigurePipeline();
}
},
@ -134,4 +133,4 @@ function getClientOptions(): languageclient.LanguageClientOptions {
// this method is called when your extension is deactivated
export function deactivate() {
}
}