mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-27 17:23:21 -05:00
Merge from vscode f5d3ffa6a0d655c87e1eb0e1e90773df58f7ff25 (#7929)
* Merge from vscode f5d3ffa6a0d655c87e1eb0e1e90773df58f7ff25 * fix launch script * add missing files
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -505,6 +505,7 @@ export interface IConfig extends IEnvConfig {
|
||||
|
||||
export interface ICompound {
|
||||
name: string;
|
||||
preLaunchTask?: string | TaskIdentifier;
|
||||
configurations: (string | { name: string, folder: string })[];
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user