Skip to content

Commit 57d06e0

Browse files
committed
No more SecondaryMarkerService in compat worker
1 parent 7167504 commit 57d06e0

7 files changed

Lines changed: 15 additions & 59 deletions

File tree

src/vs/editor/browser/standalone/standaloneServices.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {IInstantiationService, createDecorator} from 'vs/platform/instantiation/
1818
import {InstantiationService} from 'vs/platform/instantiation/common/instantiationService';
1919
import {ServiceCollection} from 'vs/platform/instantiation/common/serviceCollection';
2020
import {IKeybindingService} from 'vs/platform/keybinding/common/keybindingService';
21-
import {MainProcessMarkerService} from 'vs/platform/markers/common/markerService';
21+
import {MarkerService} from 'vs/platform/markers/common/markerService';
2222
import {IMarkerService} from 'vs/platform/markers/common/markers';
2323
import {IMessageService} from 'vs/platform/message/common/message';
2424
import {IProgressService} from 'vs/platform/progress/common/progress';
@@ -239,7 +239,7 @@ export function getOrCreateStaticServices(services?: IEditorOverrideServices): I
239239
let threadService = services.threadService || new MainThreadService(contextService, 'vs/editor/common/worker/editorWorkerServer');
240240
let messageService = services.messageService || new SimpleMessageService();
241241
let extensionService = services.extensionService || new SimpleExtensionService();
242-
let markerService = services.markerService || new MainProcessMarkerService(threadService);
242+
let markerService = services.markerService || new MarkerService();
243243
let requestService = services.requestService || new SimpleEditorRequestService(contextService, telemetryService);
244244
let modeService = services.modeService || new MainThreadModeServiceImpl(threadService, extensionService, configurationService);
245245
let modelService = services.modelService || new ModelServiceImpl(threadService, markerService, modeService, configurationService, messageService);

