diff --git a/src/vs/workbench/parts/debug/common/debug.ts b/src/vs/workbench/parts/debug/common/debug.ts index 713550ad18db5804250ef49188b40d292fdfd10e..f4fcfae1ad0d435314bd61df033d36b3ebfbce0a 100644 --- a/src/vs/workbench/parts/debug/common/debug.ts +++ b/src/vs/workbench/parts/debug/common/debug.ts @@ -12,7 +12,7 @@ import { IViewletView } from 'vs/workbench/browser/viewlet'; import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation'; import editor = require('vs/editor/common/editorCommon'); import { Source } from 'vs/workbench/parts/debug/common/debugSource'; -import {Range} from 'vs/editor/common/core/range'; +import { Range } from 'vs/editor/common/core/range'; export const VIEWLET_ID = 'workbench.view.debug'; export const REPL_ID = 'workbench.panel.repl'; @@ -194,7 +194,7 @@ export interface IGlobalConfig { configurations: IConfig[]; } -export interface IConfig { +export interface IEnvConfig { name?: string; type: string; request: string; @@ -217,6 +217,12 @@ export interface IConfig { silentlyAbort?: boolean; } +export interface IConfig extends IEnvConfig { + windows?: IEnvConfig; + osx?: IEnvConfig; + linux?: IEnvConfig; +} + export interface IRawEnvAdapter { type?: string; label?: string; diff --git a/src/vs/workbench/parts/debug/node/debugAdapter.ts b/src/vs/workbench/parts/debug/node/debugAdapter.ts index 3cd24f2909c816319dbcc2ac8e4de474b9155e0b..8ee23198df413ec9a387d5c8c869d5e386a32176 100644 --- a/src/vs/workbench/parts/debug/node/debugAdapter.ts +++ b/src/vs/workbench/parts/debug/node/debugAdapter.ts @@ -114,6 +114,18 @@ export class Adapter { default: 'openOnFirstSessionStart', description: nls.localize('internalConsoleOptions', "Controls behavior of the internal debug console.") }; + properties.windows = { + type: 'object', + description: nls.localize('debugWindowsConfiguration', "Windows specific launch configuration attributes.") + }; + properties.osx = { + type: 'object', + description: nls.localize('debugOSXConfiguration', "OS X specific launch configuration attributes.") + }; + properties.linux = { + type: 'object', + description: nls.localize('debugLinuxConfiguration', "Linux specific launch configuration attributes.") + }; this.warnRelativePaths(properties.outDir); this.warnRelativePaths(properties.program); this.warnRelativePaths(properties.cwd); diff --git a/src/vs/workbench/parts/debug/node/debugConfigurationManager.ts b/src/vs/workbench/parts/debug/node/debugConfigurationManager.ts index db3e53144e7ea20fc25063f6a5bc2ec49d872f28..45159bd58bb9b9272c823ce264e8652c2a35290b 100644 --- a/src/vs/workbench/parts/debug/node/debugConfigurationManager.ts +++ b/src/vs/workbench/parts/debug/node/debugConfigurationManager.ts @@ -8,6 +8,7 @@ import nls = require('vs/nls'); import { sequence } from 'vs/base/common/async'; import { TPromise } from 'vs/base/common/winjs.base'; import strings = require('vs/base/common/strings'); +import {isLinux, isMacintosh, isWindows} from 'vs/base/common/platform'; import Event, { Emitter } from 'vs/base/common/event'; import objects = require('vs/base/common/objects'); import uri from 'vs/base/common/uri'; @@ -288,6 +289,23 @@ export class ConfigurationManager implements debug.IConfigurationManager { this.configuration = objects.deepClone(nameOrConfig); } + // Set operating system specific properties #1873 + if (isWindows && this.configuration.windows) { + Object.keys(this.configuration.windows).forEach(key => { + this.configuration[key] = this.configuration.windows[key]; + }); + } + if (isMacintosh && this.configuration.osx) { + Object.keys(this.configuration.osx).forEach(key => { + this.configuration[key] = this.configuration.osx[key]; + }); + } + if (isLinux && this.configuration.linux) { + Object.keys(this.configuration.linux).forEach(key => { + this.configuration[key] = this.configuration.linux[key]; + }); + } + // massage configuration attributes - append workspace path to relatvie paths, substitute variables in paths. if (this.configuration && this.systemVariables) { Object.keys(this.configuration).forEach(key => {