本文整理匯總了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());
示例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());
示例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]));
示例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]));
示例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());