本文整理汇总了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());