本文整理汇总了TypeScript中vs/platform/instantiation/common/instantiationService.createInstantiationService函数的典型用法代码示例。如果您正苦于以下问题:TypeScript createInstantiationService函数的具体用法?TypeScript createInstantiationService怎么用?TypeScript createInstantiationService使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了createInstantiationService函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: createMockModelService
export function createMockModelService(): IModelService {
let contextService = new BaseWorkspaceContextService({
resource: URI.create('inmemory', 'model', '/'),
id: null,
name: null,
uid: null,
mtime: null
}, {});
let eventService = new EventService();
let configurationService = new MockConfigurationService(contextService, eventService);
var threadService = NULL_THREAD_SERVICE;
var pluginService = new MockPluginService();
var modeService = new MockModeService(threadService, pluginService);
var modelService = new MockModelService(threadService, null, modeService, configurationService);
var inst = createInstantiationService({
threadService: threadService,
pluginService: pluginService,
modeService: modeService,
contextService: contextService,
eventService: eventService,
configurationService: configurationService
});
threadService.setInstantiationService(inst);
return modelService;
}
示例2: test
test("TextDiffEditorModel", function(done) {
let inst = InstantiationService.createInstantiationService({
modeService: createMockModeService(),
modelService: createMockModelService(),
});
let input = inst.createInstance(StringEditorInput, "name", 'description', "value", "text/plain", false);
let otherInput = inst.createInstance(StringEditorInput, "name2", 'description', "value2", "text/plain", false);
let diffInput = new DiffEditorInput("name", "description", input, otherInput);
diffInput.resolve(true).then(function(model: any) {
assert(model);
assert(model instanceof TextDiffEditorModel);
let diffEditorModel = model.textDiffEditorModel;
assert(diffEditorModel.original);
assert(diffEditorModel.modified);
return diffInput.resolve(true).then(function(model: any) {
assert(model.isResolved());
assert(diffEditorModel !== model.textDiffEditorModel);
diffInput.dispose();
assert(!model.textDiffEditorModel);
});
}).done(() => {
done();
});
});
示例3: setup
setup(() => {
instantiation = createInstantiationService({
modelService: {
getModel: () => null
},
requestService: {
getRequestUrl: () => 'file:///folder/file.txt'
},
contextService: new TestContextService()
});
});
示例4: createMockModeService
export function createMockModeService(): IModeService {
var threadService = NULL_THREAD_SERVICE;
var pluginService = new MockPluginService();
var modeService = new MockModeService(threadService, pluginService);
var inst = createInstantiationService({
threadService: threadService,
pluginService: pluginService,
modeService: modeService
});
threadService.setInstantiationService(inst);
return modeService;
}
示例5: initialize
public initialize(mainThread:WorkerServer, complete:ICallback, error:ICallback, progress:ICallback, initData:IInitData):void {
var extensionService = new WorkerPluginService();
var contextService = new BaseWorkspaceContextService(initData.contextService.workspace, initData.contextService.configuration, initData.contextService.options);
this.threadService = new WorkerThreadService(mainThread.getRemoteCom());
this.threadService.setInstantiationService(createInstantiationService({ threadService: this.threadService }));
var telemetryServiceInstance = new WorkerTelemetryService(this.threadService);
var resourceService = new ResourceService();
var markerService = new SecondaryMarkerService(this.threadService);
var modeService = new ModeServiceImpl(this.threadService, extensionService);
var requestService = new BaseRequestService(contextService, telemetryServiceInstance);
var _services : any = {
threadService: this.threadService,
extensionService: extensionService,
modeService: modeService,
contextService: contextService,
eventService: new EventService(),
resourceService: resourceService,
markerService: markerService,
telemetryService: telemetryServiceInstance,
requestService: requestService
};
var instantiationService = createInstantiationService(_services);
this.threadService.setInstantiationService(instantiationService);
// Instantiate thread actors
this.threadService.getRemotable(ModeServiceWorkerHelper);
this.threadService.getRemotable(ModelServiceWorkerHelper);
complete(undefined);
}
示例6: setup
setup(() => {
let emitter = new Emitter<any>();
oneModel = new model.Model('line1\nline2\nline3', model.Model.DEFAULT_CREATION_OPTIONS, null, URI.parse('file:///folder/file.txt'));
instantiation = createInstantiationService({
modelService: {
getModel: () => oneModel,
onModelAdded: emitter.event
},
requestService: {
getRequestUrl: () => 'file:///folder/file.txt'
},
contextService: new TestContextService()
});
});
示例7: createInstantiationService
(function() {
let threadService = NULL_THREAD_SERVICE;
let inst = createInstantiationService({
threadService: threadService,
});
threadService.setInstantiationService(inst);
let mode = new CSSMode(
{ id: 'css' },
inst,
threadService
);
tokenizationSupport = mode.tokenizationSupport;
assertOnEnter = modesUtil.createOnEnterAsserter(mode.getId(), mode.richEditSupport);
wordDefinition = mode.richEditSupport.wordDefinition;
})();
示例8: createInstantiationService
(function() {
let threadService = NULL_THREAD_SERVICE;
let inst = createInstantiationService({
threadService: threadService
});
threadService.setInstantiationService(inst);
let mode = new jsonMode.JSONMode(
{ id: 'json' },
inst,
threadService
)
tokenizationSupport = mode.tokenizationSupport;
assertOnEnter = modesUtil.createOnEnterAsserter(mode.getId(), mode.richEditSupport);
})();
示例9: HTMLMockModeService
(function() {
let threadService = NULL_THREAD_SERVICE;
let modeService = new HTMLMockModeService();
let inst = createInstantiationService({
threadService: threadService,
modeService: modeService
});
threadService.setInstantiationService(inst);
_mode = new HTMLMode<htmlWorker.HTMLWorker>(
{ id: 'html' },
inst,
modeService,
threadService
);
tokenizationSupport = _mode.tokenizationSupport;
})();
示例10: MockModeService
(function() {
let threadService = NULL_THREAD_SERVICE;
let modeService = new MockModeService();
let inst = createInstantiationService({
threadService: threadService,
modeService: modeService
});
threadService.setInstantiationService(inst);
let mode = new RAZORMode(
{ id: 'razor' },
inst,
modeService,
threadService
);
tokenizationSupport = mode.tokenizationSupport;
})();