提交 6aa2de7e 编写于 作者: I isidor

Operating System Specific Properties in launch.json

fixes #1873
上级 b459c6a3
......@@ -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;
......
......@@ -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);
......
......@@ -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 => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册