Skip to content

Commit

Permalink
Operating System Specific Properties in launch.json
Browse files Browse the repository at this point in the history
fixes #1873
  • Loading branch information
isidorn committed Jun 2, 2016
1 parent b459c6a commit 6aa2de7
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/vs/workbench/parts/debug/common/debug.ts
Expand Up @@ -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';
Expand Down Expand Up @@ -194,7 +194,7 @@ export interface IGlobalConfig {
configurations: IConfig[];
}

export interface IConfig {
export interface IEnvConfig {
name?: string;
type: string;
request: string;
Expand All @@ -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;
Expand Down
12 changes: 12 additions & 0 deletions src/vs/workbench/parts/debug/node/debugAdapter.ts
Expand Up @@ -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);
Expand Down
18 changes: 18 additions & 0 deletions src/vs/workbench/parts/debug/node/debugConfigurationManager.ts
Expand Up @@ -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';

This comment has been minimized.

Copy link
@JimiC

JimiC Jun 3, 2016

Contributor

Fix whitespace between curly braces.

import Event, { Emitter } from 'vs/base/common/event';
import objects = require('vs/base/common/objects');
import uri from 'vs/base/common/uri';
Expand Down Expand Up @@ -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 => {
Expand Down

0 comments on commit 6aa2de7

Please sign in to comment.