src/vs/editor/common/worker/editorWorkerServer.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ import {AbstractExtensionService, ActivatedExtension} from 'vs/platform/extensio
1616
import {IExtensionDescription, IExtensionService} from 'vs/platform/extensions/common/extensions';
1717
import {ServiceCollection} from 'vs/platform/instantiation/common/serviceCollection';
1818
import {InstantiationService} from 'vs/platform/instantiation/common/instantiationService';
19-
import {SecondaryMarkerService} from 'vs/platform/markers/common/markerService';
20-
import {IMarkerService} from 'vs/platform/markers/common/markers';
2119
import {BaseRequestService} from 'vs/platform/request/common/baseRequestService';
2220
import {IRequestService} from 'vs/platform/request/common/request';
2321
import {NullTelemetryService} from 'vs/platform/telemetry/common/telemetry';
@@ -100,7 +98,6 @@ export class EditorWorkerServer {
10098
this.threadService = new WorkerThreadService(mainThread.getRemoteCom());
10199
this.threadService.setInstantiationService(new InstantiationService(new ServiceCollection([IThreadService, this.threadService])));
102100
const resourceService = new ResourceService();
103-
const markerService = new SecondaryMarkerService(this.threadService);
104101
const modeService = new ModeServiceImpl(this.threadService, extensionService);
105102
const requestService = new BaseRequestService(contextService, NullTelemetryService);
106103

@@ -110,7 +107,6 @@ export class EditorWorkerServer {
110107
services.set(IWorkspaceContextService, contextService);
111108
services.set(IEventService, new EventService());
112109
services.set(IResourceService, resourceService);
113-
services.set(IMarkerService, markerService);
114110
services.set(IRequestService, requestService);
115111

116112
const instantiationService = new InstantiationService(services);

src/vs/platform/markers/common/markerService.ts

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import collections = require('vs/base/common/collections');
1111
import URI from 'vs/base/common/uri';
1212
import Event, {Emitter} from 'vs/base/common/event';
1313
import Severity from 'vs/base/common/severity';
14-
import {Remotable, IThreadService} from 'vs/platform/thread/common/thread';
1514
import {IMarkerService, IMarkerData, IResourceMarker, IMarker, MarkerStatistics} from './markers';
1615

1716
interface Key {
@@ -49,7 +48,7 @@ export interface MarkerData {
4948
}
5049

5150

52-
export abstract class MarkerService implements IMarkerService {
51+
export class MarkerService implements IMarkerService {
5352
public serviceId = IMarkerService;
5453
private _data: { [k: string]: IMarkerData[] };
5554
private _stats: MarkerStatistics;
@@ -296,41 +295,3 @@ export abstract class MarkerService implements IMarkerService {
296295
return true;
297296
}
298297
}
299-
300-
export class SecondaryMarkerService extends MarkerService {
301-
302-
private _proxy: MainProcessMarkerService;
303-
304-
constructor(threadService: IThreadService) {
305-
super();
306-
this._proxy = threadService.getRemotable(MainProcessMarkerService);
307-
}
308-
309-
public changeOne(owner: string, resource: URI, markers: IMarkerData[]): void {
310-
super.changeOne(owner, resource, markers);
311-
this._proxy.changeOne(owner, resource, markers);
312-
}
313-
314-
public changeAll(owner: string, data: IResourceMarker[]): void {
315-
super.changeAll(owner, data);
316-
this._proxy.changeAll(owner, data);
317-
}
318-
319-
}
320-
321-
@Remotable.MainContext('MainProcessMarkerService')
322-
export class MainProcessMarkerService extends MarkerService {
323-
324-
constructor(@IThreadService threadService: IThreadService) {
325-
super();
326-
threadService.registerRemotableInstance(MainProcessMarkerService, this);
327-
}
328-
329-
public changeOne(owner: string, resource: URI, markers: IMarkerData[]): void {
330-
super.changeOne(owner, resource, markers);
331-
}
332-
333-
public changeAll(owner: string, data: IResourceMarker[]): void {
334-
super.changeAll(owner, data);
335-
}
336-
}

src/vs/platform/markers/test/common/markerService.test.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import assert = require('assert');
99
import URI from 'vs/base/common/uri';
1010
import markerService = require('vs/platform/markers/common/markerService');
11-
import {NULL_THREAD_SERVICE} from 'vs/platform/test/common/nullThreadService';
1211
import {IMarkerData} from 'vs/platform/markers/common/markers';
1312

1413
function randomMarkerData(): IMarkerData {
@@ -26,7 +25,7 @@ suite('Marker Service', () => {
2625

2726
test('query', () => {
2827

29-
let service = new markerService.MainProcessMarkerService(NULL_THREAD_SERVICE);
28+
let service = new markerService.MarkerService();
3029

3130
service.changeAll('far', [{
3231
resource: URI.parse('file:///c/test/file.cs'),
@@ -52,7 +51,7 @@ suite('Marker Service', () => {
5251

5352
test('changeOne override', () => {
5453

55-
let service = new markerService.MainProcessMarkerService(NULL_THREAD_SERVICE);
54+
let service = new markerService.MarkerService();
5655
service.changeOne('far', URI.parse('/path/only.cs'), [randomMarkerData()]);
5756
assert.equal(service.read().length, 1);
5857
assert.equal(service.read({ owner: 'far' }).length, 1);
@@ -70,7 +69,7 @@ suite('Marker Service', () => {
7069

7170
test('changeOne/All clears', () => {
7271

73-
let service = new markerService.MainProcessMarkerService(NULL_THREAD_SERVICE);
72+
let service = new markerService.MarkerService();
7473
service.changeOne('far', URI.parse('/path/only.cs'), [randomMarkerData()]);
7574
service.changeOne('boo', URI.parse('/path/only.cs'), [randomMarkerData()]);
7675
assert.equal(service.read({ owner: 'far' }).length, 1);
@@ -90,7 +89,7 @@ suite('Marker Service', () => {
9089

9190
test('changeAll sends event for cleared', () => {
9291

93-
let service = new markerService.MainProcessMarkerService(NULL_THREAD_SERVICE);
92+
let service = new markerService.MarkerService();
9493
service.changeAll('far', [{
9594
resource: URI.parse('file:///d/path'),
9695
marker: randomMarkerData()
@@ -111,7 +110,7 @@ suite('Marker Service', () => {
111110
});
112111

113112
test('changeAll merges', () => {
114-
let service = new markerService.MainProcessMarkerService(NULL_THREAD_SERVICE);
113+
let service = new markerService.MarkerService();
115114

116115
service.changeAll('far', [{
117116
resource: URI.parse('file:///c/test/file.cs'),
@@ -127,7 +126,7 @@ suite('Marker Service', () => {
127126
test('invalid marker data', () => {
128127

129128
let data = randomMarkerData();
130-
let service = new markerService.MainProcessMarkerService(NULL_THREAD_SERVICE);
129+
let service = new markerService.MarkerService();
131130

132131
data.message = undefined;
133132
service.changeOne('far', URI.parse('some:uri/path'), [data]);

src/vs/workbench/electron-browser/shell.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import {FileService} from 'vs/workbench/services/files/electron-browser/fileServ
3636
import {SearchService} from 'vs/workbench/services/search/node/searchService';
3737
import {LifecycleService} from 'vs/workbench/services/lifecycle/electron-browser/lifecycleService';
3838
import {MainThreadService} from 'vs/workbench/services/thread/electron-browser/threadService';
39-
import {MainProcessMarkerService} from 'vs/platform/markers/common/markerService';
39+
import {MarkerService} from 'vs/platform/markers/common/markerService';
4040
import {IModelService} from 'vs/editor/common/services/modelService';
4141
import {ModelServiceImpl} from 'vs/editor/common/services/modelServiceImpl';
4242
import {CodeEditorServiceImpl} from 'vs/editor/browser/services/codeEditorServiceImpl';
@@ -275,7 +275,7 @@ export class WorkbenchShell {
275275
let requestService = disposables.add(instantiationService.createInstance(RequestService));
276276
serviceCollection.set(IRequestService, requestService);
277277

278-
let markerService = instantiationService.createInstance(MainProcessMarkerService);
278+
let markerService = instantiationService.createInstance(MarkerService);
279279
serviceCollection.set(IMarkerService, markerService);
280280

281281
let modeService = instantiationService.createInstance(MainThreadModeServiceImpl);

src/vs/workbench/test/node/api/extHostApiCommands.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {Model as EditorModel} from 'vs/editor/common/model/model';
1515
import {TestThreadService} from './testThreadService';
1616
import {ServiceCollection} from 'vs/platform/instantiation/common/serviceCollection';
1717
import {InstantiationService} from 'vs/platform/instantiation/common/instantiationService';
18-
import {MainProcessMarkerService} from 'vs/platform/markers/common/markerService';
18+
import {MarkerService} from 'vs/platform/markers/common/markerService';
1919
import {IMarkerService} from 'vs/platform/markers/common/markers';
2020
import {IThreadService} from 'vs/platform/thread/common/thread';
2121
import {IKeybindingService} from 'vs/platform/keybinding/common/keybindingService';
@@ -62,7 +62,7 @@ suite('ExtHostLanguageFeatureCommands', function() {
6262
return TPromise.as(instantiationService.invokeFunction(handler, args));
6363
}
6464
});
65-
services.set(IMarkerService, new MainProcessMarkerService(threadService));
65+
services.set(IMarkerService, new MarkerService());
6666
services.set(IThreadService, threadService);
6767
services.set(IModelService, <IModelService>{
6868
serviceId: IModelService,

src/vs/workbench/test/node/api/extHostLanguageFeatures.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {Range as EditorRange} from 'vs/editor/common/core/range';
1616
import {TestThreadService} from './testThreadService';
1717
import {ServiceCollection} from 'vs/platform/instantiation/common/serviceCollection';
1818
import {InstantiationService} from 'vs/platform/instantiation/common/instantiationService';
19-
import {MainProcessMarkerService} from 'vs/platform/markers/common/markerService';
19+
import {MarkerService} from 'vs/platform/markers/common/markerService';
2020
import {IMarkerService} from 'vs/platform/markers/common/markers';
2121
import {IThreadService} from 'vs/platform/thread/common/thread';
2222
import {ExtHostLanguageFeatures, MainThreadLanguageFeatures} from 'vs/workbench/api/node/extHostLanguageFeatures';
@@ -61,7 +61,7 @@ suite('ExtHostLanguageFeatures', function() {
6161
let services = new ServiceCollection();
6262
let instantiationService = new InstantiationService(services);
6363
threadService = new TestThreadService(instantiationService);
64-
services.set(IMarkerService, new MainProcessMarkerService(threadService));
64+
services.set(IMarkerService, new MarkerService());
6565
services.set(IThreadService, threadService);
6666

6767
originalErrorHandler = errorHandler.getUnexpectedErrorHandler();

0 commit comments

Comments
 (0)