@codingame/monaco-vscode-configuration-service-override 2.2.2 → 3.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 +9 -9
- package/vscode/src/vs/workbench/api/common/configurationExtensionPoint.js +72 -6
- package/vscode/src/vs/workbench/contrib/workspaces/browser/workspaces.contribution.js +3 -3
- package/vscode/src/vs/workbench/services/configuration/browser/configurationService.js +23 -9
- package/vscode/src/vs/workbench/services/label/common/labelService.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-configuration-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@3.0.0",
|
|
22
22
|
"vscode-marked": "npm:marked@=3.0.2",
|
|
23
|
-
"@codingame/monaco-vscode-files-service-override": "
|
|
24
|
-
"@codingame/monaco-vscode-quickaccess-service-override": "
|
|
25
|
-
"@codingame/monaco-vscode-extensions-service-override": "
|
|
26
|
-
"@codingame/monaco-vscode-environment-service-override": "
|
|
27
|
-
"@codingame/monaco-vscode-layout-service-override": "
|
|
28
|
-
"@codingame/monaco-vscode-host-service-override": "
|
|
29
|
-
"@codingame/monaco-vscode-base-service-override": "
|
|
23
|
+
"@codingame/monaco-vscode-files-service-override": "3.0.0",
|
|
24
|
+
"@codingame/monaco-vscode-quickaccess-service-override": "3.0.0",
|
|
25
|
+
"@codingame/monaco-vscode-extensions-service-override": "3.0.0",
|
|
26
|
+
"@codingame/monaco-vscode-environment-service-override": "3.0.0",
|
|
27
|
+
"@codingame/monaco-vscode-layout-service-override": "3.0.0",
|
|
28
|
+
"@codingame/monaco-vscode-host-service-override": "3.0.0",
|
|
29
|
+
"@codingame/monaco-vscode-base-service-override": "3.0.0"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -2,11 +2,15 @@ import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
|
2
2
|
import { deepClone } from 'vscode/vscode/vs/base/common/objects';
|
|
3
3
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
4
4
|
import { ExtensionsRegistry } from 'vscode/vscode/vs/workbench/services/extensions/common/extensionsRegistry';
|
|
5
|
-
import { Extensions as Extensions$1, configurationDefaultsSchemaId, OVERRIDE_PROPERTY_REGEX, validateProperty } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
5
|
+
import { Extensions as Extensions$1, configurationDefaultsSchemaId, OVERRIDE_PROPERTY_REGEX, validateProperty, getDefaultValue } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
6
6
|
import { Extensions } from 'vscode/vscode/vs/platform/jsonschemas/common/jsonContributionRegistry';
|
|
7
7
|
import { workspaceSettingsSchemaId, launchSchemaId, tasksSchemaId } from 'vscode/vscode/vs/workbench/services/configuration/common/configuration';
|
|
8
|
-
import { isObject } from 'vscode/vscode/vs/base/common/types';
|
|
8
|
+
import { isObject, isUndefined } from 'vscode/vscode/vs/base/common/types';
|
|
9
9
|
import { ExtensionIdentifierMap } from 'vscode/vscode/vs/platform/extensions/common/extensions';
|
|
10
|
+
import { Extensions as Extensions$2 } from 'vscode/vscode/vs/workbench/services/extensionManagement/common/extensionFeatures';
|
|
11
|
+
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
12
|
+
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
13
|
+
import { MarkdownString } from 'vscode/vscode/vs/base/common/htmlContent';
|
|
10
14
|
|
|
11
15
|
const jsonRegistry = ( Registry.as(Extensions.JSONContribution));
|
|
12
16
|
const configurationRegistry = ( Registry.as(Extensions$1.Configuration));
|
|
@@ -204,12 +208,12 @@ const configurationEntrySchema = {
|
|
|
204
208
|
}
|
|
205
209
|
};
|
|
206
210
|
let _configDelta;
|
|
207
|
-
const defaultConfigurationExtPoint =
|
|
211
|
+
const defaultConfigurationExtPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
208
212
|
extensionPoint: 'configurationDefaults',
|
|
209
213
|
jsonSchema: {
|
|
210
214
|
$ref: configurationDefaultsSchemaId,
|
|
211
215
|
}
|
|
212
|
-
})
|
|
216
|
+
});
|
|
213
217
|
defaultConfigurationExtPoint.setHandler((extensions, { added, removed }) => {
|
|
214
218
|
if (_configDelta) {
|
|
215
219
|
configurationRegistry.deltaConfiguration(_configDelta);
|
|
@@ -251,7 +255,7 @@ defaultConfigurationExtPoint.setHandler((extensions, { added, removed }) => {
|
|
|
251
255
|
_configDelta.addedDefaults = addedDefaultConfigurations;
|
|
252
256
|
}
|
|
253
257
|
});
|
|
254
|
-
const configurationExtPoint =
|
|
258
|
+
const configurationExtPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
255
259
|
extensionPoint: 'configuration',
|
|
256
260
|
deps: [defaultConfigurationExtPoint],
|
|
257
261
|
jsonSchema: {
|
|
@@ -268,7 +272,7 @@ const configurationExtPoint = ( ExtensionsRegistry.registerExtensionPoint({
|
|
|
268
272
|
}
|
|
269
273
|
]
|
|
270
274
|
}
|
|
271
|
-
})
|
|
275
|
+
});
|
|
272
276
|
const extensionConfigurations = ( new ExtensionIdentifierMap());
|
|
273
277
|
configurationExtPoint.setHandler((extensions, { added, removed }) => {
|
|
274
278
|
_configDelta ??= {};
|
|
@@ -527,3 +531,65 @@ jsonRegistry.registerSchema('vscode://schemas/workspaceConfig', {
|
|
|
527
531
|
"Unknown workspace configuration property"
|
|
528
532
|
))
|
|
529
533
|
});
|
|
534
|
+
class SettingsTableRenderer extends Disposable {
|
|
535
|
+
constructor() {
|
|
536
|
+
super(...arguments);
|
|
537
|
+
this.type = 'table';
|
|
538
|
+
}
|
|
539
|
+
shouldRender(manifest) {
|
|
540
|
+
return !!manifest.contributes?.configuration;
|
|
541
|
+
}
|
|
542
|
+
render(manifest) {
|
|
543
|
+
const configuration = manifest.contributes?.configuration;
|
|
544
|
+
let properties = {};
|
|
545
|
+
if (Array.isArray(configuration)) {
|
|
546
|
+
configuration.forEach(config => {
|
|
547
|
+
properties = { ...properties, ...config.properties };
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
else if (configuration) {
|
|
551
|
+
properties = configuration.properties;
|
|
552
|
+
}
|
|
553
|
+
const contrib = properties ? ( Object.keys(properties)) : [];
|
|
554
|
+
const headers = [( localizeWithPath(
|
|
555
|
+
'vs/workbench/api/common/configurationExtensionPoint',
|
|
556
|
+
'setting name',
|
|
557
|
+
"ID"
|
|
558
|
+
)), ( localizeWithPath(
|
|
559
|
+
'vs/workbench/api/common/configurationExtensionPoint',
|
|
560
|
+
'description',
|
|
561
|
+
"Description"
|
|
562
|
+
)), ( localizeWithPath(
|
|
563
|
+
'vs/workbench/api/common/configurationExtensionPoint',
|
|
564
|
+
'default',
|
|
565
|
+
"Default"
|
|
566
|
+
))];
|
|
567
|
+
const rows = ( contrib.sort((a, b) => a.localeCompare(b))
|
|
568
|
+
.map(key => {
|
|
569
|
+
return [
|
|
570
|
+
( new MarkdownString()).appendMarkdown(`\`${key}\``),
|
|
571
|
+
properties[key].markdownDescription ? ( new MarkdownString(properties[key].markdownDescription, false)) : properties[key].description ?? '',
|
|
572
|
+
( new MarkdownString()).appendCodeblock('json', JSON.stringify(isUndefined(properties[key].default) ? getDefaultValue(properties[key].type) : properties[key].default, null, 2)),
|
|
573
|
+
];
|
|
574
|
+
}));
|
|
575
|
+
return {
|
|
576
|
+
data: {
|
|
577
|
+
headers,
|
|
578
|
+
rows
|
|
579
|
+
},
|
|
580
|
+
dispose: () => { }
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
( Registry.as(Extensions$2.ExtensionFeaturesRegistry)).registerExtensionFeature({
|
|
585
|
+
id: 'configuration',
|
|
586
|
+
label: ( localizeWithPath(
|
|
587
|
+
'vs/workbench/api/common/configurationExtensionPoint',
|
|
588
|
+
'settings',
|
|
589
|
+
"Settings"
|
|
590
|
+
)),
|
|
591
|
+
access: {
|
|
592
|
+
canToggle: false
|
|
593
|
+
},
|
|
594
|
+
renderer: ( new SyncDescriptor(SettingsTableRenderer)),
|
|
595
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
2
|
+
import { localize2WithPath, localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
3
3
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
4
4
|
import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
5
5
|
import { WORKSPACE_SUFFIX, IWorkspaceContextService, hasWorkspaceFileExtension } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
@@ -100,11 +100,11 @@ registerAction2(class extends Action2 {
|
|
|
100
100
|
constructor() {
|
|
101
101
|
super({
|
|
102
102
|
id: 'workbench.action.openWorkspaceFromEditor',
|
|
103
|
-
title:
|
|
103
|
+
title: ( localize2WithPath(
|
|
104
104
|
'vs/workbench/contrib/workspaces/browser/workspaces.contribution',
|
|
105
105
|
'openWorkspace',
|
|
106
106
|
"Open Workspace"
|
|
107
|
-
))
|
|
107
|
+
)),
|
|
108
108
|
f1: false,
|
|
109
109
|
menu: {
|
|
110
110
|
id: MenuId.EditorContent,
|
|
@@ -8,18 +8,18 @@ import { Delayer, Barrier, Queue, Promises } from 'vscode/vscode/vs/base/common/
|
|
|
8
8
|
import { Extensions as Extensions$2 } from 'vscode/vscode/vs/platform/jsonschemas/common/jsonContributionRegistry';
|
|
9
9
|
import { IWorkspaceContextService, isWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, isWorkspaceFolder, toWorkspaceFolder, Workspace as Workspace$1 } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
10
10
|
import { ConfigurationModel, mergeChanges, ConfigurationChangeEvent } from 'vscode/vscode/vs/platform/configuration/common/configurationModels';
|
|
11
|
-
import { isConfigurationOverrides, isConfigurationUpdateOverrides, ConfigurationTargetToString } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
11
|
+
import { IConfigurationService, isConfigurationOverrides, isConfigurationUpdateOverrides, ConfigurationTargetToString } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
12
12
|
import { NullPolicyConfiguration, PolicyConfiguration } from 'vscode/vscode/vs/platform/configuration/common/configurations';
|
|
13
13
|
import { Configuration } from '../common/configurationModels.js';
|
|
14
14
|
import { APPLY_ALL_PROFILES_SETTING, defaultSettingsSchemaId, userSettingsSchemaId, profileSettingsSchemaId, machineSettingsSchemaId, workspaceSettingsSchemaId, folderSettingsSchemaId, FOLDER_CONFIG_FOLDER_NAME, LOCAL_MACHINE_SCOPES, LOCAL_MACHINE_PROFILE_SCOPES, PROFILE_SCOPES } from 'vscode/vscode/vs/workbench/services/configuration/common/configuration';
|
|
15
15
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
16
|
-
import { Extensions
|
|
16
|
+
import { Extensions, allSettings, applicationSettings, windowSettings, resourceSettings, machineSettings, machineOverridableSettings, OVERRIDE_PROPERTY_PATTERN, resourceLanguageSettingsSchemaId, configurationDefaultsSchemaId, keyFromOverrideIdentifiers } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
17
17
|
import { isStoredWorkspaceFolder, toWorkspaceFolders, getStoredWorkspaceFolder } from 'vscode/vscode/vs/platform/workspaces/common/workspaces';
|
|
18
18
|
import { ConfigurationEditing } from '../common/configurationEditing.js';
|
|
19
19
|
import { DefaultConfiguration, UserConfiguration, RemoteUserConfiguration, WorkspaceConfiguration, ApplicationConfiguration, FolderConfiguration } from './configuration.js';
|
|
20
20
|
import { mark } from 'vscode/vscode/vs/base/common/performance';
|
|
21
21
|
import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService';
|
|
22
|
-
import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
22
|
+
import { Extensions as Extensions$1, registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
23
23
|
import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
24
24
|
import { toErrorMessage } from 'vscode/vscode/vs/base/common/errorMessage';
|
|
25
25
|
import { IWorkspaceTrustManagementService } from 'vscode/vscode/vs/platform/workspace/common/workspaceTrust';
|
|
@@ -72,7 +72,7 @@ class WorkspaceService extends Disposable {
|
|
|
72
72
|
this._restrictedSettings = { default: [] };
|
|
73
73
|
this._onDidChangeRestrictedSettings = this._register(( new Emitter()));
|
|
74
74
|
this.onDidChangeRestrictedSettings = this._onDidChangeRestrictedSettings.event;
|
|
75
|
-
this.configurationRegistry = ( Registry.as(Extensions
|
|
75
|
+
this.configurationRegistry = ( Registry.as(Extensions.Configuration));
|
|
76
76
|
this.initRemoteUserConfigurationBarrier = ( new Barrier());
|
|
77
77
|
this.completeWorkspaceBarrier = ( new Barrier());
|
|
78
78
|
this.defaultConfiguration = this._register(( new DefaultConfiguration(configurationCache, environmentService)));
|
|
@@ -1000,7 +1000,7 @@ let RegisterConfigurationSchemasContribution = class RegisterConfigurationSchema
|
|
|
1000
1000
|
this.workspaceTrustManagementService = workspaceTrustManagementService;
|
|
1001
1001
|
extensionService.whenInstalledExtensionsRegistered().then(() => {
|
|
1002
1002
|
this.registerConfigurationSchemas();
|
|
1003
|
-
const configurationRegistry = ( Registry.as(Extensions
|
|
1003
|
+
const configurationRegistry = ( Registry.as(Extensions.Configuration));
|
|
1004
1004
|
const delayer = this._register(( new Delayer(50)));
|
|
1005
1005
|
this._register(Event.any(configurationRegistry.onDidUpdateConfiguration, configurationRegistry.onDidSchemaChange, workspaceTrustManagementService.onDidChangeTrust)(() => delayer.trigger(() => this.registerConfigurationSchemas(), lifecycleService.phase === 4 ? undefined : 2500 )));
|
|
1006
1006
|
});
|
|
@@ -1121,12 +1121,25 @@ RegisterConfigurationSchemasContribution = ( __decorate([
|
|
|
1121
1121
|
( __param(3, IExtensionService)),
|
|
1122
1122
|
( __param(4, ILifecycleService))
|
|
1123
1123
|
], RegisterConfigurationSchemasContribution));
|
|
1124
|
+
let ResetConfigurationDefaultsOverridesCache = class ResetConfigurationDefaultsOverridesCache extends Disposable {
|
|
1125
|
+
constructor(configurationService, extensionService) {
|
|
1126
|
+
super();
|
|
1127
|
+
if (configurationService.hasCachedConfigurationDefaultsOverrides()) {
|
|
1128
|
+
extensionService.whenInstalledExtensionsRegistered().then(() => configurationService.reloadConfiguration(7 ));
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
};
|
|
1132
|
+
ResetConfigurationDefaultsOverridesCache = ( __decorate([
|
|
1133
|
+
( __param(0, IConfigurationService)),
|
|
1134
|
+
( __param(1, IExtensionService))
|
|
1135
|
+
], ResetConfigurationDefaultsOverridesCache));
|
|
1124
1136
|
let UpdateExperimentalSettingsDefaults = class UpdateExperimentalSettingsDefaults extends Disposable {
|
|
1137
|
+
static { this.ID = 'workbench.contrib.updateExperimentalSettingsDefaults'; }
|
|
1125
1138
|
constructor(workbenchAssignmentService) {
|
|
1126
1139
|
super();
|
|
1127
1140
|
this.workbenchAssignmentService = workbenchAssignmentService;
|
|
1128
1141
|
this.processedExperimentalSettings = ( new Set());
|
|
1129
|
-
this.configurationRegistry = ( Registry.as(Extensions
|
|
1142
|
+
this.configurationRegistry = ( Registry.as(Extensions.Configuration));
|
|
1130
1143
|
this.processExperimentalSettings(( Object.keys(this.configurationRegistry.getConfigurationProperties())));
|
|
1131
1144
|
this._register(this.configurationRegistry.onDidUpdateConfiguration(({ properties }) => this.processExperimentalSettings(properties)));
|
|
1132
1145
|
}
|
|
@@ -1162,10 +1175,11 @@ let UpdateExperimentalSettingsDefaults = class UpdateExperimentalSettingsDefault
|
|
|
1162
1175
|
UpdateExperimentalSettingsDefaults = ( __decorate([
|
|
1163
1176
|
( __param(0, IWorkbenchAssignmentService))
|
|
1164
1177
|
], UpdateExperimentalSettingsDefaults));
|
|
1165
|
-
const workbenchContributionsRegistry = ( Registry.as(Extensions.Workbench));
|
|
1178
|
+
const workbenchContributionsRegistry = ( Registry.as(Extensions$1.Workbench));
|
|
1166
1179
|
workbenchContributionsRegistry.registerWorkbenchContribution(RegisterConfigurationSchemasContribution, 3 );
|
|
1167
|
-
workbenchContributionsRegistry.registerWorkbenchContribution(
|
|
1168
|
-
|
|
1180
|
+
workbenchContributionsRegistry.registerWorkbenchContribution(ResetConfigurationDefaultsOverridesCache, 4 );
|
|
1181
|
+
registerWorkbenchContribution2(UpdateExperimentalSettingsDefaults.ID, UpdateExperimentalSettingsDefaults, 2 );
|
|
1182
|
+
const configurationRegistry = ( Registry.as(Extensions.Configuration));
|
|
1169
1183
|
configurationRegistry.registerConfiguration({
|
|
1170
1184
|
...workbenchConfigurationNodeBase,
|
|
1171
1185
|
properties: {
|
|
@@ -23,7 +23,7 @@ import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storag
|
|
|
23
23
|
import { Memento } from 'vscode/vscode/vs/workbench/common/memento';
|
|
24
24
|
import { firstOrDefault } from 'vscode/vscode/vs/base/common/arrays';
|
|
25
25
|
|
|
26
|
-
const resourceLabelFormattersExtPoint =
|
|
26
|
+
const resourceLabelFormattersExtPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
27
27
|
extensionPoint: 'resourceLabelFormatters',
|
|
28
28
|
jsonSchema: {
|
|
29
29
|
description: ( localizeWithPath(
|
|
@@ -105,7 +105,7 @@ const resourceLabelFormattersExtPoint = ( ExtensionsRegistry.registerExtensionPo
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
})
|
|
108
|
+
});
|
|
109
109
|
const sepRegexp = /\//g;
|
|
110
110
|
const labelMatchingRegexp = /\$\{(scheme|authoritySuffix|authority|path|(query)\.(.+?))\}/g;
|
|
111
111
|
function hasDriveLetterIgnorePlatform(path) {
|