Merge from vscode f5d3ffa6a0d655c87e1eb0e1e90773df58f7ff25 (#7929)

* Merge from vscode f5d3ffa6a0d655c87e1eb0e1e90773df58f7ff25

* fix launch script

* add missing files
This commit is contained in:
Anthony Dresser
2019-10-22 21:49:55 -07:00
committed by GitHub
parent 4a68ab4659
commit a94cbb528e
189 changed files with 1976 additions and 1541 deletions

View File

@@ -289,6 +289,13 @@ export class DebugService implements IDebugService {
throw new Error(nls.localize({ key: 'compoundMustHaveConfigurations', comment: ['compound indicates a "compounds" configuration item', '"configurations" is an attribute and should not be localized'] },
"Compound must have \"configurations\" attribute set in order to start multiple configurations."));
}
if (compound.preLaunchTask) {
const taskResult = await this.runTaskAndCheckErrors(launch?.workspace || this.contextService.getWorkspace(), compound.preLaunchTask);
if (taskResult === TaskRunResult.Failure) {
this.endInitializingState();
return false;
}
}
const values = await Promise.all(compound.configurations.map(configData => {
const name = typeof configData === 'string' ? configData : configData.name;
@@ -394,10 +401,10 @@ export class DebugService implements IDebugService {
return false;
}
const workspace = launch ? launch.workspace : undefined;
const workspace = launch ? launch.workspace : this.contextService.getWorkspace();
const taskResult = await this.runTaskAndCheckErrors(workspace, resolvedConfig.preLaunchTask);
if (taskResult === TaskRunResult.Success) {
return this.doCreateSession(workspace, { resolved: resolvedConfig, unresolved: unresolvedConfig }, options);
return this.doCreateSession(launch?.workspace, { resolved: resolvedConfig, unresolved: unresolvedConfig }, options);
}
return false;
} catch (err) {
@@ -701,7 +708,7 @@ export class DebugService implements IDebugService {
//---- task management
private async runTaskAndCheckErrors(root: IWorkspaceFolder | undefined, taskId: string | TaskIdentifier | undefined): Promise<TaskRunResult> {
private async runTaskAndCheckErrors(root: IWorkspaceFolder | IWorkspace | undefined, taskId: string | TaskIdentifier | undefined): Promise<TaskRunResult> {
try {
const taskSummary = await this.runTask(root, taskId);

View File

@@ -571,21 +571,18 @@ export class RawDebugSession implements IDisposable {
const args: string[] = [];
for (let arg of vscodeArgs.args) {
if (arg.prefix) {
const a2 = (arg.prefix || '') + (arg.path || '');
const match = /^--(.+)=(.+)$/.exec(a2);
if (match && match.length === 3) {
const key = match[1];
let value = match[2];
const a2 = (arg.prefix || '') + (arg.path || '');
const match = /^--(.+)=(.+)$/.exec(a2);
if (match && match.length === 3) {
const key = match[1];
let value = match[2];
if ((key === 'file-uri' || key === 'folder-uri') && !isUri(arg.path)) {
value = URI.file(value).toString();
}
args.push(`--${key}=${value}`);
} else {
args.push(a2);
if ((key === 'file-uri' || key === 'folder-uri') && !isUri(arg.path)) {
value = URI.file(value).toString();
}
args.push(`--${key}=${value}`);
} else {
args.push(a2);
}
}

View File

@@ -505,6 +505,7 @@ export interface IConfig extends IEnvConfig {
export interface ICompound {
name: string;
preLaunchTask?: string | TaskIdentifier;
configurations: (string | { name: string, folder: string })[];
}

View File

@@ -190,6 +190,11 @@ export const launchSchema: IJSONSchema = {
}]
},
description: nls.localize('app.launch.json.compounds.configurations', "Names of configurations that will be started as part of this compound.")
},
preLaunchTask: {
type: 'string',
default: '',
description: nls.localize('compoundPrelaunchTask', "Task to run before any of the compound configurations start.")
}
},
default: defaultCompound