@codingame/monaco-vscode-configuration-service-override 15.0.2 → 16.0.0
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 +11 -8
- package/vscode/src/vs/editor/common/services/textResourceConfigurationService.d.ts +1 -1
- package/vscode/src/vs/editor/common/services/textResourceConfigurationService.js +1 -1
- package/vscode/src/vs/workbench/api/common/configurationExtensionPoint.js +66 -47
- package/vscode/src/vs/workbench/contrib/workspaces/browser/workspaces.contribution.js +8 -8
- package/vscode/src/vs/workbench/services/configuration/browser/configuration.d.ts +1 -1
- package/vscode/src/vs/workbench/services/configuration/browser/configuration.js +2 -2
- package/vscode/src/vs/workbench/services/configuration/browser/configurationService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/configuration/browser/configurationService.js +3 -3
- package/vscode/src/vs/workbench/services/configuration/common/configurationCache.d.ts +1 -1
- package/vscode/src/vs/workbench/services/configuration/common/configurationEditing.d.ts +3 -1
- package/vscode/src/vs/workbench/services/configuration/common/configurationEditing.js +84 -52
- package/vscode/src/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.d.ts +7 -9
- package/vscode/src/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.js +100 -142
- package/vscode/src/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.js +4 -4
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
3
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
4
4
|
import { parse } from '@codingame/monaco-vscode-api/vscode/vs/base/common/json';
|
|
5
|
-
import { setProperty } from '@codingame/monaco-vscode-
|
|
5
|
+
import { setProperty } from '@codingame/monaco-vscode-68b3311c-eb96-5711-8f72-f5f4b2e31932-common/vscode/vs/base/common/jsonEdit';
|
|
6
6
|
import { Queue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
7
7
|
import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/registry/common/platform';
|
|
8
8
|
import { WorkbenchState } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace';
|
|
9
9
|
import { IWorkspaceContextService } from '@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service';
|
|
10
10
|
import { ITextFileService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/textfile/common/textfiles.service';
|
|
11
|
-
import { TASKS_CONFIGURATION_KEY, LAUNCH_CONFIGURATION_KEY, TASKS_DEFAULT, APPLICATION_SCOPES, FOLDER_SCOPES, USER_STANDALONE_CONFIGURATIONS, WORKSPACE_STANDALONE_CONFIGURATIONS, FOLDER_SETTINGS_PATH } from '@codingame/monaco-vscode-
|
|
11
|
+
import { TASKS_CONFIGURATION_KEY, LAUNCH_CONFIGURATION_KEY, MCP_CONFIGURATION_KEY, TASKS_DEFAULT, APPLICATION_SCOPES, FOLDER_SCOPES, USER_STANDALONE_CONFIGURATIONS, WORKSPACE_STANDALONE_CONFIGURATIONS, FOLDER_SETTINGS_PATH } from '@codingame/monaco-vscode-2b1a9082-790f-527f-b013-d1b29d6265a3-common/vscode/vs/workbench/services/configuration/common/configuration';
|
|
12
12
|
import { IWorkbenchConfigurationService } from '@codingame/monaco-vscode-422642f2-7e3a-5c1c-9e1e-1d3ef1817346-common/vscode/vs/workbench/services/configuration/common/configuration.service';
|
|
13
13
|
import { FileOperationResult } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files';
|
|
14
14
|
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
@@ -25,6 +25,7 @@ import { Selection } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/
|
|
|
25
25
|
import { IUserDataProfileService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
|
|
26
26
|
import { IUserDataProfilesService } from '@codingame/monaco-vscode-api/vscode/vs/platform/userDataProfile/common/userDataProfile.service';
|
|
27
27
|
import { ErrorNoTelemetry } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
28
|
+
import { IFilesConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/filesConfiguration/common/filesConfigurationService.service';
|
|
28
29
|
import Severity from '@codingame/monaco-vscode-api/vscode/vs/base/common/severity';
|
|
29
30
|
|
|
30
31
|
var ConfigurationEditingErrorCode;
|
|
@@ -58,7 +59,7 @@ var EditableConfigurationTarget;
|
|
|
58
59
|
EditableConfigurationTarget[EditableConfigurationTarget["WORKSPACE_FOLDER"] = 4] = "WORKSPACE_FOLDER";
|
|
59
60
|
})(EditableConfigurationTarget || (EditableConfigurationTarget = {}));
|
|
60
61
|
let ConfigurationEditing = class ConfigurationEditing {
|
|
61
|
-
constructor(remoteSettingsResource, configurationService, contextService, userDataProfileService, userDataProfilesService, fileService, textModelResolverService, textFileService, notificationService, preferencesService, editorService, uriIdentityService) {
|
|
62
|
+
constructor(remoteSettingsResource, configurationService, contextService, userDataProfileService, userDataProfilesService, fileService, textModelResolverService, textFileService, notificationService, preferencesService, editorService, uriIdentityService, filesConfigurationService) {
|
|
62
63
|
this.remoteSettingsResource = remoteSettingsResource;
|
|
63
64
|
this.configurationService = configurationService;
|
|
64
65
|
this.contextService = contextService;
|
|
@@ -71,6 +72,7 @@ let ConfigurationEditing = class ConfigurationEditing {
|
|
|
71
72
|
this.preferencesService = preferencesService;
|
|
72
73
|
this.editorService = editorService;
|
|
73
74
|
this.uriIdentityService = uriIdentityService;
|
|
75
|
+
this.filesConfigurationService = filesConfigurationService;
|
|
74
76
|
this.queue = ( new Queue());
|
|
75
77
|
}
|
|
76
78
|
async writeConfiguration(target, value, options = {}) {
|
|
@@ -114,8 +116,17 @@ let ConfigurationEditing = class ConfigurationEditing {
|
|
|
114
116
|
}
|
|
115
117
|
}
|
|
116
118
|
const edit = this.getEdits(operation, model.getValue(), formattingOptions)[0];
|
|
117
|
-
if (edit
|
|
118
|
-
|
|
119
|
+
if (edit) {
|
|
120
|
+
let disposable;
|
|
121
|
+
try {
|
|
122
|
+
disposable = this.filesConfigurationService.enableAutoSaveAfterShortDelay(model.uri);
|
|
123
|
+
if (this.applyEditsToBuffer(edit, model)) {
|
|
124
|
+
await this.save(model, operation);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
finally {
|
|
128
|
+
disposable?.dispose();
|
|
129
|
+
}
|
|
119
130
|
}
|
|
120
131
|
}
|
|
121
132
|
async save(model, operation) {
|
|
@@ -127,7 +138,7 @@ let ConfigurationEditing = class ConfigurationEditing {
|
|
|
127
138
|
throw this.toConfigurationEditingError(ConfigurationEditingErrorCode.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE, operation.target, operation);
|
|
128
139
|
}
|
|
129
140
|
throw ( new ConfigurationEditingError(( localize(
|
|
130
|
-
|
|
141
|
+
11929,
|
|
131
142
|
"Error while writing to {0}. {1}",
|
|
132
143
|
this.stringifyTarget(operation.target),
|
|
133
144
|
error.message
|
|
@@ -187,9 +198,10 @@ let ConfigurationEditing = class ConfigurationEditing {
|
|
|
187
198
|
}
|
|
188
199
|
}
|
|
189
200
|
onInvalidConfigurationError(error, operation) {
|
|
190
|
-
const openStandAloneConfigurationActionLabel = operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY ? ( localize(
|
|
191
|
-
: operation.workspaceStandAloneConfigurationKey === LAUNCH_CONFIGURATION_KEY ? ( localize(
|
|
192
|
-
:
|
|
201
|
+
const openStandAloneConfigurationActionLabel = operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY ? ( localize(11930, "Open Tasks Configuration"))
|
|
202
|
+
: operation.workspaceStandAloneConfigurationKey === LAUNCH_CONFIGURATION_KEY ? ( localize(11931, "Open Launch Configuration"))
|
|
203
|
+
: operation.workspaceStandAloneConfigurationKey === MCP_CONFIGURATION_KEY ? ( localize(11932, "Open MCP Configuration"))
|
|
204
|
+
: null;
|
|
193
205
|
if (openStandAloneConfigurationActionLabel) {
|
|
194
206
|
this.notificationService.prompt(Severity.Error, error.message, [{
|
|
195
207
|
label: openStandAloneConfigurationActionLabel,
|
|
@@ -198,18 +210,18 @@ let ConfigurationEditing = class ConfigurationEditing {
|
|
|
198
210
|
}
|
|
199
211
|
else {
|
|
200
212
|
this.notificationService.prompt(Severity.Error, error.message, [{
|
|
201
|
-
label: ( localize(
|
|
213
|
+
label: ( localize(11933, "Open Settings")),
|
|
202
214
|
run: () => this.openSettings(operation)
|
|
203
215
|
}]);
|
|
204
216
|
}
|
|
205
217
|
}
|
|
206
218
|
onConfigurationFileDirtyError(error, operation, scopes) {
|
|
207
|
-
const openStandAloneConfigurationActionLabel = operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY ? ( localize(
|
|
208
|
-
: operation.workspaceStandAloneConfigurationKey === LAUNCH_CONFIGURATION_KEY ? ( localize(
|
|
219
|
+
const openStandAloneConfigurationActionLabel = operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY ? ( localize(11930, "Open Tasks Configuration"))
|
|
220
|
+
: operation.workspaceStandAloneConfigurationKey === LAUNCH_CONFIGURATION_KEY ? ( localize(11931, "Open Launch Configuration"))
|
|
209
221
|
: null;
|
|
210
222
|
if (openStandAloneConfigurationActionLabel) {
|
|
211
223
|
this.notificationService.prompt(Severity.Error, error.message, [{
|
|
212
|
-
label: ( localize(
|
|
224
|
+
label: ( localize(11934, "Save and Retry")),
|
|
213
225
|
run: () => {
|
|
214
226
|
const key = operation.key ? `${operation.workspaceStandAloneConfigurationKey}.${operation.key}` : operation.workspaceStandAloneConfigurationKey;
|
|
215
227
|
this.writeConfiguration(operation.target, { key, value: operation.value }, { handleDirtyFile: 'save', scopes });
|
|
@@ -222,11 +234,11 @@ let ConfigurationEditing = class ConfigurationEditing {
|
|
|
222
234
|
}
|
|
223
235
|
else {
|
|
224
236
|
this.notificationService.prompt(Severity.Error, error.message, [{
|
|
225
|
-
label: ( localize(
|
|
237
|
+
label: ( localize(11934, "Save and Retry")),
|
|
226
238
|
run: () => this.writeConfiguration(operation.target, { key: operation.key, value: operation.value }, { handleDirtyFile: 'save', scopes })
|
|
227
239
|
},
|
|
228
240
|
{
|
|
229
|
-
label: ( localize(
|
|
241
|
+
label: ( localize(11933, "Open Settings")),
|
|
230
242
|
run: () => this.openSettings(operation)
|
|
231
243
|
}]);
|
|
232
244
|
}
|
|
@@ -263,82 +275,88 @@ let ConfigurationEditing = class ConfigurationEditing {
|
|
|
263
275
|
toErrorMessage(error, target, operation) {
|
|
264
276
|
switch (error) {
|
|
265
277
|
case ConfigurationEditingErrorCode.ERROR_POLICY_CONFIGURATION: return localize(
|
|
266
|
-
|
|
278
|
+
11935,
|
|
267
279
|
"Unable to write {0} because it is configured in system policy.",
|
|
268
280
|
operation.key
|
|
269
281
|
);
|
|
270
282
|
case ConfigurationEditingErrorCode.ERROR_UNKNOWN_KEY: return localize(
|
|
271
|
-
|
|
283
|
+
11936,
|
|
272
284
|
"Unable to write to {0} because {1} is not a registered configuration.",
|
|
273
285
|
this.stringifyTarget(target),
|
|
274
286
|
operation.key
|
|
275
287
|
);
|
|
276
288
|
case ConfigurationEditingErrorCode.ERROR_INVALID_WORKSPACE_CONFIGURATION_APPLICATION: return localize(
|
|
277
|
-
|
|
289
|
+
11937,
|
|
278
290
|
"Unable to write {0} to Workspace Settings. This setting can be written only into User settings.",
|
|
279
291
|
operation.key
|
|
280
292
|
);
|
|
281
293
|
case ConfigurationEditingErrorCode.ERROR_INVALID_WORKSPACE_CONFIGURATION_MACHINE: return localize(
|
|
282
|
-
|
|
294
|
+
11938,
|
|
283
295
|
"Unable to write {0} to Workspace Settings. This setting can be written only into User settings.",
|
|
284
296
|
operation.key
|
|
285
297
|
);
|
|
286
298
|
case ConfigurationEditingErrorCode.ERROR_INVALID_FOLDER_CONFIGURATION: return localize(
|
|
287
|
-
|
|
299
|
+
11939,
|
|
288
300
|
"Unable to write to Folder Settings because {0} does not support the folder resource scope.",
|
|
289
301
|
operation.key
|
|
290
302
|
);
|
|
291
303
|
case ConfigurationEditingErrorCode.ERROR_INVALID_USER_TARGET: return localize(
|
|
292
|
-
|
|
304
|
+
11940,
|
|
293
305
|
"Unable to write to User Settings because {0} does not support for global scope.",
|
|
294
306
|
operation.key
|
|
295
307
|
);
|
|
296
308
|
case ConfigurationEditingErrorCode.ERROR_INVALID_WORKSPACE_TARGET: return localize(
|
|
297
|
-
|
|
309
|
+
11941,
|
|
298
310
|
"Unable to write to Workspace Settings because {0} does not support for workspace scope in a multi folder workspace.",
|
|
299
311
|
operation.key
|
|
300
312
|
);
|
|
301
313
|
case ConfigurationEditingErrorCode.ERROR_INVALID_FOLDER_TARGET: return localize(
|
|
302
|
-
|
|
314
|
+
11942,
|
|
303
315
|
"Unable to write to Folder Settings because no resource is provided."
|
|
304
316
|
);
|
|
305
317
|
case ConfigurationEditingErrorCode.ERROR_INVALID_RESOURCE_LANGUAGE_CONFIGURATION: return localize(
|
|
306
|
-
|
|
318
|
+
11943,
|
|
307
319
|
"Unable to write to Language Settings because {0} is not a resource language setting.",
|
|
308
320
|
operation.key
|
|
309
321
|
);
|
|
310
322
|
case ConfigurationEditingErrorCode.ERROR_NO_WORKSPACE_OPENED: return localize(
|
|
311
|
-
|
|
323
|
+
11944,
|
|
312
324
|
"Unable to write to {0} because no workspace is opened. Please open a workspace first and try again.",
|
|
313
325
|
this.stringifyTarget(target)
|
|
314
326
|
);
|
|
315
327
|
case ConfigurationEditingErrorCode.ERROR_INVALID_CONFIGURATION: {
|
|
316
328
|
if (operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY) {
|
|
317
329
|
return localize(
|
|
318
|
-
|
|
330
|
+
11945,
|
|
319
331
|
"Unable to write into the tasks configuration file. Please open it to correct errors/warnings in it and try again."
|
|
320
332
|
);
|
|
321
333
|
}
|
|
322
334
|
if (operation.workspaceStandAloneConfigurationKey === LAUNCH_CONFIGURATION_KEY) {
|
|
323
335
|
return localize(
|
|
324
|
-
|
|
336
|
+
11946,
|
|
325
337
|
"Unable to write into the launch configuration file. Please open it to correct errors/warnings in it and try again."
|
|
326
338
|
);
|
|
327
339
|
}
|
|
340
|
+
if (operation.workspaceStandAloneConfigurationKey === MCP_CONFIGURATION_KEY) {
|
|
341
|
+
return localize(
|
|
342
|
+
11947,
|
|
343
|
+
"Unable to write into the MCP configuration file. Please open it to correct errors/warnings in it and try again."
|
|
344
|
+
);
|
|
345
|
+
}
|
|
328
346
|
switch (target) {
|
|
329
347
|
case EditableConfigurationTarget.USER_LOCAL:
|
|
330
348
|
return localize(
|
|
331
|
-
|
|
349
|
+
11948,
|
|
332
350
|
"Unable to write into user settings. Please open the user settings to correct errors/warnings in it and try again."
|
|
333
351
|
);
|
|
334
352
|
case EditableConfigurationTarget.USER_REMOTE:
|
|
335
353
|
return localize(
|
|
336
|
-
|
|
354
|
+
11949,
|
|
337
355
|
"Unable to write into remote user settings. Please open the remote user settings to correct errors/warnings in it and try again."
|
|
338
356
|
);
|
|
339
357
|
case EditableConfigurationTarget.WORKSPACE:
|
|
340
358
|
return localize(
|
|
341
|
-
|
|
359
|
+
11950,
|
|
342
360
|
"Unable to write into workspace settings. Please open the workspace settings to correct errors/warnings in the file and try again."
|
|
343
361
|
);
|
|
344
362
|
case EditableConfigurationTarget.WORKSPACE_FOLDER: {
|
|
@@ -350,7 +368,7 @@ let ConfigurationEditing = class ConfigurationEditing {
|
|
|
350
368
|
}
|
|
351
369
|
}
|
|
352
370
|
return localize(
|
|
353
|
-
|
|
371
|
+
11951,
|
|
354
372
|
"Unable to write into folder settings. Please open the '{0}' folder settings to correct errors/warnings in it and try again.",
|
|
355
373
|
workspaceFolderName
|
|
356
374
|
);
|
|
@@ -362,30 +380,36 @@ let ConfigurationEditing = class ConfigurationEditing {
|
|
|
362
380
|
case ConfigurationEditingErrorCode.ERROR_CONFIGURATION_FILE_DIRTY: {
|
|
363
381
|
if (operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY) {
|
|
364
382
|
return localize(
|
|
365
|
-
|
|
383
|
+
11952,
|
|
366
384
|
"Unable to write into tasks configuration file because the file has unsaved changes. Please save it first and then try again."
|
|
367
385
|
);
|
|
368
386
|
}
|
|
369
387
|
if (operation.workspaceStandAloneConfigurationKey === LAUNCH_CONFIGURATION_KEY) {
|
|
370
388
|
return localize(
|
|
371
|
-
|
|
389
|
+
11953,
|
|
372
390
|
"Unable to write into launch configuration file because the file has unsaved changes. Please save it first and then try again."
|
|
373
391
|
);
|
|
374
392
|
}
|
|
393
|
+
if (operation.workspaceStandAloneConfigurationKey === MCP_CONFIGURATION_KEY) {
|
|
394
|
+
return localize(
|
|
395
|
+
11954,
|
|
396
|
+
"Unable to write into MCP configuration file because the file has unsaved changes. Please save it first and then try again."
|
|
397
|
+
);
|
|
398
|
+
}
|
|
375
399
|
switch (target) {
|
|
376
400
|
case EditableConfigurationTarget.USER_LOCAL:
|
|
377
401
|
return localize(
|
|
378
|
-
|
|
402
|
+
11955,
|
|
379
403
|
"Unable to write into user settings because the file has unsaved changes. Please save the user settings file first and then try again."
|
|
380
404
|
);
|
|
381
405
|
case EditableConfigurationTarget.USER_REMOTE:
|
|
382
406
|
return localize(
|
|
383
|
-
|
|
407
|
+
11956,
|
|
384
408
|
"Unable to write into remote user settings because the file has unsaved changes. Please save the remote user settings file first and then try again."
|
|
385
409
|
);
|
|
386
410
|
case EditableConfigurationTarget.WORKSPACE:
|
|
387
411
|
return localize(
|
|
388
|
-
|
|
412
|
+
11957,
|
|
389
413
|
"Unable to write into workspace settings because the file has unsaved changes. Please save the workspace settings file first and then try again."
|
|
390
414
|
);
|
|
391
415
|
case EditableConfigurationTarget.WORKSPACE_FOLDER: {
|
|
@@ -397,7 +421,7 @@ let ConfigurationEditing = class ConfigurationEditing {
|
|
|
397
421
|
}
|
|
398
422
|
}
|
|
399
423
|
return localize(
|
|
400
|
-
|
|
424
|
+
11958,
|
|
401
425
|
"Unable to write into folder settings because the file has unsaved changes. Please save the '{0}' folder settings file first and then try again.",
|
|
402
426
|
workspaceFolderName
|
|
403
427
|
);
|
|
@@ -409,40 +433,46 @@ let ConfigurationEditing = class ConfigurationEditing {
|
|
|
409
433
|
case ConfigurationEditingErrorCode.ERROR_CONFIGURATION_FILE_MODIFIED_SINCE:
|
|
410
434
|
if (operation.workspaceStandAloneConfigurationKey === TASKS_CONFIGURATION_KEY) {
|
|
411
435
|
return localize(
|
|
412
|
-
|
|
436
|
+
11959,
|
|
413
437
|
"Unable to write into tasks configuration file because the content of the file is newer."
|
|
414
438
|
);
|
|
415
439
|
}
|
|
416
440
|
if (operation.workspaceStandAloneConfigurationKey === LAUNCH_CONFIGURATION_KEY) {
|
|
417
441
|
return localize(
|
|
418
|
-
|
|
442
|
+
11960,
|
|
419
443
|
"Unable to write into launch configuration file because the content of the file is newer."
|
|
420
444
|
);
|
|
421
445
|
}
|
|
446
|
+
if (operation.workspaceStandAloneConfigurationKey === MCP_CONFIGURATION_KEY) {
|
|
447
|
+
return localize(
|
|
448
|
+
11961,
|
|
449
|
+
"Unable to write into MCP configuration file because the content of the file is newer."
|
|
450
|
+
);
|
|
451
|
+
}
|
|
422
452
|
switch (target) {
|
|
423
453
|
case EditableConfigurationTarget.USER_LOCAL:
|
|
424
454
|
return localize(
|
|
425
|
-
|
|
455
|
+
11962,
|
|
426
456
|
"Unable to write into user settings because the content of the file is newer."
|
|
427
457
|
);
|
|
428
458
|
case EditableConfigurationTarget.USER_REMOTE:
|
|
429
459
|
return localize(
|
|
430
|
-
|
|
460
|
+
11963,
|
|
431
461
|
"Unable to write into remote user settings because the content of the file is newer."
|
|
432
462
|
);
|
|
433
463
|
case EditableConfigurationTarget.WORKSPACE:
|
|
434
464
|
return localize(
|
|
435
|
-
|
|
465
|
+
11964,
|
|
436
466
|
"Unable to write into workspace settings because the content of the file is newer."
|
|
437
467
|
);
|
|
438
468
|
case EditableConfigurationTarget.WORKSPACE_FOLDER:
|
|
439
469
|
return localize(
|
|
440
|
-
|
|
470
|
+
11965,
|
|
441
471
|
"Unable to write into folder settings because the content of the file is newer."
|
|
442
472
|
);
|
|
443
473
|
}
|
|
444
474
|
case ConfigurationEditingErrorCode.ERROR_INTERNAL: return localize(
|
|
445
|
-
|
|
475
|
+
11966,
|
|
446
476
|
"Unable to write to {0} because of an internal error.",
|
|
447
477
|
this.stringifyTarget(target)
|
|
448
478
|
);
|
|
@@ -451,13 +481,13 @@ let ConfigurationEditing = class ConfigurationEditing {
|
|
|
451
481
|
stringifyTarget(target) {
|
|
452
482
|
switch (target) {
|
|
453
483
|
case EditableConfigurationTarget.USER_LOCAL:
|
|
454
|
-
return localize(
|
|
484
|
+
return localize(11967, "User Settings");
|
|
455
485
|
case EditableConfigurationTarget.USER_REMOTE:
|
|
456
|
-
return localize(
|
|
486
|
+
return localize(11968, "Remote User Settings");
|
|
457
487
|
case EditableConfigurationTarget.WORKSPACE:
|
|
458
|
-
return localize(
|
|
488
|
+
return localize(11969, "Workspace Settings");
|
|
459
489
|
case EditableConfigurationTarget.WORKSPACE_FOLDER:
|
|
460
|
-
return localize(
|
|
490
|
+
return localize(11970, "Folder Settings");
|
|
461
491
|
default:
|
|
462
492
|
return '';
|
|
463
493
|
}
|
|
@@ -498,7 +528,7 @@ let ConfigurationEditing = class ConfigurationEditing {
|
|
|
498
528
|
}
|
|
499
529
|
}
|
|
500
530
|
if (operation.workspaceStandAloneConfigurationKey) {
|
|
501
|
-
if ((operation.workspaceStandAloneConfigurationKey !== TASKS_CONFIGURATION_KEY) && (target === EditableConfigurationTarget.USER_LOCAL || target === EditableConfigurationTarget.USER_REMOTE)) {
|
|
531
|
+
if ((operation.workspaceStandAloneConfigurationKey !== TASKS_CONFIGURATION_KEY) && (operation.workspaceStandAloneConfigurationKey !== MCP_CONFIGURATION_KEY) && (target === EditableConfigurationTarget.USER_LOCAL || target === EditableConfigurationTarget.USER_REMOTE)) {
|
|
502
532
|
throw this.toConfigurationEditingError(ConfigurationEditingErrorCode.ERROR_INVALID_USER_TARGET, target, operation);
|
|
503
533
|
}
|
|
504
534
|
}
|
|
@@ -543,13 +573,14 @@ let ConfigurationEditing = class ConfigurationEditing {
|
|
|
543
573
|
const standaloneConfigurationKeys = ( Object.keys(standaloneConfigurationMap));
|
|
544
574
|
for (const key of standaloneConfigurationKeys) {
|
|
545
575
|
const resource = this.getConfigurationFileResource(target, key, standaloneConfigurationMap[key], overrides.resource, undefined);
|
|
576
|
+
const keyRemainsNested = this.isWorkspaceConfigurationResource(resource) || resource?.fsPath === this.userDataProfileService.currentProfile.settingsResource.fsPath;
|
|
546
577
|
if (config.key === key) {
|
|
547
|
-
const jsonPath =
|
|
578
|
+
const jsonPath = keyRemainsNested ? [key] : [];
|
|
548
579
|
return { key: jsonPath[jsonPath.length - 1], jsonPath, value: config.value, resource: resource ?? undefined, workspaceStandAloneConfigurationKey: key, target };
|
|
549
580
|
}
|
|
550
581
|
const keyPrefix = `${key}.`;
|
|
551
582
|
if (config.key.indexOf(keyPrefix) === 0) {
|
|
552
|
-
const jsonPath =
|
|
583
|
+
const jsonPath = keyRemainsNested ? [key, config.key.substr(keyPrefix.length)] : [config.key.substr(keyPrefix.length)];
|
|
553
584
|
return { key: jsonPath[jsonPath.length - 1], jsonPath, value: config.value, resource: resource ?? undefined, workspaceStandAloneConfigurationKey: key, target };
|
|
554
585
|
}
|
|
555
586
|
}
|
|
@@ -620,7 +651,8 @@ ConfigurationEditing = ( __decorate([
|
|
|
620
651
|
( __param(8, INotificationService)),
|
|
621
652
|
( __param(9, IPreferencesService)),
|
|
622
653
|
( __param(10, IEditorService)),
|
|
623
|
-
( __param(11, IUriIdentityService))
|
|
654
|
+
( __param(11, IUriIdentityService)),
|
|
655
|
+
( __param(12, IFilesConfigurationService))
|
|
624
656
|
], ConfigurationEditing));
|
|
625
657
|
|
|
626
658
|
export { ConfigurationEditing, ConfigurationEditingError, ConfigurationEditingErrorCode, EditableConfigurationTarget };
|
|
@@ -6,12 +6,12 @@ import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/pl
|
|
|
6
6
|
import { ILabelService } from "@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service";
|
|
7
7
|
import { IQuickInputService } from "@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service";
|
|
8
8
|
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
9
|
-
import {
|
|
9
|
+
import { IWorkspaceFolderData } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace";
|
|
10
10
|
import { IWorkspaceContextService } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service";
|
|
11
|
-
import { AbstractVariableResolverService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/configurationResolver/common/variableResolver";
|
|
12
11
|
import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
13
12
|
import { IExtensionService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service";
|
|
14
13
|
import { IPathService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/path/common/pathService.service";
|
|
14
|
+
import { AbstractVariableResolverService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/configurationResolver/common/variableResolver";
|
|
15
15
|
export declare abstract class BaseConfigurationResolverService extends AbstractVariableResolverService {
|
|
16
16
|
private readonly configurationService;
|
|
17
17
|
private readonly commandService;
|
|
@@ -26,12 +26,10 @@ export declare abstract class BaseConfigurationResolverService extends AbstractV
|
|
|
26
26
|
getAppRoot: () => string | undefined;
|
|
27
27
|
getExecPath: () => string | undefined;
|
|
28
28
|
}, envVariablesPromise: Promise<IProcessEnvironment>, editorService: IEditorService, configurationService: IConfigurationService, commandService: ICommandService, workspaceContextService: IWorkspaceContextService, quickInputService: IQuickInputService, labelService: ILabelService, pathService: IPathService, extensionService: IExtensionService, storageService: IStorageService);
|
|
29
|
-
resolveWithInteractionReplace(folder:
|
|
30
|
-
resolveWithInteraction(folder:
|
|
31
|
-
private
|
|
32
|
-
private resolveWithInputAndCommands;
|
|
33
|
-
private findVariables;
|
|
34
|
-
private showUserInput;
|
|
35
|
-
private storeInputLru;
|
|
29
|
+
resolveWithInteractionReplace(folder: IWorkspaceFolderData | undefined, config: any, section?: string, variables?: IStringDictionary<string>, target?: ConfigurationTarget): Promise<any>;
|
|
30
|
+
resolveWithInteraction(folder: IWorkspaceFolderData | undefined, config: any, section?: string, variableToCommandMap?: IStringDictionary<string>, target?: ConfigurationTarget): Promise<Map<string, string> | undefined>;
|
|
31
|
+
private resolveInputs;
|
|
36
32
|
private readInputLru;
|
|
33
|
+
private storeInputLru;
|
|
34
|
+
private showUserInput;
|
|
37
35
|
}
|