當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript instantiationService.createInstantiationService函數代碼示例

本文整理匯總了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;
}
開發者ID:BMGburger,項目名稱:vscode,代碼行數:25,代碼來源:servicesTestUtils.ts

示例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();
		});
	});
開發者ID:578723746,項目名稱:vscode,代碼行數:28,代碼來源:editorModel.test.ts

示例3: setup

	setup(() => {
		instantiation = createInstantiationService({
			modelService: {
				getModel: () => null
			},
			requestService: {
				getRequestUrl: () => 'file:///folder/file.txt'
			},
			contextService: new TestContextService()
		});
	});
開發者ID:Abdullah-Mamun,項目名稱:vscode,代碼行數:11,代碼來源:searchViewlet.test.ts

示例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;
}
開發者ID:BMGburger,項目名稱:vscode,代碼行數:12,代碼來源:servicesTestUtils.ts

示例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);
	}
開發者ID:caocao485,項目名稱:vscode,代碼行數:39,代碼來源:editorWorkerServer.ts

示例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()
		});
	});
開發者ID:578723746,項目名稱:vscode,代碼行數:15,代碼來源:searchModel.test.ts

示例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;
	})();
開發者ID:Abdullah-Mamun,項目名稱:vscode,代碼行數:17,代碼來源:css.test.ts

示例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);

	})();
開發者ID:Abdullah-Mamun,項目名稱:vscode,代碼行數:18,代碼來源:json.test.ts

示例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;
	})();
開發者ID:Abdullah-Mamun,項目名稱:vscode,代碼行數:18,代碼來源:html.test.ts

示例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;
	})();
開發者ID:Abdullah-Mamun,項目名稱:vscode,代碼行數:19,代碼來源:razor.test.ts


注:本文中的vs/platform/instantiation/common/instantiationService.createInstantiationService函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。