@@ -28,7 +28,7 @@ initializeFileLogging(logDispose);
28
28
//===============================================
29
29
// loading starts here
30
30
31
- import { ProgressLocation , ProgressOptions , window } from 'vscode' ;
31
+ import { commands , ProgressLocation , ProgressOptions , window } from 'vscode' ;
32
32
import { buildApi } from './api' ;
33
33
import { IApplicationShell , IWorkspaceService } from './common/application/types' ;
34
34
import { IDisposableRegistry , IExperimentService , IExtensionContext } from './common/types' ;
@@ -46,6 +46,8 @@ import { WorkspaceService } from './common/application/workspace';
46
46
import { disposeAll } from './common/utils/resourceLifecycle' ;
47
47
import { ProposedExtensionAPI } from './proposedApiTypes' ;
48
48
import { buildProposedApi } from './proposedApi' ;
49
+ import ContextManager from './pythonEnvironments/base/locators/composite/envsCollectionService' ;
50
+ import { PySparkParam } from './browser/extension' ;
49
51
50
52
durations . codeLoadingTime = stopWatch . elapsedTime ;
51
53
@@ -63,13 +65,34 @@ export async function activate(context: IExtensionContext): Promise<PythonExtens
63
65
let ready : Promise < void > ;
64
66
let serviceContainer : IServiceContainer ;
65
67
try {
68
+ // 设置 context
69
+ ContextManager . getInstance ( ) . setContext ( context ) ;
66
70
const workspaceService = new WorkspaceService ( ) ;
67
71
context . subscriptions . push (
68
72
workspaceService . onDidGrantWorkspaceTrust ( async ( ) => {
69
73
await deactivate ( ) ;
70
74
await activate ( context ) ;
71
75
} ) ,
72
76
) ;
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
+
73
96
[ api , ready , serviceContainer ] = await activateUnsafe ( context , stopWatch , durations ) ;
74
97
} catch ( ex ) {
75
98
// We want to completely handle the error
0 commit comments