本文整理匯總了TypeScript中vs/workbench/parts/debug/node/debugAdapter.Adapter.merge方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Adapter.merge方法的具體用法?TypeScript Adapter.merge怎麽用?TypeScript Adapter.merge使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vs/workbench/parts/debug/node/debugAdapter.Adapter
的用法示例。
在下文中一共展示了Adapter.merge方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: test
test('merge', () => {
const da: IRawAdapter = {
type: 'mock',
win: {
runtime: 'winRuntime'
},
linux: {
runtime: 'linuxRuntime'
},
osx: {
runtime: 'osxRuntime'
},
runtimeArgs: ['first arg'],
program: 'mockprogram',
args: ['arg']
};
adapter.merge(da, {
name: 'my name',
id: 'my_id',
version: '1.0',
publisher: 'mockPublisher',
isBuiltin: true,
extensionFolderPath: 'a/b/c/d',
engines: null
});
return adapter.getAdapterExecutable(undefined, false).then(details => {
assert.equal(details.command, platform.isLinux ? da.linux.runtime : platform.isMacintosh ? da.osx.runtime : da.win.runtime);
assert.deepEqual(details.args, da.runtimeArgs.concat(['a/b/c/d/mockprogram'].concat(da.args)));
});
});
示例2: test
test('merge', () => {
const runtimeArgs = ['first arg'];
adapter.merge({
type: 'mock',
runtimeArgs,
program: 'mockprogram'
}, {
name: 'my name',
id: 'my_id',
version: '1.0',
publisher: 'mockPublisher',
isBuiltin: true,
extensionFolderPath: 'a/b/c/d',
engines: null
});
assert.deepEqual(adapter.runtimeArgs, runtimeArgs);
assert.equal(adapter.program, 'a/b/c/d/mockprogram');
});