@@ -28,7 +28,7 @@ initializeFileLogging(logDispose);
2828//===============================================
2929// loading starts here
3030
31- import { ProgressLocation , ProgressOptions , window } from 'vscode' ;
31+ import { commands , ProgressLocation , ProgressOptions , window } from 'vscode' ;
3232import { buildApi } from './api' ;
3333import { IApplicationShell , IWorkspaceService } from './common/application/types' ;
3434import { IDisposableRegistry , IExperimentService , IExtensionContext } from './common/types' ;
@@ -46,6 +46,8 @@ import { WorkspaceService } from './common/application/workspace';
4646import { disposeAll } from './common/utils/resourceLifecycle' ;
4747import { ProposedExtensionAPI } from './proposedApiTypes' ;
4848import { buildProposedApi } from './proposedApi' ;
49+ import ContextManager from './pythonEnvironments/base/locators/composite/envsCollectionService' ;
50+ import { PySparkParam } from './browser/extension' ;
4951
5052durations . codeLoadingTime = stopWatch . elapsedTime ;
5153
@@ -63,13 +65,34 @@ export async function activate(context: IExtensionContext): Promise<PythonExtens
6365 let ready : Promise < void > ;
6466 let serviceContainer : IServiceContainer ;
6567 try {
68+ // 设置 context
69+ ContextManager . getInstance ( ) . setContext ( context ) ;
6670 const workspaceService = new WorkspaceService ( ) ;
6771 context . subscriptions . push (
6872 workspaceService . onDidGrantWorkspaceTrust ( async ( ) => {
6973 await deactivate ( ) ;
7074 await activate ( context ) ;
7175 } ) ,
7276 ) ;
77+
78+ let gatewayUri = "http://10.245.23.158:8080" ;
79+ const runEnv = process . env . RUN_ENV ;
80+
81+ if ( runEnv === 'online' ) {
82+ console . log ( '当前运行环境: online' ) ;
83+ gatewayUri = "http://easdsp-gateway.msxf.lo" ;
84+ } else {
85+ console . log ( '当前运行环境: 非 online' ) ;
86+ }
87+ context . globalState . update ( 'gateway.addr' , gatewayUri ) ;
88+
89+ context . subscriptions . push (
90+ commands . registerCommand ( 'pyspark.paramRegister.copy' , ( pySparkParam : PySparkParam ) => {
91+ console . log ( `PySparkParam-python: ${ JSON . stringify ( pySparkParam ) } ` ) ;
92+ context . globalState . update ( 'pyspark.paramRegister.copy' , pySparkParam ) ;
93+ } ) ,
94+ ) ;
95+
7396 [ api , ready , serviceContainer ] = await activateUnsafe ( context , stopWatch , durations ) ;
7497 } catch ( ex ) {
7598 // We want to completely handle the error
0 commit comments