@codingame/monaco-vscode-configuration-service-override 2.0.3 → 2.1.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-configuration-service-override",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.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@2.0
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@2.1.0",
|
|
22
22
|
"vscode-marked": "npm:marked@=3.0.2",
|
|
23
|
-
"@codingame/monaco-vscode-files-service-override": "2.0
|
|
24
|
-
"@codingame/monaco-vscode-quickaccess-service-override": "2.0
|
|
25
|
-
"@codingame/monaco-vscode-extensions-service-override": "2.0
|
|
26
|
-
"@codingame/monaco-vscode-environment-service-override": "2.0
|
|
27
|
-
"@codingame/monaco-vscode-layout-service-override": "2.0
|
|
28
|
-
"@codingame/monaco-vscode-host-service-override": "2.0
|
|
29
|
-
"@codingame/monaco-vscode-base-service-override": "2.0
|
|
23
|
+
"@codingame/monaco-vscode-files-service-override": "2.1.0",
|
|
24
|
+
"@codingame/monaco-vscode-quickaccess-service-override": "2.1.0",
|
|
25
|
+
"@codingame/monaco-vscode-extensions-service-override": "2.1.0",
|
|
26
|
+
"@codingame/monaco-vscode-environment-service-override": "2.1.0",
|
|
27
|
+
"@codingame/monaco-vscode-layout-service-override": "2.1.0",
|
|
28
|
+
"@codingame/monaco-vscode-host-service-override": "2.1.0",
|
|
29
|
+
"@codingame/monaco-vscode-base-service-override": "2.1.0"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -879,7 +879,7 @@ class WorkspaceService extends Disposable {
|
|
|
879
879
|
throw new Error('Invalid configuration target');
|
|
880
880
|
}
|
|
881
881
|
if (overrides?.overrideIdentifiers?.length && overrides.overrideIdentifiers.length > 1) {
|
|
882
|
-
const configurationModel = this.
|
|
882
|
+
const configurationModel = this.getConfigurationModelForEditableConfigurationTarget(editableConfigurationTarget, overrides.resource);
|
|
883
883
|
if (configurationModel) {
|
|
884
884
|
const overrideIdentifiers = overrides.overrideIdentifiers.sort();
|
|
885
885
|
const existingOverrides = configurationModel.overrides.find(override => equals$1([...override.identifiers].sort(), overrideIdentifiers));
|
|
@@ -888,8 +888,8 @@ class WorkspaceService extends Disposable {
|
|
|
888
888
|
}
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
|
-
this.configurationEditing = this.configurationEditing ?? this.
|
|
892
|
-
await this.configurationEditing.writeConfiguration(editableConfigurationTarget, { key, value }, { scopes: overrides, ...options });
|
|
891
|
+
this.configurationEditing = this.configurationEditing ?? this.createConfigurationEditingService(this.instantiationService);
|
|
892
|
+
await (await this.configurationEditing).writeConfiguration(editableConfigurationTarget, { key, value }, { scopes: overrides, ...options });
|
|
893
893
|
switch (editableConfigurationTarget) {
|
|
894
894
|
case 1 :
|
|
895
895
|
if (this.applicationConfiguration && this.isSettingAppliedForAllProfiles(key)) {
|
|
@@ -911,7 +911,11 @@ class WorkspaceService extends Disposable {
|
|
|
911
911
|
}
|
|
912
912
|
}
|
|
913
913
|
}
|
|
914
|
-
|
|
914
|
+
async createConfigurationEditingService(instantiationService) {
|
|
915
|
+
const remoteSettingsResource = (await this.remoteAgentService.getEnvironment())?.settingsPath ?? null;
|
|
916
|
+
return instantiationService.createInstance(ConfigurationEditing, remoteSettingsResource);
|
|
917
|
+
}
|
|
918
|
+
getConfigurationModelForEditableConfigurationTarget(target, resource) {
|
|
915
919
|
switch (target) {
|
|
916
920
|
case 1 : return this._configuration.localUserConfiguration;
|
|
917
921
|
case 2 : return this._configuration.remoteUserConfiguration;
|
|
@@ -919,6 +923,15 @@ class WorkspaceService extends Disposable {
|
|
|
919
923
|
case 4 : return resource ? this._configuration.folderConfigurations.get(resource) : undefined;
|
|
920
924
|
}
|
|
921
925
|
}
|
|
926
|
+
getConfigurationModel(target, resource) {
|
|
927
|
+
switch (target) {
|
|
928
|
+
case 3 : return this._configuration.localUserConfiguration;
|
|
929
|
+
case 4 : return this._configuration.remoteUserConfiguration;
|
|
930
|
+
case 5 : return this._configuration.workspaceConfiguration;
|
|
931
|
+
case 6 : return resource ? this._configuration.folderConfigurations.get(resource) : undefined;
|
|
932
|
+
default: return undefined;
|
|
933
|
+
}
|
|
934
|
+
}
|
|
922
935
|
deriveConfigurationTargets(key, value, inspect) {
|
|
923
936
|
if (equals(value, inspect.value)) {
|
|
924
937
|
return [];
|
|
@@ -948,21 +961,9 @@ class WorkspaceService extends Disposable {
|
|
|
948
961
|
}
|
|
949
962
|
const configurationChangeEvent = ( new ConfigurationChangeEvent(change, previous, this._configuration, this.workspace));
|
|
950
963
|
configurationChangeEvent.source = target;
|
|
951
|
-
configurationChangeEvent.sourceConfig = this.getTargetConfiguration(target);
|
|
952
964
|
this._onDidChangeConfiguration.fire(configurationChangeEvent);
|
|
953
965
|
}
|
|
954
966
|
}
|
|
955
|
-
getTargetConfiguration(target) {
|
|
956
|
-
switch (target) {
|
|
957
|
-
case 7 :
|
|
958
|
-
return this._configuration.defaults.contents;
|
|
959
|
-
case 2 :
|
|
960
|
-
return this._configuration.userConfiguration.contents;
|
|
961
|
-
case 5 :
|
|
962
|
-
return this._configuration.workspaceConfiguration.contents;
|
|
963
|
-
}
|
|
964
|
-
return {};
|
|
965
|
-
}
|
|
966
967
|
toEditableConfigurationTarget(target, key) {
|
|
967
968
|
if (target === 2 ) {
|
|
968
969
|
if (this.remoteUserConfiguration) {
|