@@ -11,11 +11,10 @@ import {
1111 extensions , IndentAction , languages , Memento ,
1212 OutputChannel , window
1313} from 'vscode' ;
14- import { AnalysisExtensionActivator } from './activation/analysis' ;
15- import { ClassicExtensionActivator } from './activation/classic' ;
16- import { IExtensionActivator } from './activation/types' ;
14+ import { registerTypes as activationRegisterTypes } from './activation/serviceRegistry' ;
15+ import { IExtensionActivationService } from './activation/types' ;
1716import { PythonSettings } from './common/configSettings' ;
18- import { isPythonAnalysisEngineTest , PYTHON , PYTHON_LANGUAGE , STANDARD_OUTPUT_CHANNEL } from './common/constants' ;
17+ import { PYTHON , PYTHON_LANGUAGE , STANDARD_OUTPUT_CHANNEL } from './common/constants' ;
1918import { FeatureDeprecationManager } from './common/featureDeprecationManager' ;
2019import { createDeferred } from './common/helpers' ;
2120import { PythonInstaller } from './common/installer/pythonInstallation' ;
@@ -25,7 +24,7 @@ import { registerTypes as processRegisterTypes } from './common/process/serviceR
2524import { registerTypes as commonRegisterTypes } from './common/serviceRegistry' ;
2625import { StopWatch } from './common/stopWatch' ;
2726import { ITerminalHelper } from './common/terminal/types' ;
28- import { GLOBAL_MEMENTO , IConfigurationService , IDisposableRegistry , ILogger , IMemento , IOutputChannel , IPersistentStateFactory , WORKSPACE_MEMENTO } from './common/types' ;
27+ import { GLOBAL_MEMENTO , IConfigurationService , IDisposableRegistry , IExtensionContext , ILogger , IMemento , IOutputChannel , IPersistentStateFactory , WORKSPACE_MEMENTO } from './common/types' ;
2928import { registerTypes as variableRegisterTypes } from './common/variables/serviceRegistry' ;
3029import { AttachRequestArguments , LaunchRequestArguments } from './debugger/Common/Contracts' ;
3130import { BaseConfigurationProvider } from './debugger/configProviders/baseProvider' ;
@@ -37,7 +36,7 @@ import { ICondaService, IInterpreterService } from './interpreter/contracts';
3736import { registerTypes as interpretersRegisterTypes } from './interpreter/serviceRegistry' ;
3837import { ServiceContainer } from './ioc/container' ;
3938import { ServiceManager } from './ioc/serviceManager' ;
40- import { IServiceContainer } from './ioc/types' ;
39+ import { IServiceContainer , IServiceManager } from './ioc/types' ;
4140import { LinterCommands } from './linters/linterCommands' ;
4241import { registerTypes as lintersRegisterTypes } from './linters/serviceRegistry' ;
4342import { ILintingEngine } from './linters/types' ;
@@ -76,18 +75,14 @@ export async function activate(context: ExtensionContext) {
7675 const configuration = serviceManager . get < IConfigurationService > ( IConfigurationService ) ;
7776 const pythonSettings = configuration . getSettings ( ) ;
7877
79- const activator : IExtensionActivator = isPythonAnalysisEngineTest ( ) || ! pythonSettings . jediEnabled
80- ? new AnalysisExtensionActivator ( serviceManager , pythonSettings )
81- : new ClassicExtensionActivator ( serviceManager , pythonSettings , PYTHON ) ;
82-
83- await activator . activate ( context ) ;
78+ const activationService = serviceContainer . get < IExtensionActivationService > ( IExtensionActivationService ) ;
79+ await activationService . activate ( ) ;
8480
8581 const standardOutputChannel = serviceManager . get < OutputChannel > ( IOutputChannel , STANDARD_OUTPUT_CHANNEL ) ;
8682 sortImports . activate ( context , standardOutputChannel , serviceManager ) ;
8783
8884 serviceManager . get < ICodeExecutionManager > ( ICodeExecutionManager ) . registerCommands ( ) ;
89- // tslint:disable-next-line:no-floating-promises
90- sendStartupTelemetry ( activated , serviceContainer ) ;
85+ sendStartupTelemetry ( activated , serviceContainer ) . ignoreErrors ( ) ;
9186
9287 const pythonInstaller = new PythonInstaller ( serviceContainer ) ;
9388 pythonInstaller . checkPythonInstallation ( PythonSettings . getInstance ( ) )
@@ -160,15 +155,18 @@ export async function activate(context: ExtensionContext) {
160155
161156function registerServices ( context : ExtensionContext , serviceManager : ServiceManager , serviceContainer : ServiceContainer ) {
162157 serviceManager . addSingletonInstance < IServiceContainer > ( IServiceContainer , serviceContainer ) ;
158+ serviceManager . addSingletonInstance < IServiceManager > ( IServiceManager , serviceManager ) ;
163159 serviceManager . addSingletonInstance < Disposable [ ] > ( IDisposableRegistry , context . subscriptions ) ;
164160 serviceManager . addSingletonInstance < Memento > ( IMemento , context . globalState , GLOBAL_MEMENTO ) ;
165161 serviceManager . addSingletonInstance < Memento > ( IMemento , context . workspaceState , WORKSPACE_MEMENTO ) ;
162+ serviceManager . addSingletonInstance < IExtensionContext > ( IExtensionContext , context ) ;
166163
167164 const standardOutputChannel = window . createOutputChannel ( 'Python' ) ;
168165 const unitTestOutChannel = window . createOutputChannel ( 'Python Test Log' ) ;
169166 serviceManager . addSingletonInstance < OutputChannel > ( IOutputChannel , standardOutputChannel , STANDARD_OUTPUT_CHANNEL ) ;
170167 serviceManager . addSingletonInstance < OutputChannel > ( IOutputChannel , unitTestOutChannel , TEST_OUTPUT_CHANNEL ) ;
171168
169+ activationRegisterTypes ( serviceManager ) ;
172170 commonRegisterTypes ( serviceManager ) ;
173171 processRegisterTypes ( serviceManager ) ;
174172 variableRegisterTypes ( serviceManager ) ;
0 commit comments