@@ -44,13 +44,13 @@ suite('TextResourceConfigurationService - Update', () => {
44
44
test ( 'updateValue writes without target and overrides when no language is defined' , async ( ) => {
45
45
const resource = URI . file ( 'someFile' ) ;
46
46
await testObject . updateValue ( resource , 'a' , 'b' ) ;
47
- assert . deepStrictEqual ( updateArgs , [ 'a' , 'b' , { resource } , ConfigurationTarget . USER_LOCAL ] ) ;
47
+ assert . deepStrictEqual ( updateArgs , [ 'a' , 'b' , { resource, overrideIdentifier : undefined } , ConfigurationTarget . USER_LOCAL ] ) ;
48
48
} ) ;
49
49
50
50
test ( 'updateValue writes with target and without overrides when no language is defined' , async ( ) => {
51
51
const resource = URI . file ( 'someFile' ) ;
52
52
await testObject . updateValue ( resource , 'a' , 'b' , ConfigurationTarget . USER_LOCAL ) ;
53
- assert . deepStrictEqual ( updateArgs , [ 'a' , 'b' , { resource } , ConfigurationTarget . USER_LOCAL ] ) ;
53
+ assert . deepStrictEqual ( updateArgs , [ 'a' , 'b' , { resource, overrideIdentifier : undefined } , ConfigurationTarget . USER_LOCAL ] ) ;
54
54
} ) ;
55
55
56
56
test ( 'updateValue writes into given memory target without overrides' , async ( ) => {
@@ -63,7 +63,7 @@ suite('TextResourceConfigurationService - Update', () => {
63
63
const resource = URI . file ( 'someFile' ) ;
64
64
65
65
await testObject . updateValue ( resource , 'a' , 'b' , ConfigurationTarget . MEMORY ) ;
66
- assert . deepStrictEqual ( updateArgs , [ 'a' , 'b' , { resource } , ConfigurationTarget . MEMORY ] ) ;
66
+ assert . deepStrictEqual ( updateArgs , [ 'a' , 'b' , { resource, overrideIdentifier : undefined } , ConfigurationTarget . MEMORY ] ) ;
67
67
} ) ;
68
68
69
69
test ( 'updateValue writes into given workspace target without overrides' , async ( ) => {
@@ -76,7 +76,7 @@ suite('TextResourceConfigurationService - Update', () => {
76
76
const resource = URI . file ( 'someFile' ) ;
77
77
78
78
await testObject . updateValue ( resource , 'a' , 'b' , ConfigurationTarget . WORKSPACE ) ;
79
- assert . deepStrictEqual ( updateArgs , [ 'a' , 'b' , { resource } , ConfigurationTarget . WORKSPACE ] ) ;
79
+ assert . deepStrictEqual ( updateArgs , [ 'a' , 'b' , { resource, overrideIdentifier : undefined } , ConfigurationTarget . WORKSPACE ] ) ;
80
80
} ) ;
81
81
82
82
test ( 'updateValue writes into given user target without overrides' , async ( ) => {
@@ -89,7 +89,7 @@ suite('TextResourceConfigurationService - Update', () => {
89
89
const resource = URI . file ( 'someFile' ) ;
90
90
91
91
await testObject . updateValue ( resource , 'a' , 'b' , ConfigurationTarget . USER ) ;
92
- assert . deepStrictEqual ( updateArgs , [ 'a' , 'b' , { resource } , ConfigurationTarget . USER ] ) ;
92
+ assert . deepStrictEqual ( updateArgs , [ 'a' , 'b' , { resource, overrideIdentifier : undefined } , ConfigurationTarget . USER ] ) ;
93
93
} ) ;
94
94
95
95
test ( 'updateValue writes into given workspace folder target with overrides' , async ( ) => {
@@ -98,6 +98,7 @@ suite('TextResourceConfigurationService - Update', () => {
98
98
default : { value : '1' } ,
99
99
userLocal : { value : '2' } ,
100
100
workspaceFolder : { value : '2' , override : '1' } ,
101
+ overrideIdentifiers : [ language ]
101
102
} ;
102
103
const resource = URI . file ( 'someFile' ) ;
103
104
@@ -115,7 +116,7 @@ suite('TextResourceConfigurationService - Update', () => {
115
116
const resource = URI . file ( 'someFile' ) ;
116
117
117
118
await testObject . updateValue ( resource , 'a' , 'b' ) ;
118
- assert . deepStrictEqual ( updateArgs , [ 'a' , 'b' , { resource } , ConfigurationTarget . WORKSPACE_FOLDER ] ) ;
119
+ assert . deepStrictEqual ( updateArgs , [ 'a' , 'b' , { resource, overrideIdentifier : undefined } , ConfigurationTarget . WORKSPACE_FOLDER ] ) ;
119
120
} ) ;
120
121
121
122
test ( 'updateValue writes into derived workspace folder target with overrides' , async ( ) => {
@@ -125,6 +126,7 @@ suite('TextResourceConfigurationService - Update', () => {
125
126
userLocal : { value : '2' } ,
126
127
workspace : { value : '2' , override : '1' } ,
127
128
workspaceFolder : { value : '2' , override : '2' } ,
129
+ overrideIdentifiers : [ language ]
128
130
} ;
129
131
const resource = URI . file ( 'someFile' ) ;
130
132
@@ -142,7 +144,7 @@ suite('TextResourceConfigurationService - Update', () => {
142
144
const resource = URI . file ( 'someFile' ) ;
143
145
144
146
await testObject . updateValue ( resource , 'a' , 'b' ) ;
145
- assert . deepStrictEqual ( updateArgs , [ 'a' , 'b' , { resource } , ConfigurationTarget . WORKSPACE ] ) ;
147
+ assert . deepStrictEqual ( updateArgs , [ 'a' , 'b' , { resource, overrideIdentifier : undefined } , ConfigurationTarget . WORKSPACE ] ) ;
146
148
} ) ;
147
149
148
150
test ( 'updateValue writes into derived workspace target with overrides' , async ( ) => {
@@ -151,6 +153,7 @@ suite('TextResourceConfigurationService - Update', () => {
151
153
default : { value : '1' } ,
152
154
userLocal : { value : '2' } ,
153
155
workspace : { value : '2' , override : '2' } ,
156
+ overrideIdentifiers : [ language ]
154
157
} ;
155
158
const resource = URI . file ( 'someFile' ) ;
156
159
@@ -165,6 +168,7 @@ suite('TextResourceConfigurationService - Update', () => {
165
168
userLocal : { value : '2' } ,
166
169
workspace : { value : '2' , override : '2' } ,
167
170
workspaceFolder : { value : '2' } ,
171
+ overrideIdentifiers : [ language ]
168
172
} ;
169
173
const resource = URI . file ( 'someFile' ) ;
170
174
@@ -182,7 +186,7 @@ suite('TextResourceConfigurationService - Update', () => {
182
186
const resource = URI . file ( 'someFile' ) ;
183
187
184
188
await testObject . updateValue ( resource , 'a' , 'b' ) ;
185
- assert . deepStrictEqual ( updateArgs , [ 'a' , 'b' , { resource } , ConfigurationTarget . USER_REMOTE ] ) ;
189
+ assert . deepStrictEqual ( updateArgs , [ 'a' , 'b' , { resource, overrideIdentifier : undefined } , ConfigurationTarget . USER_REMOTE ] ) ;
186
190
} ) ;
187
191
188
192
test ( 'updateValue writes into derived user remote target with overrides' , async ( ) => {
@@ -191,6 +195,7 @@ suite('TextResourceConfigurationService - Update', () => {
191
195
default : { value : '1' } ,
192
196
userLocal : { value : '2' } ,
193
197
userRemote : { value : '2' , override : '3' } ,
198
+ overrideIdentifiers : [ language ]
194
199
} ;
195
200
const resource = URI . file ( 'someFile' ) ;
196
201
@@ -204,7 +209,8 @@ suite('TextResourceConfigurationService - Update', () => {
204
209
default : { value : '1' } ,
205
210
userLocal : { value : '2' } ,
206
211
userRemote : { value : '2' , override : '3' } ,
207
- workspace : { value : '3' }
212
+ workspace : { value : '3' } ,
213
+ overrideIdentifiers : [ language ]
208
214
} ;
209
215
const resource = URI . file ( 'someFile' ) ;
210
216
@@ -219,7 +225,8 @@ suite('TextResourceConfigurationService - Update', () => {
219
225
userLocal : { value : '2' , override : '1' } ,
220
226
userRemote : { value : '2' , override : '3' } ,
221
227
workspace : { value : '3' } ,
222
- workspaceFolder : { value : '3' }
228
+ workspaceFolder : { value : '3' } ,
229
+ overrideIdentifiers : [ language ]
223
230
} ;
224
231
const resource = URI . file ( 'someFile' ) ;
225
232
@@ -236,14 +243,15 @@ suite('TextResourceConfigurationService - Update', () => {
236
243
const resource = URI . file ( 'someFile' ) ;
237
244
238
245
await testObject . updateValue ( resource , 'a' , 'b' ) ;
239
- assert . deepStrictEqual ( updateArgs , [ 'a' , 'b' , { resource } , ConfigurationTarget . USER_LOCAL ] ) ;
246
+ assert . deepStrictEqual ( updateArgs , [ 'a' , 'b' , { resource, overrideIdentifier : undefined } , ConfigurationTarget . USER_LOCAL ] ) ;
240
247
} ) ;
241
248
242
249
test ( 'updateValue writes into derived user target with overrides' , async ( ) => {
243
250
language = 'a' ;
244
251
configurationValue = {
245
252
default : { value : '1' } ,
246
253
userLocal : { value : '2' , override : '3' } ,
254
+ overrideIdentifiers : [ language ]
247
255
} ;
248
256
const resource = URI . file ( 'someFile' ) ;
249
257
@@ -256,7 +264,8 @@ suite('TextResourceConfigurationService - Update', () => {
256
264
configurationValue = {
257
265
default : { value : '1' } ,
258
266
userLocal : { value : '2' , override : '3' } ,
259
- userRemote : { value : '3' }
267
+ userRemote : { value : '3' } ,
268
+ overrideIdentifiers : [ language ]
260
269
} ;
261
270
const resource = URI . file ( 'someFile' ) ;
262
271
@@ -269,7 +278,8 @@ suite('TextResourceConfigurationService - Update', () => {
269
278
configurationValue = {
270
279
default : { value : '1' } ,
271
280
userLocal : { value : '2' , override : '3' } ,
272
- workspaceValue : { value : '3' }
281
+ workspaceValue : { value : '3' } ,
282
+ overrideIdentifiers : [ language ]
273
283
} ;
274
284
const resource = URI . file ( 'someFile' ) ;
275
285
@@ -283,7 +293,21 @@ suite('TextResourceConfigurationService - Update', () => {
283
293
default : { value : '1' , override : '3' } ,
284
294
userLocal : { value : '2' , override : '3' } ,
285
295
userRemote : { value : '3' } ,
286
- workspaceFolderValue : { value : '3' }
296
+ workspaceFolderValue : { value : '3' } ,
297
+ overrideIdentifiers : [ language ]
298
+ } ;
299
+ const resource = URI . file ( 'someFile' ) ;
300
+
301
+ await testObject . updateValue ( resource , 'a' , '2' ) ;
302
+ assert . deepStrictEqual ( updateArgs , [ 'a' , '2' , { resource, overrideIdentifier : language } , ConfigurationTarget . USER_LOCAL ] ) ;
303
+ } ) ;
304
+
305
+ test ( 'updateValue writes into derived user target when overridden in default and not in user' , async ( ) => {
306
+ language = 'a' ;
307
+ configurationValue = {
308
+ default : { value : '1' , override : '3' } ,
309
+ userLocal : { value : '2' } ,
310
+ overrideIdentifiers : [ language ]
287
311
} ;
288
312
const resource = URI . file ( 'someFile' ) ;
289
313
@@ -299,7 +323,7 @@ suite('TextResourceConfigurationService - Update', () => {
299
323
const resource = URI . file ( 'someFile' ) ;
300
324
301
325
await testObject . updateValue ( resource , 'a' , 'b' ) ;
302
- assert . deepStrictEqual ( updateArgs , [ 'a' , 'b' , { resource } , ConfigurationTarget . USER_LOCAL ] ) ;
326
+ assert . deepStrictEqual ( updateArgs , [ 'a' , 'b' , { resource, overrideIdentifier : undefined } , ConfigurationTarget . USER_LOCAL ] ) ;
303
327
} ) ;
304
328
305
329
} ) ;
0 commit comments