Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/vscode.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Lourens <roblourens@gmail.com>2022-08-06 03:18:11 +0300
committerRob Lourens <roblourens@gmail.com>2022-08-06 03:18:11 +0300
commitcfd3c5c86e14552cc01bf926b09395dcfe26ce4d (patch)
treeea50c0fb19eef9f0256af2dfe963c900dda7acf0
parent6d24a019d8784650fe1a63b7d7326f2d206104af (diff)
"input" variables prevent compound configuration from launching more than one sessionroblourens/issue141514
Fixes #141514
-rw-r--r--src/vs/workbench/contrib/debug/browser/debugService.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/vs/workbench/contrib/debug/browser/debugService.ts b/src/vs/workbench/contrib/debug/browser/debugService.ts
index 0cf0497bec2..27bb4016459 100644
--- a/src/vs/workbench/contrib/debug/browser/debugService.ts
+++ b/src/vs/workbench/contrib/debug/browser/debugService.ts
@@ -6,7 +6,7 @@
import * as aria from 'vs/base/browser/ui/aria/aria';
import { Action, IAction } from 'vs/base/common/actions';
import { distinct } from 'vs/base/common/arrays';
-import { raceTimeout, RunOnceScheduler } from 'vs/base/common/async';
+import { Queue, raceTimeout, RunOnceScheduler } from 'vs/base/common/async';
import { CancellationTokenSource } from 'vs/base/common/cancellation';
import { isErrorWithActions } from 'vs/base/common/errorMessage';
import * as errors from 'vs/base/common/errors';
@@ -825,6 +825,7 @@ export class DebugService implements IDebugService {
return Promise.all(sessions.map(s => disconnect ? s.disconnect(undefined, suspend) : s.terminate()));
}
+ private variableSubstitutionQueue = new Queue<IConfig | undefined>();
private async substituteVariables(launch: ILaunch | undefined, config: IConfig): Promise<IConfig | undefined> {
const dbg = this.adapterManager.getDebugger(config.type);
if (dbg) {
@@ -838,7 +839,8 @@ export class DebugService implements IDebugService {
}
}
try {
- return await dbg.substituteVariables(folder, config);
+ // Variable substitution can require user interaction, so only one of these should be running at a time.
+ return this.variableSubstitutionQueue.queue(() => dbg.substituteVariables(folder, config));
} catch (err) {
this.showError(err.message, undefined, !!launch?.getConfiguration(config.name));
return undefined; // bail out