提交 b217ea1b 编写于 作者: I isidor

debug compounds: "launches" -> "configurations"

上级 72574a9b
......@@ -61,9 +61,12 @@ function updateLaunchJsonDecorations(editor: vscode.TextEditor | undefined) {
const ranges: vscode.Range[] = [];
let addPropertyAndValue = false;
let depthInArray = 0;
visit(editor.document.getText(), {
onObjectProperty: (property, offset, length) => {
addPropertyAndValue = property === 'version' || property === 'type' || property === 'request' || property === 'configurations' || property === 'compounds';
// Decorate attributes which are unlikely to be edited by the user.
// Only decorate "configurations" if it is not inside an array (compounds have a configurations property which should not be decorated).
addPropertyAndValue = property === 'version' || property === 'type' || property === 'request' || property === 'compounds' || (property === 'configurations' && depthInArray === 0);
if (addPropertyAndValue) {
ranges.push(new vscode.Range(editor.document.positionAt(offset), editor.document.positionAt(offset + length)));
}
......@@ -72,6 +75,12 @@ function updateLaunchJsonDecorations(editor: vscode.TextEditor | undefined) {
if (addPropertyAndValue) {
ranges.push(new vscode.Range(editor.document.positionAt(offset), editor.document.positionAt(offset + length)));
}
},
onArrayBegin: (offset: number, length: number) => {
depthInArray++;
},
onArrayEnd: (offset: number, length: number) => {
depthInArray--;
}
});
......
......@@ -303,7 +303,7 @@ export interface IConfig extends IEnvConfig {
export interface ICompound {
name: string;
launches: string[];
configurations: string[];
}
export interface IRawEnvAdapter {
......
......@@ -552,11 +552,11 @@ export class DebugService implements debug.IDebugService {
.then(() => {
const compound = typeof configurationOrName === 'string' ? this.configurationManager.getCompound(configurationOrName) : null;
if (compound) {
if (!compound.launches) {
if (!compound.configurations) {
return TPromise.wrapError(new Error(nls.localize('compoundMustHaveConfigurationNames', "Compound must have \"configurationNames\" attribute set in order to start multiple configurations.")));
}
return TPromise.join(compound.launches.map(name => this.createProcess(name)));
return TPromise.join(compound.configurations.map(name => this.createProcess(name)));
}
return this.configurationManager.getConfiguration(configurationOrName).then(configuration => {
......
......@@ -131,7 +131,7 @@ export const breakpointsExtPoint = extensionsRegistry.ExtensionsRegistry.registe
// debug general schema
export const schemaId = 'vscode://schemas/launch';
const defaultCompound: debug.ICompound = { name: 'Compound', launches: [] };
const defaultCompound: debug.ICompound = { name: 'Compound', configurations: [] };
const schema: IJSONSchema = {
id: schemaId,
type: 'object',
......@@ -162,19 +162,19 @@ const schema: IJSONSchema = {
description: nls.localize('app.launch.json.compounds', "List of compounds. Each compound references multiple configurations which will get launched together."),
items: {
type: 'object',
required: ['name', 'launches'],
required: ['name', 'configurations'],
properties: {
name: {
type: 'string',
description: nls.localize('app.launch.json.compound.name', "Name of compound. Appears in the launch configuration drop down menu.")
},
launches: {
configurations: {
type: 'array',
default: [],
items: {
type: 'string'
},
description: nls.localize('app.launch.json.compounds.launches', "Names of configurations that will be launched as part of this compound.")
description: nls.localize('app.launch.json.compounds.configurations', "Names of configurations that will be started as part of this compound.")
}
},
default: defaultCompound
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册