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


TypeScript service.cp.Server類代碼示例

本文整理匯總了TypeScript中vs/base/node/service.cp.Server的典型用法代碼示例。如果您正苦於以下問題:TypeScript cp.Server類的具體用法?TypeScript cp.Server怎麽用?TypeScript cp.Server使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了cp.Server類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: Server

/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

'use strict';

import { Server } from 'vs/base/node/service.cp';
import {SearchService} from 'vs/workbench/services/search/node/rawSearchService';

const server = new Server();
server.registerService('SearchService', new SearchService());
開發者ID:gaoxiaojun,項目名稱:vscode,代碼行數:12,代碼來源:searchApp.ts

示例2: Server

/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
'use strict';

import { Server } from 'vs/base/node/service.cp';
import { TestService } from 'vs/base/test/node/service/testService';

const server = new Server();
server.registerService('TestService', new TestService());
開發者ID:1424667164,項目名稱:vscode,代碼行數:11,代碼來源:testApp.ts

示例3: tmpdirSync

		var git = new gitlib.Git({
			gitPath: gitPath,
			tmpPath: tmpdirSync(), // TODO@Joao os.tmpdir()???
			defaultEncoding: defaultEncoding,
			env: env
		});

		super(git.open(path.normalize(basePath)));
	}
}

function tmpdirSync(): string {
	var path: string;
	var paths = /^win/i.test(process.platform) ? [process.env.TMP, process.env.TEMP] : ['/tmp', '/var/tmp', '/private/tmp', '/private/var/tmp'];

	for (var i = 0; i < paths.length; i++) {
		path = paths[i];
		try {
			if (fs.statSync(path).isDirectory()) {
				return path;
			}
		} catch (e) {
			// Ignore
		}
	}

	throw new Error('Temp dir not found');
}

const server = new Server();
server.registerService('GitService', new NativeRawGitService(process.argv[2], process.argv[3], process.argv[4], process.argv[5]));
開發者ID:gaoxiaojun,項目名稱:vscode,代碼行數:31,代碼來源:gitApp.ts

示例4: tmpdir

				VSCODE_GIT_ASKPASS_NODE: exePath,
				VSCODE_GIT_ASKPASS_MODULE_ID: 'vs/workbench/parts/git/electron-main/askpass'
			});

			const git = new gitlib.Git({
				gitPath, version,
				tmpPath: tmpdir(),
				defaultEncoding: defaultEncoding,
				env: env
			});

			const repo = git.open(workspaceRoot);
			const promise = repo.getRoot()
				.then<string>(null, (err: gitlib.GitError) => {
					if (err instanceof gitlib.GitError && err.gitErrorCode === GitErrorCodes.NotAGitRepository) {
						return workspaceRoot;
					}

					return TPromise.wrapError(err);
				})
				.then(root => realpath(root))
				.then(root => git.open(root))
				.then(repo => new RawGitService(repo));

			super(promise);
		}
	}
}

const server = new Server();
server.registerService('GitService', new IPCRawGitService(process.argv[2], process.argv[3], process.argv[4], process.argv[5], process.argv[6]));
開發者ID:1833183060,項目名稱:vscode,代碼行數:31,代碼來源:gitApp.ts

示例5: Server

/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
'use strict';

import { Server } from 'vs/base/node/service.cp';
import {ChokidarWatcherService} from 'vs/workbench/services/files/node/watcher/unix/chokidarWatcherService';

const server = new Server();
server.registerService('WatcherService', new ChokidarWatcherService());
開發者ID:1833183060,項目名稱:vscode,代碼行數:11,代碼來源:watcherApp.ts


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