ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / src / vs / platform / configuration / test / common / configurationModels.test.ts 1609 строк · изменён 14 нояб., 04:52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
import assert from 'assert' ;
import { ResourceMap } from '../../../../base/common/map.js' ;
import { join } from '../../../../base/common/path.js' ;
import { URI } from '../../../../base/common/uri.js' ;
import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js' ;
import { Configuration, ConfigurationChangeEvent, ConfigurationModel, ConfigurationModelParser, mergeChanges } from '../../common/configurationModels.js' ;
import { IConfigurationRegistry, Extensions, ConfigurationScope, IConfigurationNode
NullLogService
Registry
WorkspaceFolder
Workspace
Registry Extensions Configuration
testObject
testObject
assert testObject configurationModel overrides identifiers keys contents
testObject
testObject
assert testObject configurationModel overrides identifiers keys contents
testObject
testObject
assert testObject configurationModel overrides identifiers keys contents
testObject
testObject exclude
assert testObject configurationModel
assert testObject configurationModel
testObject
testObject exclude include
assert testObject configurationModel
assert testObject configurationModel
testObject
testObject scopes ConfigurationScope
assert testObject configurationModel
testObject
testObject include scopes ConfigurationScope
assert testObject configurationModel
testObject
testObject c
assert testObject configurationModel
assert testObject configurationModel
assert testObject configurationModel
configurationRegistry Registry Extensions Configuration
testConfigurationNodes IConfigurationNode
testConfigurationNodes length
configurationRegistry testConfigurationNodes
testConfigurationNodes
node
configurationRegistry node
testConfigurationNodes node
node
testObject
testData
testObject testData skipRestricted
assert testObject configurationModel
assert testObject configurationModel
assert testObject configurationModel
assert testObject configurationModel
assert testObject restrictedConfigurations
assert testObject restrictedConfigurations
testObject
testData
testObject testData
assert testObject configurationModel
assert testObject restrictedConfigurations
testObject
testData
testObject testData skipRestricted
overrideConfig testObject configurationModel
assert overrideConfig
assert overrideConfig
assert overrideConfig
node
ConfigurationScope
ConfigurationScope
ConfigurationScope
configurationRegistry node
testConfigurationNodes node
testObject
testData
testObject testData scopes ConfigurationScope
assert testObject configurationModel
assert testObject configurationModel
assert testObject configurationModel
testObject
testData
testObject testData include
assert testObject configurationModel
assert testObject configurationModel
testObject
testData
testObject testData exclude
assert testObject configurationModel
assert testObject configurationModel
testObject
testData
testObject testData skipRestricted
model testObject configurationModel
assert model raw
testObject
testObject
skipUnregistered
assert testObject configurationModel
testObject
testObject
skipUnregistered
assert testObject configurationModel
assert testObject configurationModel
assert testObject configurationModel
registry Registry Extensions Configuration
excludedProperties registry
assert excludedProperties
assert excludedProperties
regularProperties registry
assert regularProperties
assert regularProperties
assert regularProperties
assert regularProperties
testObject
testData
testObject testData skipRestricted
assert testObject configurationModel
assert testObject configurationModel
assert testObject restrictedConfigurations
assert testObject configurationModel
assert testObject restrictedConfigurations
assert testObject configurationModel
assert testObject configurationModel
testObject
testObject
assert testObject contents
assert testObject keys
testObject
testObject
assert testObject contents
assert testObject keys
testObject
testObject
expected Record
expected
expected
expected Object
expected Record
assert testObject contents expected
assert testObject keys
testObject
testObject
assert testObject contents
assert testObject keys
testObject
testObject
assert testObject contents
assert testObject keys
testObject
testObject
assert testObject contents
assert testObject keys
testObject
testObject
assert testObject contents
assert testObject keys
testObject
testObject
assert testObject contents
assert testObject keys
testObject
testObject
assert testObject contents
assert testObject keys
testObject
testObject
assert testObject contents
assert testObject keys
testObject
identifiers contents keys
assert testObject contents
testObject
identifiers contents keys
assert testObject contents
testObject
identifiers contents keys
assert testObject contents
testObject
identifiers contents keys
assert testObject contents
testObject
identifiers contents keys
assert testObject contents
testObject
identifiers contents Record keys
assert testObject contents
testObject
identifiers contents keys
assert testObject contents
base
add
result base add
assert result contents
assert result keys
base
add
result base add
assert result contents
assert result
assert result keys
base identifiers contents keys
add identifiers contents keys
result base add
assert result contents
assert result overrides identifiers contents keys
assert result contents
assert result keys
base identifiers contents keys
add identifiers contents keys
result base add
assert result contents
assert result overrides identifiers contents keys
assert result contents
assert result keys
testObject
assert testObject
testObject
assert testObject
testObject awesome
assert testObject
testObject identifiers contents keys
assert testObject contents
testObject identifiers contents keys
actual testObject
assert actual contents
assert actual keys
assert testObject
actual testObject
assert actual contents
assert actual keys
assert testObject
testObject identifiers contents keys identifiers contents keys
actual testObject
assert actual contents
assert actual keys
assert testObject
testObject identifiers contents keys identifiers contents keys
target identifiers contents keys identifiers contents keys
actual testObject target
assert actual contents
assert actual keys
assert actual overrides
identifiers contents keys
identifiers contents keys
identifiers contents keys
testObject identifiers contents keys
assert testObject value override merged overrides identifiers value
assert testObject value override merged overrides identifiers value
assert testObject value override merged overrides identifiers value
assert testObject value override merged overrides
testObject identifiers contents keys
assert testObject value override merged overrides identifiers value
assert testObject value override merged overrides identifiers value
assert testObject value override merged overrides identifiers value
assert testObject value override merged overrides
assert testObject value override merged overrides
target1 identifiers contents keys
target2
testObject target1 target2
assert testObject value override merged overrides identifiers value
assert testObject value override merged overrides identifiers value
assert testObject value override merged overrides
assert testObject value override merged overrides
assert testObject value override merged overrides
target1 identifiers contents keys
target2
testObject target1 target2
assert testObject value override merged overrides identifiers value
assert testObject value override merged overrides identifiers value
assert testObject value override merged overrides identifiers value
assert testObject value override merged overrides identifiers value
assert testObject value override merged overrides
testObject
identifiers contents keys
identifiers contents keys
identifiers contents keys
assert testObject overrides
identifiers value
identifiers value
testObject
assert testObject overrides
base
base
add
add
result base configurationModel add configurationModel
assert result contents
base
base
add
result base configurationModel add configurationModel
assert result contents
base
add
add
result base configurationModel add configurationModel
assert result contents
base
add
result base configurationModel add configurationModel
assert result contents
base
base
add
add
result base configurationModel add configurationModel
assert result contents
testObject
testObject
assert testObject configurationModel
testObject
assert testObject configurationModel
testObject
testObject
awesome
assert testObject configurationModel
testObject
assert testObject configurationModel
testObject
testObject
assert testObject configurationModel contents
testObject
assert testObject configurationModel contents
testObject
testObject
assert testObject configurationModel contents Object
assert testObject configurationModel keys
testObject
assert testObject configurationModel contents Object
assert testObject configurationModel keys
testObject
assert testObject configurationModel contents Object
assert testObject configurationModel keys
testObject
testObject
assert testObject configurationModel contents
assert testObject configurationModel keys
defaultConfiguration ConfigurationModel
policyConfiguration ConfigurationModel
applicationConfiguration ConfigurationModel
localUserConfiguration ConfigurationModel
remoteUserConfiguration ConfigurationModel
defaultConfiguration
policyConfiguration
applicationConfiguration
localUserConfiguration
remoteUserConfiguration ConfigurationModel
ConfigurationModel
ConfigurationModel
defaultConfigurationModel
userConfigurationModel
workspaceConfigurationModel
testObject Configuration defaultConfigurationModel ConfigurationModel userConfigurationModel workspaceConfigurationModel
overrideIdentifiers testObject
assert overrideIdentifiers
parser
parser
testObject Configuration parser configurationModel ConfigurationModel ConfigurationModel ConfigurationModel
testObject
assert testObject
parser
parser
testObject Configuration parser configurationModel ConfigurationModel ConfigurationModel ConfigurationModel
testObject
testObject
assert testObject
testObject ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel
testObject
actual testObject
assert actual keys overrides
testObject ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel
testObject
actual testObject
assert actual keys overrides
testObject ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel
testObject
actual testObject
assert actual keys overrides
testObject ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel
testObject
actual testObject
assert actual keys overrides
testObject ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel
testObject
actual testObject
assert actual keys overrides
testObject ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel
testObject
actual testObject
assert actual keys overrides
content Record ConfigurationModel
parser
parser content
parser configurationModel
configuration ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel
change configuration
testObject change configuration
assert testObject affectedKeys
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
configuration ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel
configuration
data configuration
change configuration
testObject change data configuration
assert testObject affectedKeys
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
configuration ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel
change configuration
testObject change configuration
assert testObject affectedKeys
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject overrideIdentifier
assert testObject overrideIdentifier
assert testObject overrideIdentifier
assert testObject overrideIdentifier
assert testObject overrideIdentifier
assert testObject overrideIdentifier
assert testObject overrideIdentifier
assert testObject overrideIdentifier
assert testObject overrideIdentifier
assert testObject overrideIdentifier
assert testObject overrideIdentifier
assert testObject
assert testObject
configuration ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel
configuration
data configuration
change configuration
testObject change data configuration
assert testObject affectedKeys
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject
assert testObject overrideIdentifier
assert testObject overrideIdentifier
assert testObject overrideIdentifier
assert testObject overrideIdentifier
assert testObject overrideIdentifier
assert testObject overrideIdentifier
assert testObject overrideIdentifier
assert testObject overrideIdentifier
assert testObject overrideIdentifier
assert testObject
assert testObject overrideIdentifier
assert testObject overrideIdentifier
assert testObject overrideIdentifier
assert testObject
assert testObject
assert testObject overrideIdentifier
assert testObject overrideIdentifier
assert testObject
assert testObject
assert testObject
assert testObject overrideIdentifier
assert testObject overrideIdentifier
configuration ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel
configuration
configuration
configuration
data configuration
workspace index name uri index name uri index name uri
change
configuration
configuration
configuration
testObject change data workspace configuration workspace
assert testObject affectedKeys
assert testObject
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
assert testObject resource
configuration ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel
configuration
data configuration
change
configuration
configuration
configuration
configuration
configuration
workspace index name uri index name uri index name uri
testObject change data workspace configuration workspace
assert testObject affectedKeys
assert testObject
assert testObject resource
assert testObject resource
assert testObject
assert testObject resource
assert testObject resource
assert testObject
assert testObject resource
assert testObject resource
assert testObject
assert testObject resource
assert testObject resource
assert testObject
assert testObject resource
assert testObject resource
assert testObject
assert testObject resource
assert testObject resource
assert testObject
assert testObject resource
assert testObject resource
assert testObject
assert testObject resource
assert testObject resource
assert testObject
assert testObject resource
assert testObject resource
assert testObject
assert testObject resource
assert testObject resource
assert testObject resource overrideIdentifier
assert testObject resource overrideIdentifier
assert testObject resource overrideIdentifier
assert testObject resource overrideIdentifier
assert testObject resource overrideIdentifier
assert testObject resource overrideIdentifier
assert testObject
assert testObject resource
assert testObject resource
assert testObject resource overrideIdentifier
assert testObject resource overrideIdentifier
assert testObject resource overrideIdentifier
assert testObject resource overrideIdentifier
assert testObject resource overrideIdentifier
assert testObject resource overrideIdentifier
assert testObject
assert testObject resource
assert testObject resource
assert testObject resource overrideIdentifier
assert testObject resource overrideIdentifier
assert testObject resource overrideIdentifier
assert testObject resource overrideIdentifier
assert testObject resource overrideIdentifier
assert testObject resource overrideIdentifier
assert testObject
assert testObject resource
assert testObject resource
configuration ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel
change configuration
testObject change configuration
assert testObject affectedKeys
assert testObject
assert testObject
assert testObject
configuration ConfigurationModel ConfigurationModel ConfigurationModel ConfigurationModel
change configuration
testObject change configuration
assert testObject
logService
configuration
ConfigurationModel logService
ConfigurationModel logService
ConfigurationModel logService
identifiers contents keys logService
actual Configuration configuration logService
assert actual userLocal value override merged overrides identifiers value
assert actual overrideIdentifier userLocal value override merged overrides identifiers value
assert actual overrideIdentifier userLocal value override merged overrides identifiers value
assert actual userLocal
assert actual userRemote
assert actual overrideIdentifier userRemote
assert actual overrideIdentifier userRemote
assert actual userRemote
assert actual user value override merged overrides identifiers value
assert actual overrideIdentifier user value override merged overrides identifiers value
assert actual overrideIdentifier user value override merged overrides identifiers value
assert actual user
configuration
ConfigurationModel logService
ConfigurationModel logService
ConfigurationModel logService
identifiers contents keys
logService
actual Configuration configuration logService
assert actual userLocal value override merged overrides identifiers value
assert actual overrideIdentifier userLocal value override merged overrides identifiers value
assert actual overrideIdentifier userLocal value override merged overrides identifiers value
assert actual userLocal value override merged overrides
assert actual userLocal
assert actual userRemote
assert actual overrideIdentifier userRemote
assert actual overrideIdentifier userRemote
assert actual userRemote
assert actual userRemote
assert actual user value override merged overrides identifiers value
assert actual overrideIdentifier user value override merged overrides identifiers value
assert actual overrideIdentifier user value override merged overrides identifiers value
assert actual user value override merged overrides
assert actual user
configuration
ConfigurationModel logService
ConfigurationModel logService
ConfigurationModel logService
identifiers contents keys logService
logService
actual Configuration configuration logService
assert actual userLocal value override merged overrides identifiers value
assert actual overrideIdentifier userLocal value override merged overrides identifiers value
assert actual userLocal
assert actual overrideIdentifier userLocal
assert actual userLocal
assert actual userRemote
assert actual overrideIdentifier userRemote
assert actual userRemote value override merged overrides
assert actual overrideIdentifier userRemote value override merged overrides
assert actual userRemote
assert actual user value override merged overrides identifiers value
assert actual overrideIdentifier user value override merged overrides identifiers value
assert actual user value override merged overrides
assert actual overrideIdentifier user value override merged overrides
assert actual user
configuration
ConfigurationModel logService
ConfigurationModel logService
ConfigurationModel logService
identifiers contents keys
logService
logService
actual Configuration configuration logService
assert actual userLocal value override merged overrides identifiers value
assert actual overrideIdentifier userLocal value override merged overrides identifiers value
assert actual userLocal value override merged overrides identifiers value
assert actual overrideIdentifier userLocal value override merged overrides identifiers value
assert actual userLocal value override merged overrides
assert actual userRemote
assert actual overrideIdentifier userRemote
assert actual userRemote value override merged overrides
assert actual overrideIdentifier userRemote value override merged overrides
assert actual userRemote
assert actual user value override merged overrides identifiers value
assert actual overrideIdentifier user value override merged overrides identifiers value
assert actual user value merged override overrides
assert actual overrideIdentifier user value override merged overrides
assert actual user
configuration
ConfigurationModel logService
ConfigurationModel logService
ConfigurationModel logService
logService
identifiers contents keys
logService
actual Configuration configuration logService
assert actual userLocal
assert actual overrideIdentifier userLocal
assert actual userLocal value override merged overrides
assert actual overrideIdentifier userLocal value override merged overrides
assert actual userLocal
assert actual userRemote value override merged overrides identifiers value
assert actual overrideIdentifier userRemote value override merged overrides identifiers value
assert actual userRemote value override merged overrides identifiers value
assert actual overrideIdentifier userRemote value override merged overrides identifiers value
assert actual userRemote value override merged overrides
assert actual user value override merged overrides identifiers value
assert actual overrideIdentifier user value override merged overrides identifiers value
assert actual user value override merged overrides
assert actual overrideIdentifier user value override merged overrides
assert actual user
configuration
ConfigurationModel logService
ConfigurationModel logService
ConfigurationModel logService
logService
identifiers contents keys
logService
actual Configuration configuration logService
assert actual userLocal value override merged overrides
assert actual overrideIdentifier userLocal value override merged overrides
assert actual userLocal value override merged overrides
assert actual overrideIdentifier userLocal value override merged overrides
assert actual userLocal
assert actual userRemote value override merged overrides identifiers value
assert actual overrideIdentifier userRemote value override merged overrides identifiers value
assert actual userRemote value override merged overrides identifiers value
assert actual overrideIdentifier userRemote value override merged overrides identifiers value
assert actual userRemote value override merged overrides
assert actual user value override merged overrides identifiers value
assert actual overrideIdentifier user value override merged overrides identifiers value
assert actual user value override merged overrides
assert actual overrideIdentifier user value override merged overrides
assert actual user
obj Record ConfigurationModel
parser
parser obj
parser configurationModel
}
from
'../../common/configurationRegistry.js'
;
import
{
}
from
'../../../log/common/log.js'
;
import
{
}
from
'../../../registry/common/platform.js'
;
import
{
}
from
'../../../workspace/common/workspace.js'
;
import
{
}
from
'../../../workspace/test/common/testWorkspace.js'
;
suite
(
'ConfigurationModelParser'
,
(
)
=>
{
ensureNoDisposablesAreLeakedInTestSuite
(
)
;
suiteSetup
(
(
)
=>
{
.
as < IConfigurationRegistry>
(
.
)
.
registerConfiguration
(
{
'id'
:
'ConfigurationModelParserTest'
,
'type'
:
'object'
,
'properties'
:
{
'ConfigurationModelParserTest.windowSetting'
:
{
'type'
:
'string'
,
'default'
:
'isSet'
,
}
}
}
)
;
}
)
;
test
(
'parse configuration model with single override identifier'
,
(
)
=>
{
const
=
new
ConfigurationModelParser
(
''
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
{
'[x]'
:
{
'a'
:
1
}
}
)
)
;
.
deepStrictEqual
(
JSON
.
stringify
(
.
.
)
,
JSON
.
stringify
(
[
{
:
[
'x'
]
,
:
[
'a'
]
,
:
{
'a'
:
1
}
}
]
)
)
;
}
)
;
test
(
'parse configuration model with multiple override identifiers'
,
(
)
=>
{
const
=
new
ConfigurationModelParser
(
''
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
{
'[x][y]'
:
{
'a'
:
1
}
}
)
)
;
.
deepStrictEqual
(
JSON
.
stringify
(
.
.
)
,
JSON
.
stringify
(
[
{
:
[
'x'
,
'y'
]
,
:
[
'a'
]
,
:
{
'a'
:
1
}
}
]
)
)
;
}
)
;
test
(
'parse configuration model with multiple duplicate override identifiers'
,
(
)
=>
{
const
=
new
ConfigurationModelParser
(
''
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
{
'[x][y][x][z]'
:
{
'a'
:
1
}
}
)
)
;
.
deepStrictEqual
(
JSON
.
stringify
(
.
.
)
,
JSON
.
stringify
(
[
{
:
[
'x'
,
'y'
,
'z'
]
,
:
[
'a'
]
,
:
{
'a'
:
1
}
}
]
)
)
;
}
)
;
test
(
'parse configuration model with exclude option'
,
(
)
=>
{
const
=
new
ConfigurationModelParser
(
''
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
{
'a'
:
1
,
'b'
:
2
}
)
,
{
:
[
'a'
]
}
)
;
.
strictEqual
(
.
.
getValue
(
'a'
)
,
undefined
)
;
.
strictEqual
(
.
.
getValue
(
'b'
)
,
2
)
;
}
)
;
test
(
'parse configuration model with exclude option even included'
,
(
)
=>
{
const
=
new
ConfigurationModelParser
(
''
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
{
'a'
:
1
,
'b'
:
2
}
)
,
{
:
[
'a'
]
,
:
[
'a'
]
}
)
;
.
strictEqual
(
.
.
getValue
(
'a'
)
,
undefined
)
;
.
strictEqual
(
.
.
getValue
(
'b'
)
,
2
)
;
}
)
;
test
(
'parse configuration model with scopes filter'
,
(
)
=>
{
const
=
new
ConfigurationModelParser
(
''
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
{
'ConfigurationModelParserTest.windowSetting'
:
'1'
}
)
,
{
:
[
.
APPLICATION
]
}
)
;
.
strictEqual
(
.
.
getValue
(
'ConfigurationModelParserTest.windowSetting'
)
,
undefined
)
;
}
)
;
test
(
'parse configuration model with include option'
,
(
)
=>
{
const
=
new
ConfigurationModelParser
(
''
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
{
'ConfigurationModelParserTest.windowSetting'
:
'1'
}
)
,
{
:
[
'ConfigurationModelParserTest.windowSetting'
]
,
:
[
.
APPLICATION
]
}
)
;
.
strictEqual
(
.
.
getValue
(
'ConfigurationModelParserTest.windowSetting'
)
,
'1'
)
;
}
)
;
test
(
'parse configuration model with invalid setting key'
,
(
)
=>
{
const
=
new
ConfigurationModelParser
(
''
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
{
'a'
:
null
,
'a.b.c'
:
{
:
1
}
}
)
)
;
.
strictEqual
(
.
.
getValue
(
'a'
)
,
null
)
;
.
strictEqual
(
.
.
getValue
(
'a.b'
)
,
undefined
)
;
.
strictEqual
(
.
.
getValue
(
'a.b.c'
)
,
undefined
)
;
}
)
;
}
)
;
suite
(
'ConfigurationModelParser - Excluded Properties'
,
(
)
=>
{
ensureNoDisposablesAreLeakedInTestSuite
(
)
;
const
=
.
as < IConfigurationRegistry>
(
.
)
;
let
:
[
]
=
[
]
;
setup
(
(
)
=>
reset
(
)
)
;
teardown
(
(
)
=>
reset
(
)
)
;
function
reset
(
)
{
if
(
.
>
0
)
{
.
deregisterConfigurations
(
)
;
=
[
]
;
}
}
function
registerTestConfiguration
(
)
{
const
=
{
'id'
:
'ExcludedPropertiesTest'
,
'type'
:
'object'
,
'properties'
:
{
'regularProperty'
:
{
'type'
:
'string'
as
const
,
'default'
:
'regular'
,
'restricted'
:
false
}
,
'restrictedProperty'
:
{
'type'
:
'string'
as
const
,
'default'
:
'restricted'
,
'restricted'
:
true
}
,
'excludedProperty'
:
{
'type'
:
'string'
as
const
,
'default'
:
'excluded'
,
'restricted'
:
true
,
'included'
:
false
}
,
'excludedNonRestrictedProperty'
:
{
'type'
:
'string'
as
const
,
'default'
:
'excludedNonRestricted'
,
'restricted'
:
false
,
'included'
:
false
}
}
}
;
.
registerConfiguration
(
)
;
.
push
(
)
;
return
;
}
test
(
'should handle excluded restricted properties correctly'
,
(
)
=>
{
registerTestConfiguration
(
)
;
const
=
new
ConfigurationModelParser
(
'test'
,
new
NullLogService
(
)
)
;
const
=
{
'regularProperty'
:
'regularValue'
,
'restrictedProperty'
:
'restrictedValue'
,
'excludedProperty'
:
'excludedValue'
,
'excludedNonRestrictedProperty'
:
'excludedNonRestrictedValue'
}
;
.
parse
(
JSON
.
stringify
(
)
,
{
:
true
}
)
;
.
strictEqual
(
.
.
getValue
(
'regularProperty'
)
,
'regularValue'
)
;
.
strictEqual
(
.
.
getValue
(
'restrictedProperty'
)
,
undefined
)
;
.
strictEqual
(
.
.
getValue
(
'excludedProperty'
)
,
'excludedValue'
)
;
.
strictEqual
(
.
.
getValue
(
'excludedNonRestrictedProperty'
)
,
'excludedNonRestrictedValue'
)
;
.
ok
(
.
.
includes
(
'restrictedProperty'
)
)
;
.
ok
(
!
.
.
includes
(
'excludedProperty'
)
)
;
}
)
;
test
(
'should find excluded properties when checking for restricted settings'
,
(
)
=>
{
registerTestConfiguration
(
)
;
const
=
new
ConfigurationModelParser
(
'test'
,
new
NullLogService
(
)
)
;
const
=
{
'excludedProperty'
:
'excludedValue'
}
;
.
parse
(
JSON
.
stringify
(
)
)
;
.
strictEqual
(
.
.
getValue
(
'excludedProperty'
)
,
'excludedValue'
)
;
.
ok
(
!
.
.
includes
(
'excludedProperty'
)
)
;
}
)
;
test
(
'should handle override properties with excluded configurations'
,
(
)
=>
{
registerTestConfiguration
(
)
;
const
=
new
ConfigurationModelParser
(
'test'
,
new
NullLogService
(
)
)
;
const
=
{
'[typescript]'
:
{
'regularProperty'
:
'overrideRegular'
,
'restrictedProperty'
:
'overrideRestricted'
,
'excludedProperty'
:
'overrideExcluded'
}
}
;
.
parse
(
JSON
.
stringify
(
)
,
{
:
true
}
)
;
const
=
.
.
override
(
'typescript'
)
;
.
strictEqual
(
.
getValue
(
'regularProperty'
)
,
'overrideRegular'
)
;
.
strictEqual
(
.
getValue
(
'restrictedProperty'
)
,
undefined
)
;
.
strictEqual
(
.
getValue
(
'excludedProperty'
)
,
'overrideExcluded'
)
;
}
)
;
test
(
'should handle scope filtering with excluded properties'
,
(
)
=>
{
const
=
{
'id'
:
'ScopeExcludedTest'
,
'type'
:
'object'
,
'properties'
:
{
'windowProperty'
:
{
'type'
:
'string'
as
const
,
'default'
:
'window'
,
'scope'
:
.
WINDOW
}
,
'applicationProperty'
:
{
'type'
:
'string'
as
const
,
'default'
:
'application'
,
'scope'
:
.
APPLICATION
}
,
'excludedApplicationProperty'
:
{
'type'
:
'string'
as
const
,
'default'
:
'excludedApplication'
,
'scope'
:
.
APPLICATION
,
'included'
:
false
}
}
}
;
.
registerConfiguration
(
)
;
.
push
(
)
;
const
=
new
ConfigurationModelParser
(
'test'
,
new
NullLogService
(
)
)
;
const
=
{
'windowProperty'
:
'windowValue'
,
'applicationProperty'
:
'applicationValue'
,
'excludedApplicationProperty'
:
'excludedApplicationValue'
}
;
.
parse
(
JSON
.
stringify
(
)
,
{
:
[
.
WINDOW
]
}
)
;
.
strictEqual
(
.
.
getValue
(
'windowProperty'
)
,
'windowValue'
)
;
.
strictEqual
(
.
.
getValue
(
'applicationProperty'
)
,
undefined
)
;
.
strictEqual
(
.
.
getValue
(
'excludedApplicationProperty'
)
,
undefined
)
;
}
)
;
test
(
'filter should handle include/exclude options with excluded properties'
,
(
)
=>
{
registerTestConfiguration
(
)
;
const
=
new
ConfigurationModelParser
(
'test'
,
new
NullLogService
(
)
)
;
const
=
{
'regularProperty'
:
'regularValue'
,
'excludedProperty'
:
'excludedValue'
}
;
.
parse
(
JSON
.
stringify
(
)
,
{
:
[
'excludedProperty'
]
}
)
;
.
strictEqual
(
.
.
getValue
(
'regularProperty'
)
,
'regularValue'
)
;
.
strictEqual
(
.
.
getValue
(
'excludedProperty'
)
,
'excludedValue'
)
;
}
)
;
test
(
'should handle exclude options with excluded properties'
,
(
)
=>
{
registerTestConfiguration
(
)
;
const
=
new
ConfigurationModelParser
(
'test'
,
new
NullLogService
(
)
)
;
const
=
{
'regularProperty'
:
'regularValue'
,
'excludedProperty'
:
'excludedValue'
}
;
.
parse
(
JSON
.
stringify
(
)
,
{
:
[
'regularProperty'
]
}
)
;
.
strictEqual
(
.
.
getValue
(
'regularProperty'
)
,
undefined
)
;
.
strictEqual
(
.
.
getValue
(
'excludedProperty'
)
,
'excludedValue'
)
;
}
)
;
test
(
'should report hasExcludedProperties correctly when excluded properties are filtered'
,
(
)
=>
{
registerTestConfiguration
(
)
;
const
=
new
ConfigurationModelParser
(
'test'
,
new
NullLogService
(
)
)
;
const
=
{
'regularProperty'
:
'regularValue'
,
'restrictedProperty'
:
'restrictedValue'
,
'excludedProperty'
:
'excludedValue'
}
;
.
parse
(
JSON
.
stringify
(
)
,
{
:
true
}
)
;
const
=
.
;
.
notStrictEqual
(
.
,
undefined
,
'Raw should be set when properties are excluded'
)
;
}
)
;
test
(
'skipUnregistered should exclude unregistered properties'
,
(
)
=>
{
registerTestConfiguration
(
)
;
const
=
new
ConfigurationModelParser
(
'test'
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
{
'unregisteredProperty'
:
'value3'
}
)
,
{
:
true
}
)
;
.
strictEqual
(
.
.
getValue
(
'unregisteredProperty'
)
,
undefined
)
;
}
)
;
test
(
'shouldInclude method works correctly with excluded properties for skipUnregistered'
,
(
)
=>
{
registerTestConfiguration
(
)
;
const
=
new
ConfigurationModelParser
(
'test'
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
{
'regularProperty'
:
'value1'
,
'excludedProperty'
:
'value2'
,
'unregisteredProperty'
:
'value3'
}
)
,
{
:
true
}
)
;
.
strictEqual
(
.
.
getValue
(
'regularProperty'
)
,
'value1'
)
;
.
strictEqual
(
.
.
getValue
(
'excludedProperty'
)
,
undefined
)
;
.
strictEqual
(
.
.
getValue
(
'unregisteredProperty'
)
,
undefined
)
;
}
)
;
test
(
'excluded properties are found during property schema lookup'
,
(
)
=>
{
registerTestConfiguration
(
)
;
const
=
.
as < IConfigurationRegistry>
(
.
)
;
const
=
.
getExcludedConfigurationProperties
(
)
;
.
ok
(
[
'excludedProperty'
]
,
'Excluded property should be in excluded properties map'
)
;
.
ok
(
[
'excludedNonRestrictedProperty'
]
,
'Excluded non-restricted property should be in excluded properties map'
)
;
const
=
.
getConfigurationProperties
(
)
;
.
strictEqual
(
[
'excludedProperty'
]
,
undefined
,
'Excluded property should not be in regular properties map'
)
;
.
strictEqual
(
[
'excludedNonRestrictedProperty'
]
,
undefined
,
'Excluded non-restricted property should not be in regular properties map'
)
;
.
ok
(
[
'regularProperty'
]
,
'Regular property should be in regular properties map'
)
;
.
ok
(
[
'restrictedProperty'
]
,
'Restricted property should be in regular properties map'
)
;
}
)
;
test
(
'should correctly use shouldInclude with excluded properties for scope and unregistered filtering'
,
(
)
=>
{
registerTestConfiguration
(
)
;
const
=
new
ConfigurationModelParser
(
'test'
,
new
NullLogService
(
)
)
;
const
=
{
'regularProperty'
:
'regularValue'
,
'restrictedProperty'
:
'restrictedValue'
,
'excludedProperty'
:
'excludedValue'
,
'excludedNonRestrictedProperty'
:
'excludedNonRestrictedValue'
,
'unknownProperty'
:
'unknownValue'
}
;
.
parse
(
JSON
.
stringify
(
)
,
{
:
true
}
)
;
.
strictEqual
(
.
.
getValue
(
'regularProperty'
)
,
'regularValue'
)
;
.
strictEqual
(
.
.
getValue
(
'restrictedProperty'
)
,
undefined
)
;
.
ok
(
.
.
includes
(
'restrictedProperty'
)
)
;
.
strictEqual
(
.
.
getValue
(
'excludedProperty'
)
,
'excludedValue'
)
;
.
ok
(
!
.
.
includes
(
'excludedProperty'
)
)
;
.
strictEqual
(
.
.
getValue
(
'excludedNonRestrictedProperty'
)
,
'excludedNonRestrictedValue'
)
;
.
strictEqual
(
.
.
getValue
(
'unknownProperty'
)
,
'unknownValue'
)
;
}
)
;
}
)
;
suite
(
'ConfigurationModel'
,
(
)
=>
{
ensureNoDisposablesAreLeakedInTestSuite
(
)
;
test
(
'setValue for a key that has no sections and not defined'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
{
'b'
:
1
}
}
,
[
'a.b'
]
,
[
]
,
undefined
,
new
NullLogService
(
)
)
;
.
setValue
(
'f'
,
1
)
;
.
deepStrictEqual
(
.
,
{
'a'
:
{
'b'
:
1
}
,
'f'
:
1
}
)
;
.
deepStrictEqual
(
.
,
[
'a.b'
,
'f'
]
)
;
}
)
;
test
(
'setValue for a key that has no sections and defined'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
{
'b'
:
1
}
,
'f'
:
1
}
,
[
'a.b'
,
'f'
]
,
[
]
,
undefined
,
new
NullLogService
(
)
)
;
.
setValue
(
'f'
,
3
)
;
.
deepStrictEqual
(
.
,
{
'a'
:
{
'b'
:
1
}
,
'f'
:
3
}
)
;
.
deepStrictEqual
(
.
,
[
'a.b'
,
'f'
]
)
;
}
)
;
test
(
'setValue for a key that has sections and not defined'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
{
'b'
:
1
}
,
'f'
:
1
}
,
[
'a.b'
,
'f'
]
,
[
]
,
undefined
,
new
NullLogService
(
)
)
;
.
setValue
(
'b.c'
,
1
)
;
const
:
<
string
,
unknown
>
=
{
}
;
[
'a'
]
=
{
'b'
:
1
}
;
[
'f'
]
=
1
;
[
'b'
]
=
.
create
(
null
)
;
(
[
'b'
]
as
<
string
,
unknown
>
)
[
'c'
]
=
1
;
.
deepStrictEqual
(
.
,
)
;
.
deepStrictEqual
(
.
,
[
'a.b'
,
'f'
,
'b.c'
]
)
;
}
)
;
test
(
'setValue for a key that has sections and defined'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
{
'b'
:
1
}
,
'b'
:
{
'c'
:
1
}
,
'f'
:
1
}
,
[
'a.b'
,
'b.c'
,
'f'
]
,
[
]
,
undefined
,
new
NullLogService
(
)
)
;
.
setValue
(
'b.c'
,
3
)
;
.
deepStrictEqual
(
.
,
{
'a'
:
{
'b'
:
1
}
,
'b'
:
{
'c'
:
3
}
,
'f'
:
1
}
)
;
.
deepStrictEqual
(
.
,
[
'a.b'
,
'b.c'
,
'f'
]
)
;
}
)
;
test
(
'setValue for a key that has sections and sub section not defined'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
{
'b'
:
1
}
,
'f'
:
1
}
,
[
'a.b'
,
'f'
]
,
[
]
,
undefined
,
new
NullLogService
(
)
)
;
.
setValue
(
'a.c'
,
1
)
;
.
deepStrictEqual
(
.
,
{
'a'
:
{
'b'
:
1
,
'c'
:
1
}
,
'f'
:
1
}
)
;
.
deepStrictEqual
(
.
,
[
'a.b'
,
'f'
,
'a.c'
]
)
;
}
)
;
test
(
'setValue for a key that has sections and sub section defined'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
{
'b'
:
1
,
'c'
:
1
}
,
'f'
:
1
}
,
[
'a.b'
,
'a.c'
,
'f'
]
,
[
]
,
undefined
,
new
NullLogService
(
)
)
;
.
setValue
(
'a.c'
,
3
)
;
.
deepStrictEqual
(
.
,
{
'a'
:
{
'b'
:
1
,
'c'
:
3
}
,
'f'
:
1
}
)
;
.
deepStrictEqual
(
.
,
[
'a.b'
,
'a.c'
,
'f'
]
)
;
}
)
;
test
(
'setValue for a key that has sections and last section is added'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
{
'b'
:
{
}
}
,
'f'
:
1
}
,
[
'a.b'
,
'f'
]
,
[
]
,
undefined
,
new
NullLogService
(
)
)
;
.
setValue
(
'a.b.c'
,
1
)
;
.
deepStrictEqual
(
.
,
{
'a'
:
{
'b'
:
{
'c'
:
1
}
}
,
'f'
:
1
}
)
;
.
deepStrictEqual
(
.
,
[
'a.b'
,
'f'
,
'a.b.c'
]
)
;
}
)
;
test
(
'removeValue: remove a non existing key'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
{
'b'
:
2
}
}
,
[
'a.b'
]
,
[
]
,
undefined
,
new
NullLogService
(
)
)
;
.
removeValue
(
'a.b.c'
)
;
.
deepStrictEqual
(
.
,
{
'a'
:
{
'b'
:
2
}
}
)
;
.
deepStrictEqual
(
.
,
[
'a.b'
]
)
;
}
)
;
test
(
'removeValue: remove a single segmented key'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
1
}
,
[
'a'
]
,
[
]
,
undefined
,
new
NullLogService
(
)
)
;
.
removeValue
(
'a'
)
;
.
deepStrictEqual
(
.
,
{
}
)
;
.
deepStrictEqual
(
.
,
[
]
)
;
}
)
;
test
(
'removeValue: remove a multi segmented key'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
{
'b'
:
1
}
}
,
[
'a.b'
]
,
[
]
,
undefined
,
new
NullLogService
(
)
)
;
.
removeValue
(
'a.b'
)
;
.
deepStrictEqual
(
.
,
{
}
)
;
.
deepStrictEqual
(
.
,
[
]
)
;
}
)
;
test
(
'get overriding configuration model for an existing identifier'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
{
'b'
:
1
}
,
'f'
:
1
}
,
[
]
,
[
{
:
[
'c'
]
,
:
{
'a'
:
{
'd'
:
1
}
}
,
:
[
'a'
]
}
]
,
[
]
,
new
NullLogService
(
)
)
;
.
deepStrictEqual
(
.
override
(
'c'
)
.
,
{
'a'
:
{
'b'
:
1
,
'd'
:
1
}
,
'f'
:
1
}
)
;
}
)
;
test
(
'get overriding configuration model for an identifier that does not exist'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
{
'b'
:
1
}
,
'f'
:
1
}
,
[
]
,
[
{
:
[
'c'
]
,
:
{
'a'
:
{
'd'
:
1
}
}
,
:
[
'a'
]
}
]
,
[
]
,
new
NullLogService
(
)
)
;
.
deepStrictEqual
(
.
override
(
'xyz'
)
.
,
{
'a'
:
{
'b'
:
1
}
,
'f'
:
1
}
)
;
}
)
;
test
(
'get overriding configuration when one of the keys does not exist in base'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
{
'b'
:
1
}
,
'f'
:
1
}
,
[
]
,
[
{
:
[
'c'
]
,
:
{
'a'
:
{
'd'
:
1
}
,
'g'
:
1
}
,
:
[
'a'
,
'g'
]
}
]
,
[
]
,
new
NullLogService
(
)
)
;
.
deepStrictEqual
(
.
override
(
'c'
)
.
,
{
'a'
:
{
'b'
:
1
,
'd'
:
1
}
,
'f'
:
1
,
'g'
:
1
}
)
;
}
)
;
test
(
'get overriding configuration when one of the key in base is not of object type'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
{
'b'
:
1
}
,
'f'
:
1
}
,
[
]
,
[
{
:
[
'c'
]
,
:
{
'a'
:
{
'd'
:
1
}
,
'f'
:
{
'g'
:
1
}
}
,
:
[
'a'
,
'f'
]
}
]
,
[
]
,
new
NullLogService
(
)
)
;
.
deepStrictEqual
(
.
override
(
'c'
)
.
,
{
'a'
:
{
'b'
:
1
,
'd'
:
1
}
,
'f'
:
{
'g'
:
1
}
}
)
;
}
)
;
test
(
'get overriding configuration when one of the key in overriding contents is not of object type'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
{
'b'
:
1
}
,
'f'
:
{
'g'
:
1
}
}
,
[
]
,
[
{
:
[
'c'
]
,
:
{
'a'
:
{
'd'
:
1
}
,
'f'
:
1
}
,
:
[
'a'
,
'f'
]
}
]
,
[
]
,
new
NullLogService
(
)
)
;
.
deepStrictEqual
(
.
override
(
'c'
)
.
,
{
'a'
:
{
'b'
:
1
,
'd'
:
1
}
,
'f'
:
1
}
)
;
}
)
;
test
(
'get overriding configuration if the value of overriding identifier is not object'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
{
'b'
:
1
}
,
'f'
:
{
'g'
:
1
}
}
,
[
]
,
[
{
:
[
'c'
]
,
:
'abc'
as
unknown
as
<
string
,
unknown
>
,
:
[
]
}
]
,
[
]
,
new
NullLogService
(
)
)
;
.
deepStrictEqual
(
.
override
(
'c'
)
.
,
{
'a'
:
{
'b'
:
1
}
,
'f'
:
{
'g'
:
1
}
}
)
;
}
)
;
test
(
'get overriding configuration if the value of overriding identifier is an empty object'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
{
'b'
:
1
}
,
'f'
:
{
'g'
:
1
}
}
,
[
]
,
[
{
:
[
'c'
]
,
:
{
}
,
:
[
]
}
]
,
[
]
,
new
NullLogService
(
)
)
;
.
deepStrictEqual
(
.
override
(
'c'
)
.
,
{
'a'
:
{
'b'
:
1
}
,
'f'
:
{
'g'
:
1
}
}
)
;
}
)
;
test
(
'simple merge'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
1
,
'b'
:
2
}
,
[
'a'
,
'b'
]
,
[
]
,
undefined
,
new
NullLogService
(
)
)
;
const
=
new
ConfigurationModel
(
{
'a'
:
3
,
'c'
:
4
}
,
[
'a'
,
'c'
]
,
[
]
,
undefined
,
new
NullLogService
(
)
)
;
const
=
.
merge
(
)
;
.
deepStrictEqual
(
.
,
{
'a'
:
3
,
'b'
:
2
,
'c'
:
4
}
)
;
.
deepStrictEqual
(
.
,
[
'a'
,
'b'
,
'c'
]
)
;
}
)
;
test
(
'recursive merge'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
{
'b'
:
1
}
}
,
[
'a.b'
]
,
[
]
,
undefined
,
new
NullLogService
(
)
)
;
const
=
new
ConfigurationModel
(
{
'a'
:
{
'b'
:
2
}
}
,
[
'a.b'
]
,
[
]
,
undefined
,
new
NullLogService
(
)
)
;
const
=
.
merge
(
)
;
.
deepStrictEqual
(
.
,
{
'a'
:
{
'b'
:
2
}
}
)
;
.
deepStrictEqual
(
.
getValue
(
'a'
)
,
{
'b'
:
2
}
)
;
.
deepStrictEqual
(
.
,
[
'a.b'
]
)
;
}
)
;
test
(
'simple merge overrides'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
{
'b'
:
1
}
}
,
[
'a.b'
]
,
[
{
:
[
'c'
]
,
:
{
'a'
:
2
}
,
:
[
'a'
]
}
]
,
undefined
,
new
NullLogService
(
)
)
;
const
=
new
ConfigurationModel
(
{
'a'
:
{
'b'
:
2
}
}
,
[
'a.b'
]
,
[
{
:
[
'c'
]
,
:
{
'b'
:
2
}
,
:
[
'b'
]
}
]
,
undefined
,
new
NullLogService
(
)
)
;
const
=
.
merge
(
)
;
.
deepStrictEqual
(
.
,
{
'a'
:
{
'b'
:
2
}
}
)
;
.
deepStrictEqual
(
.
,
[
{
:
[
'c'
]
,
:
{
'a'
:
2
,
'b'
:
2
}
,
:
[
'a'
,
'b'
]
}
]
)
;
.
deepStrictEqual
(
.
override
(
'c'
)
.
,
{
'a'
:
2
,
'b'
:
2
}
)
;
.
deepStrictEqual
(
.
,
[
'a.b'
]
)
;
}
)
;
test
(
'recursive merge overrides'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
{
'b'
:
1
}
,
'f'
:
1
}
,
[
'a.b'
,
'f'
]
,
[
{
:
[
'c'
]
,
:
{
'a'
:
{
'd'
:
1
}
}
,
:
[
'a'
]
}
]
,
undefined
,
new
NullLogService
(
)
)
;
const
=
new
ConfigurationModel
(
{
'a'
:
{
'b'
:
2
}
}
,
[
'a.b'
]
,
[
{
:
[
'c'
]
,
:
{
'a'
:
{
'e'
:
2
}
}
,
:
[
'a'
]
}
]
,
undefined
,
new
NullLogService
(
)
)
;
const
=
.
merge
(
)
;
.
deepStrictEqual
(
.
,
{
'a'
:
{
'b'
:
2
}
,
'f'
:
1
}
)
;
.
deepStrictEqual
(
.
,
[
{
:
[
'c'
]
,
:
{
'a'
:
{
'd'
:
1
,
'e'
:
2
}
}
,
:
[
'a'
]
}
]
)
;
.
deepStrictEqual
(
.
override
(
'c'
)
.
,
{
'a'
:
{
'b'
:
2
,
'd'
:
1
,
'e'
:
2
}
,
'f'
:
1
}
)
;
.
deepStrictEqual
(
.
,
[
'a.b'
,
'f'
]
)
;
}
)
;
test
(
'Test contents while getting an existing property'
,
(
)
=>
{
let
=
new
ConfigurationModel
(
{
'a'
:
1
}
,
[
]
,
[
]
,
undefined
,
new
NullLogService
(
)
)
;
.
deepStrictEqual
(
.
getValue
(
'a'
)
,
1
)
;
=
new
ConfigurationModel
(
{
'a'
:
{
'b'
:
1
}
}
,
[
]
,
[
]
,
undefined
,
new
NullLogService
(
)
)
;
.
deepStrictEqual
(
.
getValue
(
'a'
)
,
{
'b'
:
1
}
)
;
}
)
;
test
(
'Test contents are undefined for non existing properties'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
:
true
}
,
[
]
,
[
]
,
undefined
,
new
NullLogService
(
)
)
;
.
deepStrictEqual
(
.
getValue
(
'unknownproperty'
)
,
undefined
)
;
}
)
;
test
(
'Test override gives all content merged with overrides'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
1
,
'c'
:
1
}
,
[
]
,
[
{
:
[
'b'
]
,
:
{
'a'
:
2
}
,
:
[
'a'
]
}
]
,
undefined
,
new
NullLogService
(
)
)
;
.
deepStrictEqual
(
.
override
(
'b'
)
.
,
{
'a'
:
2
,
'c'
:
1
}
)
;
}
)
;
test
(
'Test override when an override has multiple identifiers'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
1
,
'c'
:
1
}
,
[
'a'
,
'c'
]
,
[
{
:
[
'x'
,
'y'
]
,
:
{
'a'
:
2
}
,
:
[
'a'
]
}
]
,
undefined
,
new
NullLogService
(
)
)
;
let
=
.
override
(
'x'
)
;
.
deepStrictEqual
(
.
,
{
'a'
:
2
,
'c'
:
1
}
)
;
.
deepStrictEqual
(
.
,
[
'a'
,
'c'
]
)
;
.
deepStrictEqual
(
.
getKeysForOverrideIdentifier
(
'x'
)
,
[
'a'
]
)
;
=
.
override
(
'y'
)
;
.
deepStrictEqual
(
.
,
{
'a'
:
2
,
'c'
:
1
}
)
;
.
deepStrictEqual
(
.
,
[
'a'
,
'c'
]
)
;
.
deepStrictEqual
(
.
getKeysForOverrideIdentifier
(
'y'
)
,
[
'a'
]
)
;
}
)
;
test
(
'Test override when an identifier is defined in multiple overrides'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
1
,
'c'
:
1
}
,
[
'a'
,
'c'
]
,
[
{
:
[
'x'
]
,
:
{
'a'
:
3
,
'b'
:
1
}
,
:
[
'a'
,
'b'
]
}
,
{
:
[
'x'
,
'y'
]
,
:
{
'a'
:
2
}
,
:
[
'a'
]
}
]
,
undefined
,
new
NullLogService
(
)
)
;
const
=
.
override
(
'x'
)
;
.
deepStrictEqual
(
.
,
{
'a'
:
3
,
'c'
:
1
,
'b'
:
1
}
)
;
.
deepStrictEqual
(
.
,
[
'a'
,
'c'
]
)
;
.
deepStrictEqual
(
.
getKeysForOverrideIdentifier
(
'x'
)
,
[
'a'
,
'b'
]
)
;
}
)
;
test
(
'Test merge when configuration models have multiple identifiers'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
1
,
'c'
:
1
}
,
[
'a'
,
'c'
]
,
[
{
:
[
'y'
]
,
:
{
'c'
:
1
}
,
:
[
'c'
]
}
,
{
:
[
'x'
,
'y'
]
,
:
{
'a'
:
2
}
,
:
[
'a'
]
}
]
,
undefined
,
new
NullLogService
(
)
)
;
const
=
new
ConfigurationModel
(
{
'a'
:
2
,
'b'
:
1
}
,
[
'a'
,
'b'
]
,
[
{
:
[
'x'
]
,
:
{
'a'
:
3
,
'b'
:
2
}
,
:
[
'a'
,
'b'
]
}
,
{
:
[
'x'
,
'y'
]
,
:
{
'b'
:
3
}
,
:
[
'b'
]
}
]
,
undefined
,
new
NullLogService
(
)
)
;
const
=
.
merge
(
)
;
.
deepStrictEqual
(
.
,
{
'a'
:
2
,
'c'
:
1
,
'b'
:
1
}
)
;
.
deepStrictEqual
(
.
,
[
'a'
,
'c'
,
'b'
]
)
;
.
deepStrictEqual
(
.
,
[
{
:
[
'y'
]
,
:
{
'c'
:
1
}
,
:
[
'c'
]
}
,
{
:
[
'x'
,
'y'
]
,
:
{
'a'
:
2
,
'b'
:
3
}
,
:
[
'a'
,
'b'
]
}
,
{
:
[
'x'
]
,
:
{
'a'
:
3
,
'b'
:
2
}
,
:
[
'a'
,
'b'
]
}
,
]
)
;
}
)
;
test
(
'inspect when raw is same'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
1
,
'c'
:
1
}
,
[
'a'
,
'c'
]
,
[
{
:
[
'x'
,
'y'
]
,
:
{
'a'
:
2
,
'b'
:
1
}
,
:
[
'a'
]
}
]
,
undefined
,
new
NullLogService
(
)
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
)
,
{
:
1
,
:
undefined
,
:
1
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
'x'
)
,
{
:
1
,
:
2
,
:
2
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
'x'
)
,
{
:
undefined
,
:
1
,
:
1
,
:
[
{
:
[
'x'
,
'y'
]
,
:
1
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'd'
)
,
{
:
undefined
,
:
undefined
,
:
undefined
,
:
undefined
}
)
;
}
)
;
test
(
'inspect when raw is not same'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
1
,
'c'
:
1
}
,
[
'a'
,
'c'
]
,
[
{
:
[
'x'
,
'y'
]
,
:
{
'a'
:
2
,
}
,
:
[
'a'
]
}
]
,
{
'a'
:
1
,
'b'
:
2
,
'c'
:
1
,
'd'
:
3
,
'[x][y]'
:
{
'a'
:
2
,
'b'
:
1
}
}
,
new
NullLogService
(
)
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
)
,
{
:
1
,
:
undefined
,
:
1
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
'x'
)
,
{
:
1
,
:
2
,
:
2
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
'x'
)
,
{
:
2
,
:
1
,
:
1
,
:
[
{
:
[
'x'
,
'y'
]
,
:
1
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'd'
)
,
{
:
3
,
:
undefined
,
:
3
,
:
undefined
}
)
;
.
deepStrictEqual
(
.
inspect
(
'e'
)
,
{
:
undefined
,
:
undefined
,
:
undefined
,
:
undefined
}
)
;
}
)
;
test
(
'inspect in merged configuration when raw is same'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
1
}
,
[
'a'
]
,
[
{
:
[
'x'
,
'y'
]
,
:
{
'a'
:
2
,
}
,
:
[
'a'
]
}
]
,
undefined
,
new
NullLogService
(
)
)
;
const
=
new
ConfigurationModel
(
{
'b'
:
3
}
,
[
'b'
]
,
[
]
,
undefined
,
new
NullLogService
(
)
)
;
const
=
.
merge
(
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
)
,
{
:
1
,
:
undefined
,
:
1
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
'x'
)
,
{
:
1
,
:
2
,
:
2
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
)
,
{
:
3
,
:
undefined
,
:
3
,
:
undefined
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
'y'
)
,
{
:
3
,
:
undefined
,
:
3
,
:
undefined
}
)
;
.
deepStrictEqual
(
.
inspect
(
'c'
)
,
{
:
undefined
,
:
undefined
,
:
undefined
,
:
undefined
}
)
;
}
)
;
test
(
'inspect in merged configuration when raw is not same for one model'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
1
}
,
[
'a'
]
,
[
{
:
[
'x'
,
'y'
]
,
:
{
'a'
:
2
,
}
,
:
[
'a'
]
}
]
,
{
'a'
:
1
,
'b'
:
2
,
'c'
:
3
,
'[x][y]'
:
{
'a'
:
2
,
'b'
:
4
,
}
}
,
new
NullLogService
(
)
)
;
const
=
new
ConfigurationModel
(
{
'b'
:
3
}
,
[
'b'
]
,
[
]
,
undefined
,
new
NullLogService
(
)
)
;
const
=
.
merge
(
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
)
,
{
:
1
,
:
undefined
,
:
1
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
'x'
)
,
{
:
1
,
:
2
,
:
2
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
)
,
{
:
3
,
:
undefined
,
:
3
,
:
[
{
:
[
'x'
,
'y'
]
,
:
4
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
'y'
)
,
{
:
3
,
:
4
,
:
4
,
:
[
{
:
[
'x'
,
'y'
]
,
:
4
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'c'
)
,
{
:
3
,
:
undefined
,
:
3
,
:
undefined
}
)
;
}
)
;
test
(
'inspect: return all overrides'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
1
,
'c'
:
1
}
,
[
'a'
,
'c'
]
,
[
{
:
[
'x'
,
'y'
]
,
:
{
'a'
:
2
,
'b'
:
1
}
,
:
[
'a'
,
'b'
]
}
,
{
:
[
'x'
]
,
:
{
'a'
:
3
}
,
:
[
'a'
]
}
,
{
:
[
'y'
]
,
:
{
'b'
:
3
}
,
:
[
'b'
]
}
]
,
undefined
,
new
NullLogService
(
)
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
)
.
,
[
{
:
[
'x'
,
'y'
]
,
:
2
}
,
{
:
[
'x'
]
,
:
3
}
]
)
;
}
)
;
test
(
'inspect when no overrides'
,
(
)
=>
{
const
=
new
ConfigurationModel
(
{
'a'
:
1
,
'c'
:
1
}
,
[
'a'
,
'c'
]
,
[
]
,
undefined
,
new
NullLogService
(
)
)
;
.
strictEqual
(
.
inspect
(
'a'
)
.
,
undefined
)
;
}
)
;
}
)
;
suite
(
'CustomConfigurationModel'
,
(
)
=>
{
ensureNoDisposablesAreLeakedInTestSuite
(
)
;
test
(
'simple merge using models'
,
(
)
=>
{
const
=
new
ConfigurationModelParser
(
'base'
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
{
'a'
:
1
,
'b'
:
2
}
)
)
;
const
=
new
ConfigurationModelParser
(
'add'
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
{
'a'
:
3
,
'c'
:
4
}
)
)
;
const
=
.
.
merge
(
.
)
;
.
deepStrictEqual
(
.
,
{
'a'
:
3
,
'b'
:
2
,
'c'
:
4
}
)
;
}
)
;
test
(
'simple merge with an undefined contents'
,
(
)
=>
{
let
=
new
ConfigurationModelParser
(
'base'
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
{
'a'
:
1
,
'b'
:
2
}
)
)
;
let
=
new
ConfigurationModelParser
(
'add'
,
new
NullLogService
(
)
)
;
let
=
.
.
merge
(
.
)
;
.
deepStrictEqual
(
.
,
{
'a'
:
1
,
'b'
:
2
}
)
;
=
new
ConfigurationModelParser
(
'base'
,
new
NullLogService
(
)
)
;
=
new
ConfigurationModelParser
(
'add'
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
{
'a'
:
1
,
'b'
:
2
}
)
)
;
=
.
.
merge
(
.
)
;
.
deepStrictEqual
(
.
,
{
'a'
:
1
,
'b'
:
2
}
)
;
=
new
ConfigurationModelParser
(
'base'
,
new
NullLogService
(
)
)
;
=
new
ConfigurationModelParser
(
'add'
,
new
NullLogService
(
)
)
;
=
.
.
merge
(
.
)
;
.
deepStrictEqual
(
.
,
{
}
)
;
}
)
;
test
(
'Recursive merge using config models'
,
(
)
=>
{
const
=
new
ConfigurationModelParser
(
'base'
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
{
'a'
:
{
'b'
:
1
}
}
)
)
;
const
=
new
ConfigurationModelParser
(
'add'
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
{
'a'
:
{
'b'
:
2
}
}
)
)
;
const
=
.
.
merge
(
.
)
;
.
deepStrictEqual
(
.
,
{
'a'
:
{
'b'
:
2
}
}
)
;
}
)
;
test
(
'Test contents while getting an existing property'
,
(
)
=>
{
const
=
new
ConfigurationModelParser
(
'test'
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
{
'a'
:
1
}
)
)
;
.
deepStrictEqual
(
.
.
getValue
(
'a'
)
,
1
)
;
.
parse
(
JSON
.
stringify
(
{
'a'
:
{
'b'
:
1
}
}
)
)
;
.
deepStrictEqual
(
.
.
getValue
(
'a'
)
,
{
'b'
:
1
}
)
;
}
)
;
test
(
'Test contents are undefined for non existing properties'
,
(
)
=>
{
const
=
new
ConfigurationModelParser
(
'test'
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
{
:
true
}
)
)
;
.
deepStrictEqual
(
.
.
getValue
(
'unknownproperty'
)
,
undefined
)
;
}
)
;
test
(
'Test contents are undefined for undefined config'
,
(
)
=>
{
const
=
new
ConfigurationModelParser
(
'test'
,
new
NullLogService
(
)
)
;
.
deepStrictEqual
(
.
.
getValue
(
'unknownproperty'
)
,
undefined
)
;
}
)
;
test
(
'Test configWithOverrides gives all content merged with overrides'
,
(
)
=>
{
const
=
new
ConfigurationModelParser
(
'test'
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
{
'a'
:
1
,
'c'
:
1
,
'[b]'
:
{
'a'
:
2
}
}
)
)
;
.
deepStrictEqual
(
.
.
override
(
'b'
)
.
,
{
'a'
:
2
,
'c'
:
1
,
'[b]'
:
{
'a'
:
2
}
}
)
;
}
)
;
test
(
'Test configWithOverrides gives empty contents'
,
(
)
=>
{
const
=
new
ConfigurationModelParser
(
'test'
,
new
NullLogService
(
)
)
;
.
deepStrictEqual
(
.
.
override
(
'b'
)
.
,
{
}
)
;
}
)
;
test
(
'Test update with empty data'
,
(
)
=>
{
const
=
new
ConfigurationModelParser
(
'test'
,
new
NullLogService
(
)
)
;
.
parse
(
''
)
;
.
deepStrictEqual
(
.
.
,
.
create
(
null
)
)
;
.
deepStrictEqual
(
.
.
,
[
]
)
;
.
parse
(
null
)
;
.
deepStrictEqual
(
.
.
,
.
create
(
null
)
)
;
.
deepStrictEqual
(
.
.
,
[
]
)
;
.
parse
(
undefined
)
;
.
deepStrictEqual
(
.
.
,
.
create
(
null
)
)
;
.
deepStrictEqual
(
.
.
,
[
]
)
;
}
)
;
test
(
'Test empty property is not ignored'
,
(
)
=>
{
const
=
new
ConfigurationModelParser
(
'test'
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
{
''
:
1
}
)
)
;
.
strictEqual
(
JSON
.
stringify
(
.
.
)
,
JSON
.
stringify
(
{
''
:
1
}
)
)
;
.
deepStrictEqual
(
.
.
,
[
''
]
)
;
}
)
;
}
)
;
export
class
TestConfiguration
extends
Configuration
{
constructor
(
:
,
:
,
:
,
:
,
?
:
,
)
{
super
(
,
,
,
,
??
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
new
ResourceMap< ConfigurationModel>
(
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
new
ResourceMap< ConfigurationModel>
(
)
,
new
NullLogService
(
)
)
;
}
}
suite
(
'Configuration'
,
(
)
=>
{
ensureNoDisposablesAreLeakedInTestSuite
(
)
;
test
(
'Test inspect for overrideIdentifiers'
,
(
)
=>
{
const
=
parseConfigurationModel
(
{
'[l1]'
:
{
'a'
:
1
}
,
'[l2]'
:
{
'b'
:
1
}
}
)
;
const
=
parseConfigurationModel
(
{
'[l3]'
:
{
'a'
:
2
}
}
)
;
const
=
parseConfigurationModel
(
{
'[l1]'
:
{
'a'
:
3
}
,
'[l4]'
:
{
'a'
:
3
}
}
)
;
const
:
=
new
TestConfiguration
(
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
,
)
;
const
{
}
=
.
inspect
(
'a'
,
{
}
,
undefined
)
;
.
deepStrictEqual
(
,
[
'l1'
,
'l3'
,
'l4'
]
)
;
}
)
;
test
(
'Test update value'
,
(
)
=>
{
const
=
new
ConfigurationModelParser
(
'test'
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
{
'a'
:
1
}
)
)
;
const
:
=
new
TestConfiguration
(
.
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
)
;
.
updateValue
(
'a'
,
2
)
;
.
strictEqual
(
.
getValue
(
'a'
,
{
}
,
undefined
)
,
2
)
;
}
)
;
test
(
'Test update value after inspect'
,
(
)
=>
{
const
=
new
ConfigurationModelParser
(
'test'
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
{
'a'
:
1
}
)
)
;
const
:
=
new
TestConfiguration
(
.
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
)
;
.
inspect
(
'a'
,
{
}
,
undefined
)
;
.
updateValue
(
'a'
,
2
)
;
.
strictEqual
(
.
getValue
(
'a'
,
{
}
,
undefined
)
,
2
)
;
}
)
;
test
(
'Test compare and update default configuration'
,
(
)
=>
{
const
=
new
TestConfiguration
(
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
)
;
.
updateDefaultConfiguration
(
toConfigurationModel
(
{
'editor.lineNumbers'
:
'on'
,
}
)
)
;
const
=
.
compareAndUpdateDefaultConfiguration
(
toConfigurationModel
(
{
'editor.lineNumbers'
:
'off'
,
'[markdown]'
:
{
'editor.wordWrap'
:
'off'
}
}
)
,
[
'editor.lineNumbers'
,
'[markdown]'
]
)
;
.
deepStrictEqual
(
,
{
:
[
'editor.lineNumbers'
,
'[markdown]'
]
,
:
[
[
'markdown'
,
[
'editor.wordWrap'
]
]
]
}
)
;
}
)
;
test
(
'Test compare and update application configuration'
,
(
)
=>
{
const
=
new
TestConfiguration
(
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
)
;
.
updateApplicationConfiguration
(
toConfigurationModel
(
{
'update.mode'
:
'on'
,
}
)
)
;
const
=
.
compareAndUpdateApplicationConfiguration
(
toConfigurationModel
(
{
'update.mode'
:
'none'
,
'[typescript]'
:
{
'editor.wordWrap'
:
'off'
}
}
)
)
;
.
deepStrictEqual
(
,
{
:
[
'[typescript]'
,
'update.mode'
,
]
,
:
[
[
'typescript'
,
[
'editor.wordWrap'
]
]
]
}
)
;
}
)
;
test
(
'Test compare and update user configuration'
,
(
)
=>
{
const
=
new
TestConfiguration
(
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
)
;
.
updateLocalUserConfiguration
(
toConfigurationModel
(
{
'editor.lineNumbers'
:
'off'
,
'editor.fontSize'
:
12
,
'[typescript]'
:
{
'editor.wordWrap'
:
'off'
}
}
)
)
;
const
=
.
compareAndUpdateLocalUserConfiguration
(
toConfigurationModel
(
{
'editor.lineNumbers'
:
'on'
,
'window.zoomLevel'
:
1
,
'[typescript]'
:
{
'editor.wordWrap'
:
'on'
,
'editor.insertSpaces'
:
false
}
}
)
)
;
.
deepStrictEqual
(
,
{
:
[
'window.zoomLevel'
,
'editor.lineNumbers'
,
'[typescript]'
,
'editor.fontSize'
]
,
:
[
[
'typescript'
,
[
'editor.insertSpaces'
,
'editor.wordWrap'
]
]
]
}
)
;
}
)
;
test
(
'Test compare and update workspace configuration'
,
(
)
=>
{
const
=
new
TestConfiguration
(
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
)
;
.
updateWorkspaceConfiguration
(
toConfigurationModel
(
{
'editor.lineNumbers'
:
'off'
,
'editor.fontSize'
:
12
,
'[typescript]'
:
{
'editor.wordWrap'
:
'off'
}
}
)
)
;
const
=
.
compareAndUpdateWorkspaceConfiguration
(
toConfigurationModel
(
{
'editor.lineNumbers'
:
'on'
,
'window.zoomLevel'
:
1
,
'[typescript]'
:
{
'editor.wordWrap'
:
'on'
,
'editor.insertSpaces'
:
false
}
}
)
)
;
.
deepStrictEqual
(
,
{
:
[
'window.zoomLevel'
,
'editor.lineNumbers'
,
'[typescript]'
,
'editor.fontSize'
]
,
:
[
[
'typescript'
,
[
'editor.insertSpaces'
,
'editor.wordWrap'
]
]
]
}
)
;
}
)
;
test
(
'Test compare and update workspace folder configuration'
,
(
)
=>
{
const
=
new
TestConfiguration
(
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
)
;
.
updateFolderConfiguration
(
URI
.
file
(
'file1'
)
,
toConfigurationModel
(
{
'editor.lineNumbers'
:
'off'
,
'editor.fontSize'
:
12
,
'[typescript]'
:
{
'editor.wordWrap'
:
'off'
}
}
)
)
;
const
=
.
compareAndUpdateFolderConfiguration
(
URI
.
file
(
'file1'
)
,
toConfigurationModel
(
{
'editor.lineNumbers'
:
'on'
,
'window.zoomLevel'
:
1
,
'[typescript]'
:
{
'editor.wordWrap'
:
'on'
,
'editor.insertSpaces'
:
false
}
}
)
)
;
.
deepStrictEqual
(
,
{
:
[
'window.zoomLevel'
,
'editor.lineNumbers'
,
'[typescript]'
,
'editor.fontSize'
]
,
:
[
[
'typescript'
,
[
'editor.insertSpaces'
,
'editor.wordWrap'
]
]
]
}
)
;
}
)
;
test
(
'Test compare and delete workspace folder configuration'
,
(
)
=>
{
const
=
new
TestConfiguration
(
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
)
;
.
updateFolderConfiguration
(
URI
.
file
(
'file1'
)
,
toConfigurationModel
(
{
'editor.lineNumbers'
:
'off'
,
'editor.fontSize'
:
12
,
'[typescript]'
:
{
'editor.wordWrap'
:
'off'
}
}
)
)
;
const
=
.
compareAndDeleteFolderConfiguration
(
URI
.
file
(
'file1'
)
)
;
.
deepStrictEqual
(
,
{
:
[
'editor.lineNumbers'
,
'editor.fontSize'
,
'[typescript]'
]
,
:
[
[
'typescript'
,
[
'editor.wordWrap'
]
]
]
}
)
;
}
)
;
function
parseConfigurationModel
(
:
<
string
,
unknown
>
)
:
{
const
=
new
ConfigurationModelParser
(
'test'
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
)
)
;
return
.
;
}
}
)
;
suite
(
'ConfigurationChangeEvent'
,
(
)
=>
{
ensureNoDisposablesAreLeakedInTestSuite
(
)
;
test
(
'changeEvent affecting keys with new configuration'
,
(
)
=>
{
const
=
new
TestConfiguration
(
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
)
;
const
=
.
compareAndUpdateLocalUserConfiguration
(
toConfigurationModel
(
{
'window.zoomLevel'
:
1
,
'workbench.editor.enablePreview'
:
false
,
'files.autoSave'
:
'off'
,
}
)
)
;
const
=
new
ConfigurationChangeEvent
(
,
undefined
,
,
undefined
,
new
NullLogService
(
)
)
;
.
deepStrictEqual
(
[
...
.
]
,
[
'window.zoomLevel'
,
'workbench.editor.enablePreview'
,
'files.autoSave'
]
)
;
.
ok
(
.
affectsConfiguration
(
'window.zoomLevel'
)
)
;
.
ok
(
.
affectsConfiguration
(
'window'
)
)
;
.
ok
(
.
affectsConfiguration
(
'workbench.editor.enablePreview'
)
)
;
.
ok
(
.
affectsConfiguration
(
'workbench.editor'
)
)
;
.
ok
(
.
affectsConfiguration
(
'workbench'
)
)
;
.
ok
(
.
affectsConfiguration
(
'files'
)
)
;
.
ok
(
.
affectsConfiguration
(
'files.autoSave'
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'files.exclude'
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'[markdown]'
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'editor'
)
)
;
}
)
;
test
(
'changeEvent affecting keys when configuration changed'
,
(
)
=>
{
const
=
new
TestConfiguration
(
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
)
;
.
updateLocalUserConfiguration
(
toConfigurationModel
(
{
'window.zoomLevel'
:
2
,
'workbench.editor.enablePreview'
:
true
,
'files.autoSave'
:
'off'
,
}
)
)
;
const
=
.
toData
(
)
;
const
=
.
compareAndUpdateLocalUserConfiguration
(
toConfigurationModel
(
{
'window.zoomLevel'
:
1
,
'workbench.editor.enablePreview'
:
false
,
'files.autoSave'
:
'off'
,
}
)
)
;
const
=
new
ConfigurationChangeEvent
(
,
{
}
,
,
undefined
,
new
NullLogService
(
)
)
;
.
deepStrictEqual
(
[
...
.
]
,
[
'window.zoomLevel'
,
'workbench.editor.enablePreview'
]
)
;
.
ok
(
.
affectsConfiguration
(
'window.zoomLevel'
)
)
;
.
ok
(
.
affectsConfiguration
(
'window'
)
)
;
.
ok
(
.
affectsConfiguration
(
'workbench.editor.enablePreview'
)
)
;
.
ok
(
.
affectsConfiguration
(
'workbench.editor'
)
)
;
.
ok
(
.
affectsConfiguration
(
'workbench'
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'files'
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'[markdown]'
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'editor'
)
)
;
}
)
;
test
(
'changeEvent affecting overrides with new configuration'
,
(
)
=>
{
const
=
new
TestConfiguration
(
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
)
;
const
=
.
compareAndUpdateLocalUserConfiguration
(
toConfigurationModel
(
{
'files.autoSave'
:
'off'
,
'[markdown]'
:
{
'editor.wordWrap'
:
'off'
}
,
'[typescript][jsonc]'
:
{
'editor.lineNumbers'
:
'off'
}
}
)
)
;
const
=
new
ConfigurationChangeEvent
(
,
undefined
,
,
undefined
,
new
NullLogService
(
)
)
;
.
deepStrictEqual
(
[
...
.
]
,
[
'files.autoSave'
,
'[markdown]'
,
'[typescript][jsonc]'
,
'editor.wordWrap'
,
'editor.lineNumbers'
]
)
;
.
ok
(
.
affectsConfiguration
(
'files'
)
)
;
.
ok
(
.
affectsConfiguration
(
'files.autoSave'
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'files.exclude'
)
)
;
.
ok
(
.
affectsConfiguration
(
'[markdown]'
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'[markdown].editor'
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'[markdown].workbench'
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor'
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor.wordWrap'
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor.lineNumbers'
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor'
,
{
:
'markdown'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor'
,
{
:
'jsonc'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor'
,
{
:
'typescript'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor.wordWrap'
,
{
:
'markdown'
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'editor.wordWrap'
,
{
:
'jsonc'
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'editor.wordWrap'
,
{
:
'typescript'
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'editor.lineNumbers'
,
{
:
'markdown'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor.lineNumbers'
,
{
:
'typescript'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor.lineNumbers'
,
{
:
'jsonc'
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'editor'
,
{
:
'json'
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'editor.fontSize'
,
{
:
'markdown'
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'editor.fontSize'
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'window'
)
)
;
}
)
;
test
(
'changeEvent affecting overrides when configuration changed'
,
(
)
=>
{
const
=
new
TestConfiguration
(
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
)
;
.
updateLocalUserConfiguration
(
toConfigurationModel
(
{
'workbench.editor.enablePreview'
:
true
,
'[markdown]'
:
{
'editor.fontSize'
:
12
,
'editor.wordWrap'
:
'off'
}
,
'[css][scss]'
:
{
'editor.lineNumbers'
:
'off'
,
'css.lint.emptyRules'
:
'error'
}
,
'files.autoSave'
:
'off'
,
}
)
)
;
const
=
.
toData
(
)
;
const
=
.
compareAndUpdateLocalUserConfiguration
(
toConfigurationModel
(
{
'files.autoSave'
:
'off'
,
'[markdown]'
:
{
'editor.fontSize'
:
13
,
'editor.wordWrap'
:
'off'
}
,
'[css][scss]'
:
{
'editor.lineNumbers'
:
'relative'
,
'css.lint.emptyRules'
:
'error'
}
,
'window.zoomLevel'
:
1
,
}
)
)
;
const
=
new
ConfigurationChangeEvent
(
,
{
}
,
,
undefined
,
new
NullLogService
(
)
)
;
.
deepStrictEqual
(
[
...
.
]
,
[
'window.zoomLevel'
,
'[markdown]'
,
'[css][scss]'
,
'workbench.editor.enablePreview'
,
'editor.fontSize'
,
'editor.lineNumbers'
]
)
;
.
ok
(
!
.
affectsConfiguration
(
'files'
)
)
;
.
ok
(
.
affectsConfiguration
(
'[markdown]'
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'[markdown].editor'
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'[markdown].editor.fontSize'
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'[markdown].editor.wordWrap'
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'[markdown].workbench'
)
)
;
.
ok
(
.
affectsConfiguration
(
'[css][scss]'
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor'
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor'
,
{
:
'markdown'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor'
,
{
:
'css'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor'
,
{
:
'scss'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor.fontSize'
,
{
:
'markdown'
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'editor.fontSize'
,
{
:
'css'
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'editor.fontSize'
,
{
:
'scss'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor.lineNumbers'
,
{
:
'scss'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor.lineNumbers'
,
{
:
'css'
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'editor.lineNumbers'
,
{
:
'markdown'
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'editor.wordWrap'
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'editor.wordWrap'
,
{
:
'markdown'
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'editor'
,
{
:
'json'
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'editor.fontSize'
,
{
:
'json'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window'
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.zoomLevel'
)
)
;
.
ok
(
.
affectsConfiguration
(
'window'
,
{
:
'markdown'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.zoomLevel'
,
{
:
'markdown'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'workbench'
)
)
;
.
ok
(
.
affectsConfiguration
(
'workbench.editor'
)
)
;
.
ok
(
.
affectsConfiguration
(
'workbench.editor.enablePreview'
)
)
;
.
ok
(
.
affectsConfiguration
(
'workbench'
,
{
:
'markdown'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'workbench.editor'
,
{
:
'markdown'
}
)
)
;
}
)
;
test
(
'changeEvent affecting workspace folders'
,
(
)
=>
{
const
=
new
TestConfiguration
(
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
)
;
.
updateWorkspaceConfiguration
(
toConfigurationModel
(
{
'window.title'
:
'custom'
}
)
)
;
.
updateFolderConfiguration
(
URI
.
file
(
'folder1'
)
,
toConfigurationModel
(
{
'window.zoomLevel'
:
2
,
'window.restoreFullscreen'
:
true
}
)
)
;
.
updateFolderConfiguration
(
URI
.
file
(
'folder2'
)
,
toConfigurationModel
(
{
'workbench.editor.enablePreview'
:
true
,
'window.restoreWindows'
:
true
}
)
)
;
const
=
.
toData
(
)
;
const
=
new
Workspace
(
'a'
,
[
new
WorkspaceFolder
(
{
:
0
,
:
'a'
,
:
URI
.
file
(
'folder1'
)
}
)
,
new
WorkspaceFolder
(
{
:
1
,
:
'b'
,
:
URI
.
file
(
'folder2'
)
}
)
,
new
WorkspaceFolder
(
{
:
2
,
:
'c'
,
:
URI
.
file
(
'folder3'
)
}
)
]
)
;
const
=
mergeChanges
(
.
compareAndUpdateWorkspaceConfiguration
(
toConfigurationModel
(
{
'window.title'
:
'native'
}
)
)
,
.
compareAndUpdateFolderConfiguration
(
URI
.
file
(
'folder1'
)
,
toConfigurationModel
(
{
'window.zoomLevel'
:
1
,
'window.restoreFullscreen'
:
false
}
)
)
,
.
compareAndUpdateFolderConfiguration
(
URI
.
file
(
'folder2'
)
,
toConfigurationModel
(
{
'workbench.editor.enablePreview'
:
false
,
'window.restoreWindows'
:
false
}
)
)
)
;
const
=
new
ConfigurationChangeEvent
(
,
{
,
}
,
,
,
new
NullLogService
(
)
)
;
.
deepStrictEqual
(
[
...
.
]
,
[
'window.title'
,
'window.zoomLevel'
,
'window.restoreFullscreen'
,
'workbench.editor.enablePreview'
,
'window.restoreWindows'
]
)
;
.
ok
(
.
affectsConfiguration
(
'window.zoomLevel'
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.zoomLevel'
,
{
:
URI
.
file
(
'folder1'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.zoomLevel'
,
{
:
URI
.
file
(
join
(
'folder1'
,
'file1'
)
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'window.zoomLevel'
,
{
:
URI
.
file
(
'file1'
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'window.zoomLevel'
,
{
:
URI
.
file
(
'file2'
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'window.zoomLevel'
,
{
:
URI
.
file
(
join
(
'folder2'
,
'file2'
)
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'window.zoomLevel'
,
{
:
URI
.
file
(
join
(
'folder3'
,
'file3'
)
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.restoreFullscreen'
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.restoreFullscreen'
,
{
:
URI
.
file
(
join
(
'folder1'
,
'file1'
)
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.restoreFullscreen'
,
{
:
URI
.
file
(
'folder1'
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'window.restoreFullscreen'
,
{
:
URI
.
file
(
'file1'
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'window.restoreFullscreen'
,
{
:
URI
.
file
(
'file2'
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'window.restoreFullscreen'
,
{
:
URI
.
file
(
join
(
'folder2'
,
'file2'
)
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'window.restoreFullscreen'
,
{
:
URI
.
file
(
join
(
'folder3'
,
'file3'
)
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.restoreWindows'
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.restoreWindows'
,
{
:
URI
.
file
(
'folder2'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.restoreWindows'
,
{
:
URI
.
file
(
join
(
'folder2'
,
'file2'
)
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'window.restoreWindows'
,
{
:
URI
.
file
(
'file2'
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'window.restoreWindows'
,
{
:
URI
.
file
(
join
(
'folder1'
,
'file1'
)
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'window.restoreWindows'
,
{
:
URI
.
file
(
join
(
'folder3'
,
'file3'
)
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.title'
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.title'
,
{
:
URI
.
file
(
'folder1'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.title'
,
{
:
URI
.
file
(
join
(
'folder1'
,
'file1'
)
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.title'
,
{
:
URI
.
file
(
'folder2'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.title'
,
{
:
URI
.
file
(
join
(
'folder2'
,
'file2'
)
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.title'
,
{
:
URI
.
file
(
'folder3'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.title'
,
{
:
URI
.
file
(
join
(
'folder3'
,
'file3'
)
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.title'
,
{
:
URI
.
file
(
'file1'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.title'
,
{
:
URI
.
file
(
'file2'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.title'
,
{
:
URI
.
file
(
'file3'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window'
)
)
;
.
ok
(
.
affectsConfiguration
(
'window'
,
{
:
URI
.
file
(
'folder1'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window'
,
{
:
URI
.
file
(
join
(
'folder1'
,
'file1'
)
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window'
,
{
:
URI
.
file
(
'folder2'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window'
,
{
:
URI
.
file
(
join
(
'folder2'
,
'file2'
)
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window'
,
{
:
URI
.
file
(
'folder3'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window'
,
{
:
URI
.
file
(
join
(
'folder3'
,
'file3'
)
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window'
,
{
:
URI
.
file
(
'file1'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window'
,
{
:
URI
.
file
(
'file2'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window'
,
{
:
URI
.
file
(
'file3'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'workbench.editor.enablePreview'
)
)
;
.
ok
(
.
affectsConfiguration
(
'workbench.editor.enablePreview'
,
{
:
URI
.
file
(
'folder2'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'workbench.editor.enablePreview'
,
{
:
URI
.
file
(
join
(
'folder2'
,
'file2'
)
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'workbench.editor.enablePreview'
,
{
:
URI
.
file
(
'folder1'
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'workbench.editor.enablePreview'
,
{
:
URI
.
file
(
join
(
'folder1'
,
'file1'
)
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'workbench.editor.enablePreview'
,
{
:
URI
.
file
(
'folder3'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'workbench.editor'
)
)
;
.
ok
(
.
affectsConfiguration
(
'workbench.editor'
,
{
:
URI
.
file
(
'folder2'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'workbench.editor'
,
{
:
URI
.
file
(
join
(
'folder2'
,
'file2'
)
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'workbench.editor'
,
{
:
URI
.
file
(
'folder1'
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'workbench.editor'
,
{
:
URI
.
file
(
join
(
'folder1'
,
'file1'
)
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'workbench.editor'
,
{
:
URI
.
file
(
'folder3'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'workbench'
)
)
;
.
ok
(
.
affectsConfiguration
(
'workbench'
,
{
:
URI
.
file
(
'folder2'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'workbench'
,
{
:
URI
.
file
(
join
(
'folder2'
,
'file2'
)
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'workbench'
,
{
:
URI
.
file
(
'folder1'
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'workbench'
,
{
:
URI
.
file
(
'folder3'
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'files'
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'files'
,
{
:
URI
.
file
(
'folder1'
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'files'
,
{
:
URI
.
file
(
join
(
'folder1'
,
'file1'
)
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'files'
,
{
:
URI
.
file
(
'folder2'
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'files'
,
{
:
URI
.
file
(
join
(
'folder2'
,
'file2'
)
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'files'
,
{
:
URI
.
file
(
'folder3'
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'files'
,
{
:
URI
.
file
(
join
(
'folder3'
,
'file3'
)
)
}
)
)
;
}
)
;
test
(
'changeEvent - all'
,
(
)
=>
{
const
=
new
TestConfiguration
(
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
)
;
.
updateFolderConfiguration
(
URI
.
file
(
'file1'
)
,
toConfigurationModel
(
{
'window.zoomLevel'
:
2
,
'window.restoreFullscreen'
:
true
}
)
)
;
const
=
.
toData
(
)
;
const
=
mergeChanges
(
.
compareAndUpdateDefaultConfiguration
(
toConfigurationModel
(
{
'editor.lineNumbers'
:
'off'
,
'[markdown]'
:
{
'editor.wordWrap'
:
'off'
}
}
)
,
[
'editor.lineNumbers'
,
'[markdown]'
]
)
,
.
compareAndUpdateLocalUserConfiguration
(
toConfigurationModel
(
{
'[json]'
:
{
'editor.lineNumbers'
:
'relative'
}
}
)
)
,
.
compareAndUpdateWorkspaceConfiguration
(
toConfigurationModel
(
{
'window.title'
:
'custom'
}
)
)
,
.
compareAndDeleteFolderConfiguration
(
URI
.
file
(
'file1'
)
)
,
.
compareAndUpdateFolderConfiguration
(
URI
.
file
(
'file2'
)
,
toConfigurationModel
(
{
'workbench.editor.enablePreview'
:
true
,
'window.restoreWindows'
:
true
}
)
)
)
;
const
=
new
Workspace
(
'a'
,
[
new
WorkspaceFolder
(
{
:
0
,
:
'a'
,
:
URI
.
file
(
'file1'
)
}
)
,
new
WorkspaceFolder
(
{
:
1
,
:
'b'
,
:
URI
.
file
(
'file2'
)
}
)
,
new
WorkspaceFolder
(
{
:
2
,
:
'c'
,
:
URI
.
file
(
'folder3'
)
}
)
]
)
;
const
=
new
ConfigurationChangeEvent
(
,
{
,
}
,
,
,
new
NullLogService
(
)
)
;
.
deepStrictEqual
(
[
...
.
]
,
[
'editor.lineNumbers'
,
'[markdown]'
,
'[json]'
,
'window.title'
,
'window.zoomLevel'
,
'window.restoreFullscreen'
,
'workbench.editor.enablePreview'
,
'window.restoreWindows'
,
'editor.wordWrap'
]
)
;
.
ok
(
.
affectsConfiguration
(
'window.title'
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.title'
,
{
:
URI
.
file
(
'file1'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.title'
,
{
:
URI
.
file
(
'file2'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window'
)
)
;
.
ok
(
.
affectsConfiguration
(
'window'
,
{
:
URI
.
file
(
'file1'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window'
,
{
:
URI
.
file
(
'file2'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.zoomLevel'
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.zoomLevel'
,
{
:
URI
.
file
(
'file1'
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'window.zoomLevel'
,
{
:
URI
.
file
(
'file2'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.restoreFullscreen'
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.restoreFullscreen'
,
{
:
URI
.
file
(
'file1'
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'window.restoreFullscreen'
,
{
:
URI
.
file
(
'file2'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.restoreWindows'
)
)
;
.
ok
(
.
affectsConfiguration
(
'window.restoreWindows'
,
{
:
URI
.
file
(
'file2'
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'window.restoreWindows'
,
{
:
URI
.
file
(
'file1'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'workbench.editor.enablePreview'
)
)
;
.
ok
(
.
affectsConfiguration
(
'workbench.editor.enablePreview'
,
{
:
URI
.
file
(
'file2'
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'workbench.editor.enablePreview'
,
{
:
URI
.
file
(
'file1'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'workbench.editor'
)
)
;
.
ok
(
.
affectsConfiguration
(
'workbench.editor'
,
{
:
URI
.
file
(
'file2'
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'workbench.editor'
,
{
:
URI
.
file
(
'file1'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'workbench'
)
)
;
.
ok
(
.
affectsConfiguration
(
'workbench'
,
{
:
URI
.
file
(
'file2'
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'workbench'
,
{
:
URI
.
file
(
'file1'
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'files'
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'files'
,
{
:
URI
.
file
(
'file1'
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'files'
,
{
:
URI
.
file
(
'file2'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor'
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor'
,
{
:
URI
.
file
(
'file1'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor'
,
{
:
URI
.
file
(
'file2'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor'
,
{
:
URI
.
file
(
'file1'
)
,
:
'json'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor'
,
{
:
URI
.
file
(
'file1'
)
,
:
'markdown'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor'
,
{
:
URI
.
file
(
'file1'
)
,
:
'typescript'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor'
,
{
:
URI
.
file
(
'file2'
)
,
:
'json'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor'
,
{
:
URI
.
file
(
'file2'
)
,
:
'markdown'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor'
,
{
:
URI
.
file
(
'file2'
)
,
:
'typescript'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor.lineNumbers'
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor.lineNumbers'
,
{
:
URI
.
file
(
'file1'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor.lineNumbers'
,
{
:
URI
.
file
(
'file2'
)
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor.lineNumbers'
,
{
:
URI
.
file
(
'file1'
)
,
:
'json'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor.lineNumbers'
,
{
:
URI
.
file
(
'file1'
)
,
:
'markdown'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor.lineNumbers'
,
{
:
URI
.
file
(
'file1'
)
,
:
'typescript'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor.lineNumbers'
,
{
:
URI
.
file
(
'file2'
)
,
:
'json'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor.lineNumbers'
,
{
:
URI
.
file
(
'file2'
)
,
:
'markdown'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor.lineNumbers'
,
{
:
URI
.
file
(
'file2'
)
,
:
'typescript'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor.wordWrap'
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'editor.wordWrap'
,
{
:
URI
.
file
(
'file1'
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'editor.wordWrap'
,
{
:
URI
.
file
(
'file2'
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'editor.wordWrap'
,
{
:
URI
.
file
(
'file1'
)
,
:
'json'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor.wordWrap'
,
{
:
URI
.
file
(
'file1'
)
,
:
'markdown'
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'editor.wordWrap'
,
{
:
URI
.
file
(
'file1'
)
,
:
'typescript'
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'editor.wordWrap'
,
{
:
URI
.
file
(
'file2'
)
,
:
'json'
}
)
)
;
.
ok
(
.
affectsConfiguration
(
'editor.wordWrap'
,
{
:
URI
.
file
(
'file2'
)
,
:
'markdown'
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'editor.wordWrap'
,
{
:
URI
.
file
(
'file2'
)
,
:
'typescript'
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'editor.fontSize'
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'editor.fontSize'
,
{
:
URI
.
file
(
'file1'
)
}
)
)
;
.
ok
(
!
.
affectsConfiguration
(
'editor.fontSize'
,
{
:
URI
.
file
(
'file2'
)
}
)
)
;
}
)
;
test
(
'changeEvent affecting tasks and launches'
,
(
)
=>
{
const
=
new
TestConfiguration
(
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
)
;
const
=
.
compareAndUpdateLocalUserConfiguration
(
toConfigurationModel
(
{
'launch'
:
{
'configuraiton'
:
{
}
}
,
'launch.version'
:
1
,
'tasks'
:
{
'version'
:
2
}
}
)
)
;
const
=
new
ConfigurationChangeEvent
(
,
undefined
,
,
undefined
,
new
NullLogService
(
)
)
;
.
deepStrictEqual
(
[
...
.
]
,
[
'launch'
,
'launch.version'
,
'tasks'
]
)
;
.
ok
(
.
affectsConfiguration
(
'launch'
)
)
;
.
ok
(
.
affectsConfiguration
(
'launch.version'
)
)
;
.
ok
(
.
affectsConfiguration
(
'tasks'
)
)
;
}
)
;
test
(
'affectsConfiguration returns false for empty string'
,
(
)
=>
{
const
=
new
TestConfiguration
(
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
,
.
createEmptyModel
(
new
NullLogService
(
)
)
)
;
const
=
.
compareAndUpdateLocalUserConfiguration
(
toConfigurationModel
(
{
'window.zoomLevel'
:
1
}
)
)
;
const
=
new
ConfigurationChangeEvent
(
,
undefined
,
,
undefined
,
new
NullLogService
(
)
)
;
.
strictEqual
(
false
,
.
affectsConfiguration
(
''
)
)
;
}
)
;
}
)
;
suite
(
'Configuration.Parse'
,
(
)
=>
{
const
=
new
NullLogService
(
)
;
ensureNoDisposablesAreLeakedInTestSuite
(
)
;
test
(
'parsing configuration only with local user configuration and raw is same'
,
(
)
=>
{
const
=
new
TestConfiguration
(
.
createEmptyModel
(
)
,
.
createEmptyModel
(
)
,
.
createEmptyModel
(
)
,
new
ConfigurationModel
(
{
'a'
:
1
,
'c'
:
1
}
,
[
'a'
,
'c'
]
,
[
{
:
[
'x'
,
'y'
]
,
:
{
'a'
:
2
,
'b'
:
1
}
,
:
[
'a'
]
}
]
,
undefined
,
)
)
;
const
=
.
parse
(
.
toData
(
)
,
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
}
,
undefined
)
.
,
{
:
1
,
:
undefined
,
:
1
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
:
'x'
}
,
undefined
)
.
,
{
:
1
,
:
2
,
:
2
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
:
'x'
}
,
undefined
)
.
,
{
:
undefined
,
:
1
,
:
1
,
:
[
{
:
[
'x'
,
'y'
]
,
:
1
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'd'
,
{
}
,
undefined
)
.
,
undefined
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
}
,
undefined
)
.
,
undefined
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
:
'x'
}
,
undefined
)
.
,
undefined
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
:
'x'
}
,
undefined
)
.
,
undefined
)
;
.
deepStrictEqual
(
.
inspect
(
'd'
,
{
}
,
undefined
)
.
,
undefined
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
}
,
undefined
)
.
,
{
:
1
,
:
undefined
,
:
1
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
:
'x'
}
,
undefined
)
.
,
{
:
1
,
:
2
,
:
2
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
:
'x'
}
,
undefined
)
.
,
{
:
undefined
,
:
1
,
:
1
,
:
[
{
:
[
'x'
,
'y'
]
,
:
1
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'd'
,
{
}
,
undefined
)
.
,
undefined
)
;
}
)
;
test
(
'parsing configuration only with local user configuration and raw is not same'
,
(
)
=>
{
const
=
new
TestConfiguration
(
.
createEmptyModel
(
)
,
.
createEmptyModel
(
)
,
.
createEmptyModel
(
)
,
new
ConfigurationModel
(
{
'a'
:
1
,
'c'
:
1
}
,
[
'a'
,
'c'
]
,
[
{
:
[
'x'
,
'y'
]
,
:
{
'a'
:
2
,
}
,
:
[
'a'
]
}
]
,
{
'a'
:
1
,
'b'
:
2
,
'c'
:
1
,
'd'
:
3
,
'[x][y]'
:
{
'a'
:
2
,
'b'
:
1
}
}
,
)
)
;
const
=
.
parse
(
.
toData
(
)
,
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
}
,
undefined
)
.
,
{
:
1
,
:
undefined
,
:
1
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
:
'x'
}
,
undefined
)
.
,
{
:
1
,
:
2
,
:
2
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
:
'x'
}
,
undefined
)
.
,
{
:
2
,
:
1
,
:
1
,
:
[
{
:
[
'x'
,
'y'
]
,
:
1
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'd'
,
{
}
,
undefined
)
.
,
{
:
3
,
:
undefined
,
:
3
,
:
undefined
}
)
;
.
deepStrictEqual
(
.
inspect
(
'e'
,
{
}
,
undefined
)
.
,
undefined
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
}
,
undefined
)
.
,
undefined
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
:
'x'
}
,
undefined
)
.
,
undefined
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
:
'x'
}
,
undefined
)
.
,
undefined
)
;
.
deepStrictEqual
(
.
inspect
(
'd'
,
{
}
,
undefined
)
.
,
undefined
)
;
.
deepStrictEqual
(
.
inspect
(
'e'
,
{
}
,
undefined
)
.
,
undefined
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
}
,
undefined
)
.
,
{
:
1
,
:
undefined
,
:
1
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
:
'x'
}
,
undefined
)
.
,
{
:
1
,
:
2
,
:
2
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
:
'x'
}
,
undefined
)
.
,
{
:
2
,
:
1
,
:
1
,
:
[
{
:
[
'x'
,
'y'
]
,
:
1
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'd'
,
{
}
,
undefined
)
.
,
{
:
3
,
:
undefined
,
:
3
,
:
undefined
}
)
;
.
deepStrictEqual
(
.
inspect
(
'e'
,
{
}
,
undefined
)
.
,
undefined
)
;
}
)
;
test
(
'parsing configuration with local and remote user configuration and raw is same for both'
,
(
)
=>
{
const
=
new
TestConfiguration
(
.
createEmptyModel
(
)
,
.
createEmptyModel
(
)
,
.
createEmptyModel
(
)
,
new
ConfigurationModel
(
{
'a'
:
1
}
,
[
'a'
]
,
[
{
:
[
'x'
,
'y'
]
,
:
{
'a'
:
2
,
}
,
:
[
'a'
]
}
]
,
undefined
,
)
,
new
ConfigurationModel
(
{
'b'
:
3
}
,
[
'b'
]
,
[
]
,
undefined
,
)
)
;
const
=
.
parse
(
.
toData
(
)
,
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
}
,
undefined
)
.
,
{
:
1
,
:
undefined
,
:
1
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
:
'x'
}
,
undefined
)
.
,
{
:
1
,
:
2
,
:
2
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
}
,
undefined
)
.
,
undefined
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
:
'y'
}
,
undefined
)
.
,
undefined
)
;
.
deepStrictEqual
(
.
inspect
(
'c'
,
{
}
,
undefined
)
.
,
undefined
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
}
,
undefined
)
.
,
undefined
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
:
'x'
}
,
undefined
)
.
,
undefined
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
}
,
undefined
)
.
,
{
:
3
,
:
undefined
,
:
3
,
:
undefined
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
:
'y'
}
,
undefined
)
.
,
{
:
3
,
:
undefined
,
:
3
,
:
undefined
}
)
;
.
deepStrictEqual
(
.
inspect
(
'c'
,
{
}
,
undefined
)
.
,
undefined
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
}
,
undefined
)
.
,
{
:
1
,
:
undefined
,
:
1
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
:
'x'
}
,
undefined
)
.
,
{
:
1
,
:
2
,
:
2
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
}
,
undefined
)
.
,
{
:
3
,
:
undefined
,
:
3
,
:
undefined
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
:
'y'
}
,
undefined
)
.
,
{
:
3
,
:
undefined
,
:
3
,
:
undefined
}
)
;
.
deepStrictEqual
(
.
inspect
(
'c'
,
{
}
,
undefined
)
.
,
undefined
)
;
}
)
;
test
(
'parsing configuration with local and remote user configuration and raw is not same for local user'
,
(
)
=>
{
const
=
new
TestConfiguration
(
.
createEmptyModel
(
)
,
.
createEmptyModel
(
)
,
.
createEmptyModel
(
)
,
new
ConfigurationModel
(
{
'a'
:
1
}
,
[
'a'
]
,
[
{
:
[
'x'
,
'y'
]
,
:
{
'a'
:
2
,
}
,
:
[
'a'
]
}
]
,
{
'a'
:
1
,
'b'
:
2
,
'c'
:
3
,
'[x][y]'
:
{
'a'
:
2
,
'b'
:
4
,
}
}
,
)
,
new
ConfigurationModel
(
{
'b'
:
3
}
,
[
'b'
]
,
[
]
,
undefined
,
)
)
;
const
=
.
parse
(
.
toData
(
)
,
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
}
,
undefined
)
.
,
{
:
1
,
:
undefined
,
:
1
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
:
'x'
}
,
undefined
)
.
,
{
:
1
,
:
2
,
:
2
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
}
,
undefined
)
.
,
{
:
2
,
:
undefined
,
:
2
,
:
[
{
:
[
'x'
,
'y'
]
,
:
4
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
:
'y'
}
,
undefined
)
.
,
{
:
2
,
:
4
,
:
4
,
:
[
{
:
[
'x'
,
'y'
]
,
:
4
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'c'
,
{
}
,
undefined
)
.
,
{
:
3
,
:
undefined
,
:
3
,
:
undefined
}
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
}
,
undefined
)
.
,
undefined
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
:
'x'
}
,
undefined
)
.
,
undefined
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
}
,
undefined
)
.
,
{
:
3
,
:
undefined
,
:
3
,
:
undefined
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
:
'y'
}
,
undefined
)
.
,
{
:
3
,
:
undefined
,
:
3
,
:
undefined
}
)
;
.
deepStrictEqual
(
.
inspect
(
'c'
,
{
}
,
undefined
)
.
,
undefined
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
}
,
undefined
)
.
,
{
:
1
,
:
undefined
,
:
1
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
:
'x'
}
,
undefined
)
.
,
{
:
1
,
:
2
,
:
2
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
}
,
undefined
)
.
,
{
:
3
,
:
3
,
:
undefined
,
:
undefined
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
:
'y'
}
,
undefined
)
.
,
{
:
3
,
:
undefined
,
:
3
,
:
undefined
}
)
;
.
deepStrictEqual
(
.
inspect
(
'c'
,
{
}
,
undefined
)
.
,
undefined
)
;
}
)
;
test
(
'parsing configuration with local and remote user configuration and raw is not same for remote user'
,
(
)
=>
{
const
=
new
TestConfiguration
(
.
createEmptyModel
(
)
,
.
createEmptyModel
(
)
,
.
createEmptyModel
(
)
,
new
ConfigurationModel
(
{
'b'
:
3
}
,
[
'b'
]
,
[
]
,
undefined
,
)
,
new
ConfigurationModel
(
{
'a'
:
1
}
,
[
'a'
]
,
[
{
:
[
'x'
,
'y'
]
,
:
{
'a'
:
2
,
}
,
:
[
'a'
]
}
]
,
{
'a'
:
1
,
'b'
:
2
,
'c'
:
3
,
'[x][y]'
:
{
'a'
:
2
,
'b'
:
4
,
}
}
,
)
,
)
;
const
=
.
parse
(
.
toData
(
)
,
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
}
,
undefined
)
.
,
undefined
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
:
'x'
}
,
undefined
)
.
,
undefined
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
}
,
undefined
)
.
,
{
:
3
,
:
undefined
,
:
3
,
:
undefined
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
:
'y'
}
,
undefined
)
.
,
{
:
3
,
:
undefined
,
:
3
,
:
undefined
}
)
;
.
deepStrictEqual
(
.
inspect
(
'c'
,
{
}
,
undefined
)
.
,
undefined
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
}
,
undefined
)
.
,
{
:
1
,
:
undefined
,
:
1
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
:
'x'
}
,
undefined
)
.
,
{
:
1
,
:
2
,
:
2
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
}
,
undefined
)
.
,
{
:
2
,
:
undefined
,
:
2
,
:
[
{
:
[
'x'
,
'y'
]
,
:
4
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
:
'y'
}
,
undefined
)
.
,
{
:
2
,
:
4
,
:
4
,
:
[
{
:
[
'x'
,
'y'
]
,
:
4
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'c'
,
{
}
,
undefined
)
.
,
{
:
3
,
:
undefined
,
:
3
,
:
undefined
}
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
}
,
undefined
)
.
,
{
:
1
,
:
undefined
,
:
1
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
:
'x'
}
,
undefined
)
.
,
{
:
1
,
:
2
,
:
2
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
}
,
undefined
)
.
,
{
:
3
,
:
undefined
,
:
3
,
:
undefined
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
:
'y'
}
,
undefined
)
.
,
{
:
3
,
:
undefined
,
:
3
,
:
undefined
}
)
;
.
deepStrictEqual
(
.
inspect
(
'c'
,
{
}
,
undefined
)
.
,
undefined
)
;
}
)
;
test
(
'parsing configuration with local and remote user configuration and raw is not same for both'
,
(
)
=>
{
const
=
new
TestConfiguration
(
.
createEmptyModel
(
)
,
.
createEmptyModel
(
)
,
.
createEmptyModel
(
)
,
new
ConfigurationModel
(
{
'b'
:
3
}
,
[
'b'
]
,
[
]
,
{
'a'
:
4
,
'b'
:
3
}
,
)
,
new
ConfigurationModel
(
{
'a'
:
1
}
,
[
'a'
]
,
[
{
:
[
'x'
,
'y'
]
,
:
{
'a'
:
2
,
}
,
:
[
'a'
]
}
]
,
{
'a'
:
1
,
'b'
:
2
,
'c'
:
3
,
'[x][y]'
:
{
'a'
:
2
,
'b'
:
4
,
}
}
,
)
,
)
;
const
=
.
parse
(
.
toData
(
)
,
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
}
,
undefined
)
.
,
{
:
4
,
:
undefined
,
:
4
,
:
undefined
}
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
:
'x'
}
,
undefined
)
.
,
{
:
4
,
:
undefined
,
:
4
,
:
undefined
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
}
,
undefined
)
.
,
{
:
3
,
:
undefined
,
:
3
,
:
undefined
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
:
'y'
}
,
undefined
)
.
,
{
:
3
,
:
undefined
,
:
3
,
:
undefined
}
)
;
.
deepStrictEqual
(
.
inspect
(
'c'
,
{
}
,
undefined
)
.
,
undefined
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
}
,
undefined
)
.
,
{
:
1
,
:
undefined
,
:
1
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
:
'x'
}
,
undefined
)
.
,
{
:
1
,
:
2
,
:
2
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
}
,
undefined
)
.
,
{
:
2
,
:
undefined
,
:
2
,
:
[
{
:
[
'x'
,
'y'
]
,
:
4
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
:
'y'
}
,
undefined
)
.
,
{
:
2
,
:
4
,
:
4
,
:
[
{
:
[
'x'
,
'y'
]
,
:
4
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'c'
,
{
}
,
undefined
)
.
,
{
:
3
,
:
undefined
,
:
3
,
:
undefined
}
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
}
,
undefined
)
.
,
{
:
1
,
:
undefined
,
:
1
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'a'
,
{
:
'x'
}
,
undefined
)
.
,
{
:
1
,
:
2
,
:
2
,
:
[
{
:
[
'x'
,
'y'
]
,
:
2
}
]
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
}
,
undefined
)
.
,
{
:
3
,
:
undefined
,
:
3
,
:
undefined
}
)
;
.
deepStrictEqual
(
.
inspect
(
'b'
,
{
:
'y'
}
,
undefined
)
.
,
{
:
3
,
:
undefined
,
:
3
,
:
undefined
}
)
;
.
deepStrictEqual
(
.
inspect
(
'c'
,
{
}
,
undefined
)
.
,
undefined
)
;
}
)
;
}
)
;
function
toConfigurationModel
(
:
<
string
,
unknown
>
)
:
{
const
=
new
ConfigurationModelParser
(
'test'
,
new
NullLogService
(
)
)
;
.
parse
(
JSON
.
stringify
(
)
)
;
return
.
;
}