312
}
313
}
315
result.runtimeArgs = platformContribution.runtimeArgs;
316
}
318
>
if (!path.isAbsolute(platformContribution.program)) {
319
>
result.program = path.join(extensionFolderPath, platformContribution.program);
320
>
} else {
321
result.program = platformContribution.program;
322
}
324
>
if (platformContribution.args) {
325
>
result.args = platformContribution.args;
326
>
}
327
>
328
>
const contribution = platformContribution as IDebuggerContribution;
329
>
330
>
if (contribution.win) {
331
result.win = ExecutableDebugAdapter.extract(contribution.win, extensionFolderPath);
332
}
334
result.winx86 = ExecutableDebugAdapter.extract(contribution.winx86, extensionFolderPath);
335
}
337
result.windows = ExecutableDebugAdapter.extract(contribution.windows, extensionFolderPath);
338
}
340
result.osx = ExecutableDebugAdapter.extract(contribution.osx, extensionFolderPath);
341
}
343
result.linux = ExecutableDebugAdapter.extract(contribution.linux, extensionFolderPath);
344
}
346
>
}
347
348
static platformAdapterExecutable(extensionDescriptions: IExtensionDescription[], debugType: string): IDebugAdapterExecutable | undefined {
349
>
let result: IDebuggerContribution = Object.create(null);
debugAdapter.ts
350
>
debugType = debugType.toLowerCase();
351
>
352
>
// merge all contributions into one
353
>
for (const ed of extensionDescriptions) {
354
>
if (ed.contributes) {
355
>
const debuggers = <IDebuggerContribution[]>ed.contributes['debuggers'];
356
>
if (debuggers && debuggers.length > 0) {
357
>
debuggers.filter(dbg => typeof dbg.type === 'string' && strings.equalsIgnoreCase(dbg.type, debugType)).forEach(dbg => {
358
>
// extract relevant attributes and make them absolute where needed
359
>
const extractedDbg = ExecutableDebugAdapter.extract(dbg, ed.extensionLocation.fsPath);
360
>
361
>
// merge
362
>
result = objects.mixin(result, extractedDbg, ed.isBuiltin);
363
>
});
364
>
}
365
>
}
366
>
}
367
>
368
>
// select the right platform
369
>
let platformInfo: IPlatformSpecificAdapterContribution | undefined;
370
>
if (platform.isWindows && !process.env.hasOwnProperty('PROCESSOR_ARCHITEW6432')) {
371
platformInfo = result.winx86 || result.win || result.windows;
373
platformInfo = result.win || result.windows;
375
platformInfo = result.osx;
377
>
platformInfo = result.linux;
378
>
}
379
>
platformInfo = platformInfo || result;
380
>
381
>
// these are the relevant attributes
382
>
const program = platformInfo.program || result.program;
383
>
const args = platformInfo.args || result.args;
384
>
const runtime = platformInfo.runtime || result.runtime;
385
>
const runtimeArgs = platformInfo.runtimeArgs || result.runtimeArgs;
386
>
387
>
if (runtime) {
388
return {
389
type: 'executable',