@codingame/monaco-vscode-debug-service-override 25.1.2 → 26.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/platform/debug/common/extensionHostDebugIpc.js +41 -29
- package/vscode/src/vs/workbench/contrib/debug/browser/callStackView.js +379 -255
- package/vscode/src/vs/workbench/contrib/debug/browser/debug.contribution.js +606 -325
- package/vscode/src/vs/workbench/contrib/debug/browser/debugAdapterManager.js +132 -91
- package/vscode/src/vs/workbench/contrib/debug/browser/debugChatIntegration.js +105 -103
- package/vscode/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +258 -147
- package/vscode/src/vs/workbench/contrib/debug/browser/debugConsoleQuickAccess.js +14 -10
- package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorActions.js +163 -121
- package/vscode/src/vs/workbench/contrib/debug/browser/debugMemory.js +92 -41
- package/vscode/src/vs/workbench/contrib/debug/browser/debugProgress.js +13 -12
- package/vscode/src/vs/workbench/contrib/debug/browser/debugQuickAccess.js +68 -39
- package/vscode/src/vs/workbench/contrib/debug/browser/debugService.js +290 -214
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSession.js +409 -260
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSettingMigration.js +14 -12
- package/vscode/src/vs/workbench/contrib/debug/browser/debugStatus.js +19 -21
- package/vscode/src/vs/workbench/contrib/debug/browser/debugTaskRunner.js +126 -100
- package/vscode/src/vs/workbench/contrib/debug/browser/debugTitle.js +8 -9
- package/vscode/src/vs/workbench/contrib/debug/browser/debugToolBar.js +160 -89
- package/vscode/src/vs/workbench/contrib/debug/browser/debugViewlet.js +87 -71
- package/vscode/src/vs/workbench/contrib/debug/browser/disassemblyView.js +270 -181
- package/vscode/src/vs/workbench/contrib/debug/browser/extensionHostDebugService.js +79 -48
- package/vscode/src/vs/workbench/contrib/debug/browser/loadedScriptsView.js +149 -113
- package/vscode/src/vs/workbench/contrib/debug/browser/media/debugViewlet.css +24 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/rawDebugSession.js +201 -189
- package/vscode/src/vs/workbench/contrib/debug/browser/replAccessibilityHelp.js +28 -35
- package/vscode/src/vs/workbench/contrib/debug/browser/replAccessibleView.js +10 -12
- package/vscode/src/vs/workbench/contrib/debug/browser/runAndDebugAccessibilityHelp.js +66 -86
- package/vscode/src/vs/workbench/contrib/debug/browser/statusbarColorProvider.js +24 -31
- package/vscode/src/vs/workbench/contrib/debug/browser/watchExpressionsView.js +177 -138
- package/vscode/src/vs/workbench/contrib/debug/browser/welcomeView.js +55 -33
- package/vscode/src/vs/workbench/contrib/debug/common/breakpoints.js +2 -4
- package/vscode/src/vs/workbench/contrib/debug/common/debugAccessibilityAnnouncer.js +8 -12
- package/vscode/src/vs/workbench/contrib/debug/common/debugContentProvider.js +23 -19
- package/vscode/src/vs/workbench/contrib/debug/common/debugLifecycle.js +9 -15
- package/vscode/src/vs/workbench/contrib/debug/common/debugSchemas.js +156 -133
- package/vscode/src/vs/workbench/contrib/debug/common/debugStorage.js +81 -52
- package/vscode/src/vs/workbench/contrib/debug/common/debugTelemetry.js +3 -5
- package/vscode/src/vs/workbench/contrib/debug/common/debugViewModel.js +22 -14
- package/vscode/src/vs/workbench/contrib/debug/common/debugVisualizers.js +46 -30
- package/vscode/src/vs/workbench/contrib/debug/common/debugger.js +74 -52
- package/vscode/src/vs/workbench/contrib/debug/common/replAccessibilityAnnouncer.js +11 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableCommands.js +7 -7
|
@@ -38,13 +38,25 @@ import { debugConfigure } from '@codingame/monaco-vscode-api/vscode/vs/workbench
|
|
|
38
38
|
|
|
39
39
|
const jsonRegistry = ( Registry.as(Extensions.JSONContribution));
|
|
40
40
|
jsonRegistry.registerSchema(launchSchemaId, launchSchema);
|
|
41
|
-
const DEBUG_SELECTED_CONFIG_NAME_KEY =
|
|
42
|
-
const DEBUG_SELECTED_ROOT =
|
|
43
|
-
const DEBUG_SELECTED_TYPE =
|
|
44
|
-
const DEBUG_RECENT_DYNAMIC_CONFIGURATIONS =
|
|
45
|
-
const ON_DEBUG_DYNAMIC_CONFIGURATIONS_NAME =
|
|
41
|
+
const DEBUG_SELECTED_CONFIG_NAME_KEY = "debug.selectedconfigname";
|
|
42
|
+
const DEBUG_SELECTED_ROOT = "debug.selectedroot";
|
|
43
|
+
const DEBUG_SELECTED_TYPE = "debug.selectedtype";
|
|
44
|
+
const DEBUG_RECENT_DYNAMIC_CONFIGURATIONS = "debug.recentdynamicconfigurations";
|
|
45
|
+
const ON_DEBUG_DYNAMIC_CONFIGURATIONS_NAME = "onDebugDynamicConfigurations";
|
|
46
46
|
let ConfigurationManager = class ConfigurationManager {
|
|
47
|
-
constructor(
|
|
47
|
+
constructor(
|
|
48
|
+
adapterManager,
|
|
49
|
+
contextService,
|
|
50
|
+
configurationService,
|
|
51
|
+
quickInputService,
|
|
52
|
+
instantiationService,
|
|
53
|
+
storageService,
|
|
54
|
+
extensionService,
|
|
55
|
+
historyService,
|
|
56
|
+
uriIdentityService,
|
|
57
|
+
contextKeyService,
|
|
58
|
+
logService
|
|
59
|
+
) {
|
|
48
60
|
this.adapterManager = adapterManager;
|
|
49
61
|
this.contextService = contextService;
|
|
50
62
|
this.configurationService = configurationService;
|
|
@@ -70,11 +82,12 @@ let ConfigurationManager = class ConfigurationManager {
|
|
|
70
82
|
const previousSelectedLaunch = this.launches.find(l => ( l.uri.toString()) === previousSelectedRoot);
|
|
71
83
|
const previousSelectedName = this.storageService.get(DEBUG_SELECTED_CONFIG_NAME_KEY, StorageScope.WORKSPACE);
|
|
72
84
|
this.debugConfigurationTypeContext = CONTEXT_DEBUG_CONFIGURATION_TYPE.bindTo(contextKeyService);
|
|
73
|
-
const dynamicConfig = previousSelectedType ? {
|
|
85
|
+
const dynamicConfig = previousSelectedType ? {
|
|
86
|
+
type: previousSelectedType
|
|
87
|
+
} : undefined;
|
|
74
88
|
if (previousSelectedLaunch && previousSelectedLaunch.getConfigurationNames().length) {
|
|
75
89
|
this.selectConfiguration(previousSelectedLaunch, previousSelectedName, undefined, dynamicConfig);
|
|
76
|
-
}
|
|
77
|
-
else if (this.launches.length > 0) {
|
|
90
|
+
} else if (this.launches.length > 0) {
|
|
78
91
|
this.selectConfiguration(undefined, previousSelectedName, undefined, dynamicConfig);
|
|
79
92
|
}
|
|
80
93
|
}
|
|
@@ -98,13 +111,15 @@ let ConfigurationManager = class ConfigurationManager {
|
|
|
98
111
|
if (triggerKind === undefined) {
|
|
99
112
|
triggerKind = DebugConfigurationProviderTriggerKind.Initial;
|
|
100
113
|
}
|
|
101
|
-
const provider = this.configProviders.find(
|
|
114
|
+
const provider = this.configProviders.find(
|
|
115
|
+
p => p.provideDebugConfigurations && (p.type === debugType) && (p.triggerKind === triggerKind)
|
|
116
|
+
);
|
|
102
117
|
return !!provider;
|
|
103
118
|
}
|
|
104
119
|
async resolveConfigurationByProviders(folderUri, type, config, token) {
|
|
105
120
|
const resolveDebugConfigurationForType = async (type, config) => {
|
|
106
|
-
if (type !==
|
|
107
|
-
await this.adapterManager.activateDebuggers(
|
|
121
|
+
if (type !== "*") {
|
|
122
|
+
await this.adapterManager.activateDebuggers("onDebugResolve", type);
|
|
108
123
|
}
|
|
109
124
|
for (const p of this.configProviders) {
|
|
110
125
|
if (p.type === type && p.resolveDebugConfiguration && config) {
|
|
@@ -115,17 +130,23 @@ let ConfigurationManager = class ConfigurationManager {
|
|
|
115
130
|
};
|
|
116
131
|
let resolvedType = config.type ?? type;
|
|
117
132
|
let result = config;
|
|
118
|
-
for (let seen = ( new Set());
|
|
133
|
+
for (let seen = ( new Set());
|
|
134
|
+
result && !( seen.has(resolvedType));
|
|
135
|
+
)
|
|
136
|
+
{
|
|
119
137
|
seen.add(resolvedType);
|
|
120
138
|
result = await resolveDebugConfigurationForType(resolvedType, result);
|
|
121
|
-
result = await resolveDebugConfigurationForType(
|
|
139
|
+
result = await resolveDebugConfigurationForType("*", result);
|
|
122
140
|
resolvedType = result?.type ?? type;
|
|
123
141
|
}
|
|
124
142
|
return result;
|
|
125
143
|
}
|
|
126
144
|
async resolveDebugConfigurationWithSubstitutedVariables(folderUri, type, config, token) {
|
|
127
|
-
const providers = this.configProviders.filter(
|
|
128
|
-
|
|
145
|
+
const providers = this.configProviders.filter(
|
|
146
|
+
p => p.type === type && p.resolveDebugConfigurationWithSubstitutedVariables
|
|
147
|
+
).concat(
|
|
148
|
+
this.configProviders.filter(p => p.type === "*" && p.resolveDebugConfigurationWithSubstitutedVariables)
|
|
149
|
+
);
|
|
129
150
|
let result = config;
|
|
130
151
|
await sequence(( providers.map(provider => async () => {
|
|
131
152
|
if (result) {
|
|
@@ -135,8 +156,10 @@ let ConfigurationManager = class ConfigurationManager {
|
|
|
135
156
|
return result;
|
|
136
157
|
}
|
|
137
158
|
async provideDebugConfigurations(folderUri, type, token) {
|
|
138
|
-
await this.adapterManager.activateDebuggers(
|
|
139
|
-
const results = await Promise.all(( this.configProviders.filter(
|
|
159
|
+
await this.adapterManager.activateDebuggers("onDebugInitialConfigurations");
|
|
160
|
+
const results = await Promise.all(( this.configProviders.filter(
|
|
161
|
+
p => p.type === type && p.triggerKind === DebugConfigurationProviderTriggerKind.Initial && p.provideDebugConfigurations
|
|
162
|
+
).map(p => p.provideDebugConfigurations(folderUri, token))));
|
|
140
163
|
return results.reduce((first, second) => first.concat(second), []);
|
|
141
164
|
}
|
|
142
165
|
async getDynamicProviders() {
|
|
@@ -150,15 +173,13 @@ let ConfigurationManager = class ConfigurationManager {
|
|
|
150
173
|
for (const event of e.activationEvents) {
|
|
151
174
|
if (event === ON_DEBUG_DYNAMIC_CONFIGURATIONS_NAME) {
|
|
152
175
|
hasGenericEvent = true;
|
|
153
|
-
}
|
|
154
|
-
else if (event.startsWith(`${ON_DEBUG_DYNAMIC_CONFIGURATIONS_NAME}:`)) {
|
|
176
|
+
} else if (event.startsWith(`${ON_DEBUG_DYNAMIC_CONFIGURATIONS_NAME}:`)) {
|
|
155
177
|
explicitTypes.push(event.slice(ON_DEBUG_DYNAMIC_CONFIGURATIONS_NAME.length + 1));
|
|
156
178
|
}
|
|
157
179
|
}
|
|
158
180
|
if (explicitTypes.length) {
|
|
159
181
|
explicitTypes.forEach(t => acc.add(t));
|
|
160
|
-
}
|
|
161
|
-
else if (hasGenericEvent) {
|
|
182
|
+
} else if (hasGenericEvent) {
|
|
162
183
|
const debuggerType = e.contributes?.debuggers?.[0].type;
|
|
163
184
|
if (debuggerType) {
|
|
164
185
|
acc.add(debuggerType);
|
|
@@ -176,7 +197,9 @@ let ConfigurationManager = class ConfigurationManager {
|
|
|
176
197
|
label: this.adapterManager.getDebuggerLabel(type),
|
|
177
198
|
getProvider: async () => {
|
|
178
199
|
await this.adapterManager.activateDebuggers(ON_DEBUG_DYNAMIC_CONFIGURATIONS_NAME, type);
|
|
179
|
-
return this.configProviders.find(
|
|
200
|
+
return this.configProviders.find(
|
|
201
|
+
p => p.type === type && p.triggerKind === DebugConfigurationProviderTriggerKind.Dynamic && p.provideDebugConfigurations
|
|
202
|
+
);
|
|
180
203
|
},
|
|
181
204
|
type,
|
|
182
205
|
pick: async () => {
|
|
@@ -186,13 +209,20 @@ let ConfigurationManager = class ConfigurationManager {
|
|
|
186
209
|
disposables.add(token);
|
|
187
210
|
const input = disposables.add(this.quickInputService.createQuickPick());
|
|
188
211
|
input.busy = true;
|
|
189
|
-
input.placeholder = ( localize(
|
|
212
|
+
input.placeholder = ( localize(7084, "Select Launch Configuration"));
|
|
190
213
|
const chosenPromise = ( new Promise(resolve => {
|
|
191
214
|
disposables.add(input.onDidAccept(() => resolve(input.activeItems[0])));
|
|
192
|
-
disposables.add(input.onDidTriggerItemButton(async
|
|
215
|
+
disposables.add(input.onDidTriggerItemButton(async context => {
|
|
193
216
|
resolve(undefined);
|
|
194
|
-
const {
|
|
195
|
-
|
|
217
|
+
const {
|
|
218
|
+
launch,
|
|
219
|
+
config
|
|
220
|
+
} = context.item;
|
|
221
|
+
await launch.openConfigFile({
|
|
222
|
+
preserveFocus: false,
|
|
223
|
+
type: config.type,
|
|
224
|
+
suppressInitialConfigs: true
|
|
225
|
+
});
|
|
196
226
|
await launch.writeConfiguration(config);
|
|
197
227
|
await this.selectConfiguration(launch, config.name);
|
|
198
228
|
this.removeRecentDynamicConfigurations(config.name, config.type);
|
|
@@ -202,8 +232,7 @@ let ConfigurationManager = class ConfigurationManager {
|
|
|
202
232
|
let items;
|
|
203
233
|
try {
|
|
204
234
|
items = await this.getDynamicConfigurationsByType(type, token.token);
|
|
205
|
-
}
|
|
206
|
-
catch (err) {
|
|
235
|
+
} catch (err) {
|
|
207
236
|
this.logService.error(err);
|
|
208
237
|
disposables.dispose();
|
|
209
238
|
return;
|
|
@@ -221,19 +250,23 @@ let ConfigurationManager = class ConfigurationManager {
|
|
|
221
250
|
async getDynamicConfigurationsByType(type, token = CancellationToken.None) {
|
|
222
251
|
await this.adapterManager.activateDebuggers(ON_DEBUG_DYNAMIC_CONFIGURATIONS_NAME, type);
|
|
223
252
|
const picks = [];
|
|
224
|
-
const provider = this.configProviders.find(
|
|
253
|
+
const provider = this.configProviders.find(
|
|
254
|
+
p => p.type === type && p.triggerKind === DebugConfigurationProviderTriggerKind.Dynamic && p.provideDebugConfigurations
|
|
255
|
+
);
|
|
225
256
|
this.getLaunches().forEach(launch => {
|
|
226
257
|
if (provider) {
|
|
227
|
-
picks.push(
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
258
|
+
picks.push(
|
|
259
|
+
provider.provideDebugConfigurations(launch.workspace?.uri, token).then(configurations => ( configurations.map(config => ({
|
|
260
|
+
label: config.name,
|
|
261
|
+
description: launch.name,
|
|
262
|
+
config,
|
|
263
|
+
buttons: [{
|
|
232
264
|
iconClass: ThemeIcon.asClassName(debugConfigure),
|
|
233
|
-
tooltip: ( localize(
|
|
265
|
+
tooltip: ( localize(7085, "Edit Debug Configuration in launch.json"))
|
|
234
266
|
}],
|
|
235
|
-
|
|
236
|
-
|
|
267
|
+
launch
|
|
268
|
+
}))))
|
|
269
|
+
);
|
|
237
270
|
}
|
|
238
271
|
});
|
|
239
272
|
return (await Promise.all(picks)).flat();
|
|
@@ -244,7 +277,11 @@ let ConfigurationManager = class ConfigurationManager {
|
|
|
244
277
|
for (const name of l.getConfigurationNames()) {
|
|
245
278
|
const config = l.getConfiguration(name) || l.getCompound(name);
|
|
246
279
|
if (config) {
|
|
247
|
-
all.push({
|
|
280
|
+
all.push({
|
|
281
|
+
launch: l,
|
|
282
|
+
name,
|
|
283
|
+
presentation: config.presentation
|
|
284
|
+
});
|
|
248
285
|
}
|
|
249
286
|
}
|
|
250
287
|
}
|
|
@@ -252,25 +289,34 @@ let ConfigurationManager = class ConfigurationManager {
|
|
|
252
289
|
}
|
|
253
290
|
removeRecentDynamicConfigurations(name, type) {
|
|
254
291
|
const remaining = this.getRecentDynamicConfigurations().filter(c => c.name !== name || c.type !== type);
|
|
255
|
-
this.storageService.store(
|
|
292
|
+
this.storageService.store(
|
|
293
|
+
DEBUG_RECENT_DYNAMIC_CONFIGURATIONS,
|
|
294
|
+
JSON.stringify(remaining),
|
|
295
|
+
StorageScope.WORKSPACE,
|
|
296
|
+
StorageTarget.MACHINE
|
|
297
|
+
);
|
|
256
298
|
if (this.selectedConfiguration.name === name && this.selectedType === type && this.selectedDynamic) {
|
|
257
299
|
this.selectConfiguration(undefined, undefined);
|
|
258
|
-
}
|
|
259
|
-
else {
|
|
300
|
+
} else {
|
|
260
301
|
this._onDidSelectConfigurationName.fire();
|
|
261
302
|
}
|
|
262
303
|
}
|
|
263
304
|
getRecentDynamicConfigurations() {
|
|
264
|
-
return JSON.parse(
|
|
305
|
+
return JSON.parse(
|
|
306
|
+
this.storageService.get(DEBUG_RECENT_DYNAMIC_CONFIGURATIONS, StorageScope.WORKSPACE, "[]")
|
|
307
|
+
);
|
|
265
308
|
}
|
|
266
309
|
registerListeners() {
|
|
267
|
-
this.toDispose.push(Event.any(
|
|
310
|
+
this.toDispose.push(Event.any(
|
|
311
|
+
this.contextService.onDidChangeWorkspaceFolders,
|
|
312
|
+
this.contextService.onDidChangeWorkbenchState
|
|
313
|
+
)(() => {
|
|
268
314
|
this.initLaunches();
|
|
269
315
|
this.selectConfiguration(undefined);
|
|
270
316
|
this.setCompoundSchemaValues();
|
|
271
317
|
}));
|
|
272
|
-
this.toDispose.push(this.configurationService.onDidChangeConfiguration(async
|
|
273
|
-
if (e.affectsConfiguration(
|
|
318
|
+
this.toDispose.push(this.configurationService.onDidChangeConfiguration(async e => {
|
|
319
|
+
if (e.affectsConfiguration("launch")) {
|
|
274
320
|
await this.selectConfiguration(undefined);
|
|
275
321
|
this.setCompoundSchemaValues();
|
|
276
322
|
}
|
|
@@ -284,15 +330,19 @@ let ConfigurationManager = class ConfigurationManager {
|
|
|
284
330
|
folder => this.instantiationService.createInstance(Launch, this, this.adapterManager, folder)
|
|
285
331
|
));
|
|
286
332
|
if (this.contextService.getWorkbenchState() === WorkbenchState.WORKSPACE) {
|
|
287
|
-
this.launches.push(
|
|
333
|
+
this.launches.push(
|
|
334
|
+
this.instantiationService.createInstance(WorkspaceLaunch, this, this.adapterManager)
|
|
335
|
+
);
|
|
288
336
|
}
|
|
289
|
-
this.launches.push(
|
|
337
|
+
this.launches.push(
|
|
338
|
+
this.instantiationService.createInstance(UserLaunch, this, this.adapterManager)
|
|
339
|
+
);
|
|
290
340
|
if (this.selectedLaunch && this.launches.indexOf(this.selectedLaunch) === -1) {
|
|
291
341
|
this.selectConfiguration(undefined);
|
|
292
342
|
}
|
|
293
343
|
}
|
|
294
344
|
setCompoundSchemaValues() {
|
|
295
|
-
const compoundConfigurationsSchema = launchSchema.properties[
|
|
345
|
+
const compoundConfigurationsSchema = launchSchema.properties["compounds"].items.properties["configurations"];
|
|
296
346
|
const launchNames = ( this.launches.map(l => l.getConfigurationNames(true))).reduce((first, second) => first.concat(second), []);
|
|
297
347
|
compoundConfigurationsSchema.items.oneOf[0].enum = launchNames;
|
|
298
348
|
compoundConfigurationsSchema.items.oneOf[1].properties.name.enum = launchNames;
|
|
@@ -307,7 +357,9 @@ let ConfigurationManager = class ConfigurationManager {
|
|
|
307
357
|
if (!URI.isUri(workspaceUri)) {
|
|
308
358
|
return undefined;
|
|
309
359
|
}
|
|
310
|
-
return this.launches.find(
|
|
360
|
+
return this.launches.find(
|
|
361
|
+
l => l.workspace && this.uriIdentityService.extUri.isEqual(l.workspace.uri, workspaceUri)
|
|
362
|
+
);
|
|
311
363
|
}
|
|
312
364
|
get selectedConfiguration() {
|
|
313
365
|
return {
|
|
@@ -327,7 +379,7 @@ let ConfigurationManager = class ConfigurationManager {
|
|
|
327
379
|
return undefined;
|
|
328
380
|
}
|
|
329
381
|
async selectConfiguration(launch, name, config, dynamicConfig) {
|
|
330
|
-
if (typeof launch ===
|
|
382
|
+
if (typeof launch === "undefined") {
|
|
331
383
|
const rootUri = this.historyService.getLastActiveWorkspaceRoot();
|
|
332
384
|
launch = this.getLaunch(rootUri);
|
|
333
385
|
if (!launch || launch.getConfigurationNames().length === 0) {
|
|
@@ -340,8 +392,7 @@ let ConfigurationManager = class ConfigurationManager {
|
|
|
340
392
|
this.selectedLaunch = launch;
|
|
341
393
|
if (this.selectedLaunch) {
|
|
342
394
|
this.storageService.store(DEBUG_SELECTED_ROOT, ( this.selectedLaunch.uri.toString()), StorageScope.WORKSPACE, StorageTarget.MACHINE);
|
|
343
|
-
}
|
|
344
|
-
else {
|
|
395
|
+
} else {
|
|
345
396
|
this.storageService.remove(DEBUG_SELECTED_ROOT, StorageScope.WORKSPACE);
|
|
346
397
|
}
|
|
347
398
|
const names = launch ? launch.getConfigurationNames() : [];
|
|
@@ -352,8 +403,7 @@ let ConfigurationManager = class ConfigurationManager {
|
|
|
352
403
|
let type = config?.type;
|
|
353
404
|
if (name && names.indexOf(name) >= 0) {
|
|
354
405
|
this.setSelectedLaunchName(name);
|
|
355
|
-
}
|
|
356
|
-
else if (dynamicConfig && dynamicConfig.type) {
|
|
406
|
+
} else if (dynamicConfig && dynamicConfig.type) {
|
|
357
407
|
type = dynamicConfig.type;
|
|
358
408
|
if (!config) {
|
|
359
409
|
const providers = (await this.getDynamicProviders()).filter(p => p.type === type);
|
|
@@ -374,12 +424,19 @@ let ConfigurationManager = class ConfigurationManager {
|
|
|
374
424
|
this.setSelectedLaunchName(name);
|
|
375
425
|
let recentDynamicProviders = this.getRecentDynamicConfigurations();
|
|
376
426
|
if (name && dynamicConfig.type) {
|
|
377
|
-
recentDynamicProviders.unshift({
|
|
427
|
+
recentDynamicProviders.unshift({
|
|
428
|
+
name,
|
|
429
|
+
type: dynamicConfig.type
|
|
430
|
+
});
|
|
378
431
|
recentDynamicProviders = distinct(recentDynamicProviders, t => `${t.name} : ${t.type}`);
|
|
379
|
-
this.storageService.store(
|
|
432
|
+
this.storageService.store(
|
|
433
|
+
DEBUG_RECENT_DYNAMIC_CONFIGURATIONS,
|
|
434
|
+
JSON.stringify(recentDynamicProviders),
|
|
435
|
+
StorageScope.WORKSPACE,
|
|
436
|
+
StorageTarget.MACHINE
|
|
437
|
+
);
|
|
380
438
|
}
|
|
381
|
-
}
|
|
382
|
-
else if (!this.selectedName || names.indexOf(this.selectedName) === -1) {
|
|
439
|
+
} else if (!this.selectedName || names.indexOf(this.selectedName) === -1) {
|
|
383
440
|
const nameToSet = names.length ? names[0] : undefined;
|
|
384
441
|
this.setSelectedLaunchName(nameToSet);
|
|
385
442
|
}
|
|
@@ -389,11 +446,15 @@ let ConfigurationManager = class ConfigurationManager {
|
|
|
389
446
|
}
|
|
390
447
|
this.selectedType = dynamicConfig?.type || config?.type;
|
|
391
448
|
this.selectedDynamic = !!dynamicConfig;
|
|
392
|
-
this.storageService.store(
|
|
449
|
+
this.storageService.store(
|
|
450
|
+
DEBUG_SELECTED_TYPE,
|
|
451
|
+
dynamicConfig ? this.selectedType : undefined,
|
|
452
|
+
StorageScope.WORKSPACE,
|
|
453
|
+
StorageTarget.MACHINE
|
|
454
|
+
);
|
|
393
455
|
if (type) {
|
|
394
456
|
this.debugConfigurationTypeContext.set(type);
|
|
395
|
-
}
|
|
396
|
-
else {
|
|
457
|
+
} else {
|
|
397
458
|
this.debugConfigurationTypeContext.reset();
|
|
398
459
|
}
|
|
399
460
|
if (this.selectedLaunch !== previousLaunch || this.selectedName !== previousName || previousSelectedDynamic !== this.selectedDynamic) {
|
|
@@ -403,9 +464,13 @@ let ConfigurationManager = class ConfigurationManager {
|
|
|
403
464
|
setSelectedLaunchName(selectedName) {
|
|
404
465
|
this.selectedName = selectedName;
|
|
405
466
|
if (this.selectedName) {
|
|
406
|
-
this.storageService.store(
|
|
407
|
-
|
|
408
|
-
|
|
467
|
+
this.storageService.store(
|
|
468
|
+
DEBUG_SELECTED_CONFIG_NAME_KEY,
|
|
469
|
+
this.selectedName,
|
|
470
|
+
StorageScope.WORKSPACE,
|
|
471
|
+
StorageTarget.MACHINE
|
|
472
|
+
);
|
|
473
|
+
} else {
|
|
409
474
|
this.storageService.remove(DEBUG_SELECTED_CONFIG_NAME_KEY, StorageScope.WORKSPACE);
|
|
410
475
|
}
|
|
411
476
|
}
|
|
@@ -413,18 +478,7 @@ let ConfigurationManager = class ConfigurationManager {
|
|
|
413
478
|
this.toDispose = dispose(this.toDispose);
|
|
414
479
|
}
|
|
415
480
|
};
|
|
416
|
-
ConfigurationManager = ( __decorate([
|
|
417
|
-
( __param(1, IWorkspaceContextService)),
|
|
418
|
-
( __param(2, IConfigurationService)),
|
|
419
|
-
( __param(3, IQuickInputService)),
|
|
420
|
-
( __param(4, IInstantiationService)),
|
|
421
|
-
( __param(5, IStorageService)),
|
|
422
|
-
( __param(6, IExtensionService)),
|
|
423
|
-
( __param(7, IHistoryService)),
|
|
424
|
-
( __param(8, IUriIdentityService)),
|
|
425
|
-
( __param(9, IContextKeyService)),
|
|
426
|
-
( __param(10, ILogService))
|
|
427
|
-
], ConfigurationManager));
|
|
481
|
+
ConfigurationManager = ( __decorate([( __param(1, IWorkspaceContextService)), ( __param(2, IConfigurationService)), ( __param(3, IQuickInputService)), ( __param(4, IInstantiationService)), ( __param(5, IStorageService)), ( __param(6, IExtensionService)), ( __param(7, IHistoryService)), ( __param(8, IUriIdentityService)), ( __param(9, IContextKeyService)), ( __param(10, ILogService))], ConfigurationManager));
|
|
428
482
|
class AbstractLaunch {
|
|
429
483
|
constructor(configurationManager, adapterManager) {
|
|
430
484
|
this.configurationManager = configurationManager;
|
|
@@ -441,17 +495,20 @@ class AbstractLaunch {
|
|
|
441
495
|
const config = this.getDeduplicatedConfig();
|
|
442
496
|
if (!config || (!Array.isArray(config.configurations) && !Array.isArray(config.compounds))) {
|
|
443
497
|
return [];
|
|
444
|
-
}
|
|
445
|
-
else {
|
|
498
|
+
} else {
|
|
446
499
|
const configurations = [];
|
|
447
500
|
if (config.configurations) {
|
|
448
|
-
configurations.push(
|
|
501
|
+
configurations.push(
|
|
502
|
+
...config.configurations.filter(cfg => cfg && typeof cfg.name === "string")
|
|
503
|
+
);
|
|
449
504
|
}
|
|
450
505
|
if (ignoreCompoundsAndPresentation) {
|
|
451
506
|
return ( configurations.map(c => c.name));
|
|
452
507
|
}
|
|
453
508
|
if (config.compounds) {
|
|
454
|
-
configurations.push(...config.compounds.filter(
|
|
509
|
+
configurations.push(...config.compounds.filter(
|
|
510
|
+
compound => typeof compound.name === "string" && compound.configurations && compound.configurations.length
|
|
511
|
+
));
|
|
455
512
|
}
|
|
456
513
|
return ( getVisibleAndSorted(configurations).map(c => c.name));
|
|
457
514
|
}
|
|
@@ -466,27 +523,31 @@ class AbstractLaunch {
|
|
|
466
523
|
return;
|
|
467
524
|
}
|
|
468
525
|
if (this instanceof UserLaunch) {
|
|
469
|
-
return {
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
|
|
526
|
+
return {
|
|
527
|
+
...configuration,
|
|
528
|
+
__configurationTarget: ConfigurationTarget.USER
|
|
529
|
+
};
|
|
530
|
+
} else if (this instanceof WorkspaceLaunch) {
|
|
531
|
+
return {
|
|
532
|
+
...configuration,
|
|
533
|
+
__configurationTarget: ConfigurationTarget.WORKSPACE
|
|
534
|
+
};
|
|
535
|
+
} else {
|
|
536
|
+
return {
|
|
537
|
+
...configuration,
|
|
538
|
+
__configurationTarget: ConfigurationTarget.WORKSPACE_FOLDER
|
|
539
|
+
};
|
|
476
540
|
}
|
|
477
541
|
}
|
|
478
542
|
async getInitialConfigurationContent(folderUri, type, useInitialConfigs, token) {
|
|
479
|
-
let content =
|
|
480
|
-
const adapter = type
|
|
481
|
-
|
|
482
|
-
|
|
543
|
+
let content = "";
|
|
544
|
+
const adapter = type ? {
|
|
545
|
+
debugger: this.adapterManager.getEnabledDebugger(type)
|
|
546
|
+
} : await this.adapterManager.guessDebugger(true);
|
|
483
547
|
if (adapter?.withConfig && adapter.debugger) {
|
|
484
548
|
content = await adapter.debugger.getInitialConfigurationContent([adapter.withConfig.config]);
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
const initialConfigs = useInitialConfigs ?
|
|
488
|
-
await this.configurationManager.provideDebugConfigurations(folderUri, adapter.debugger.type, token || CancellationToken.None) :
|
|
489
|
-
[];
|
|
549
|
+
} else if (adapter?.debugger) {
|
|
550
|
+
const initialConfigs = useInitialConfigs ? await this.configurationManager.provideDebugConfigurations(folderUri, adapter.debugger.type, token || CancellationToken.None) : [];
|
|
490
551
|
content = await adapter.debugger.getInitialConfigurationContent(initialConfigs);
|
|
491
552
|
}
|
|
492
553
|
return content;
|
|
@@ -499,7 +560,7 @@ class AbstractLaunch {
|
|
|
499
560
|
return original && {
|
|
500
561
|
version: original.version,
|
|
501
562
|
compounds: original.compounds && distinguishConfigsByName(original.compounds),
|
|
502
|
-
configurations: original.configurations && distinguishConfigsByName(original.configurations)
|
|
563
|
+
configurations: original.configurations && distinguishConfigsByName(original.configurations)
|
|
503
564
|
};
|
|
504
565
|
}
|
|
505
566
|
}
|
|
@@ -508,11 +569,22 @@ function distinguishConfigsByName(things) {
|
|
|
508
569
|
return ( things.map(thing => {
|
|
509
570
|
const no = seen.get(thing.name) || 0;
|
|
510
571
|
seen.set(thing.name, no + 1);
|
|
511
|
-
return no === 0 ? thing : {
|
|
572
|
+
return no === 0 ? thing : {
|
|
573
|
+
...thing,
|
|
574
|
+
name: `${thing.name} (${no})`
|
|
575
|
+
};
|
|
512
576
|
}));
|
|
513
577
|
}
|
|
514
578
|
let Launch = class Launch extends AbstractLaunch {
|
|
515
|
-
constructor(
|
|
579
|
+
constructor(
|
|
580
|
+
configurationManager,
|
|
581
|
+
adapterManager,
|
|
582
|
+
workspace,
|
|
583
|
+
fileService,
|
|
584
|
+
textFileService,
|
|
585
|
+
editorService,
|
|
586
|
+
configurationService
|
|
587
|
+
) {
|
|
516
588
|
super(configurationManager, adapterManager);
|
|
517
589
|
this.workspace = workspace;
|
|
518
590
|
this.fileService = fileService;
|
|
@@ -521,34 +593,44 @@ let Launch = class Launch extends AbstractLaunch {
|
|
|
521
593
|
this.configurationService = configurationService;
|
|
522
594
|
}
|
|
523
595
|
get uri() {
|
|
524
|
-
return joinPath(this.workspace.uri,
|
|
596
|
+
return joinPath(this.workspace.uri, "/.vscode/launch.json");
|
|
525
597
|
}
|
|
526
598
|
get name() {
|
|
527
599
|
return this.workspace.name;
|
|
528
600
|
}
|
|
529
601
|
getConfig() {
|
|
530
|
-
return this.configurationService.inspect(
|
|
531
|
-
|
|
532
|
-
|
|
602
|
+
return this.configurationService.inspect("launch", {
|
|
603
|
+
resource: this.workspace.uri
|
|
604
|
+
}).workspaceFolderValue;
|
|
605
|
+
}
|
|
606
|
+
async openConfigFile(
|
|
607
|
+
{
|
|
608
|
+
preserveFocus,
|
|
609
|
+
type,
|
|
610
|
+
suppressInitialConfigs
|
|
611
|
+
},
|
|
612
|
+
token
|
|
613
|
+
) {
|
|
533
614
|
const resource = this.uri;
|
|
534
615
|
let created = false;
|
|
535
|
-
let content =
|
|
616
|
+
let content = "";
|
|
536
617
|
try {
|
|
537
618
|
const fileContent = await this.fileService.readFile(resource);
|
|
538
619
|
content = ( fileContent.value.toString());
|
|
539
|
-
}
|
|
540
|
-
catch {
|
|
620
|
+
} catch {
|
|
541
621
|
content = await this.getInitialConfigurationContent(this.workspace.uri, type, !suppressInitialConfigs, token);
|
|
542
622
|
if (!content) {
|
|
543
|
-
return {
|
|
623
|
+
return {
|
|
624
|
+
editor: null,
|
|
625
|
+
created: false
|
|
626
|
+
};
|
|
544
627
|
}
|
|
545
628
|
created = true;
|
|
546
629
|
try {
|
|
547
630
|
await this.textFileService.write(resource, content);
|
|
548
|
-
}
|
|
549
|
-
catch (error) {
|
|
631
|
+
} catch (error) {
|
|
550
632
|
throw ( new Error(( localize(
|
|
551
|
-
|
|
633
|
+
7086,
|
|
552
634
|
"Unable to create 'launch.json' file inside the '.vscode' folder ({0}).",
|
|
553
635
|
error.message
|
|
554
636
|
))));
|
|
@@ -557,11 +639,14 @@ let Launch = class Launch extends AbstractLaunch {
|
|
|
557
639
|
const index = content.indexOf(`"${this.configurationManager.selectedConfiguration.name}"`);
|
|
558
640
|
let startLineNumber = 1;
|
|
559
641
|
for (let i = 0; i < index; i++) {
|
|
560
|
-
if (content.charAt(i) ===
|
|
642
|
+
if (content.charAt(i) === "\n") {
|
|
561
643
|
startLineNumber++;
|
|
562
644
|
}
|
|
563
645
|
}
|
|
564
|
-
const selection = startLineNumber > 1 ? {
|
|
646
|
+
const selection = startLineNumber > 1 ? {
|
|
647
|
+
startLineNumber,
|
|
648
|
+
startColumn: 4
|
|
649
|
+
} : undefined;
|
|
565
650
|
const editor = await this.editorService.openEditor({
|
|
566
651
|
resource,
|
|
567
652
|
options: {
|
|
@@ -569,7 +654,7 @@ let Launch = class Launch extends AbstractLaunch {
|
|
|
569
654
|
preserveFocus,
|
|
570
655
|
pinned: created,
|
|
571
656
|
revealIfVisible: true
|
|
572
|
-
}
|
|
657
|
+
}
|
|
573
658
|
}, ACTIVE_GROUP);
|
|
574
659
|
return ({
|
|
575
660
|
editor: editor ?? null,
|
|
@@ -577,19 +662,24 @@ let Launch = class Launch extends AbstractLaunch {
|
|
|
577
662
|
});
|
|
578
663
|
}
|
|
579
664
|
async writeConfiguration(configuration) {
|
|
580
|
-
const fullConfig = {
|
|
665
|
+
const fullConfig = {
|
|
666
|
+
...(this.getConfig() ?? {})
|
|
667
|
+
};
|
|
581
668
|
fullConfig.configurations = [...(fullConfig.configurations || []), configuration];
|
|
582
|
-
await this.configurationService.updateValue(
|
|
669
|
+
await this.configurationService.updateValue("launch", fullConfig, {
|
|
670
|
+
resource: this.workspace.uri
|
|
671
|
+
}, ConfigurationTarget.WORKSPACE_FOLDER);
|
|
583
672
|
}
|
|
584
673
|
};
|
|
585
|
-
Launch = ( __decorate([
|
|
586
|
-
( __param(3, IFileService)),
|
|
587
|
-
( __param(4, ITextFileService)),
|
|
588
|
-
( __param(5, IEditorService)),
|
|
589
|
-
( __param(6, IConfigurationService))
|
|
590
|
-
], Launch));
|
|
674
|
+
Launch = ( __decorate([( __param(3, IFileService)), ( __param(4, ITextFileService)), ( __param(5, IEditorService)), ( __param(6, IConfigurationService))], Launch));
|
|
591
675
|
let WorkspaceLaunch = class WorkspaceLaunch extends AbstractLaunch {
|
|
592
|
-
constructor(
|
|
676
|
+
constructor(
|
|
677
|
+
configurationManager,
|
|
678
|
+
adapterManager,
|
|
679
|
+
editorService,
|
|
680
|
+
configurationService,
|
|
681
|
+
contextService
|
|
682
|
+
) {
|
|
593
683
|
super(configurationManager, adapterManager);
|
|
594
684
|
this.editorService = editorService;
|
|
595
685
|
this.configurationService = configurationService;
|
|
@@ -602,25 +692,36 @@ let WorkspaceLaunch = class WorkspaceLaunch extends AbstractLaunch {
|
|
|
602
692
|
return this.contextService.getWorkspace().configuration;
|
|
603
693
|
}
|
|
604
694
|
get name() {
|
|
605
|
-
return localize(
|
|
695
|
+
return localize(7087, "workspace");
|
|
606
696
|
}
|
|
607
697
|
getConfig() {
|
|
608
|
-
return this.configurationService.inspect(
|
|
609
|
-
}
|
|
610
|
-
async openConfigFile(
|
|
698
|
+
return this.configurationService.inspect("launch").workspaceValue;
|
|
699
|
+
}
|
|
700
|
+
async openConfigFile(
|
|
701
|
+
{
|
|
702
|
+
preserveFocus,
|
|
703
|
+
type,
|
|
704
|
+
useInitialConfigs
|
|
705
|
+
},
|
|
706
|
+
token
|
|
707
|
+
) {
|
|
611
708
|
const launchExistInFile = !!this.getConfig();
|
|
612
709
|
if (!launchExistInFile) {
|
|
613
710
|
const content = await this.getInitialConfigurationContent(undefined, type, useInitialConfigs, token);
|
|
614
711
|
if (content) {
|
|
615
|
-
await this.configurationService.updateValue(
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
|
|
712
|
+
await this.configurationService.updateValue("launch", parse(content), ConfigurationTarget.WORKSPACE);
|
|
713
|
+
} else {
|
|
714
|
+
return {
|
|
715
|
+
editor: null,
|
|
716
|
+
created: false
|
|
717
|
+
};
|
|
619
718
|
}
|
|
620
719
|
}
|
|
621
720
|
const editor = await this.editorService.openEditor({
|
|
622
721
|
resource: this.contextService.getWorkspace().configuration,
|
|
623
|
-
options: {
|
|
722
|
+
options: {
|
|
723
|
+
preserveFocus
|
|
724
|
+
}
|
|
624
725
|
}, ACTIVE_GROUP);
|
|
625
726
|
return ({
|
|
626
727
|
editor: editor ?? null,
|
|
@@ -628,13 +729,14 @@ let WorkspaceLaunch = class WorkspaceLaunch extends AbstractLaunch {
|
|
|
628
729
|
});
|
|
629
730
|
}
|
|
630
731
|
};
|
|
631
|
-
WorkspaceLaunch = ( __decorate([
|
|
632
|
-
( __param(2, IEditorService)),
|
|
633
|
-
( __param(3, IConfigurationService)),
|
|
634
|
-
( __param(4, IWorkspaceContextService))
|
|
635
|
-
], WorkspaceLaunch));
|
|
732
|
+
WorkspaceLaunch = ( __decorate([( __param(2, IEditorService)), ( __param(3, IConfigurationService)), ( __param(4, IWorkspaceContextService))], WorkspaceLaunch));
|
|
636
733
|
let UserLaunch = class UserLaunch extends AbstractLaunch {
|
|
637
|
-
constructor(
|
|
734
|
+
constructor(
|
|
735
|
+
configurationManager,
|
|
736
|
+
adapterManager,
|
|
737
|
+
configurationService,
|
|
738
|
+
preferencesService
|
|
739
|
+
) {
|
|
638
740
|
super(configurationManager, adapterManager);
|
|
639
741
|
this.configurationService = configurationService;
|
|
640
742
|
this.preferencesService = preferencesService;
|
|
@@ -646,25 +748,34 @@ let UserLaunch = class UserLaunch extends AbstractLaunch {
|
|
|
646
748
|
return this.preferencesService.userSettingsResource;
|
|
647
749
|
}
|
|
648
750
|
get name() {
|
|
649
|
-
return localize(
|
|
751
|
+
return localize(7088, "user settings");
|
|
650
752
|
}
|
|
651
753
|
get hidden() {
|
|
652
754
|
return true;
|
|
653
755
|
}
|
|
654
756
|
getConfig() {
|
|
655
|
-
return this.configurationService.inspect(
|
|
656
|
-
}
|
|
657
|
-
async openConfigFile(
|
|
658
|
-
|
|
757
|
+
return this.configurationService.inspect("launch").userValue;
|
|
758
|
+
}
|
|
759
|
+
async openConfigFile(
|
|
760
|
+
{
|
|
761
|
+
preserveFocus,
|
|
762
|
+
type,
|
|
763
|
+
useInitialContent
|
|
764
|
+
}
|
|
765
|
+
) {
|
|
766
|
+
const editor = await this.preferencesService.openUserSettings({
|
|
767
|
+
jsonEditor: true,
|
|
768
|
+
preserveFocus,
|
|
769
|
+
revealSetting: {
|
|
770
|
+
key: "launch"
|
|
771
|
+
}
|
|
772
|
+
});
|
|
659
773
|
return ({
|
|
660
774
|
editor: editor ?? null,
|
|
661
775
|
created: false
|
|
662
776
|
});
|
|
663
777
|
}
|
|
664
778
|
};
|
|
665
|
-
UserLaunch = ( __decorate([
|
|
666
|
-
( __param(2, IConfigurationService)),
|
|
667
|
-
( __param(3, IPreferencesService))
|
|
668
|
-
], UserLaunch));
|
|
779
|
+
UserLaunch = ( __decorate([( __param(2, IConfigurationService)), ( __param(3, IPreferencesService))], UserLaunch));
|
|
669
780
|
|
|
670
781
|
export { ConfigurationManager };
|