mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-25 17:27:26 +01:00
Remove thread attribute usage from markerService
This commit is contained in:
@@ -39,7 +39,6 @@ export class WorkerClient {
|
||||
|
||||
private _lastMessageId:number;
|
||||
private _promises:{[id:string]:IActiveRequest;};
|
||||
private _messageHandlers:{[type:string]:(payload:any)=>void;};
|
||||
private _workerId:number;
|
||||
private _worker:IWorker;
|
||||
|
||||
@@ -57,7 +56,6 @@ export class WorkerClient {
|
||||
this._decodeMessageName = decodeMessageName;
|
||||
this._lastMessageId = 0;
|
||||
this._promises = {};
|
||||
this._messageHandlers= {};
|
||||
|
||||
this._messagesQueue = [];
|
||||
this._processQueueTimeout = -1;
|
||||
@@ -152,14 +150,6 @@ export class WorkerClient {
|
||||
this._worker.terminate();
|
||||
}
|
||||
|
||||
public addMessageHandler(message:string, handler:(payload:any)=>void): void {
|
||||
this._messageHandlers[message]= handler;
|
||||
}
|
||||
|
||||
public removeMessageHandler(message:string): void {
|
||||
delete this._messageHandlers[message];
|
||||
}
|
||||
|
||||
private _sendMessage(type:string, payload:any, forceTimestamp:number=(new Date()).getTime()):TPromise<any> {
|
||||
|
||||
let msg = {
|
||||
@@ -359,10 +349,6 @@ export class WorkerClient {
|
||||
return this._invokeHandler(this[msg.type], this, msg.payload);
|
||||
}
|
||||
|
||||
if (typeof this._messageHandlers[msg.type] === 'function') {
|
||||
return this._invokeHandler(this._messageHandlers[msg.type], null, msg.payload);
|
||||
}
|
||||
|
||||
this._onError('Received unexpected message from Worker:', msg);
|
||||
return TPromise.wrapError(new Error('No handler found'));
|
||||
}
|
||||
|
||||
@@ -213,17 +213,14 @@ export class WorkerServer {
|
||||
}
|
||||
|
||||
if ((msg.type in this._requestHandler) && (typeof this._requestHandler[msg.type] === 'function')) {
|
||||
//var now = (new Date()).getTime();
|
||||
// var now = (new Date()).getTime();
|
||||
try {
|
||||
this._requestHandler[msg.type].call(this._requestHandler, this, c, e, p, msg.payload);
|
||||
} catch (handlerError) {
|
||||
e(errors.transformErrorForSerialization(handlerError));
|
||||
}
|
||||
//var what = msg.type;
|
||||
//if (msg.type === 'rawRequest') {
|
||||
// what += '(' + msg.payload.name + ')';
|
||||
//}
|
||||
//console.info(what + ' took ' + ((new Date().getTime())-now));
|
||||
// var what = msg.type;
|
||||
// console.info(what + ' took ' + ((new Date().getTime())-now));
|
||||
|
||||
} else {
|
||||
this._requestHandler.request(this, c, e, p, msg);
|
||||
|
||||
@@ -181,7 +181,7 @@ export function getOrCreateStaticServices(services?: IEditorOverrideServices): I
|
||||
|
||||
var messageService = services.messageService || new SimpleServices.SimpleMessageService();
|
||||
var pluginService = services.pluginService || new SimpleServices.SimplePluginService();
|
||||
var markerService = services.markerService || new MarkerService.MarkerService(threadService);
|
||||
var markerService = services.markerService || new MarkerService.MainProcessMarkerService(threadService);
|
||||
var requestService = services.requestService || new SimpleServices.SimpleEditorRequestService(contextService, telemetryService);
|
||||
|
||||
var modelService = services.modelService || new ModelServiceImpl(threadService, markerService);
|
||||
|
||||
@@ -11,7 +11,7 @@ import 'vs/editor/common/modes/abstractModeWorker';
|
||||
import 'vs/editor/common/languages.common';
|
||||
|
||||
import {WorkerServer} from 'vs/base/common/worker/workerServer';
|
||||
import {MarkerService} from 'vs/platform/markers/common/markerService';
|
||||
import {SecondaryMarkerService} from 'vs/platform/markers/common/markerService';
|
||||
import {WorkerThreadService} from 'vs/platform/thread/common/workerThreadService';
|
||||
import InstantiationService = require('vs/platform/instantiation/common/instantiationService');
|
||||
import {EventService} from 'vs/platform/event/common/eventService';
|
||||
@@ -98,15 +98,13 @@ export class EditorWorkerServer {
|
||||
|
||||
var contextService = new BaseWorkspaceContextService(initData.contextService.workspace, initData.contextService.configuration, initData.contextService.options);
|
||||
|
||||
this.threadService = new WorkerThreadService(initData.threadService, mainThread.getRemoteCom(), (messageName: string, payload: any) => {
|
||||
return mainThread.request(messageName, payload);
|
||||
});
|
||||
this.threadService = new WorkerThreadService(initData.threadService, mainThread.getRemoteCom());
|
||||
this.threadService.setInstantiationService(InstantiationService.create({ threadService: this.threadService }));
|
||||
|
||||
var telemetryServiceInstance = new WorkerTelemetryService(this.threadService);
|
||||
|
||||
var resourceService = new ResourceService();
|
||||
var markerService = new MarkerService(this.threadService);
|
||||
var markerService = new SecondaryMarkerService(this.threadService);
|
||||
|
||||
var modeService = new ModeServiceImpl(this.threadService, pluginService);
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ suite('Validation - CSS', () => {
|
||||
var url = URI.parse('inmemory://localhost/vs/editor/common/model/mirrorModel/1');
|
||||
var mirrorModel:any= mockMirrorModel(source, url);
|
||||
|
||||
var markerService = new MarkerService.MarkerService(NULL_THREAD_SERVICE);
|
||||
var markerService = new MarkerService.MainProcessMarkerService(NULL_THREAD_SERVICE);
|
||||
var resourceService = new ResourceService.ResourceService();
|
||||
resourceService.insert(url, mirrorModel);
|
||||
|
||||
@@ -55,7 +55,7 @@ suite('Validation - CSS', () => {
|
||||
var model = mockMirrorModel(content, url);
|
||||
resourceService.insert(url, model);
|
||||
|
||||
var markerService = new MarkerService.MarkerService(NULL_THREAD_SERVICE);
|
||||
var markerService = new MarkerService.MainProcessMarkerService(NULL_THREAD_SERVICE);
|
||||
|
||||
let services = servicesUtil2.createMockEditorWorkerServices({
|
||||
resourceService: resourceService,
|
||||
|
||||
@@ -37,7 +37,7 @@ suite('HTML - worker', () => {
|
||||
var model = mm.createMirrorModelFromString(null, 0, content, mode, url);
|
||||
resourceService.insert(url, model);
|
||||
|
||||
var markerService = new MarkerService.MarkerService(NULL_THREAD_SERVICE);
|
||||
var markerService = new MarkerService.MainProcessMarkerService(NULL_THREAD_SERVICE);
|
||||
|
||||
let services = servicesUtil2.createMockEditorWorkerServices({
|
||||
resourceService: resourceService,
|
||||
|
||||
@@ -188,7 +188,7 @@ var instantiationService: IInstantiationService;
|
||||
function setup() {
|
||||
instantiationService = instantiation.create({
|
||||
eventService: new eventEmitter.EventEmitter(),
|
||||
markerService: new markerService.MarkerService(NULL_THREAD_SERVICE),
|
||||
markerService: new markerService.MainProcessMarkerService(NULL_THREAD_SERVICE),
|
||||
fileService: createFileService(),
|
||||
searchService: createSearchService(),
|
||||
messageService: createMessageService(),
|
||||
|
||||
@@ -11,8 +11,7 @@ import collections = require('vs/base/common/collections');
|
||||
import URI from 'vs/base/common/uri';
|
||||
import Event, {Emitter} from 'vs/base/common/event';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import {IThreadService, IThreadSynchronizableObject} from 'vs/platform/thread/common/thread';
|
||||
import {MainThreadAttr} from 'vs/platform/thread/common/threadService';
|
||||
import {Remotable, IThreadService} from 'vs/platform/thread/common/thread';
|
||||
import {IMarkerService, IMarkerData, IResourceMarker, IMarker, MarkerStatistics} from './markers';
|
||||
|
||||
interface Key {
|
||||
@@ -49,42 +48,23 @@ export interface MarkerData {
|
||||
[k: string]: IMarkerData[];
|
||||
}
|
||||
|
||||
export class MarkerService implements IMarkerService, IThreadSynchronizableObject<MarkerData> {
|
||||
|
||||
export abstract class MarkerService implements IMarkerService {
|
||||
public serviceId = IMarkerService;
|
||||
private _data: { [k: string]: IMarkerData[] };
|
||||
private _stats: MarkerStatistics;
|
||||
private _onMarkerChanged: Emitter<URI[]>;
|
||||
|
||||
constructor(threadService: IThreadService) {
|
||||
constructor() {
|
||||
this._data = Object.create(null);
|
||||
this._stats = this._emptyStats();
|
||||
this._onMarkerChanged = new Emitter<URI[]>();
|
||||
threadService.registerInstance(this);
|
||||
}
|
||||
|
||||
// ---- IThreadSynchronizableObject ------------------------------
|
||||
|
||||
public getId(): string {
|
||||
return '__markerService';
|
||||
}
|
||||
|
||||
public getSerializableState(): MarkerData {
|
||||
return this._data;
|
||||
}
|
||||
|
||||
public setData(data: MarkerData): void {
|
||||
this._data = data;
|
||||
}
|
||||
|
||||
public getStatistics(): MarkerStatistics {
|
||||
return this._stats;
|
||||
}
|
||||
|
||||
// ---- Threading attributes to invoke functions everywhere ------
|
||||
|
||||
static $changeOne = MainThreadAttr(MarkerService, MarkerService.prototype.changeOne);
|
||||
static $changeAll = MainThreadAttr(MarkerService, MarkerService.prototype.changeAll);
|
||||
|
||||
// ---- IMarkerService ------------------------------------------
|
||||
|
||||
public get onMarkerChanged(): Event<URI[]> {
|
||||
@@ -306,4 +286,40 @@ export class MarkerService implements IMarkerService, IThreadSynchronizableObjec
|
||||
data.endLineNumber = data.endLineNumber >= data.startLineNumber ? data.endLineNumber : data.startLineNumber;
|
||||
data.endColumn = data.endColumn > 0 ? data.endColumn : data.startColumn;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class SecondaryMarkerService extends MarkerService {
|
||||
|
||||
private _proxy: MainProcessMarkerService;
|
||||
|
||||
constructor(threadService: IThreadService) {
|
||||
super();
|
||||
this._proxy = threadService.getRemotable(MainProcessMarkerService);
|
||||
}
|
||||
|
||||
public changeOne(owner: string, resource: URI, markers: IMarkerData[]): void {
|
||||
this._proxy.changeOne(owner, resource, markers);
|
||||
}
|
||||
|
||||
public changeAll(owner: string, data: IResourceMarker[]): void {
|
||||
this._proxy.changeAll(owner, data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Remotable.MainContext('MainProcessMarkerService')
|
||||
export class MainProcessMarkerService extends MarkerService {
|
||||
|
||||
constructor(threadService: IThreadService) {
|
||||
super();
|
||||
threadService.registerRemotableInstance(MainProcessMarkerService, this);
|
||||
}
|
||||
|
||||
public changeOne(owner: string, resource: URI, markers: IMarkerData[]): void {
|
||||
super.changeOne(owner, resource, markers);
|
||||
}
|
||||
|
||||
public changeAll(owner: string, data: IResourceMarker[]): void {
|
||||
super.changeAll(owner, data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ suite('Marker Service', () => {
|
||||
|
||||
test('query', () => {
|
||||
|
||||
let service = new markerService.MarkerService(NULL_THREAD_SERVICE);
|
||||
let service = new markerService.MainProcessMarkerService(NULL_THREAD_SERVICE);
|
||||
|
||||
service.changeAll('far', [{
|
||||
resource: URI.parse('file:///c/test/file.cs'),
|
||||
@@ -52,7 +52,7 @@ suite('Marker Service', () => {
|
||||
|
||||
test('changeOne override', () => {
|
||||
|
||||
let service = new markerService.MarkerService(NULL_THREAD_SERVICE);
|
||||
let service = new markerService.MainProcessMarkerService(NULL_THREAD_SERVICE);
|
||||
service.changeOne('far', URI.parse('/path/only.cs'), [randomMarkerData()]);
|
||||
assert.equal(service.read().length, 1);
|
||||
assert.equal(service.read({ owner: 'far' }).length, 1);
|
||||
@@ -70,7 +70,7 @@ suite('Marker Service', () => {
|
||||
|
||||
test('changeOne/All clears', () => {
|
||||
|
||||
let service = new markerService.MarkerService(NULL_THREAD_SERVICE);
|
||||
let service = new markerService.MainProcessMarkerService(NULL_THREAD_SERVICE);
|
||||
service.changeOne('far', URI.parse('/path/only.cs'), [randomMarkerData()]);
|
||||
service.changeOne('boo', URI.parse('/path/only.cs'), [randomMarkerData()]);
|
||||
assert.equal(service.read({ owner: 'far' }).length, 1);
|
||||
@@ -90,7 +90,7 @@ suite('Marker Service', () => {
|
||||
|
||||
test('changeAll sends event for cleared', () => {
|
||||
|
||||
let service = new markerService.MarkerService(NULL_THREAD_SERVICE);
|
||||
let service = new markerService.MainProcessMarkerService(NULL_THREAD_SERVICE);
|
||||
service.changeAll('far', [{
|
||||
resource: URI.parse('file:///d/path'),
|
||||
marker: randomMarkerData()
|
||||
@@ -111,7 +111,7 @@ suite('Marker Service', () => {
|
||||
});
|
||||
|
||||
test('changeAll merges', () => {
|
||||
let service = new markerService.MarkerService(NULL_THREAD_SERVICE);
|
||||
let service = new markerService.MainProcessMarkerService(NULL_THREAD_SERVICE);
|
||||
|
||||
service.changeAll('far', [{
|
||||
resource: URI.parse('file:///c/test/file.cs'),
|
||||
|
||||
@@ -24,10 +24,6 @@ export class NullThreadService extends abstractThreadService.AbstractThreadServi
|
||||
return super._doCreateInstance(params);
|
||||
}
|
||||
|
||||
MainThread(obj: IThreadSynchronizableObject<any>, methodName: string, target: Function, params: any[]): winjs.Promise {
|
||||
return target.apply(obj, params);
|
||||
}
|
||||
|
||||
OneWorker(obj: IThreadSynchronizableObject<any>, methodName: string, target: Function, params: any[], affinity: ThreadAffinity): winjs.Promise {
|
||||
return winjs.TPromise.as(null);
|
||||
}
|
||||
|
||||
@@ -119,10 +119,6 @@ export abstract class AbstractThreadService implements remote.IManyHandler {
|
||||
return instance;
|
||||
}
|
||||
|
||||
registerInstance<T extends IThreadSynchronizableObject<any>>(instance: T): void {
|
||||
this._finishInstance(instance);
|
||||
}
|
||||
|
||||
public handle(rpcId: string, methodName: string, args: any[]): any {
|
||||
if (!this._localObjMap[rpcId]) {
|
||||
throw new Error('Unknown actor ' + rpcId);
|
||||
|
||||
@@ -169,18 +169,6 @@ export class MainThreadService extends abstractThreadService.AbstractThreadServi
|
||||
options: this._contextService.getOptions()
|
||||
}
|
||||
});
|
||||
worker.addMessageHandler('threadService', (msg: any) => {
|
||||
let identifier = msg.identifier;
|
||||
let memberName = msg.memberName;
|
||||
let args = msg.args;
|
||||
|
||||
if (!this._boundObjects.hasOwnProperty(identifier)) {
|
||||
throw new Error('Object ' + identifier + ' was not found on the main thread.');
|
||||
}
|
||||
|
||||
let obj = this._boundObjects[identifier];
|
||||
return TPromise.as(obj[memberName].apply(obj, args));
|
||||
});
|
||||
|
||||
return worker;
|
||||
}
|
||||
@@ -196,10 +184,6 @@ export class MainThreadService extends abstractThreadService.AbstractThreadServi
|
||||
return r;
|
||||
}
|
||||
|
||||
MainThread(obj: IThreadSynchronizableObject<any>, methodName: string, target: Function, params: any[]): TPromise<any> {
|
||||
return target.apply(obj, params);
|
||||
}
|
||||
|
||||
private _getWorkerIndex(obj: IThreadSynchronizableObject<any>, affinity: ThreadAffinity): number {
|
||||
if (affinity === ThreadAffinity.None) {
|
||||
let winners: number[] = [0],
|
||||
|
||||
@@ -21,10 +21,6 @@ export class PluginHostThreadService extends abstractThreadService.AbstractThrea
|
||||
this._remoteCom.setManyHandler(this);
|
||||
}
|
||||
|
||||
MainThread(obj: IThreadSynchronizableObject<any>, methodName: string, target: Function, params: any[]): TPromise<any> {
|
||||
return target.apply(obj, params);
|
||||
}
|
||||
|
||||
OneWorker(obj: IThreadSynchronizableObject<any>, methodName: string, target: Function, params: any[], affinity: ThreadAffinity): TPromise<any> {
|
||||
return TPromise.as(null);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ export interface IThreadService {
|
||||
addStatusListener(listener: IThreadServiceStatusListener): void;
|
||||
removeStatusListener(listener: IThreadServiceStatusListener): void;
|
||||
|
||||
MainThread(obj: IThreadSynchronizableObject<any>, methodName: string, target: Function, param: any[]): TPromise<any>;
|
||||
OneWorker(obj: IThreadSynchronizableObject<any>, methodName: string, target: Function, param: any[], affinity: ThreadAffinity): TPromise<any>;
|
||||
AllWorkers(obj: IThreadSynchronizableObject<any>, methodName: string, target: Function, param: any[]): TPromise<any>;
|
||||
Everywhere(obj: IThreadSynchronizableObject<any>, methodName: string, target: Function, param: any[]): any;
|
||||
@@ -41,8 +40,6 @@ export interface IThreadService {
|
||||
createInstance<A1, A2, T extends IThreadSynchronizableObject<any>>(descriptor: descriptors.AsyncDescriptor2<A1, A2, T>, a1: A1, a2: A2): T;
|
||||
createInstance<A1, A2, A3, T extends IThreadSynchronizableObject<any>>(descriptor: descriptors.AsyncDescriptor3<A1, A2, A3, T>, a1: A1, a2: A2, a3: A3): T;
|
||||
|
||||
registerInstance<T extends IThreadSynchronizableObject<any>>(instance: T): void;
|
||||
|
||||
// --- END deprecated methods
|
||||
|
||||
getRemotable<T>(ctor: instantiation.INewConstructorSignature0<T>): T;
|
||||
|
||||
@@ -27,13 +27,6 @@ function findThreadService(obj: any): thread.IThreadService {
|
||||
return threadService;
|
||||
}
|
||||
|
||||
export function MainThreadAttr(type: Function, target: Function): void {
|
||||
let methodName = findMember(type.prototype, target);
|
||||
type.prototype[methodName] = function(...param: any[]) {
|
||||
return findThreadService(this).MainThread(this, methodName, target, param);
|
||||
};
|
||||
}
|
||||
|
||||
export interface IOneWorkerAnnotation {
|
||||
(type: Function, target: Function, affinity?: thread.ThreadAffinity): void;
|
||||
(type: Function, target: Function, condition: () => TPromise<any>, affinity?: thread.ThreadAffinity): void;
|
||||
|
||||
@@ -10,23 +10,16 @@ import remote = require('vs/base/common/remote');
|
||||
import {SyncDescriptor0} from 'vs/platform/instantiation/common/descriptors';
|
||||
import {IThreadService, IThreadServiceStatusListener, IThreadSynchronizableObject, ThreadAffinity} from 'vs/platform/thread/common/thread';
|
||||
|
||||
export interface IMainThreadPublisher {
|
||||
(messageName: string, payload: any): TPromise<any>;
|
||||
}
|
||||
|
||||
export class WorkerThreadService extends abstractThreadService.AbstractThreadService implements IThreadService {
|
||||
public serviceId = IThreadService;
|
||||
private _mainThreadData: abstractThreadService.IThreadServiceData;
|
||||
private _publisher: IMainThreadPublisher;
|
||||
protected _remoteCom: remote.IRemoteCom;
|
||||
|
||||
constructor(mainThreadData: abstractThreadService.IThreadServiceData, remoteCom: remote.IRemoteCom, workerPublisher: IMainThreadPublisher) {
|
||||
constructor(mainThreadData: abstractThreadService.IThreadServiceData, remoteCom: remote.IRemoteCom) {
|
||||
super(false);
|
||||
this._mainThreadData = mainThreadData;
|
||||
this._remoteCom = remoteCom;
|
||||
this._remoteCom.setManyHandler(this);
|
||||
|
||||
this._publisher = workerPublisher;
|
||||
}
|
||||
|
||||
private _handleRequest(identifier: string, memberName: string, args: any[]): TPromise<any> {
|
||||
@@ -72,14 +65,6 @@ export class WorkerThreadService extends abstractThreadService.AbstractThreadSer
|
||||
return super._finishInstance(instance);
|
||||
}
|
||||
|
||||
MainThread(obj: IThreadSynchronizableObject<any>, methodName: string, target: Function, params: any[]): TPromise<any> {
|
||||
return this._publisher('threadService', {
|
||||
identifier: obj.getId(),
|
||||
memberName: methodName,
|
||||
args: params
|
||||
});
|
||||
}
|
||||
|
||||
OneWorker(obj: IThreadSynchronizableObject<any>, methodName: string, target: Function, params: any[], affinity: ThreadAffinity): TPromise<any> {
|
||||
return target.apply(obj, params);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ import {SearchService} from 'vs/workbench/services/search/node/searchService';
|
||||
import {LifecycleService} from 'vs/workbench/services/lifecycle/electron-browser/lifecycleService';
|
||||
import {WorkbenchKeybindingService} from 'vs/workbench/services/keybinding/electron-browser/keybindingService';
|
||||
import {MainThreadService} from 'vs/workbench/services/thread/electron-browser/threadService';
|
||||
import {MarkerService} from 'vs/platform/markers/common/markerService';
|
||||
import {MainProcessMarkerService} from 'vs/platform/markers/common/markerService';
|
||||
import {IActionsService} from 'vs/platform/actions/common/actions';
|
||||
import ActionsService from 'vs/platform/actions/common/actionsService';
|
||||
import {IModelService} from 'vs/editor/common/services/modelService';
|
||||
@@ -267,7 +267,7 @@ export class WorkbenchShell {
|
||||
);
|
||||
lifecycleService.onShutdown(() => requestService.dispose());
|
||||
|
||||
let markerService = new MarkerService(this.threadService);
|
||||
let markerService = new MainProcessMarkerService(this.threadService);
|
||||
|
||||
let pluginService = new MainProcessPluginService(this.contextService, this.threadService, this.messageService, this.telemetryService);
|
||||
this.keybindingService.setPluginService(pluginService);
|
||||
|
||||
@@ -16,7 +16,7 @@ import * as EditorCommon from 'vs/editor/common/editorCommon';
|
||||
import {Model as EditorModel} from 'vs/editor/common/model/model';
|
||||
import {TestThreadService} from './testThreadService'
|
||||
import {create as createInstantiationService} from 'vs/platform/instantiation/common/instantiationService';
|
||||
import {MarkerService} from 'vs/platform/markers/common/markerService';
|
||||
import {MainProcessMarkerService} from 'vs/platform/markers/common/markerService';
|
||||
import {IMarkerService} from 'vs/platform/markers/common/markers';
|
||||
import {IThreadService} from 'vs/platform/thread/common/thread';
|
||||
import {IKeybindingService} from 'vs/platform/keybinding/common/keybindingService';
|
||||
@@ -60,7 +60,7 @@ suite('ExtHostLanguageFeatureCommands', function() {
|
||||
return TPromise.as(instantiationService.invokeFunction(handler, args));
|
||||
}
|
||||
});
|
||||
instantiationService.addSingleton(IMarkerService, new MarkerService(threadService));
|
||||
instantiationService.addSingleton(IMarkerService, new MainProcessMarkerService(threadService));
|
||||
instantiationService.addSingleton(IThreadService, threadService);
|
||||
instantiationService.addSingleton(IModelService, <IModelService>{
|
||||
serviceId: IModelService,
|
||||
|
||||
@@ -15,7 +15,7 @@ import * as EditorCommon from 'vs/editor/common/editorCommon';
|
||||
import {Model as EditorModel} from 'vs/editor/common/model/model';
|
||||
import {TestThreadService} from './testThreadService'
|
||||
import {create as createInstantiationService} from 'vs/platform/instantiation/common/instantiationService';
|
||||
import {MarkerService} from 'vs/platform/markers/common/markerService';
|
||||
import {MainProcessMarkerService} from 'vs/platform/markers/common/markerService';
|
||||
import {IMarkerService} from 'vs/platform/markers/common/markers';
|
||||
import {IThreadService} from 'vs/platform/thread/common/thread';
|
||||
import {ExtHostLanguageFeatures, MainThreadLanguageFeatures} from 'vs/workbench/api/node/extHostLanguageFeatures';
|
||||
@@ -56,7 +56,7 @@ suite('ExtHostLanguageFeatures', function() {
|
||||
|
||||
let instantiationService = createInstantiationService();
|
||||
threadService = new TestThreadService(instantiationService);
|
||||
instantiationService.addSingleton(IMarkerService, new MarkerService(threadService));
|
||||
instantiationService.addSingleton(IMarkerService, new MainProcessMarkerService(threadService));
|
||||
instantiationService.addSingleton(IThreadService, threadService);
|
||||
|
||||
originalErrorHandler = errorHandler.getUnexpectedErrorHandler();
|
||||
|
||||
Reference in New Issue
Block a user