@@ -12,18 +12,27 @@ import Severity from 'vs/base/common/severity';
12
12
import { TPromise } from 'vs/base/common/winjs.base' ;
13
13
import { WorkerServer } from 'vs/base/common/worker/workerServer' ;
14
14
import { EventService } from 'vs/platform/event/common/eventService' ;
15
+ import { IEventService } from 'vs/platform/event/common/event' ;
15
16
import { AbstractExtensionService , ActivatedExtension } from 'vs/platform/extensions/common/abstractExtensionService' ;
16
- import { IExtensionDescription } from 'vs/platform/extensions/common/extensions' ;
17
- import { createInstantiationService } from 'vs/platform/instantiation/common/instantiationService' ;
17
+ import { IExtensionDescription , IExtensionService } from 'vs/platform/extensions/common/extensions' ;
18
+ import ServiceCollection from 'vs/platform/instantiation/common/serviceCollection' ;
19
+ import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService' ;
18
20
import { SecondaryMarkerService } from 'vs/platform/markers/common/markerService' ;
21
+ import { IMarkerService } from 'vs/platform/markers/common/markers' ;
19
22
import { BaseRequestService } from 'vs/platform/request/common/baseRequestService' ;
23
+ import { IRequestService } from 'vs/platform/request/common/request' ;
20
24
import { RemoteTelemetryService } from 'vs/platform/telemetry/common/remoteTelemetryService' ;
25
+ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry' ;
21
26
import { WorkerThreadService } from 'vs/platform/thread/common/workerThreadService' ;
27
+ import { IThreadService } from 'vs/platform/thread/common/thread' ;
22
28
import { BaseWorkspaceContextService } from 'vs/platform/workspace/common/baseWorkspaceContextService' ;
23
- import { IWorkspace } from 'vs/platform/workspace/common/workspace' ;
29
+ import { IWorkspaceContextService , IWorkspace } from 'vs/platform/workspace/common/workspace' ;
24
30
import { ModeServiceImpl , ModeServiceWorkerHelper } from 'vs/editor/common/services/modeServiceImpl' ;
31
+ import { IModeService } from 'vs/editor/common/services/modeService' ;
25
32
import { ModelServiceWorkerHelper } from 'vs/editor/common/services/modelServiceImpl' ;
26
33
import { ResourceService } from 'vs/editor/common/services/resourceServiceImpl' ;
34
+ import { IResourceService } from 'vs/editor/common/services/resourceService' ;
35
+
27
36
28
37
export interface IInitData {
29
38
contextService : {
@@ -86,35 +95,29 @@ export class EditorWorkerServer {
86
95
87
96
public initialize ( mainThread :WorkerServer , complete :ICallback , error :ICallback , progress :ICallback , initData :IInitData ) :void {
88
97
89
- var extensionService = new WorkerExtensionService ( ) ;
90
-
91
- var contextService = new BaseWorkspaceContextService ( initData . contextService . workspace , initData . contextService . configuration , initData . contextService . options ) ;
98
+ const services = new ServiceCollection ( ) ;
92
99
100
+ const extensionService = new WorkerExtensionService ( ) ;
101
+ const contextService = new BaseWorkspaceContextService ( initData . contextService . workspace , initData . contextService . configuration , initData . contextService . options ) ;
93
102
this . threadService = new WorkerThreadService ( mainThread . getRemoteCom ( ) ) ;
94
- this . threadService . setInstantiationService ( createInstantiationService ( { threadService : this . threadService } ) ) ;
95
-
96
- var telemetryServiceInstance = new RemoteTelemetryService ( 'workerTelemetry' , this . threadService ) ;
97
-
98
- var resourceService = new ResourceService ( ) ;
99
- var markerService = new SecondaryMarkerService ( this . threadService ) ;
100
-
101
- var modeService = new ModeServiceImpl ( this . threadService , extensionService ) ;
102
-
103
- var requestService = new BaseRequestService ( contextService , telemetryServiceInstance ) ;
104
-
105
- var _services : any = {
106
- threadService : this . threadService ,
107
- extensionService : extensionService ,
108
- modeService : modeService ,
109
- contextService : contextService ,
110
- eventService : new EventService ( ) ,
111
- resourceService : resourceService ,
112
- markerService : markerService ,
113
- telemetryService : telemetryServiceInstance ,
114
- requestService : requestService
115
- } ;
116
-
117
- var instantiationService = createInstantiationService ( _services ) ;
103
+ this . threadService . setInstantiationService ( new InstantiationService ( new ServiceCollection ( [ IThreadService , this . threadService ] ) ) ) ;
104
+ const telemetryServiceInstance = new RemoteTelemetryService ( 'workerTelemetry' , this . threadService ) ;
105
+ const resourceService = new ResourceService ( ) ;
106
+ const markerService = new SecondaryMarkerService ( this . threadService ) ;
107
+ const modeService = new ModeServiceImpl ( this . threadService , extensionService ) ;
108
+ const requestService = new BaseRequestService ( contextService , telemetryServiceInstance ) ;
109
+
110
+ services . set ( IExtensionService , extensionService ) ;
111
+ services . set ( IThreadService , this . threadService ) ;
112
+ services . set ( IModeService , modeService ) ;
113
+ services . set ( IWorkspaceContextService , contextService ) ;
114
+ services . set ( IEventService , new EventService ( ) ) ;
115
+ services . set ( IResourceService , resourceService ) ;
116
+ services . set ( IMarkerService , markerService ) ;
117
+ services . set ( ITelemetryService , telemetryServiceInstance ) ;
118
+ services . set ( IRequestService , requestService ) ;
119
+
120
+ const instantiationService = new InstantiationService ( services ) ;
118
121
this . threadService . setInstantiationService ( instantiationService ) ;
119
122
120
123
// Instantiate thread actors
0 commit comments