import { ExtensionContext , ExtensionMode } from 'vscode' ; import { registerCommands } from './commands' ; import { ContextTypes , setVSCodeContext } from './context' ; import { succeeded } from './errorable' ; import { setExtensionContext } from './extensionContext' ; import { checkIfOpenedFolderGitRepositorySourceExists } from './git/checkIfOpenedFolderGitRepositorySourceExists' ; import { checkFluxPrerequisites , promptToInstallFlux } from './install' ; import { statusBar } from './statusBar' ; import { telemetry , TelemetryEventNames } from './telemetry' ; import { createTreeViews } from './views/treeViews' ; export const enum GitOpsExtensionConstants { ExtensionId = 'weaveworks.vscode-gitops-tools' , FirstEverActivationStorageKey = 'firstEverActivation' , FluxPath = 'fluxPath' } param context export async function activate ( context ) { setExtensionContext ( context ) ; createTreeViews ( ) ; registerCommands ( context ) ; checkIfOpenedFolderGitRepositorySourceExists ( ) ; telemetry . send ( TelemetryEventNames . Startup ) ; if ( context . globalState . get ( GitOpsExtensionConstants . FirstEverActivationStorageKey ) === undefined ) { telemetry . send ( TelemetryEventNames . NewInstall ) ; context . globalState . update ( GitOpsExtensionConstants . FirstEverActivationStorageKey , false ) ; } setVSCodeContext ( ContextTypes . IsDev , context . extensionMode === ExtensionMode . Development ) ; const fluxFoundResult = await promptToInstallFlux ( ) ; if ( succeeded ( fluxFoundResult ) ) { await checkFluxPrerequisites ( ) ; } } /**
 * Called when extension is deactivated.
 */ export function deactivate ( ) { telemetry . dispose ( ) ; statusBar . dispose ( ) ; }