ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / extensions / copilot / test / simulation / fixtures / codeMapper / notebookEditorWidget.ts 3455 строк · изменён 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
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
import * as DOM from '../../../../base/browser/dom.js' ;
import * as domStylesheets from '../../../../base/browser/domStylesheets.js' ;
import { IMouseWheelEvent, StandardMouseEvent } from '../../../../base/browser/mouseEvent.js' ;
import { PixelRatio } from '../../../../base/browser/pixelRatio.js' ;
import { IListContextMenuEvent } from '../../../../base/browser/ui/list/list.js' ;
import { mainWindow } from '../../../../base/browser/window.js' ;
import { DeferredPromise, SequencerByKey } from '../../../../base/common/async.js' ;
CancellationToken
Color
onUnexpectedError
Emitter Event
combinedDisposable Disposable DisposableStore dispose IDisposable toDisposable
Schemas
setTimeout0
extname isEqual
generateUuid
FontMeasurements
ICodeEditor
EditorExtensionsRegistry
IEditorOptions
BareFontInfo FontInfo
IDimension
Range
Selection
CopyPasteController
DropIntoEditorController
InlineCompletionsController
SuggestController
nls
MenuId
IConfigurationService
IContextKey IContextKeyService RawContextKey
IContextMenuService
IInstantiationService
ServiceCollection
ILayoutService
registerZIndex ZIndex
IEditorProgressService IProgressRunner
ITelemetryService
contrastBorder errorForeground focusBorder foreground listInactiveSelectionBackground registerColor scrollbarSliderActiveBackground scrollbarSliderBackground scrollbarSliderHoverBackground transparent
FloatingEditorClickMenu
IEditorGroupsService
debugIconStartForeground
PreventDefaultContextMenuItemsContextKeyName
IWebviewElement
NotebookTextModel
CellEditType CellKind INotebookFindOptions NotebookFindScopeType SelectionStateType
INotebookExecutionService
INotebookKernelService
INotebookLoggingService
NotebookPerfMarks
cellRangesToIndexes ICellRange
INotebookRendererMessagingService
INotebookService
CellFindMatchModel
NotebookAccessibilityProvider
CellEditState CellFindMatchWithIndex CellFocusMode CellLayoutContext CellRevealRangeType CellRevealType IActiveNotebookEditorDelegate IBaseCellEditorOptions ICellOutputViewModel ICellViewModel ICommonCellInfo IDisplayOutputLayoutUpdateRequest IFocusNotebookCellOptions IInsetRenderOutput IModelDecorationsChangeAccessor INotebookCellOverlayChangeAccessor INotebookDeltaDecoration INotebookEditor INotebookEditorContribution INotebookEditorContributionDescription INotebookEditorCreationOptions INotebookEditorDelegate INotebookEditorMouseEvent INotebookEditorOptions INotebookEditorViewState INotebookViewCellsUpdateEvent INotebookViewZoneChangeAccessor INotebookWebviewMessage RenderOutputType ScrollToRevealBehavior
NotebookEditorExtensionsRegistry
notebookDebug
NotebookOptions OutputInnerContainerTopPadding
NotebookCellStateChangedEvent NotebookLayoutChangedEvent NotebookLayoutInfo
INotebookEditorService
CellContextKeyManager
CellDragAndDropController
NotebookCellEditorPool
ListViewInfoAccessor NotebookCellList
INotebookCellList
BackLayerWebView
CodeCellRenderer MarkupCellRenderer NotebookCellListDelegate
IAckOutputHeight IMarkupCellInitialization
BaseCellEditorOptions
CodeCellViewModel outputDisplayLimit
NotebookEventDispatcher
MarkupCellViewModel
CellViewModel NotebookViewModel
ViewContext
NotebookStickyScroll
NotebookEditorWorkbenchToolbar
NotebookEditorContextKeys
NotebookHorizontalTracker
NotebookOverviewRuler
ListTopCellToolbar
$ $
INotebookEditorCreationOptions
skipContributions
FloatingEditorClickMenu
contributions EditorExtensionsRegistry c skipContributions c id
menuIds
notebookToolbar MenuId NotebookToolbar
cellTitleToolbar MenuId NotebookCellTitle
cellDeleteToolbar MenuId NotebookCellDelete
cellInsertToolbar MenuId NotebookCellBetween
cellTopInsertToolbar MenuId NotebookCellListTop
cellExecuteToolbar MenuId NotebookCellExecute
cellExecutePrimary MenuId NotebookCellExecutePrimary
cellEditorContributions contributions
INotebookEditor
_onDidChangeCellState
onDidChangeCellState _onDidChangeCellState event
_onDidChangeViewCells
onDidChangeViewCells Event INotebookViewCellsUpdateEvent _onDidChangeViewCells event
_onWillChangeModel
onWillChangeModel Event NotebookTextModel _onWillChangeModel event
_onDidChangeModel
onDidChangeModel Event NotebookTextModel _onDidChangeModel event
_onDidAttachViewModel
onDidAttachViewModel Event _onDidAttachViewModel event
_onDidChangeOptions
onDidChangeOptions Event _onDidChangeOptions event
_onDidChangeDecorations
onDidChangeDecorations Event _onDidChangeDecorations event
_onDidScroll
onDidScroll Event _onDidScroll event
_onDidChangeLayout
onDidChangeLayout Event _onDidChangeLayout event
_onDidChangeActiveCell
onDidChangeActiveCell Event _onDidChangeActiveCell event
_onDidChangeFocus
onDidChangeFocus Event _onDidChangeFocus event
_onDidChangeSelection
onDidChangeSelection Event _onDidChangeSelection event
_onDidChangeVisibleRanges
onDidChangeVisibleRanges Event _onDidChangeVisibleRanges event
_onDidFocusEmitter
onDidFocusWidget _onDidFocusEmitter event
_onDidBlurEmitter
onDidBlurWidget _onDidBlurEmitter event
_onDidChangeActiveEditor
onDidChangeActiveEditor Event _onDidChangeActiveEditor event
_onDidChangeActiveKernel
onDidChangeActiveKernel Event _onDidChangeActiveKernel event
_onMouseUp Emitter INotebookEditorMouseEvent
onMouseUp Event INotebookEditorMouseEvent _onMouseUp event
_onMouseDown Emitter INotebookEditorMouseEvent
onMouseDown Event INotebookEditorMouseEvent _onMouseDown event
_onDidReceiveMessage
onDidReceiveMessage Event INotebookWebviewMessage _onDidReceiveMessage event
_onDidRenderOutput
onDidRenderOutput _onDidRenderOutput event
_onDidRemoveOutput
onDidRemoveOutput _onDidRemoveOutput event
_onDidResizeOutputEmitter
onDidResizeOutput _onDidResizeOutputEmitter event
_overlayContainer HTMLElement
_notebookTopToolbarContainer HTMLElement
_notebookTopToolbar NotebookEditorWorkbenchToolbar
_notebookStickyScrollContainer HTMLElement
_notebookStickyScroll NotebookStickyScroll
_notebookOverviewRulerContainer HTMLElement
_notebookOverviewRuler NotebookOverviewRuler
_body HTMLElement
_styleElement HTMLStyleElement
_overflowContainer HTMLElement
_webview BackLayerWebView ICommonCellInfo
_webviewResolvePromise BackLayerWebView ICommonCellInfo
_webviewTransparentCover HTMLElement
_listDelegate NotebookCellListDelegate
_list INotebookCellList
_listViewInfoAccessor ListViewInfoAccessor
_dndController CellDragAndDropController
_listTopCellToolbar ListTopCellToolbar
_renderedEditors Map ICellViewModel ICodeEditor
_editorPool NotebookCellEditorPool
_viewContext ViewContext
_notebookViewModel NotebookViewModel
_localStore DisposableStore
_localCellStateListeners DisposableStore
_fontInfo FontInfo
_dimension Dimension
_position IDomPosition
_shadowElement HTMLElement
_shadowElementViewInfo height width top left
_editorFocus IContextKey
_outputFocus IContextKey
_editorEditable IContextKey
_cursorNavMode IContextKey
_outputInputFocus IContextKey
_contributions
_scrollBeyondLastLine
_insetModifyQueueByOutputId
_cellContextKeyManager CellContextKeyManager
_uuid
_focusTracker IFocusTracker
_webviewFocused
_isVisible
_isVisible
_isDisposed
_isDisposed
newModel NotebookViewModel
_onWillChangeModel _notebookViewModel notebookDocument
_notebookViewModel newModel
_onDidChangeModel newModel notebookDocument
_notebookViewModel
_notebookViewModel notebookDocument
_notebookViewModel options isReadOnly
ICodeEditor
_isDisposed
focused _list
_renderedEditors focused
ICellViewModel ICodeEditor
_isDisposed
focused _list
editor _renderedEditors focused
editor
focused editor
ICellViewModel ICodeEditor
_renderedEditors
_list _list visibleRanges
_baseCellEditorOptions
isReplHistory
_readOnly
scopedContextKeyService IContextKeyService
instantiationService IInstantiationService
_notebookOptions NotebookOptions
_currentProgress IProgressRunner
_notebookOptions
creationOptions INotebookEditorCreationOptions
dimension Dimension
instantiationService IInstantiationService
editorGroupsService IEditorGroupsService
notebookRendererMessaging INotebookRendererMessagingService
notebookEditorService INotebookEditorService
notebookKernelService INotebookKernelService
_notebookService INotebookService
configurationService IConfigurationService
contextKeyService IContextKeyService
layoutService ILayoutService
contextMenuService IContextMenuService
telemetryService ITelemetryService
notebookExecutionService INotebookExecutionService
editorProgressService IEditorProgressService
logService INotebookLoggingService
_dimension dimension
isReplHistory creationOptions isReplHistory
_readOnly creationOptions isReadOnly
_overlayContainer document
scopedContextKeyService contextKeyService _overlayContainer
instantiationService instantiationService IContextKeyService scopedContextKeyService
_notebookOptions creationOptions options
instantiationService NotebookOptions creationOptions codeWindow mainWindow _readOnly
_notebookOptions
eventDispatcher
_viewContext
_notebookOptions
eventDispatcher
language language
_viewContext eventDispatcher
_onDidChangeLayout
_viewContext eventDispatcher e
_onDidChangeCellState e
_notebookService
instantiationService NotebookEditorContextKeys
notebookKernelService e
e notebook viewModel uri
_onDidChangeActiveKernel
_scrollBeyondLastLine configurationService
configurationService e
e
_scrollBeyondLastLine configurationService
_dimension _isVisible
_dimension
_notebookOptions e
e cellStatusBarVisibility e cellToolbarLocation e cellToolbarInteraction
e fontFamily
e compactView
e focusIndicator
e insertToolbarPosition
e cellToolbarLocation
e dragAndDropEnabled
e fontSize
e markupFontSize
e markdownLineHeight
e fontFamily
e insertToolbarAlignment
e outputFontSize
e outputLineHeight
e outputFontFamily
e outputWordWrap
e outputScrolling
e outputLinkifyFilePaths
e minimalError
_styleElement
_webview
notebookOptions
fontFamily
_dimension _isVisible
_dimension
container creationOptions codeWindow layoutService creationOptions codeWindow layoutService mainContainer
editorGroupsService container e
_shadowElement _isVisible
_shadowElement _dimension
_dimension _position
notebookEditorService
id
_overlayContainer id
_overlayContainer className
_overlayContainer classList
_overlayContainer inert
_overlayContainer style visibility
container _overlayContainer
_overlayContainer
_isVisible
_editorFocus scopedContextKeyService
_outputFocus scopedContextKeyService
_outputInputFocus scopedContextKeyService
_editorEditable scopedContextKeyService
_cursorNavMode scopedContextKeyService
PreventDefaultContextMenuItemsContextKeyName scopedContextKeyService
_editorEditable creationOptions isReadOnly
contributions INotebookEditorContributionDescription
creationOptions contributions
contributions creationOptions contributions
contributions NotebookEditorExtensionsRegistry
desc contributions
contribution INotebookEditorContribution
contribution instantiationService desc ctor
err
err
contribution
_contributions desc id
_contributions desc id contribution
contribution
_debugFlag
args
_debugFlag
args
_uuid
NotebookViewModel
viewModel
viewModel length
viewModel
selections ICellRange
viewModel
focus viewModel
viewModel
kind SelectionStateType Index
focus focus
selections selections
viewModel start end
focus ICellRange
viewModel
selections viewModel
viewModel
kind SelectionStateType Index
focus focus
selections selections
ICellViewModel
viewModel
cellsSet
viewModel range viewModel viewCells range start range end a b
b cell
cellsSet cell handle
cellsSet cell handle
a cell
a
ICellViewModel
IActiveNotebookEditorDelegate
_notebookViewModel
_currentProgress editorProgressService
_currentProgress
_currentProgress
_currentProgress
language IBaseCellEditorOptions
existingOptions _baseCellEditorOptions language
existingOptions
existingOptions
options notebookOptions configurationService language
_baseCellEditorOptions language options
options
_overlayContainer
_overlayContainer classList
_overlayContainer classList
_overlayContainer classList
cellToolbarLocation _notebookOptions viewModel viewType
_overlayContainer classList
cellToolbarInteraction _notebookOptions cellToolbarInteraction
cellToolbarInteractionState
_overlayContainer classList
_overlayContainer classList
cellToolbarInteraction cellToolbarInteraction
cellToolbarInteractionState cellToolbarInteraction
_overlayContainer classList
editorOptions configurationService
targetWindow
_fontInfo FontMeasurements targetWindow BareFontInfo editorOptions PixelRatio targetWindow value
parent HTMLElement
_notebookTopToolbarContainer document
_notebookTopToolbarContainer classList
_notebookTopToolbarContainer style display
parent _notebookTopToolbarContainer
_notebookStickyScrollContainer document
_notebookStickyScrollContainer classList
parent _notebookStickyScrollContainer
_body document
parent _body
_body classList
_notebookOverviewRulerContainer document
_notebookOverviewRulerContainer classList
_list scrollableElement _notebookOverviewRulerContainer
instantiationService NotebookHorizontalTracker _list scrollableElement
_overflowContainer document
_overflowContainer classList
parent _overflowContainer
_fontInfo fontFamily
_styleElement domStylesheets _body
cellRightMargin
cellTopMargin
cellRunGutter
cellBottomMargin
codeCellLeftMargin
markdownCellGutter
markdownCellLeftMargin
markdownCellBottomMargin
markdownCellTopMargin
collapsedIndicatorHeight
focusIndicator
insertToolbarPosition
outputFontSize
focusIndicatorLeftMargin
focusIndicatorGap
_notebookOptions
insertToolbarAlignment
compactView
fontSize
_notebookOptions
getCellEditorContainerLeftMargin _notebookOptions
bottomToolbarGap bottomToolbarHeight _notebookOptions viewModel viewType
styleSheets
_fontInfo
fontFamily
styleSheets
compactView
styleSheets
styleSheets
focusIndicator
styleSheets
styleSheets
styleSheets
styleSheets
insertToolbarPosition insertToolbarPosition
styleSheets
styleSheets
styleSheets
styleSheets
insertToolbarAlignment
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
styleSheets
_styleElement textContent styleSheets
_body classList
_dndController _body
container HTMLElement _list contextKeyService container
_editorPool instantiationService NotebookCellEditorPool getScopedContextKeyService
renderers
instantiationService CodeCellRenderer _renderedEditors _editorPool _dndController getScopedContextKeyService
instantiationService MarkupCellRenderer _dndController _renderedEditors getScopedContextKeyService
renderers renderer
renderer
_listDelegate instantiationService NotebookCellListDelegate
_listDelegate
accessibilityProvider instantiationService NotebookAccessibilityProvider viewModel isReplHistory
accessibilityProvider
_list instantiationService
NotebookCellList
_body
_viewContext notebookOptions
_listDelegate
renderers
scopedContextKeyService
setRowLineHeight
setRowHeight
supportDynamicHeights
horizontalScrolling
keyboardSupport
mouseSupport
multipleSelectionSupport
selectionNavigation
typeNavigationEnabled
paddingTop
paddingBottom
transformOptimization
initialSize _dimension
_suffix _list
overrideStyles
listBackground notebookEditorBackground
listActiveSelectionBackground notebookEditorBackground
listActiveSelectionForeground foreground
listFocusAndSelectionBackground notebookEditorBackground
listFocusAndSelectionForeground foreground
listFocusBackground notebookEditorBackground
listFocusForeground foreground
listHoverForeground foreground
listHoverBackground notebookEditorBackground
listHoverOutline focusBorder
listFocusOutline focusBorder
listInactiveSelectionBackground notebookEditorBackground
listInactiveSelectionForeground foreground
listInactiveFocusBackground notebookEditorBackground
listInactiveFocusOutline notebookEditorBackground
accessibilityProvider
_dndController _list
_list
_listViewInfoAccessor _list
_listViewInfoAccessor
renderers
_listTopCellToolbar instantiationService ListTopCellToolbar notebookOptions
_webviewTransparentCover _list rowsContainer
_webviewTransparentCover style display
_overlayContainer e StandardMouseEvent
e target classList _webviewTransparentCover
_webviewTransparentCover style display
_overlayContainer
_webviewTransparentCover
_webviewTransparentCover style display
_list e
e element
_onMouseDown event e browserEvent target e element
_list e
e element
_onMouseUp event e browserEvent target e element
_list _e
_onDidChangeActiveEditor
_onDidChangeActiveCell
_onDidChangeFocus
_cursorNavMode
_list e
e
_list
_onDidChangeVisibleRanges
_list e
e scrollTop e oldScrollTop
_onDidScroll
e scrollTop e oldScrollTop e scrollHeightChanged
_onDidChangeLayout
_focusTracker
_focusTracker
_editorFocus
viewModel
_onDidBlurEmitter
_focusTracker
_editorFocus
viewModel
_onDidFocusEmitter
configurationService e
e accessibilityProvider verbositySettingId
_list ariaLabel accessibilityProvider
e IListContextMenuEvent CellViewModel
contextMenuService
menuId MenuId NotebookCellTitle
menuActionOptions
shouldForwardArgs
contextKeyService scopedContextKeyService
e anchor
from
_notebookOverviewRuler instantiationService NotebookOverviewRuler _notebookOverviewRulerContainer
_notebookTopToolbar instantiationService NotebookEditorWorkbenchToolbar scopedContextKeyService _notebookOptions _notebookTopToolbarContainer
_notebookTopToolbar
_dimension _isVisible
_dimension
_notebookStickyScroll instantiationService NotebookStickyScroll _notebookStickyScrollContainer _list sizeDelta
isDisposed
_dimension _isVisible
sizeDelta
_dimension
scrollTop sizeDelta
sizeDelta
scrollTop sizeDelta
_dimension
_onDidScroll
viewModel _webview
_webview
viewModel viewCells cell
cell outputsViewModels output
output pickedMimeType rendererId
output
_overlayContainer
_overflowContainer
IWebviewElement
_webview webview
editorProgressService IEditorProgressService
editorProgressService editorProgressService
parentContextKeyService IContextKeyService
scopedContextKeyService parentContextKeyService
textModel NotebookTextModel viewState INotebookEditorViewState perf NotebookPerfMarks viewType
viewModel viewModel textModel
oldBottomToolbarDimensions _notebookOptions viewModel viewType
textModel viewType textModel viewType viewState perf
newBottomToolbarDimensions _notebookOptions viewModel viewType
oldBottomToolbarDimensions bottomToolbarGap newBottomToolbarDimensions bottomToolbarGap
oldBottomToolbarDimensions bottomToolbarHeight newBottomToolbarDimensions bottomToolbarHeight
_styleElement
_webview
notebookOptions
fontFamily
owner
comment
scheme classification purpose comment
ext classification purpose comment
viewType classification purpose comment
isRepl classification purpose comment
scheme
ext
viewType
isRepl
telemetryService
scheme textModel uri scheme
ext textModel uri
viewType textModel viewType
isRepl isReplHistory
viewState
viewState
_dndController
_localStore _list
_backgroundMarkdownRenderRunning
_backgroundMarkdownRenderRunning
_backgroundMarkdownRenderRunning
deadline
deadline
deadline IdleDeadline
endTime Date deadline
_backgroundMarkdownRenderRunning
_isDisposed
viewModel
firstMarkupCell viewModel viewCells cell cell cellKind CellKind Markup _webview markupPreviewMapping cell id cell MarkupCellViewModel
firstMarkupCell
firstMarkupCell
_backgroundMarkdownRenderRunning
Date endTime
execute
viewModel
focused _list
focused
_cellContextKeyManager
_cellContextKeyManager _localStore instantiationService CellContextKeyManager focused CellViewModel
_cellContextKeyManager focused CellViewModel
options INotebookEditorOptions
options isReadOnly
_readOnly options isReadOnly
viewModel
viewModel isReadOnly _readOnly
notebookOptions _readOnly
cellOptions options cellOptions options
cellOptions
cell viewModel viewCells cell cell uri cellOptions resource
cell
cell
selection cellOptions options selection
selection
cell CellEditState Editing
cell focusMode CellFocusMode Editor
cell selection startLineNumber selection startColumn selection endLineNumber selection startLineNumber selection endColumn selection startColumn
_list cell options cellRevealType CellRevealType CenterIfOutsideViewport
editor _renderedEditors cell
editor
cellOptions options selection
selection cellOptions options
editorSelection selection startLineNumber selection startColumn selection endLineNumber selection startLineNumber selection endColumn selection startColumn
editor editorSelection
editor
lineNumber selection startLineNumber
column selection startColumn
cell editorSelection
cellOptions options preserveFocus
editor
options cellSelections
focusCellIndex options cellSelections start
focusedCell viewModel focusCellIndex
focusedCell
viewModel
kind SelectionStateType Index
focus start focusCellIndex end focusCellIndex
selections options cellSelections
focusedCell
_onDidChangeOptions
options INotebookEditorOptions
options indexedCellOptions
cell options indexedCellOptions index
cell
resource cell uri
options
selection options indexedCellOptions selection
preserveFocus
_localStore
_localCellStateListeners
_list
viewModel
viewModel
_webview
_webview element
_webview
_list
viewModel
_editorEditable viewModel options isReadOnly
_overflowContainer classList viewModel options isReadOnly
classList viewModel options isReadOnly
BackLayerWebView ICommonCellInfo
textModel
_webviewResolvePromise
_webviewResolvePromise
_webview
textModel viewType textModel uri
_webviewResolvePromise
_webview
_webview creationOptions codeWindow mainWindow
_webview webview
_localStore _webview webview
_outputFocus
_webviewFocused
_localStore _webview webview
_outputFocus
_webviewFocused
_localStore _webview e
_onDidReceiveMessage e
_webview
_webviewResolvePromise
id viewType resource
_webview
that
_webview instantiationService BackLayerWebView
that creationOptions
scrollTop that _list scrollTop scrollTop
event IMouseWheelEvent that _list event
getCellByInfo that that
getCellById that that
toggleNotebookCellSelection that that
focusNotebookCell that that
focusNextNotebookCell that that
updateOutputHeight that that
scheduleOutputHeightAck that that
updateMarkupCellHeight that that
setMarkupCellEditState that that
didStartDragMarkupCell that that
didDragMarkupCell that that
didDropMarkupCell that that
didEndDragMarkupCell that that
didResizeOutput that that
updatePerformanceMetadata that that
didFocusOutputInputChange that that
id viewType resource
_notebookOptions
fontFamily
notebookRendererMessaging _uuid
_webview element style width
_list _webview element
textModel NotebookTextModel viewType viewState INotebookEditorViewState perf NotebookPerfMarks
textModel viewType textModel uri
viewModel instantiationService NotebookViewModel viewType textModel _viewContext isReadOnly _readOnly
_viewContext eventDispatcher width fontInfo
notebookOptions _readOnly
viewModel viewState
contributionsState viewState contributionsState
id contribution _contributions
contribution restoreViewState
contribution contributionsState id
_localStore viewModel e
_onDidChangeViewCells e
_localStore viewModel
_onDidChangeSelection
_localStore _list e
_webview
_webviewTransparentCover style transform
hasPendingChangeContentHeight
_localStore _list
hasPendingChangeContentHeight
hasPendingChangeContentHeight
_localStore
hasPendingChangeContentHeight
_localStore _list outputs
outputs output output
_localStore _list outputs
outputs output output
_localStore _list cells
hiddenCells MarkupCellViewModel
deletedCells MarkupCellViewModel
cell cells
cell cellKind CellKind Markup
mdCell cell MarkupCellViewModel
viewModel viewCells cell cell handle mdCell handle
hiddenCells mdCell
deletedCells mdCell
hiddenCells
deletedCells
viewModel viewState perf
perf
_localCellStateListeners viewModel viewCells cell cell
_lastCellWithEditorFocus viewModel viewCells viewCell viewCell viewCell focusMode CellFocusMode Editor
_localStore viewModel e
_isDisposed
e splices splice
start deleted newCells splice
deletedCells _localCellStateListeners start deleted newCells cell cell
deletedCells
e splices s s cell cell cellKind CellKind Markup
_dimension
_list _dimension height _dimension width
_list
_dndController
viewState
cell ICellViewModel
store
store cell e
e totalHeight e outerWidth
cell cell layoutInfo totalHeight e context
cell cellKind CellKind Code
store cell CodeCellViewModel outputs
outputs output output
store cell CellViewModel e
e inputCollapsedChanged cell isInputCollapsed cell cellKind CellKind Markup
cell MarkupCellViewModel
e outputCollapsedChanged cell isOutputCollapsed cell cellKind CellKind Code
cell outputsViewModels output output
e focusModeChanged
cell
store cell e
e added options
options className
cell id options className cell cellKind
options outputClassName
cell id options outputClassName cell cellKind
e removed options
options className
cell id options className cell cellKind
options outputClassName
cell id options outputClassName cell cellKind
store
_lastCellWithEditorFocus ICellViewModel
cell ICellViewModel
cell focusMode CellFocusMode Editor
_lastCellWithEditorFocus _lastCellWithEditorFocus cell
_lastCellWithEditorFocus focusMode CellFocusMode Container
_lastCellWithEditorFocus cell
viewModel NotebookViewModel viewState INotebookEditorViewState perf NotebookPerfMarks
logService viewModel uri
perf
logService
_webview element style visibility
viewModel viewState
logService
_list
_list viewModel
_list scrollTop viewState scrollPosition top
_webview element style visibility
logService
_onDidAttachViewModel
viewModel NotebookViewModel viewState INotebookEditorViewState
viewState viewState cellTotalHeights
totalHeightCache viewState cellTotalHeights
scrollTop viewState scrollPosition top
scrollBottom scrollTop Math _dimension height
offset
requests ICellViewModel
i i viewModel length i
cell viewModel i
cellHeight totalHeightCache i
offset cellHeight scrollTop
offset cellHeight
cell cellKind CellKind Markup
requests cell offset
offset cellHeight
offset scrollBottom
_webview requests model offset model offset
initRequests viewModel viewCells
cell cell cellKind CellKind Markup
cell cell
_webview initRequests
offset
offsetUpdateRequests id top
scrollBottom Math _dimension height
cell viewModel viewCells
cell cellKind CellKind Markup
offsetUpdateRequests id cell id top offset
offset cell fontInfo lineHeight
offset scrollBottom
_webview offsetUpdateRequests
model ICellViewModel offset IMarkupCellInitialization
mime model mime
cellId model id
cellHandle model handle
content model
offset offset
visible
metadata model metadata
viewState INotebookEditorViewState
viewModel
viewState scrollPosition
_list scrollTop viewState scrollPosition top
_list scrollLeft viewState scrollPosition left
_list scrollTop
_list scrollLeft
focusIdx viewState focus viewState focus
focusIdx viewModel length
element viewModel focusIdx
element
viewModel
kind SelectionStateType Handle
primary element handle
selections element handle
_list length
viewModel
kind SelectionStateType Index
focus start end
selections start end
viewState editorFocused
cell viewModel focusIdx
cell
cell focusMode CellFocusMode Editor
viewState INotebookEditorViewState
viewState selectedKernelId textModel
matching notebookKernelService textModel
kernel matching all k k id viewState selectedKernelId
kernel matching selected
notebookKernelService kernel textModel
INotebookEditorViewState
state viewModel
state
editingCells
cellLineNumberStates
editorViewStates
collapsedInputCells
collapsedOutputCells
_list
state scrollPosition left _list scrollLeft top _list scrollTop
cellHeights key
i i viewModel length i
elm viewModel i CellViewModel
cellHeights i elm layoutInfo totalHeight
state cellTotalHeights cellHeights
viewModel
focusRange viewModel
element viewModel focusRange start
element
itemDOM _list element
editorFocused element CellEditState Editing itemDOM itemDOM ownerDocument activeElement itemDOM itemDOM ownerDocument activeElement
state editorFocused editorFocused
state focus focusRange start
contributionsState key
id contribution _contributions
contribution saveViewState
contributionsState id contribution
state contributionsState contributionsState
textModel uri scheme Schemas untitled
state selectedKernelId activeKernel id
state
_scrollBeyondLastLine isReplHistory
dimensionHeight
Math dimensionHeight _notebookTopToolbar useGlobalToolbar
dimension Dimension shadowElement HTMLElement position IDomPosition
shadowElement _shadowElementViewInfo
_dimension dimension
_position position
dimension width dimension height
whenContainerStylesLoaded layoutService
whenContainerStylesLoaded
whenContainerStylesLoaded dimension shadowElement position
dimension shadowElement position
dimension Dimension shadowElement HTMLElement position IDomPosition
shadowElement
shadowElement dimension position
_shadowElementViewInfo _shadowElementViewInfo width _shadowElementViewInfo height
_dimension dimension
_position position
newBodyHeight dimension height stickyHeight
_body dimension width newBodyHeight
newCellListHeight newBodyHeight
_list newCellListHeight
_list paddingBottom Math newCellListHeight paddingTop
_list newCellListHeight dimension width
_list newCellListHeight dimension width
_list paddingBottom Math newCellListHeight paddingTop
_overlayContainer inert
_overlayContainer style visibility
_overlayContainer style display
_overlayContainer style position
_overlayContainer style overflow
dimension position
_webviewTransparentCover
_webviewTransparentCover style height
_webviewTransparentCover style width
_notebookTopToolbar _dimension
_notebookOverviewRuler
_viewContext eventDispatcher width fontInfo
shadowElement HTMLElement dimension IDimension position IDomPosition
_shadowElement shadowElement
dimension position
_shadowElementViewInfo
height dimension height
width dimension width
top position top
left position left
containerRect shadowElement
_shadowElementViewInfo
height containerRect height
width containerRect width
top containerRect top
left containerRect left
dimension Dimension position IDomPosition
dimension position
_overlayContainer style top
_overlayContainer style left
_overlayContainer style width
_overlayContainer style height
_shadowElementViewInfo
elementContainerRect _overlayContainer parentElement
_overlayContainer style top
_overlayContainer style left
_overlayContainer style width
_overlayContainer style height
_isVisible
_editorFocus
_webviewFocused
_webview
viewModel
focusRange viewModel
element viewModel focusRange start
element element focusMode CellFocusMode Editor
element CellEditState Editing
element focusMode CellFocusMode Editor
element
_list
_currentProgress
_isVisible
activeElement CellViewModel
element editor _renderedEditors
element activeElement
editor
clearSelection
_webviewFocused
_webview
_list clearSelection
cell ICellViewModel
_webview cell
cell ICellViewModel
_webview cell
_isVisible
_editorFocus
_overlayContainer inert
_overlayContainer style visibility
_overlayContainer style left
_notebookTopToolbarContainer style display
_renderedEditors editor cell
cell editor
SuggestController editor
DropIntoEditorController editor
CopyPasteController editor
_renderedEditors editor cell
controller InlineCompletionsController editor
controller model inlineEditState
editor
_focusTracker
focused
_editorFocus focused
viewModel focused
activeCell
activeCell focusMode CellFocusMode Output _webviewFocused
activeCell focusMode CellFocusMode Container
_webviewFocused
windowSelection
windowSelection rangeCount
activeSelection windowSelection
activeSelection startContainer activeSelection endContainer activeSelection endOffset activeSelection startOffset
container activeSelection commonAncestorContainer
_body container
container
container _body
container HTMLElement classList container HTMLElement classList
container container parentNode
hasFocus
_outputInputFocus hasFocus
cell ICellViewModel
viewModel
kind SelectionStateType Handle
primary cell handle
selections cell handle
_list scrollTop
_list scrollTop _list
cell ICellViewModel
_list cell
cell ICellViewModel
_list cell
_list
scrollTop
_list scrollTop scrollTop
range ICellRange
_list range
cell ICellViewModel
_list cell CellRevealType Default
cell ICellViewModel
_list cell CellRevealType Top
cell ICellViewModel
_list cell CellRevealType Center
cell ICellViewModel
_list cell CellRevealType CenterIfOutsideViewport
cell ICellViewModel
_list cell CellRevealType FirstLineIfOutsideViewport
cell ICellViewModel line
_list cell line line CellRevealRangeType Default
cell ICellViewModel line
_list cell line line CellRevealRangeType Center
cell ICellViewModel line
_list cell line line CellRevealRangeType CenterIfOutsideViewport
cell ICellViewModel range Selection Range
_list cell range CellRevealRangeType Default
cell ICellViewModel range Selection Range
_list cell range CellRevealRangeType Center
cell ICellViewModel range Selection Range
_list cell range CellRevealRangeType CenterIfOutsideViewport
cell ICellViewModel offset
_list cell offset
offset
_list offset
index
_listViewInfoAccessor
cell viewModel viewCells index
cell
_listViewInfoAccessor cell
cell ICellViewModel
_listViewInfoAccessor
_listViewInfoAccessor cell
startIndex endIndex ICellRange
_listViewInfoAccessor startIndex endIndex
range ICellRange ReadonlyArray ICellViewModel
_listViewInfoAccessor range
cell ICellViewModel range Range
_list cell range
_ranges ICellRange
_list _ranges
ICellRange
_listViewInfoAccessor
oldDecorations newDecorations INotebookDeltaDecoration
ret viewModel oldDecorations newDecorations
_onDidChangeDecorations
ret
cellId added removed cellkind CellKind
cellkind CellKind Markup
_webview cellId added removed
_webview cellId added removed
changeAccessor IModelDecorationsChangeAccessor
viewModel callback
accessor INotebookViewZoneChangeAccessor
_list callback
_onDidChangeLayout
id top height
_list id
accessor INotebookCellOverlayChangeAccessor
_list callback
selected notebookKernelService textModel
_webview
_webview selected
textModel notebookKernelService textModel
cells Iterable ICellViewModel
viewModel
cells
cells viewModel viewCells
notebookExecutionService textModel cells cell cell handle
cells Iterable ICellViewModel
viewModel
logService
cells
cells viewModel viewCells
notebookExecutionService textModel cells c c model scopedContextKeyService
_pendingLayouts WeakMap ICellViewModel IDisposable
_layoutDisposables Set IDisposable
cell ICellViewModel height context CellLayoutContext
cell handle height
viewIndex _list cell
viewIndex
_pendingLayouts cell
_pendingLayouts cell
deferred
_isDisposed
viewModel cell
_list cell
_list cell height
pendingLayout _pendingLayouts cell
_pendingLayouts cell
cellIndex viewModel cell
visibleRanges visibleRanges
cellIndex
visibleRanges visibleRanges length visibleRanges start cellIndex
_list scrollTop cell
_list cell height Math cellIndex
_list cell height
deferred
pendingLayout
pendingLayout
_layoutDisposables pendingLayout
_list inRenderingTransaction
layoutDisposable doLayout
disposable
layoutDisposable
deferred
_pendingLayouts cell disposable
_layoutDisposables disposable
deferred p
elements _list
elements elements length
elements
selectedCell ICellViewModel selectFromPrevious
currentSelections _list
isSelected currentSelections selectedCell
previousSelection selectFromPrevious currentSelections currentSelections length selectedCell selectedCell
selectedIndex _list selectedCell
previousIndex _list previousSelection
cellsInSelectionRange selectedIndex previousIndex
isSelected
_list currentSelections current cellsInSelectionRange current
selectedCell
_list currentSelections current cellsInSelectionRange current cellsInSelectionRange
fromInclusive toInclusive ICellViewModel
selectedCellsInRange ICellViewModel
index index _list length index
cell _list index
cell
index fromInclusive index toInclusive index toInclusive index fromInclusive
selectedCellsInRange cell
selectedCellsInRange
cell ICellViewModel focusItem options IFocusNotebookCellOptions
_isDisposed
cell focusedOutputId
focusItem
cell isInputCollapsed
cell
_list
cell CellEditState Editing
cell focusMode CellFocusMode Editor
options skipReveal
options focusEditorLine
_cursorNavMode
cell options focusEditorLine
editor _renderedEditors cell
focusEditorLine options focusEditorLine
editor
startLineNumber focusEditorLine
startColumn
endLineNumber focusEditorLine
endColumn
selectionsStartPosition cell
selectionsStartPosition length
firstSelectionPosition selectionsStartPosition
cell Range firstSelectionPosition firstSelectionPosition
cell
focusItem
cell
_list
_webview
firstOutputId cell outputsViewModels o o model alternativeOutputId model alternativeOutputId
focusElementId options outputId firstOutputId cell id
_webview focusElementId options altOutputId options outputWebviewFocused _webviewFocused
cell CellEditState Preview
cell focusMode CellFocusMode Output
cell focusedOutputId options outputId
_outputFocus
options skipReveal
cell
itemDOM _list cell
itemDOM itemDOM ownerDocument activeElement itemDOM itemDOM ownerDocument activeElement
itemDOM ownerDocument activeElement HTMLElement
_webview
cell CellEditState Preview
cell focusMode CellFocusMode Container
cell
options skipReveal
options focusEditorLine
_cursorNavMode
cell
options revealBehavior ScrollToRevealBehavior firstLine
cell
options revealBehavior ScrollToRevealBehavior fullCell
cell
cell
_list
cell ICellViewModel focusItem
idx viewModel cell
idx
newCell viewModel idx
newCell
newCell focusItem
viewCell CodeCellViewModel
viewCell isOutputCollapsed
outputs viewCell outputsViewModels
output outputs outputDisplayLimit
mimeTypes pick output textModel
mimeTypes mimeType mimeType isTrusted mimeTypes length
pickedMimeTypeRenderer mimeTypes pick
pickedMimeTypeRenderer
renderer _notebookService pickedMimeTypeRenderer rendererId
renderer
result IInsetRenderOutput type RenderOutputType Extension renderer source output mimeType pickedMimeTypeRenderer mimeType
inset _webview insetMapping result source
inset inset initialized
p resolve
Event onDidRenderOutput onDidRemoveOutput e
e model result source model
viewCell result
p
viewCell result
includeOutput
viewModel
cells viewModel viewCells
requests
i i cells length i
cells i cellKind CellKind Markup _webview markupPreviewMapping cells i id
requests cells i
includeOutput _list
i i _list length i
cell _list i
cell cellKind CellKind Code
requests cell CodeCellViewModel
requests
includeOutput selectedCellRanges ICellRange
viewModel
cells viewModel viewCells
requests
range selectedCellRanges
i range start i range end i
cells i cellKind CellKind Markup _webview markupPreviewMapping cells i id
requests cells i
includeOutput _list
range selectedCellRanges
i range start i range end i
cell _list i
cell cellKind CellKind Code
requests cell CodeCellViewModel
requests
query options INotebookFindOptions token CancellationToken skipWarmup shouldGetSearchPreviewInfo ownerID CellFindMatchWithIndex
_notebookViewModel
ownerID
ownerID
findMatches _notebookViewModel query options match match length
options includeMarkupPreview options includeOutput options findScope findScopeType NotebookFindScopeType Text
_webview ownerID
findMatches
matchMap key CellFindMatchWithIndex
findMatches match
matchMap match cell id match
_webview
start Date
options findScope options findScope findScopeType NotebookFindScopeType Cells options findScope selectedCellRanges
options includeOutput options findScope selectedCellRanges
options includeOutput
end Date
logService
token isCancellationRequested
findIds
options findScope options findScope findScopeType NotebookFindScopeType Cells options findScope selectedCellRanges
selectedIndexes options findScope selectedCellRanges
findIds selectedIndexes index _notebookViewModel viewCells index id
webviewMatches _webview query caseSensitive options caseSensitive wholeWord options wholeWord includeMarkup options includeMarkupPreview includeOutput options includeOutput shouldGetSearchPreviewInfo ownerID findIds findIds
token isCancellationRequested
webviewMatches match
cell _notebookViewModel viewCells cell cell id match cellId
cell
match type
cell CellEditState Preview options includeMarkupPreview
cell CellEditState Editing options includeMarkupInput
options includeOutput
exisitingMatch matchMap match cellId
exisitingMatch
exisitingMatch webviewMatches match
matchMap match cellId
_notebookViewModel viewCells cell cell id match cellId
_notebookViewModel viewCells cell cell id match cellId
match
ret CellFindMatchWithIndex
_notebookViewModel viewCells cell index
matchMap cell id
ret cell index matchMap cell id contentMatches matchMap cell id webviewMatches
ret
matchIndex ownerID
_webview
_webview matchIndex ownerID
matchIndex ownerID
_webview
_webview matchIndex ownerID
ownerID
_webview ownerID
NotebookLayoutInfo
_list
_fontInfo
width _dimension width
height _dimension height
scrollHeight _list
fontInfo _fontInfo
stickyHeight _notebookStickyScroll
cell MarkupCellViewModel
_webview
_webview
_webview _list webviewElement
viewModel _list viewModel
viewModel cell
cell
webviewTop _list webviewElement domNode style top
top webviewTop webviewTop
cellTop _list cell
_webview
mime cell mime
cellHandle cell handle
cellId cell id
content cell
offset cellTop top
visible
metadata cell metadata
cell ICellViewModel
modelIndex viewModel cell
foldedRanges viewModel
foldedRanges range modelIndex range start modelIndex range end
cells MarkupCellViewModel
_webview
_webview
_webview cells cell cell id
cells MarkupCellViewModel
_webview cells length
_webview
_webview cells cell cell id
cells MarkupCellViewModel
_webview
_webview
_webview cells cell cell id
_webview
_webview
selectedCells cell cell id
_webview selectedCells length selectedCells
cell CodeCellViewModel output IInsetRenderOutput offset createWhenIdle
_insetModifyQueueByOutputId output source model outputId
_isDisposed _webview
_webview
_webview
_list webviewElement
output type RenderOutputType Extension
notebookRendererMessaging output renderer id
webviewTop _list webviewElement domNode style top
top webviewTop webviewTop
cellTop _list cell top
existingOutput _webview insetMapping output source
existingOutput
existingOutput renderer output type RenderOutputType Extension
createWhenIdle
_webview cellId cell id cellHandle cell handle cellUri cell uri executionId cell internalMetadata executionId output cellTop offset
_webview cellId cell id cellHandle cell handle cellUri cell uri executionId cell internalMetadata executionId output cellTop offset
existingOutput renderer
output type RenderOutputType Extension
existingOutput renderer id output renderer id
_webview output source
_webview cellId cell id cellHandle cell handle cellUri cell uri output cellTop offset
existingOutput versionId output source model versionId
_webview cellId cell id cellHandle cell handle cellUri cell uri executionId cell internalMetadata executionId output cellTop offset
outputIndex cell outputsViewModels output source
outputOffset cell outputIndex
_webview
cell
output output source
cellTop
outputOffset
forceDisplay cell isOutputCollapsed
cell CodeCellViewModel output IInsetRenderOutput offset
_insetModifyQueueByOutputId output source model outputId
_isDisposed _webview cell isOutputCollapsed
_webview
_webview _list webviewElement
_webview insetMapping output source
cell output offset
output type RenderOutputType Extension
notebookRendererMessaging output renderer id
webviewTop _list webviewElement domNode style top
top webviewTop webviewTop
cellTop _list cell top
_webview cellId cell id cellHandle cell handle cellUri cell uri output cellTop offset
cellOutput ICellOutputViewModel
_webview cellOutput
output ICellOutputViewModel
_insetModifyQueueByOutputId output model outputId
_isDisposed _webview
_webview
_webview output
_onDidRemoveOutput output
output ICellOutputViewModel
_insetModifyQueueByOutputId output model outputId
_isDisposed _webview
_webview
_webview output
message
_webview
_webview message
className
_overlayContainer classList className
className
_overlayContainer classList className
index ICellViewModel
viewModel index
cellInfo ICommonCellInfo ICellViewModel
cellHandle cellInfo
viewModel viewCells vc vc handle cellHandle CodeCellViewModel
handle ICellViewModel
viewModel handle
cell ICellViewModel
viewModel cell handle
index
viewModel index
index
viewModel index
_isDisposed _webview
_list webviewElement
scrollHeight _list scrollHeight
_webview element style height
webviewTop _list webviewElement domNode style top
top webviewTop webviewTop
updateItems IDisplayOutputLayoutUpdateRequest
removedItems ICellOutputViewModel
_webview insetMapping value key
cell viewModel value cellInfo cellHandle
cell cell
viewModel viewCells cell cell handle value cellInfo cellHandle
viewIndex _list cell
viewIndex
cell outputsViewModels key
removedItems key
cellTop _list cell
outputIndex cell outputsViewModels key
outputOffset cell outputIndex
updateItems
cell
output key
cellTop cellTop top
outputOffset
forceDisplay
_webview removedItems
markdownUpdateItems id top
cellId _webview markupPreviewMapping
cell viewModel viewCells cell cell id cellId
cell
cellTop _list cell
markdownUpdateItems id cellId top cellTop top
markdownUpdateItems length updateItems length
markdownUpdateItems
_webview updateItems markdownUpdateItems
cellInfo ICommonCellInfo output ICellOutputViewModel outputHeight isInit source
cell viewModel viewCells vc vc handle cellInfo cellHandle
cell cell
outputIndex cell outputsViewModels output
outputIndex
cell handle outputHeight
cell outputIndex outputHeight source
cell cell layoutInfo totalHeight
isInit
_onDidRenderOutput output
_pendingOutputHeightAcks
cellInfo ICommonCellInfo outputId height
wasEmpty _pendingOutputHeightAcks size
_pendingOutputHeightAcks outputId cellId cellInfo cellId outputId height
wasEmpty
_webview _pendingOutputHeightAcks
_pendingOutputHeightAcks
cellId ICellViewModel
viewModel viewCells vc vc id cellId
cellId height isInit
cell cellId
cell cell
bottomToolbarGap _notebookOptions viewModel viewType
cell handle height bottomToolbarGap isInit
cell renderedMarkdownHeight height
cellId editState CellEditState
cell cellId
cell
cell
cell editState
cellId event dragOffsetY
cell cellId
cell
webviewOffset _list webviewElement _list webviewElement domNode style top
_dndController cell event dragOffsetY webviewOffset
cellId event dragOffsetY
cell cellId
cell
webviewOffset _list webviewElement _list webviewElement domNode style top
_dndController cell event dragOffsetY webviewOffset
cellId event dragOffsetY ctrlKey altKey
cell cellId
cell
webviewOffset _list webviewElement _list webviewElement domNode style top
event dragOffsetY webviewOffset
_dndController cell event
cellId
cell cellId
cell
_dndController cell
cellId
cell cellId
cell
_onDidResizeOutputEmitter cell
cellId executionId duration rendererId
cell cellId
cellIndex cell cell
cell internalMetadata executionId executionId cellIndex
renderDurationMap cell internalMetadata renderDuration
renderDurationMap rendererId renderDurationMap rendererId duration
textModel
editType CellEditType PartialInternalMetadata
index cellIndex
internalMetadata
executionId executionId
renderDuration renderDurationMap
id
_contributions id
override
_isDisposed
_webview
_webview
_layoutDisposables d d
notebookEditorService
_contributions
_contributions
_localStore
_localCellStateListeners
_list
_listTopCellToolbar
_overlayContainer
viewModel
_renderedEditors
_baseCellEditorOptions v v
_baseCellEditorOptions
_notebookOverviewRulerContainer
_webview
_webviewResolvePromise
_webviewTransparentCover
_dndController
_listTopCellToolbar
_notebookViewModel
_cellContextKeyManager
_notebookTopToolbar
_list
_listViewInfoAccessor
_pendingLayouts
_listDelegate
notebookUri
notebookUri viewModel uri
ZIndex Base
ZIndex Base
ZIndex Base
ZIndex Base
ZIndex Base
ZIndex Base
ZIndex Base
ZIndex Base
ZIndex Base
ZIndex Base
ZIndex Base
ZIndex Sash
ZIndex Sash
ZIndex Sash
notebookCellBorder
dark listInactiveSelectionBackground
light listInactiveSelectionBackground
hcDark
hcLight
nls
focusedEditorBorderColor focusBorder nls
cellStatusIconSuccess debugIconStartForeground nls
runningCellRulerDecorationColor debugIconStartForeground nls
cellStatusIconError errorForeground nls
cellStatusIconRunning foreground nls
notebookOutputContainerBorderColor nls
notebookOutputContainerColor nls
dark Color
light Color
hcDark contrastBorder
hcLight contrastBorder
nls
focusedCellBackground nls
selectedCellBackground
dark listInactiveSelectionBackground
light listInactiveSelectionBackground
hcDark
hcLight
nls
cellHoverBackground
dark focusedCellBackground
light focusedCellBackground
hcDark
hcLight
nls
selectedCellBorder
dark notebookCellBorder
light notebookCellBorder
hcDark contrastBorder
hcLight contrastBorder
nls
inactiveSelectedCellBorder
dark
light
hcDark focusBorder
hcLight focusBorder
nls
focusedCellBorder focusBorder nls
inactiveFocusedCellBorder notebookCellBorder nls
cellStatusBarItemHover
light
dark
hcDark
hcLight
nls
cellInsertionIndicator focusBorder nls
listScrollbarSliderBackground scrollbarSliderBackground nls
listScrollbarSliderHoverBackground scrollbarSliderHoverBackground nls
listScrollbarSliderActiveBackground scrollbarSliderActiveBackground nls
cellSymbolHighlight
dark Color
light Color
hcDark
hcLight
nls
cellEditorBackground
light
dark
hcDark
hcLight
nls
notebookEditorBackground
light
dark
hcDark
hcLight
nls
import
{
}
from
'../../../../base/common/cancellation.js'
;
import
{
,
RGBA
}
from
'../../../../base/common/color.js'
;
import
{
}
from
'../../../../base/common/errors.js'
;
import
{
,
}
from
'../../../../base/common/event.js'
;
import
{
,
,
,
,
,
}
from
'../../../../base/common/lifecycle.js'
;
import
{
}
from
'../../../../base/common/network.js'
;
import
{
}
from
'../../../../base/common/platform.js'
;
import
{
,
}
from
'../../../../base/common/resources.js'
;
import
{
URI
}
from
'../../../../base/common/uri.js'
;
import
{
}
from
'../../../../base/common/uuid.js'
;
import
{
}
from
'../../../../editor/browser/config/fontMeasurements.js'
;
import
{
}
from
'../../../../editor/browser/editorBrowser.js'
;
import
{
}
from
'../../../../editor/browser/editorExtensions.js'
;
import
{
}
from
'../../../../editor/common/config/editorOptions.js'
;
import
{
,
}
from
'../../../../editor/common/config/fontInfo.js'
;
import
{
}
from
'../../../../editor/common/core/dimension.js'
;
import
{
}
from
'../../../../editor/common/core/range.js'
;
import
{
}
from
'../../../../editor/common/core/selection.js'
;
import
{
}
from
'../../../../editor/contrib/dropOrPasteInto/browser/copyPasteController.js'
;
import
{
}
from
'../../../../editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js'
;
import
{
}
from
'../../../../editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js'
;
import
{
}
from
'../../../../editor/contrib/suggest/browser/suggestController.js'
;
import
*
as
from
'../../../../nls.js'
;
import
{
}
from
'../../../../platform/actions/common/actions.js'
;
import
{
}
from
'../../../../platform/configuration/common/configuration.js'
;
import
{
,
,
}
from
'../../../../platform/contextkey/common/contextkey.js'
;
import
{
}
from
'../../../../platform/contextview/browser/contextView.js'
;
import
{
}
from
'../../../../platform/instantiation/common/instantiation.js'
;
import
{
}
from
'../../../../platform/instantiation/common/serviceCollection.js'
;
import
{
}
from
'../../../../platform/layout/browser/layoutService.js'
;
import
{
,
}
from
'../../../../platform/layout/browser/zIndexRegistry.js'
;
import
{
,
}
from
'../../../../platform/progress/common/progress.js'
;
import
{
}
from
'../../../../platform/telemetry/common/telemetry.js'
;
import
{
,
,
,
,
,
,
,
,
,
}
from
'../../../../platform/theme/common/colorRegistry.js'
;
import
{
}
from
'../../../browser/codeeditor.js'
;
import
{
EDITOR_PANE_BACKGROUND
,
PANEL_BORDER
,
SIDE_BAR_BACKGROUND
}
from
'../../../common/theme.js'
;
import
{
}
from
'../../../services/editor/common/editorGroupsService.js'
;
import
{
}
from
'../../debug/browser/debugColors.js'
;
import
{
}
from
'../../webview/browser/webview.contribution.js'
;
import
{
}
from
'../../webview/browser/webview.js'
;
import
{
}
from
'../common/model/notebookTextModel.js'
;
import
{
,
,
,
,
RENDERER_NOT_AVAILABLE
,
}
from
'../common/notebookCommon.js'
;
import
{
NOTEBOOK_CURSOR_NAVIGATION_MODE
,
NOTEBOOK_EDITOR_EDITABLE
,
NOTEBOOK_EDITOR_FOCUSED
,
NOTEBOOK_OUTPUT_FOCUSED
,
NOTEBOOK_OUTPUT_INPUT_FOCUSED
}
from
'../common/notebookContextKeys.js'
;
import
{
}
from
'../common/notebookExecutionService.js'
;
import
{
}
from
'../common/notebookKernelService.js'
;
import
{
}
from
'../common/notebookLoggingService.js'
;
import
{
}
from
'../common/notebookPerformance.js'
;
import
{
,
}
from
'../common/notebookRange.js'
;
import
{
}
from
'../common/notebookRendererMessagingService.js'
;
import
{
}
from
'../common/notebookService.js'
;
import
{
}
from
'./contrib/find/findModel.js'
;
import
'./media/notebook.css'
;
import
'./media/notebookCellChat.css'
;
import
'./media/notebookCellEditorHint.css'
;
import
'./media/notebookCellInsertToolbar.css'
;
import
'./media/notebookCellOutput.css'
;
import
'./media/notebookCellStatusBar.css'
;
import
'./media/notebookCellTitleToolbar.css'
;
import
'./media/notebookChatEditController.css'
;
import
'./media/notebookChatEditorOverlay.css'
;
import
'./media/notebookDnd.css'
;
import
'./media/notebookEditorStickyScroll.css'
;
import
'./media/notebookFocusIndicator.css'
;
import
'./media/notebookFolding.css'
;
import
'./media/notebookKernelActionViewItem.css'
;
import
'./media/notebookOutline.css'
;
import
'./media/notebookToolbar.css'
;
import
{
}
from
'./notebookAccessibilityProvider.js'
;
import
{
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
}
from
'./notebookBrowser.js'
;
import
{
}
from
'./notebookEditorExtensions.js'
;
import
{
}
from
'./notebookLogger.js'
;
import
{
,
}
from
'./notebookOptions.js'
;
import
{
,
,
}
from
'./notebookViewEvents.js'
;
import
{
}
from
'./services/notebookEditorService.js'
;
import
{
}
from
'./view/cellParts/cellContextKeys.js'
;
import
{
}
from
'./view/cellParts/cellDnd.js'
;
import
{
}
from
'./view/notebookCellEditorPool.js'
;
import
{
,
NOTEBOOK_WEBVIEW_BOUNDARY
,
}
from
'./view/notebookCellList.js'
;
import
{
}
from
'./view/notebookRenderingCommon.js'
;
import
{
}
from
'./view/renderers/backLayerWebView.js'
;
import
{
,
,
}
from
'./view/renderers/cellRenderer.js'
;
import
{
,
}
from
'./view/renderers/webviewMessages.js'
;
import
{
}
from
'./viewModel/cellEditorOptions.js'
;
import
{
,
}
from
'./viewModel/codeCellViewModel.js'
;
import
{
}
from
'./viewModel/eventDispatcher.js'
;
import
{
}
from
'./viewModel/markupCellViewModel.js'
;
import
{
,
}
from
'./viewModel/notebookViewModelImpl.js'
;
import
{
}
from
'./viewModel/viewContext.js'
;
import
{
}
from
'./viewParts/notebookEditorStickyScroll.js'
;
import
{
}
from
'./viewParts/notebookEditorToolbar.js'
;
import
{
}
from
'./viewParts/notebookEditorWidgetContextKeys.js'
;
import
{
}
from
'./viewParts/notebookHorizontalTracker.js'
;
import
{
}
from
'./viewParts/notebookOverviewRuler.js'
;
import
{
}
from
'./viewParts/notebookTopCellToolbar.js'
;
const
=
DOM
.
;
export
function
getDefaultNotebookCreationOptions
(
)
:
{
const
=
[
'editor.contrib.review'
,
.
ID
,
'editor.contrib.dirtydiff'
,
'editor.contrib.testingOutputPeek'
,
'editor.contrib.testingDecorations'
,
'store.contrib.stickyScrollController'
,
'editor.contrib.findController'
,
'editor.contrib.emptyTextEditorHint'
]
;
const
=
.
getEditorContributions
(
)
.
filter
(
=>
.
indexOf
(
.
)
===
-
1
)
;
return
{
:
{
:
.
,
:
.
,
:
.
,
:
.
,
:
.
,
:
.
,
:
.
,
}
,
:
}
;
}
export
class
NotebookEditorWidget
extends
Disposable
implements
INotebookEditorDelegate
,
{
private
readonly
=
this
.
_register
(
new
Emitter< NotebookCellStateChangedEvent>
(
)
)
;
readonly
=
this
.
.
;
private
readonly
=
this
.
_register
(
new
Emitter< INotebookViewCellsUpdateEvent>
(
)
)
;
readonly
:
<
>
=
this
.
.
;
private
readonly
=
this
.
_register
(
new
Emitter< NotebookTextModel | undefined >
(
)
)
;
readonly
:
<
|
undefined
>
=
this
.
.
;
private
readonly
=
this
.
_register
(
new
Emitter< NotebookTextModel | undefined >
(
)
)
;
readonly
:
<
|
undefined
>
=
this
.
.
;
private
readonly
=
this
.
_register
(
new
Emitter< void >
(
)
)
;
readonly
:
<
void
>
=
this
.
.
;
private
readonly
=
this
.
_register
(
new
Emitter< void >
(
)
)
;
readonly
:
<
void
>
=
this
.
.
;
private
readonly
=
this
.
_register
(
new
Emitter< void >
(
)
)
;
readonly
:
<
void
>
=
this
.
.
;
private
readonly
=
this
.
_register
(
new
Emitter< void >
(
)
)
;
readonly
:
<
void
>
=
this
.
.
;
private
readonly
=
this
.
_register
(
new
Emitter< void >
(
)
)
;
readonly
:
<
void
>
=
this
.
.
;
private
readonly
=
this
.
_register
(
new
Emitter< void >
(
)
)
;
readonly
:
<
void
>
=
this
.
.
;
private
readonly
=
this
.
_register
(
new
Emitter< void >
(
)
)
;
readonly
:
<
void
>
=
this
.
.
;
private
readonly
=
this
.
_register
(
new
Emitter< void >
(
)
)
;
readonly
:
<
void
>
=
this
.
.
;
private
readonly
=
this
.
_register
(
new
Emitter< void >
(
)
)
;
readonly
:
<
void
>
=
this
.
.
;
private
readonly
=
this
.
_register
(
new
Emitter< void >
(
)
)
;
readonly
=
this
.
.
;
private
readonly
=
this
.
_register
(
new
Emitter< void >
(
)
)
;
readonly
=
this
.
.
;
private
readonly
=
this
.
_register
(
new
Emitter< this >
(
)
)
;
readonly
:
<
this
>
=
this
.
.
;
private
readonly
=
this
.
_register
(
new
Emitter< void >
(
)
)
;
readonly
:
<
void
>
=
this
.
.
;
private
readonly
:
<
>
=
this
.
_register
(
new
Emitter< INotebookEditorMouseEvent>
(
)
)
;
readonly
:
<
>
=
this
.
.
;
private
readonly
:
<
>
=
this
.
_register
(
new
Emitter< INotebookEditorMouseEvent>
(
)
)
;
readonly
:
<
>
=
this
.
.
;
private
readonly
=
this
.
_register
(
new
Emitter< INotebookWebviewMessage>
(
)
)
;
readonly
:
<
>
=
this
.
.
;
private
readonly
=
this
.
_register
(
new
Emitter< ICellOutputViewModel>
(
)
)
;
private
readonly
=
this
.
.
;
private
readonly
=
this
.
_register
(
new
Emitter< ICellOutputViewModel>
(
)
)
;
private
readonly
=
this
.
.
;
private
readonly
=
this
.
_register
(
new
Emitter< ICellViewModel>
(
)
)
;
readonly
=
this
.
.
;
private
!
:
;
private
!
:
;
private
!
:
;
private
!
:
;
private
!
:
;
private
!
:
;
private
!
:
;
private
!
:
;
private
!
:
;
private
!
:
;
private
:
<
>
|
null
=
null
;
private
:
Promise
<
<
>
|
null
>
|
null
=
null
;
private
:
|
null
=
null
;
private
:
|
null
=
null
;
private
!
:
;
private
!
:
;
private
:
|
null
=
null
;
private
:
|
null
=
null
;
private
:
<
,
>
=
new
Map
(
)
;
private
!
:
;
private
:
;
private
:
|
undefined
;
private
readonly
:
=
this
.
_register
(
new
DisposableStore
(
)
)
;
private
:
[
]
=
[
]
;
private
:
|
undefined
;
private
?
:
DOM
.
;
private
?
:
DOM
.
;
private
?
:
;
private
:
{
:
number
;
:
number
;
:
number
;
:
number
}
|
null
=
null
;
private
readonly
:
<
boolean
>
;
private
readonly
:
<
boolean
>
;
private
readonly
:
<
boolean
>
;
private
readonly
:
<
boolean
>
;
private
readonly
:
<
boolean
>
;
protected
readonly
=
new
Map< string , INotebookEditorContribution>
(
)
;
private
:
boolean
;
private
readonly
=
new
SequencerByKey< string >
(
)
;
private
:
|
null
=
null
;
private
readonly
=
generateUuid
(
)
;
private
!
:
DOM
.
;
private
:
boolean
=
false
;
private
=
false
;
get
isVisible
(
)
{
return
this
.
;
}
private
:
boolean
=
false
;
get
isDisposed
(
)
{
return
this
.
;
}
set
viewModel
(
:
|
undefined
)
{
this
.
.
fire
(
this
.
?.
)
;
this
.
=
;
this
.
.
fire
(
?.
)
;
}
get
viewModel
(
)
{
return
this
.
;
}
get
textModel
(
)
{
return
this
.
?.
;
}
get
isReadOnly
(
)
{
return
this
.
?.
.
??
false
;
}
get
activeCodeEditor
(
)
:
|
undefined
{
if
(
this
.
)
{
return
;
}
const
[
]
=
this
.
.
getFocusedElements
(
)
;
return
this
.
.
get
(
)
;
}
get
activeCellAndCodeEditor
(
)
:
[
,
]
|
undefined
{
if
(
this
.
)
{
return
;
}
const
[
]
=
this
.
.
getFocusedElements
(
)
;
const
=
this
.
.
get
(
)
;
if
(
!
)
{
return
;
}
return
[
,
]
;
}
get
codeEditors
(
)
:
[
,
]
[
]
{
return
[
...
this
.
]
;
}
get
visibleRanges
(
)
{
return
this
.
?
(
this
.
.
||
[
]
)
:
[
]
;
}
private
=
new
Map< string , IBaseCellEditorOptions>
(
)
;
readonly
:
boolean
;
private
:
boolean
;
public
readonly
:
;
private
readonly
:
;
private
readonly
:
;
private
:
|
undefined
;
get
notebookOptions
(
)
{
return
this
.
;
}
constructor
(
readonly
:
,
:
DOM
.
|
undefined
,
@ IInstantiationService
:
,
@ IEditorGroupsService
:
,
@ INotebookRendererMessagingService
private
readonly
:
,
@ INotebookEditorService
private
readonly
:
,
@ INotebookKernelService
private
readonly
:
,
@ INotebookService
private
readonly
:
,
@ IConfigurationService
private
readonly
:
,
@ IContextKeyService
:
,
@ ILayoutService
private
readonly
:
,
@ IContextMenuService
private
readonly
:
,
@ ITelemetryService
private
readonly
:
,
@ INotebookExecutionService
private
readonly
:
,
@ IEditorProgressService
private
:
,
@ INotebookLoggingService
private
readonly
:
,
)
{
super
(
)
;
this
.
=
;
this
.
=
.
??
false
;
this
.
=
.
??
false
;
this
.
=
.
createElement
(
'div'
)
;
this
.
=
this
.
_register
(
.
createScoped
(
this
.
)
)
;
this
.
=
this
.
_register
(
.
createChild
(
new
ServiceCollection
(
[
,
this
.
]
)
)
)
;
this
.
=
.
??
this
.
.
createInstance
(
,
this
.
?.
??
,
this
.
,
undefined
)
;
this
.
_register
(
this
.
)
;
const
=
this
.
_register
(
new
NotebookEventDispatcher
(
)
)
;
this
.
=
new
ViewContext
(
this
.
,
,
=>
this
.
getBaseCellEditorOptions
(
)
)
;
this
.
_register
(
this
.
.
.
onDidChangeLayout
(
(
)
=>
{
this
.
.
fire
(
)
;
}
)
)
;
this
.
_register
(
this
.
.
.
onDidChangeCellState
(
=>
{
this
.
.
fire
(
)
;
}
)
)
;
this
.
_register
(
.
onDidChangeOutputRenderers
(
(
)
=>
{
this
.
_updateOutputRenderers
(
)
;
}
)
)
;
this
.
_register
(
this
.
.
createInstance
(
,
this
)
)
;
this
.
_register
(
.
onDidChangeSelectedNotebooks
(
=>
{
if
(
isEqual
(
.
,
this
.
?.
)
)
{
this
.
_loadKernelPreloads
(
)
;
this
.
.
fire
(
)
;
}
}
)
)
;
this
.
=
this
.
.
getValue < boolean >
(
'editor.scrollBeyondLastLine'
)
;
this
.
_register
(
this
.
.
onDidChangeConfiguration
(
=>
{
if
(
.
affectsConfiguration
(
'editor.scrollBeyondLastLine'
)
)
{
this
.
=
this
.
.
getValue < boolean >
(
'editor.scrollBeyondLastLine'
)
;
if
(
this
.
&&
this
.
)
{
this
.
layout
(
this
.
)
;
}
}
}
)
)
;
this
.
_register
(
this
.
.
onDidChangeOptions
(
=>
{
if
(
.
||
.
||
.
)
{
this
.
_updateForNotebookConfiguration
(
)
;
}
if
(
.
)
{
this
.
_generateFontInfo
(
)
;
}
if
(
.
||
.
||
.
||
.
||
.
||
.
||
.
||
.
||
.
||
.
||
.
||
.
||
.
||
.
||
.
||
.
||
.
)
{
this
.
?.
remove
(
)
;
this
.
_createLayoutStyles
(
)
;
this
.
?.
updateOptions
(
{
...
this
.
.
computeWebviewOptions
(
)
,
:
this
.
_generateFontFamily
(
)
}
)
;
}
if
(
this
.
&&
this
.
)
{
this
.
layout
(
this
.
)
;
}
}
)
)
;
const
=
.
?
this
.
.
getContainer
(
.
)
:
this
.
.
;
this
.
_register
(
.
getPart
(
)
.
onDidScroll
(
=>
{
if
(
!
this
.
||
!
this
.
)
{
return
;
}
this
.
updateShadowElement
(
this
.
,
this
.
)
;
this
.
layoutContainerOverShadowElement
(
this
.
,
this
.
)
;
}
)
)
;
this
.
.
addNotebookEditor
(
this
)
;
const
=
generateUuid
(
)
;
this
.
.
=
` notebook- ${ id} `
;
this
.
.
=
'notebookOverlay'
;
this
.
.
.
add
(
'notebook-editor'
)
;
this
.
.
=
true
;
this
.
.
.
=
'hidden'
;
.
appendChild
(
this
.
)
;
this
.
_createBody
(
this
.
)
;
this
.
_generateFontInfo
(
)
;
this
.
=
true
;
this
.
=
NOTEBOOK_EDITOR_FOCUSED
.
bindTo
(
this
.
)
;
this
.
=
NOTEBOOK_OUTPUT_FOCUSED
.
bindTo
(
this
.
)
;
this
.
=
NOTEBOOK_OUTPUT_INPUT_FOCUSED
.
bindTo
(
this
.
)
;
this
.
=
NOTEBOOK_EDITOR_EDITABLE
.
bindTo
(
this
.
)
;
this
.
=
NOTEBOOK_CURSOR_NAVIGATION_MODE
.
bindTo
(
this
.
)
;
new
RawContextKey< boolean >
(
,
false
)
.
bindTo
(
this
.
)
.
set
(
true
)
;
this
.
.
set
(
!
.
)
;
let
:
[
]
;
if
(
Array
.
isArray
(
this
.
.
)
)
{
=
this
.
.
;
}
else
{
=
.
getEditorContributions
(
)
;
}
for
(
const
of
)
{
let
:
|
undefined
;
try
{
=
this
.
.
createInstance
(
.
,
this
)
;
}
catch
(
)
{
onUnexpectedError
(
)
;
}
if
(
)
{
if
(
!
this
.
.
has
(
.
)
)
{
this
.
.
set
(
.
,
)
;
}
else
{
.
dispose
(
)
;
throw
new
Error
(
` DUPLICATE notebook editor contribution: ' ${ desc. id} ' `
)
;
}
}
}
this
.
_updateForNotebookConfiguration
(
)
;
}
private
:
boolean
=
false
;
private
_debug
(
...
:
any
[
]
)
{
if
(
!
this
.
)
{
return
;
}
notebookDebug
(
...
)
;
}
public
getId
(
)
:
string
{
return
this
.
;
}
getViewModel
(
)
:
|
undefined
{
return
this
.
;
}
getLength
(
)
{
return
this
.
?.
??
0
;
}
getSelections
(
)
{
return
this
.
?.
getSelections
(
)
??
[
]
;
}
setSelections
(
:
[
]
)
{
if
(
!
this
.
)
{
return
;
}
const
=
this
.
.
getFocus
(
)
;
this
.
.
updateSelectionsState
(
{
:
.
,
:
,
:
}
)
;
}
getFocus
(
)
{
return
this
.
?.
getFocus
(
)
??
{
:
0
,
:
0
}
;
}
setFocus
(
:
)
{
if
(
!
this
.
)
{
return
;
}
const
=
this
.
.
getSelections
(
)
;
this
.
.
updateSelectionsState
(
{
:
.
,
:
,
:
}
)
;
}
getSelectionViewModels
(
)
:
[
]
{
if
(
!
this
.
)
{
return
[
]
;
}
const
=
new
Set< number >
(
)
;
return
this
.
.
getSelections
(
)
.
map
(
=>
this
.
!
.
.
slice
(
.
,
.
)
)
.
reduce
(
(
,
)
=>
{
.
forEach
(
=>
{
if
(
!
.
has
(
.
)
)
{
.
add
(
.
)
;
.
push
(
)
;
}
}
)
;
return
;
}
,
[
]
as
[
]
)
;
}
hasModel
(
)
:
this
is
{
return
!
!
this
.
;
}
showProgress
(
)
:
void
{
this
.
=
this
.
.
show
(
true
)
;
}
hideProgress
(
)
:
void
{
if
(
this
.
)
{
this
.
.
done
(
)
;
this
.
=
undefined
;
}
}
getBaseCellEditorOptions
(
:
string
)
:
{
const
=
this
.
.
get
(
)
;
if
(
)
{
return
;
}
else
{
const
=
new
BaseCellEditorOptions
(
this
,
this
.
,
this
.
,
)
;
this
.
.
set
(
,
)
;
return
;
}
}
private
_updateForNotebookConfiguration
(
)
{
if
(
!
this
.
)
{
return
;
}
this
.
.
.
remove
(
'cell-title-toolbar-left'
)
;
this
.
.
.
remove
(
'cell-title-toolbar-right'
)
;
this
.
.
.
remove
(
'cell-title-toolbar-hidden'
)
;
const
=
this
.
.
computeCellToolbarLocation
(
this
.
?.
)
;
this
.
.
.
add
(
` cell-title-toolbar- ${ cellToolbarLocation} `
)
;
const
=
this
.
.
getDisplayOptions
(
)
.
;
let
=
'hover'
;
this
.
.
.
remove
(
'cell-toolbar-hover'
)
;
this
.
.
.
remove
(
'cell-toolbar-click'
)
;
if
(
===
'hover'
||
===
'click'
)
{
=
;
}
this
.
.
.
add
(
` cell-toolbar- ${ cellToolbarInteractionState} `
)
;
}
private
_generateFontInfo
(
)
:
void
{
const
=
this
.
.
getValue < IEditorOptions>
(
'editor'
)
;
const
=
DOM
.
getWindow
(
this
.
getDomNode
(
)
)
;
this
.
=
.
readFontInfo
(
,
.
createFromRawSettings
(
,
.
getInstance
(
)
.
)
)
;
}
private
_createBody
(
:
)
:
void
{
this
.
=
.
createElement
(
'div'
)
;
this
.
.
.
add
(
'notebook-toolbar-container'
)
;
this
.
.
.
=
'none'
;
DOM
.
append
(
,
this
.
)
;
this
.
=
.
createElement
(
'div'
)
;
this
.
.
.
add
(
'notebook-sticky-scroll-container'
)
;
DOM
.
append
(
,
this
.
)
;
this
.
=
.
createElement
(
'div'
)
;
DOM
.
append
(
,
this
.
)
;
this
.
.
.
add
(
'cell-list-container'
)
;
this
.
_createLayoutStyles
(
)
;
this
.
_createCellList
(
)
;
this
.
=
.
createElement
(
'div'
)
;
this
.
.
.
add
(
'notebook-overview-ruler-container'
)
;
this
.
.
.
appendChild
(
this
.
)
;
this
.
_registerNotebookOverviewRuler
(
)
;
this
.
_register
(
this
.
.
createInstance
(
,
this
,
this
.
.
)
)
;
this
.
=
.
createElement
(
'div'
)
;
this
.
.
.
add
(
'notebook-overflow-widget-container'
,
'monaco-editor'
)
;
DOM
.
append
(
,
this
.
)
;
}
private
_generateFontFamily
(
)
{
return
this
.
?.
??
` "SF Mono", Monaco, Menlo, Consolas, "Ubuntu Mono", "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace `
;
}
private
_createLayoutStyles
(
)
:
void
{
this
.
=
.
createStyleSheet
(
this
.
)
;
const
{
,
,
,
,
,
,
,
,
,
,
,
,
,
,
}
=
this
.
.
getLayoutConfiguration
(
)
;
const
{
,
,
}
=
this
.
.
getDisplayOptions
(
)
;
const
=
this
.
.
getCellEditorContainerLeftMargin
(
)
;
const
{
,
}
=
this
.
.
computeBottomToolbarDimensions
(
this
.
?.
)
;
const
:
string
[
]
=
[
]
;
if
(
!
this
.
)
{
this
.
_generateFontInfo
(
)
;
}
const
=
this
.
_generateFontFamily
(
)
;
.
push
(
`
.notebook-editor {
--notebook-cell-output-font-size: ${ outputFontSize} px;
--notebook-cell-input-preview-font-size: ${ fontSize} px;
--notebook-cell-input-preview-font-family: ${ fontFamily} ;
}
`
)
;
if
(
)
{
.
push
(
` .notebookOverlay .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .markdown-cell-row div.cell.code { margin-left: ${ getCellEditorContainerLeftMargin} px; } `
)
;
}
else
{
.
push
(
` .notebookOverlay .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .markdown-cell-row div.cell.code { margin-left: ${ codeCellLeftMargin} px; } `
)
;
}
if
(
===
'border'
)
{
.
push
(
`
.monaco-workbench .notebookOverlay .monaco-list .monaco-list-row .cell-focus-indicator-top:before,
.monaco-workbench .notebookOverlay .monaco-list .monaco-list-row .cell-focus-indicator-bottom:before,
.monaco-workbench .notebookOverlay .monaco-list .markdown-cell-row .cell-inner-container:before,
.monaco-workbench .notebookOverlay .monaco-list .markdown-cell-row .cell-inner-container:after {
content: "";
position: absolute;
width: 100%;
height: 1px;
}
.monaco-workbench .notebookOverlay .monaco-list .monaco-list-row .cell-focus-indicator-left:before,
.monaco-workbench .notebookOverlay .monaco-list .monaco-list-row .cell-focus-indicator-right:before {
content: "";
position: absolute;
width: 1px;
height: 100%;
z-index: 10;
}
/* top border */
.monaco-workbench .notebookOverlay .monaco-list .monaco-list-row .cell-focus-indicator-top:before {
border-top: 1px solid transparent;
}
/* left border */
.monaco-workbench .notebookOverlay .monaco-list .monaco-list-row .cell-focus-indicator-left:before {
border-left: 1px solid transparent;
}
/* bottom border */
.monaco-workbench .notebookOverlay .monaco-list .monaco-list-row .cell-focus-indicator-bottom:before {
border-bottom: 1px solid transparent;
}
/* right border */
.monaco-workbench .notebookOverlay .monaco-list .monaco-list-row .cell-focus-indicator-right:before {
border-right: 1px solid transparent;
}
`
)
;
.
push
(
`
.monaco-workbench .notebookOverlay .monaco-list .monaco-list-row.code-cell-row.focused .cell-focus-indicator-left:before,
.monaco-workbench .notebookOverlay .monaco-list .monaco-list-row.code-cell-row.focused .cell-focus-indicator-right:before,
.monaco-workbench .notebookOverlay .monaco-list.selection-multiple .monaco-list-row.code-cell-row.selected .cell-focus-indicator-left:before,
.monaco-workbench .notebookOverlay .monaco-list.selection-multiple .monaco-list-row.code-cell-row.selected .cell-focus-indicator-right:before {
top: - ${ cellTopMargin} px; height: calc(100% + ${ cellTopMargin + cellBottomMargin} px)
} `
)
;
}
else
{
.
push
(
`
.monaco-workbench .notebookOverlay .monaco-list .monaco-list-row .cell-focus-indicator-left .codeOutput-focus-indicator {
border-left: 3px solid transparent;
border-radius: 4px;
width: 0px;
margin-left: ${ focusIndicatorLeftMargin} px;
border-color: var(--vscode-notebook-inactiveFocusedCellBorder) !important;
}
.monaco-workbench .notebookOverlay .monaco-list .monaco-list-row.focused .cell-focus-indicator-left .codeOutput-focus-indicator-container,
.monaco-workbench .notebookOverlay .monaco-list .monaco-list-row .cell-output-hover .cell-focus-indicator-left .codeOutput-focus-indicator-container,
.monaco-workbench .notebookOverlay .monaco-list .monaco-list-row .markdown-cell-hover .cell-focus-indicator-left .codeOutput-focus-indicator-container,
.monaco-workbench .notebookOverlay .monaco-list .monaco-list-row:hover .cell-focus-indicator-left .codeOutput-focus-indicator-container {
display: block;
}
.monaco-workbench .notebookOverlay .monaco-list .monaco-list-row .cell-focus-indicator-left .codeOutput-focus-indicator-container:hover .codeOutput-focus-indicator {
border-left: 5px solid transparent;
margin-left: ${ focusIndicatorLeftMargin - 1 } px;
}
`
)
;
.
push
(
`
.monaco-workbench .notebookOverlay .monaco-list .monaco-list-row.focused .cell-inner-container.cell-output-focus .cell-focus-indicator-left .codeOutput-focus-indicator,
.monaco-workbench .notebookOverlay .monaco-list:focus-within .monaco-list-row.focused .cell-inner-container .cell-focus-indicator-left .codeOutput-focus-indicator {
border-color: var(--vscode-notebook-focusedCellBorder) !important;
}
.monaco-workbench .notebookOverlay .monaco-list .monaco-list-row .cell-inner-container .cell-focus-indicator-left .output-focus-indicator {
margin-top: ${ focusIndicatorGap} px;
}
`
)
;
}
if
(
===
'betweenCells'
||
===
'both'
)
{
.
push
(
` .monaco-workbench .notebookOverlay > .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .monaco-list-row .cell-bottom-toolbar-container { display: flex; } `
)
;
.
push
(
` .monaco-workbench .notebookOverlay > .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .view-zones .cell-list-top-cell-toolbar-container { display: flex; } `
)
;
}
else
{
.
push
(
` .monaco-workbench .notebookOverlay > .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .monaco-list-row .cell-bottom-toolbar-container { display: none; } `
)
;
.
push
(
` .monaco-workbench .notebookOverlay > .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .view-zones .cell-list-top-cell-toolbar-container { display: none; } `
)
;
}
if
(
===
'left'
)
{
.
push
(
`
.monaco-workbench .notebookOverlay .cell-list-top-cell-toolbar-container .action-item:first-child,
.monaco-workbench .notebookOverlay .cell-list-top-cell-toolbar-container .action-item:first-child, .monaco-workbench .notebookOverlay > .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .monaco-list-row .cell-bottom-toolbar-container .action-item:first-child {
margin-right: 0px !important;
} `
)
;
.
push
(
`
.monaco-workbench .notebookOverlay .cell-list-top-cell-toolbar-container .monaco-toolbar .action-label,
.monaco-workbench .notebookOverlay .cell-list-top-cell-toolbar-container .monaco-toolbar .action-label, .monaco-workbench .notebookOverlay > .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .monaco-list-row .cell-bottom-toolbar-container .monaco-toolbar .action-label {
padding: 0px !important;
justify-content: center;
border-radius: 4px;
} `
)
;
.
push
(
`
.monaco-workbench .notebookOverlay .cell-list-top-cell-toolbar-container,
.monaco-workbench .notebookOverlay .cell-list-top-cell-toolbar-container, .monaco-workbench .notebookOverlay > .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .monaco-list-row .cell-bottom-toolbar-container {
align-items: flex-start;
justify-content: left;
margin: 0 16px 0 ${ 8 + codeCellLeftMargin} px;
} `
)
;
.
push
(
`
.monaco-workbench .notebookOverlay .cell-list-top-cell-toolbar-container,
.notebookOverlay .cell-bottom-toolbar-container .action-item {
border: 0px;
} `
)
;
}
.
push
(
` .notebookOverlay .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .code-cell-row div.cell.code { margin-left: ${ getCellEditorContainerLeftMargin} px; } `
)
;
.
push
(
` .notebookOverlay .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .view-zones .code-cell-row div.cell.code { margin-left: ${ getCellEditorContainerLeftMargin} px; } `
)
;
.
push
(
` .notebookOverlay .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .view-zones .code-cell-row div.cell { margin-right: ${ cellRightMargin} px; } `
)
;
.
push
(
` .notebookOverlay .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .monaco-list-row div.cell { margin-right: ${ cellRightMargin} px; } `
)
;
.
push
(
` .notebookOverlay .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .monaco-list-row > .cell-inner-container { padding-top: ${ cellTopMargin} px; } `
)
;
.
push
(
` .notebookOverlay .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .markdown-cell-row > .cell-inner-container { padding-bottom: ${ markdownCellBottomMargin} px; padding-top: ${ markdownCellTopMargin} px; } `
)
;
.
push
(
` .notebookOverlay .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .markdown-cell-row > .cell-inner-container.webview-backed-markdown-cell { padding: 0; } `
)
;
.
push
(
` .notebookOverlay .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .markdown-cell-row > .webview-backed-markdown-cell.markdown-cell-edit-mode .cell.code { padding-bottom: ${ markdownCellBottomMargin} px; padding-top: ${ markdownCellTopMargin} px; } `
)
;
.
push
(
` .notebookOverlay .output { margin: 0px ${ cellRightMargin} px 0px ${ getCellEditorContainerLeftMargin} px; } `
)
;
.
push
(
` .notebookOverlay .output { width: calc(100% - ${ getCellEditorContainerLeftMargin + cellRightMargin} px); } `
)
;
.
push
(
` .notebookOverlay .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .monaco-list-row .cell-comment-container { left: ${ getCellEditorContainerLeftMargin} px; } `
)
;
.
push
(
` .notebookOverlay .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .monaco-list-row .cell-comment-container { width: calc(100% - ${ getCellEditorContainerLeftMargin + cellRightMargin} px); } `
)
;
.
push
(
` .monaco-workbench .notebookOverlay .output .output-collapse-container .expandButton { left: - ${ cellRunGutter} px; } `
)
;
.
push
(
` .monaco-workbench .notebookOverlay .output .output-collapse-container .expandButton {
position: absolute;
width: ${ cellRunGutter} px;
padding: 6px 0px;
} `
)
;
.
push
(
` .notebookOverlay .output-show-more-container { margin: 0px ${ cellRightMargin} px 0px ${ getCellEditorContainerLeftMargin} px; } `
)
;
.
push
(
` .notebookOverlay .output-show-more-container { width: calc(100% - ${ getCellEditorContainerLeftMargin + cellRightMargin} px); } `
)
;
.
push
(
` .notebookOverlay .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .monaco-list-row div.cell.markdown { padding-left: ${ cellRunGutter} px; } `
)
;
.
push
(
` .monaco-workbench .notebookOverlay > .cell-list-container .notebook-folding-indicator { left: ${ ( markdownCellGutter - 20 ) / 2 + markdownCellLeftMargin} px; } `
)
;
.
push
(
` .notebookOverlay > .cell-list-container .notebook-folded-hint { left: ${ markdownCellGutter + markdownCellLeftMargin + 8 } px; } `
)
;
.
push
(
` .notebookOverlay .monaco-list .monaco-list-row :not(.webview-backed-markdown-cell) .cell-focus-indicator-top { height: ${ cellTopMargin} px; } `
)
;
.
push
(
` .notebookOverlay .monaco-list .monaco-list-row .cell-focus-indicator-side { bottom: ${ bottomToolbarGap} px; } `
)
;
.
push
(
` .notebookOverlay .monaco-list .monaco-list-row.code-cell-row .cell-focus-indicator-left { width: ${ getCellEditorContainerLeftMargin} px; } `
)
;
.
push
(
` .notebookOverlay .monaco-list .monaco-list-row.markdown-cell-row .cell-focus-indicator-left { width: ${ codeCellLeftMargin} px; } `
)
;
.
push
(
` .notebookOverlay .monaco-list .monaco-list-row .cell-focus-indicator.cell-focus-indicator-right { width: ${ cellRightMargin} px; } `
)
;
.
push
(
` .notebookOverlay .monaco-list .monaco-list-row .cell-focus-indicator-bottom { height: ${ cellBottomMargin} px; } `
)
;
.
push
(
` .notebookOverlay .monaco-list .monaco-list-row .cell-shadow-container-bottom { top: ${ cellBottomMargin} px; } `
)
;
.
push
(
`
.notebookOverlay .monaco-list.selection-multiple .monaco-list-row:has(+ .monaco-list-row.selected) .cell-focus-indicator-bottom {
height: ${ bottomToolbarGap + cellBottomMargin} px;
}
`
)
;
.
push
(
`
.notebookOverlay .monaco-list .monaco-list-row.code-cell-row.nb-multiCellHighlight:has(+ .monaco-list-row.nb-multiCellHighlight) .cell-focus-indicator-bottom {
height: ${ bottomToolbarGap + cellBottomMargin} px;
background-color: var(--vscode-notebook-symbolHighlightBackground) !important;
}
.notebookOverlay .monaco-list .monaco-list-row.markdown-cell-row.nb-multiCellHighlight:has(+ .monaco-list-row.nb-multiCellHighlight) .cell-focus-indicator-bottom {
height: ${ bottomToolbarGap + cellBottomMargin - 6 } px;
background-color: var(--vscode-notebook-symbolHighlightBackground) !important;
}
`
)
;
.
push
(
`
.monaco-workbench .notebookOverlay > .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .monaco-list-row .input-collapse-container .cell-collapse-preview {
line-height: ${ collapsedIndicatorHeight} px;
}
.monaco-workbench .notebookOverlay > .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .monaco-list-row .input-collapse-container .cell-collapse-preview .monaco-tokenized-source {
max-height: ${ collapsedIndicatorHeight} px;
}
`
)
;
.
push
(
` .monaco-workbench .notebookOverlay > .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .monaco-list-row .cell-bottom-toolbar-container .monaco-toolbar { height: ${ bottomToolbarHeight} px } `
)
;
.
push
(
` .monaco-workbench .notebookOverlay > .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .view-zones .cell-list-top-cell-toolbar-container .monaco-toolbar { height: ${ bottomToolbarHeight} px } `
)
;
.
push
(
` .monaco-workbench .notebookOverlay.cell-title-toolbar-right > .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .monaco-list-row .cell-title-toolbar {
right: ${ cellRightMargin + 26 } px;
}
.monaco-workbench .notebookOverlay.cell-title-toolbar-left > .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .monaco-list-row .cell-title-toolbar {
left: ${ getCellEditorContainerLeftMargin + 16 } px;
}
.monaco-workbench .notebookOverlay.cell-title-toolbar-hidden > .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .monaco-list-row .cell-title-toolbar {
display: none;
} `
)
;
.
push
(
`
.monaco-workbench .notebookOverlay .output > div.foreground.output-inner-container {
padding: ${ OutputInnerContainerTopPadding} px 8px;
}
.monaco-workbench .notebookOverlay > .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .monaco-list-row .output-collapse-container {
padding: ${ OutputInnerContainerTopPadding} px 8px;
}
`
)
;
.
push
(
`
.monaco-workbench .notebookOverlay .cell-chat-part {
margin: 0 ${ cellRightMargin} px 6px 4px;
}
`
)
;
this
.
.
=
.
join
(
'\n'
)
;
}
private
_createCellList
(
)
:
void
{
this
.
.
.
add
(
'cell-list-container'
)
;
this
.
=
this
.
_register
(
new
CellDragAndDropController
(
this
,
this
.
)
)
;
const
getScopedContextKeyService
=
(
:
)
=>
this
.
.
.
createScoped
(
)
;
this
.
=
this
.
_register
(
this
.
.
createInstance
(
,
this
,
)
)
;
const
=
[
this
.
.
createInstance
(
,
this
,
this
.
,
this
.
,
this
.
,
)
,
this
.
.
createInstance
(
,
this
,
this
.
,
this
.
,
)
,
]
;
.
forEach
(
=>
{
this
.
_register
(
)
;
}
)
;
this
.
=
this
.
.
createInstance
(
,
DOM
.
getWindow
(
this
.
getDomNode
(
)
)
)
;
this
.
_register
(
this
.
)
;
const
=
this
.
.
createInstance
(
,
(
)
=>
this
.
,
this
.
)
;
this
.
_register
(
)
;
this
.
=
this
.
.
createInstance
(
,
'NotebookCellList'
,
this
.
,
this
.
.
,
this
.
,
,
this
.
,
{
:
false
,
:
false
,
:
true
,
:
false
,
:
false
,
:
true
,
:
true
,
:
true
,
:
true
,
:
0
,
:
0
,
:
false
,
:
this
.
,
styleController
:
(
:
string
)
=>
{
return
this
.
;
}
,
:
{
:
,
:
,
:
,
:
,
:
,
:
,
:
,
:
,
:
,
:
,
:
,
:
,
:
,
:
,
:
,
}
,
}
,
)
;
this
.
.
setList
(
this
.
)
;
this
.
_register
(
this
.
)
;
this
.
=
new
ListViewInfoAccessor
(
this
.
)
;
this
.
_register
(
this
.
)
;
this
.
_register
(
combinedDisposable
(
...
)
)
;
this
.
=
this
.
_register
(
this
.
.
createInstance
(
,
this
,
this
.
)
)
;
this
.
=
DOM
.
append
(
this
.
.
,
$
(
'.webview-cover'
)
)
;
this
.
.
.
=
'none'
;
this
.
_register
(
DOM
.
addStandardDisposableGenericMouseDownListener
(
this
.
,
(
:
)
=>
{
if
(
.
.
.
contains
(
'slider'
)
&&
this
.
)
{
this
.
.
.
=
'block'
;
}
}
)
)
;
this
.
_register
(
DOM
.
addStandardDisposableGenericMouseUpListener
(
this
.
,
(
)
=>
{
if
(
this
.
)
{
this
.
.
.
=
'none'
;
}
}
)
)
;
this
.
_register
(
this
.
.
onMouseDown
(
=>
{
if
(
.
)
{
this
.
.
fire
(
{
:
.
,
:
.
}
)
;
}
}
)
)
;
this
.
_register
(
this
.
.
onMouseUp
(
=>
{
if
(
.
)
{
this
.
.
fire
(
{
:
.
,
:
.
}
)
;
}
}
)
)
;
this
.
_register
(
this
.
.
onDidChangeFocus
(
=>
{
this
.
.
fire
(
this
)
;
this
.
.
fire
(
)
;
this
.
.
fire
(
)
;
this
.
.
set
(
false
)
;
}
)
)
;
this
.
_register
(
this
.
.
onContextMenu
(
=>
{
this
.
showListContextMenu
(
)
;
}
)
)
;
this
.
_register
(
this
.
.
onDidChangeVisibleRanges
(
(
)
=>
{
this
.
.
fire
(
)
;
}
)
)
;
this
.
_register
(
this
.
.
onDidScroll
(
(
)
=>
{
if
(
.
!==
.
)
{
this
.
.
fire
(
)
;
this
.
clearActiveCellWidgets
(
)
;
}
if
(
.
===
.
&&
.
)
{
this
.
.
fire
(
)
;
}
}
)
)
;
this
.
=
this
.
_register
(
DOM
.
trackFocus
(
this
.
getDomNode
(
)
)
)
;
this
.
_register
(
this
.
.
onDidBlur
(
(
)
=>
{
this
.
.
set
(
false
)
;
this
.
?.
setEditorFocus
(
false
)
;
this
.
.
fire
(
)
;
}
)
)
;
this
.
_register
(
this
.
.
onDidFocus
(
(
)
=>
{
this
.
.
set
(
true
)
;
this
.
?.
setEditorFocus
(
true
)
;
this
.
.
fire
(
)
;
}
)
)
;
this
.
_registerNotebookActionsToolbar
(
)
;
this
.
_registerNotebookStickyScroll
(
)
;
this
.
_register
(
this
.
.
onDidChangeConfiguration
(
=>
{
if
(
.
affectsConfiguration
(
.
)
)
{
this
.
.
=
?.
getWidgetAriaLabel
(
)
;
}
}
)
)
;
}
private
showListContextMenu
(
:
<
>
)
{
this
.
.
showContextMenu
(
{
:
.
,
:
{
:
true
}
,
:
this
.
,
getAnchor
:
(
)
=>
.
,
getActionsContext
:
(
)
=>
{
return
{
:
'cellContainer'
}
;
}
}
)
;
}
private
_registerNotebookOverviewRuler
(
)
{
this
.
=
this
.
_register
(
this
.
.
createInstance
(
,
this
,
this
.
)
)
;
}
private
_registerNotebookActionsToolbar
(
)
{
this
.
=
this
.
_register
(
this
.
.
createInstance
(
,
this
,
this
.
,
this
.
,
this
.
)
)
;
this
.
_register
(
this
.
.
onDidChangeVisibility
(
(
)
=>
{
if
(
this
.
&&
this
.
)
{
this
.
layout
(
this
.
)
;
}
}
)
)
;
}
private
_registerNotebookStickyScroll
(
)
{
this
.
=
this
.
_register
(
this
.
.
createInstance
(
,
this
.
,
this
,
this
.
,
(
)
=>
{
if
(
this
.
)
{
return
;
}
if
(
this
.
&&
this
.
)
{
if
(
>
0
)
{
this
.
layout
(
this
.
)
;
this
.
setScrollTop
(
this
.
+
)
;
}
else
if
(
<
0
)
{
this
.
setScrollTop
(
this
.
+
)
;
this
.
layout
(
this
.
)
;
}
}
this
.
.
fire
(
)
;
}
)
)
;
}
private
_updateOutputRenderers
(
)
{
if
(
!
this
.
||
!
this
.
)
{
return
;
}
this
.
.
updateOutputRenderers
(
)
;
this
.
.
.
forEach
(
=>
{
.
.
forEach
(
=>
{
if
(
.
?.
===
RENDERER_NOT_AVAILABLE
)
{
.
resetRenderer
(
)
;
}
}
)
;
}
)
;
}
getDomNode
(
)
{
return
this
.
;
}
getOverflowContainerDomNode
(
)
{
return
this
.
;
}
getInnerWebview
(
)
:
|
undefined
{
return
this
.
?.
;
}
setEditorProgressService
(
:
)
:
void
{
this
.
=
;
}
setParentContextKeyService
(
:
)
:
void
{
this
.
.
updateParent
(
)
;
}
async
setModel
(
:
,
:
|
undefined
,
?
:
,
?
:
string
)
:
Promise
<
void
>
{
if
(
this
.
===
undefined
||
!
this
.
.
equal
(
)
)
{
const
=
this
.
.
computeBottomToolbarDimensions
(
this
.
?.
)
;
this
.
_detachModel
(
)
;
await
this
.
_attachModel
(
,
??
.
,
,
)
;
const
=
this
.
.
computeBottomToolbarDimensions
(
this
.
?.
)
;
if
(
.
!==
.
||
.
!==
.
)
{
this
.
?.
remove
(
)
;
this
.
_createLayoutStyles
(
)
;
this
.
?.
updateOptions
(
{
...
this
.
.
computeWebviewOptions
(
)
,
:
this
.
_generateFontFamily
(
)
}
)
;
}
type
WorkbenchNotebookOpenClassification
=
{
:
'rebornix'
;
:
'Identify the notebook editor view type'
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'File system provider scheme for the resource'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'File extension for the resource'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'View type of the notebook editor'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'Whether the notebook editor is within a REPL editor'
}
;
}
;
type
WorkbenchNotebookOpenEvent
=
{
:
string
;
:
string
;
:
string
;
:
boolean
;
}
;
this
.
.
publicLog2 < WorkbenchNotebookOpenEvent, WorkbenchNotebookOpenClassification>
(
'notebook/editorOpened'
,
{
:
.
.
,
:
extname
(
.
)
,
:
.
,
:
this
.
}
)
;
}
else
{
this
.
restoreListViewState
(
)
;
}
this
.
_restoreSelectedKernel
(
)
;
this
.
_loadKernelPreloads
(
)
;
this
.
?.
clearGlobalDragState
(
)
;
this
.
.
add
(
this
.
.
onDidChangeFocus
(
(
)
=>
{
this
.
updateContextKeysOnFocusChange
(
)
;
}
)
)
;
this
.
updateContextKeysOnFocusChange
(
)
;
this
.
_backgroundMarkdownRendering
(
)
;
}
private
=
false
;
private
_backgroundMarkdownRendering
(
)
{
if
(
this
.
)
{
return
;
}
this
.
=
true
;
DOM
.
runWhenWindowIdle
(
DOM
.
getWindow
(
this
.
getDomNode
(
)
)
,
(
)
=>
{
this
.
_backgroundMarkdownRenderingWithDeadline
(
)
;
}
)
;
}
private
_backgroundMarkdownRenderingWithDeadline
(
:
)
{
const
=
.
now
(
)
+
.
timeRemaining
(
)
;
const
execute
=
(
)
=>
{
try
{
this
.
=
true
;
if
(
this
.
)
{
return
;
}
if
(
!
this
.
)
{
return
;
}
const
=
this
.
.
.
find
(
=>
.
===
.
&&
!
this
.
?.
.
has
(
.
)
&&
!
this
.
cellIsHidden
(
)
)
as
|
undefined
;
if
(
!
)
{
return
;
}
this
.
createMarkupPreview
(
)
;
}
finally
{
this
.
=
false
;
}
if
(
.
now
(
)
<
)
{
setTimeout0
(
)
;
}
else
{
this
.
_backgroundMarkdownRendering
(
)
;
}
}
;
execute
(
)
;
}
private
updateContextKeysOnFocusChange
(
)
{
if
(
!
this
.
)
{
return
;
}
const
=
this
.
.
getFocusedElements
(
)
[
0
]
;
if
(
)
{
if
(
!
this
.
)
{
this
.
=
this
.
.
add
(
this
.
.
createInstance
(
,
this
,
as
)
)
;
}
this
.
.
updateForElement
(
as
)
;
}
}
async
setOptions
(
:
|
undefined
)
{
if
(
?.
!==
undefined
)
{
this
.
=
?.
;
}
if
(
!
this
.
)
{
return
;
}
this
.
.
updateOptions
(
{
:
this
.
}
)
;
this
.
.
updateOptions
(
this
.
)
;
const
=
?.
??
this
.
_parseIndexedCellOptions
(
)
;
if
(
)
{
const
=
this
.
.
.
find
(
=>
.
.
toString
(
)
===
.
.
toString
(
)
)
;
if
(
)
{
this
.
focusElement
(
)
;
const
=
.
?.
;
if
(
)
{
.
updateEditState
(
.
,
'setOptions'
)
;
.
=
.
;
await
this
.
revealRangeInCenterIfOutsideViewportAsync
(
,
new
Range
(
.
,
.
,
.
||
.
,
.
||
.
)
)
;
}
else
{
this
.
.
revealCell
(
,
?.
??
.
)
;
}
const
=
this
.
.
get
(
)
!
;
if
(
)
{
if
(
.
?.
)
{
const
{
}
=
.
;
const
=
new
Range
(
.
,
.
,
.
||
.
,
.
||
.
)
;
.
setSelection
(
)
;
.
revealPositionInCenterIfOutsideViewport
(
{
:
.
,
:
.
}
)
;
await
this
.
revealRangeInCenterIfOutsideViewportAsync
(
,
)
;
}
if
(
!
.
?.
)
{
.
focus
(
)
;
}
}
}
}
if
(
?.
)
{
const
=
.
[
0
]
.
;
const
=
this
.
.
cellAt
(
)
;
if
(
)
{
this
.
.
updateSelectionsState
(
{
:
.
,
:
{
:
,
:
+
1
}
,
:
.
}
)
;
this
.
revealInCenterIfOutsideViewport
(
)
;
}
}
this
.
_updateForOptions
(
)
;
this
.
.
fire
(
)
;
}
private
_parseIndexedCellOptions
(
:
|
undefined
)
{
if
(
?.
)
{
const
=
this
.
cellAt
(
.
.
)
;
if
(
)
{
return
{
:
.
,
:
{
:
.
.
,
:
false
}
}
;
}
}
return
undefined
;
}
private
_detachModel
(
)
{
this
.
.
clear
(
)
;
dispose
(
this
.
)
;
this
.
.
detachViewModel
(
)
;
this
.
?.
dispose
(
)
;
this
.
=
undefined
;
this
.
?.
dispose
(
)
;
this
.
?.
.
remove
(
)
;
this
.
=
null
;
this
.
.
clear
(
)
;
}
private
_updateForOptions
(
)
:
void
{
if
(
!
this
.
)
{
return
;
}
this
.
.
set
(
!
this
.
.
.
)
;
this
.
.
.
toggle
(
'notebook-editor-editable'
,
!
this
.
.
.
)
;
this
.
getDomNode
(
)
.
.
toggle
(
'notebook-editor-editable'
,
!
this
.
.
.
)
;
}
private
async
_resolveWebview
(
)
:
Promise
<
<
>
|
null
>
{
if
(
!
this
.
)
{
return
null
;
}
if
(
this
.
)
{
return
this
.
;
}
if
(
!
this
.
)
{
this
.
_ensureWebview
(
this
.
getId
(
)
,
this
.
.
,
this
.
.
)
;
}
this
.
=
(
async
(
)
=>
{
if
(
!
this
.
)
{
throw
new
Error
(
'Notebook output webview object is not created successfully.'
)
;
}
await
this
.
.
createWebview
(
this
.
.
??
)
;
if
(
!
this
.
.
)
{
throw
new
Error
(
'Notebook output webview element was not created successfully.'
)
;
}
this
.
.
add
(
this
.
.
.
onDidBlur
(
(
)
=>
{
this
.
.
set
(
false
)
;
this
.
=
false
;
this
.
updateEditorFocus
(
)
;
this
.
updateCellFocusMode
(
)
;
}
)
)
;
this
.
.
add
(
this
.
.
.
onDidFocus
(
(
)
=>
{
this
.
.
set
(
true
)
;
this
.
updateEditorFocus
(
)
;
this
.
=
true
;
}
)
)
;
this
.
.
add
(
this
.
.
onMessage
(
=>
{
this
.
.
fire
(
)
;
}
)
)
;
return
this
.
;
}
)
(
)
;
return
this
.
;
}
private
_ensureWebview
(
:
string
,
:
string
,
:
URI
)
{
if
(
this
.
)
{
return
;
}
const
=
this
;
this
.
=
this
.
.
createInstance
(
,
{
get
creationOptions
(
)
{
return
.
;
}
,
setScrollTop
(
:
number
)
{
.
.
=
;
}
,
triggerScroll
(
:
)
{
.
.
triggerScrollFromMouseWheelEvent
(
)
;
}
,
:
.
getCellByInfo
.
bind
(
)
,
:
.
_getCellById
.
bind
(
)
,
:
.
_toggleNotebookCellSelection
.
bind
(
)
,
:
.
focusNotebookCell
.
bind
(
)
,
:
.
focusNextNotebookCell
.
bind
(
)
,
:
.
_updateOutputHeight
.
bind
(
)
,
:
.
_scheduleOutputHeightAck
.
bind
(
)
,
:
.
_updateMarkupCellHeight
.
bind
(
)
,
:
.
_setMarkupCellEditState
.
bind
(
)
,
:
.
_didStartDragMarkupCell
.
bind
(
)
,
:
.
_didDragMarkupCell
.
bind
(
)
,
:
.
_didDropMarkupCell
.
bind
(
)
,
:
.
_didEndDragMarkupCell
.
bind
(
)
,
:
.
_didResizeOutput
.
bind
(
)
,
:
.
_updatePerformanceMetadata
.
bind
(
)
,
:
.
_didFocusOutputInputChange
.
bind
(
)
,
}
,
,
,
,
{
...
this
.
.
computeWebviewOptions
(
)
,
:
this
.
_generateFontFamily
(
)
}
,
this
.
.
getScoped
(
this
.
)
)
;
this
.
.
.
.
=
'100%'
;
this
.
.
attachWebview
(
this
.
.
)
;
}
private
async
_attachModel
(
:
,
:
string
,
:
|
undefined
,
?
:
)
{
this
.
_ensureWebview
(
this
.
getId
(
)
,
.
,
.
)
;
this
.
=
this
.
.
createInstance
(
,
,
,
this
.
,
this
.
getLayoutInfo
(
)
,
{
:
this
.
}
)
;
this
.
.
.
emit
(
[
new
NotebookLayoutChangedEvent
(
{
:
true
,
:
true
}
,
this
.
getLayoutInfo
(
)
)
]
)
;
this
.
.
updateOptions
(
this
.
)
;
this
.
_updateForOptions
(
)
;
this
.
_updateForNotebookConfiguration
(
)
;
{
this
.
.
restoreEditorViewState
(
)
;
const
=
?.
||
{
}
;
for
(
const
[
,
]
of
this
.
)
{
if
(
typeof
.
===
'function'
)
{
.
restoreViewState
(
[
]
)
;
}
}
}
this
.
.
add
(
this
.
.
onDidChangeViewCells
(
=>
{
this
.
.
fire
(
)
;
}
)
)
;
this
.
.
add
(
this
.
.
onDidChangeSelection
(
(
)
=>
{
this
.
.
fire
(
)
;
this
.
updateSelectedMarkdownPreviews
(
)
;
}
)
)
;
this
.
.
add
(
this
.
.
onWillScroll
(
=>
{
if
(
this
.
?.
isResolved
(
)
)
{
this
.
!
.
.
=
` translateY( ${ e. scrollTop} ) `
;
}
}
)
)
;
let
=
false
;
this
.
.
add
(
this
.
.
onDidChangeContentHeight
(
(
)
=>
{
if
(
)
{
return
;
}
=
true
;
this
.
.
add
(
DOM
.
scheduleAtNextAnimationFrame
(
DOM
.
getWindow
(
this
.
getDomNode
(
)
)
,
(
)
=>
{
=
false
;
this
.
_updateScrollHeight
(
)
;
}
,
100
)
)
;
}
)
)
;
this
.
.
add
(
this
.
.
onDidRemoveOutputs
(
=>
{
.
forEach
(
=>
this
.
removeInset
(
)
)
;
}
)
)
;
this
.
.
add
(
this
.
.
onDidHideOutputs
(
=>
{
.
forEach
(
=>
this
.
hideInset
(
)
)
;
}
)
)
;
this
.
.
add
(
this
.
.
onDidRemoveCellsFromView
(
=>
{
const
:
[
]
=
[
]
;
const
:
[
]
=
[
]
;
for
(
const
of
)
{
if
(
.
===
.
)
{
const
=
as
;
if
(
this
.
?.
.
find
(
=>
.
===
.
)
)
{
.
push
(
)
;
}
else
{
.
push
(
)
;
}
}
}
this
.
hideMarkupPreviews
(
)
;
this
.
deleteMarkupPreviews
(
)
;
}
)
)
;
await
this
.
_warmupWithMarkdownRenderer
(
this
.
,
,
)
;
?.
mark
(
'customMarkdownLoaded'
)
;
this
.
=
this
.
.
.
map
(
=>
this
.
_bindCellListener
(
)
)
;
this
.
=
this
.
.
.
find
(
=>
this
.
getActiveCell
(
)
===
&&
.
===
.
)
??
null
;
this
.
.
add
(
this
.
.
onDidChangeViewCells
(
(
)
=>
{
if
(
this
.
)
{
return
;
}
[
...
.
]
.
reverse
(
)
.
forEach
(
=>
{
const
[
,
,
]
=
;
const
=
this
.
.
splice
(
,
,
...
.
map
(
=>
this
.
_bindCellListener
(
)
)
)
;
dispose
(
)
;
}
)
;
if
(
.
.
some
(
=>
[
2
]
.
some
(
=>
.
===
.
)
)
)
{
this
.
_backgroundMarkdownRendering
(
)
;
}
}
)
)
;
if
(
this
.
)
{
this
.
.
layout
(
this
.
getBodyHeight
(
this
.
.
)
,
this
.
.
)
;
}
else
{
this
.
.
layout
(
)
;
}
this
.
?.
clearGlobalDragState
(
)
;
this
.
restoreListViewState
(
)
;
}
private
_bindCellListener
(
:
)
{
const
=
new
DisposableStore
(
)
;
.
add
(
.
onDidChangeLayout
(
=>
{
if
(
.
||
.
)
{
this
.
layoutNotebookCell
(
,
.
.
,
.
)
;
}
}
)
)
;
if
(
.
===
.
)
{
.
add
(
(
as
)
.
onDidRemoveOutputs
(
(
)
=>
{
.
forEach
(
=>
this
.
removeInset
(
)
)
;
}
)
)
;
}
.
add
(
(
as
)
.
onDidChangeState
(
=>
{
if
(
.
&&
.
&&
.
===
.
)
{
this
.
hideMarkupPreviews
(
[
(
as
)
]
)
;
}
if
(
.
&&
.
&&
.
===
.
)
{
.
.
forEach
(
=>
this
.
hideInset
(
)
)
;
}
if
(
.
)
{
this
.
_validateCellFocusMode
(
)
;
}
}
)
)
;
.
add
(
.
onCellDecorationsChanged
(
=>
{
.
.
forEach
(
=>
{
if
(
.
)
{
this
.
deltaCellContainerClassNames
(
.
,
[
.
]
,
[
]
,
.
)
;
}
if
(
.
)
{
this
.
deltaCellContainerClassNames
(
.
,
[
.
]
,
[
]
,
.
)
;
}
}
)
;
.
.
forEach
(
=>
{
if
(
.
)
{
this
.
deltaCellContainerClassNames
(
.
,
[
]
,
[
.
]
,
.
)
;
}
if
(
.
)
{
this
.
deltaCellContainerClassNames
(
.
,
[
]
,
[
.
]
,
.
)
;
}
}
)
;
}
)
)
;
return
;
}
private
:
|
null
=
null
;
private
_validateCellFocusMode
(
:
)
{
if
(
.
!==
.
)
{
return
;
}
if
(
this
.
&&
this
.
!==
)
{
this
.
.
=
.
;
}
this
.
=
;
}
private
async
_warmupWithMarkdownRenderer
(
:
,
:
|
undefined
,
?
:
)
{
this
.
.
debug
(
'NotebookEditorWidget'
,
'warmup '
+
this
.
?.
.
toString
(
)
)
;
await
this
.
_resolveWebview
(
)
;
?.
mark
(
'webviewCommLoaded'
)
;
this
.
.
debug
(
'NotebookEditorWidget'
,
'warmup - webview resolved'
)
;
this
.
!
.
.
.
=
'hidden'
;
await
this
.
_warmupViewportMarkdownCells
(
,
)
;
this
.
.
debug
(
'NotebookEditorWidget'
,
'warmup - viewport warmed up'
)
;
this
.
.
layout
(
0
,
0
)
;
this
.
.
attachViewModel
(
)
;
this
.
.
=
?.
?.
??
0
;
this
.
_debug
(
'finish initial viewport warmup and view state restore.'
)
;
this
.
!
.
.
.
=
'visible'
;
this
.
.
debug
(
'NotebookEditorWidget'
,
'warmup - list view model attached, set to visible'
)
;
this
.
.
fire
(
)
;
}
private
async
_warmupViewportMarkdownCells
(
:
,
:
|
undefined
)
{
if
(
&&
.
)
{
const
=
.
;
const
=
.
?.
??
0
;
const
=
+
.
max
(
this
.
?.
??
0
,
1080
)
;
let
=
0
;
const
:
[
,
number
]
[
]
=
[
]
;
for
(
let
=
0
;
<
.
;
++
)
{
const
=
.
cellAt
(
)
!
;
const
=
[
]
??
0
;
if
(
+
<
)
{
+=
;
continue
;
}
if
(
.
===
.
)
{
.
push
(
[
,
]
)
;
}
+=
;
if
(
>
)
{
break
;
}
}
await
this
.
!
.
initializeMarkup
(
.
map
(
(
[
,
]
)
=>
this
.
createMarkupCellInitialization
(
,
)
)
)
;
}
else
{
const
=
.
.
filter
(
=>
.
===
.
)
.
slice
(
0
,
5
)
.
map
(
=>
this
.
createMarkupCellInitialization
(
,
-
10000
)
)
;
await
this
.
!
.
initializeMarkup
(
)
;
let
=
0
;
const
:
{
:
string
;
:
number
}
[
]
=
[
]
;
const
=
.
max
(
this
.
?.
??
0
,
1080
)
;
for
(
const
of
.
)
{
if
(
.
===
.
)
{
.
push
(
{
:
.
,
:
}
)
;
}
+=
.
getHeight
(
this
.
getLayoutInfo
(
)
.
.
)
;
if
(
>
)
{
break
;
}
}
this
.
?.
updateScrollTops
(
[
]
,
)
;
}
}
private
createMarkupCellInitialization
(
:
,
:
number
)
:
{
return
(
{
:
.
,
:
.
,
:
.
,
:
.
getText
(
)
,
:
,
:
false
,
:
.
,
}
)
;
}
restoreListViewState
(
:
|
undefined
)
:
void
{
if
(
!
this
.
)
{
return
;
}
if
(
?.
!==
undefined
)
{
this
.
.
=
.
.
;
this
.
.
=
.
.
;
}
else
{
this
.
.
=
0
;
this
.
.
=
0
;
}
const
=
typeof
?.
===
'number'
?
.
:
0
;
if
(
<
this
.
.
)
{
const
=
this
.
.
cellAt
(
)
;
if
(
)
{
this
.
?.
updateSelectionsState
(
{
:
.
,
:
.
,
:
[
.
]
}
)
;
}
}
else
if
(
this
.
.
>
0
)
{
this
.
.
updateSelectionsState
(
{
:
.
,
:
{
:
0
,
:
1
}
,
:
[
{
:
0
,
:
1
}
]
}
)
;
}
if
(
?.
)
{
const
=
this
.
.
cellAt
(
)
;
if
(
)
{
.
=
.
;
}
}
}
private
_restoreSelectedKernel
(
:
|
undefined
)
:
void
{
if
(
?.
&&
this
.
)
{
const
=
this
.
.
getMatchingKernel
(
this
.
)
;
const
=
.
.
find
(
=>
.
===
.
)
;
if
(
&&
!
.
)
{
this
.
.
selectKernelForNotebook
(
,
this
.
)
;
}
}
}
getEditorViewState
(
)
:
{
const
=
this
.
?.
getEditorViewState
(
)
;
if
(
!
)
{
return
{
:
{
}
,
:
{
}
,
:
{
}
,
:
{
}
,
:
{
}
,
}
;
}
if
(
this
.
)
{
.
=
{
:
this
.
.
,
:
this
.
.
}
;
const
:
{
[
:
number
]
:
number
}
=
{
}
;
for
(
let
=
0
;
<
this
.
!
.
;
++
)
{
const
=
this
.
!
.
cellAt
(
)
as
;
[
]
=
.
.
;
}
.
=
;
if
(
this
.
)
{
const
=
this
.
.
getFocus
(
)
;
const
=
this
.
.
cellAt
(
.
)
;
if
(
)
{
const
=
this
.
.
domElementOfElement
(
)
;
const
=
.
getEditState
(
)
===
.
&&
!
!
(
&&
.
.
&&
.
contains
(
.
.
)
)
;
.
=
;
.
=
.
;
}
}
}
const
:
{
[
:
string
]
:
unknown
}
=
{
}
;
for
(
const
[
,
]
of
this
.
)
{
if
(
typeof
.
===
'function'
)
{
[
]
=
.
saveViewState
(
)
;
}
}
.
=
;
if
(
this
.
?.
.
===
.
)
{
.
=
this
.
?.
;
}
return
;
}
private
_allowScrollBeyondLastLine
(
)
{
return
this
.
&&
!
this
.
;
}
private
getBodyHeight
(
:
number
)
{
return
.
max
(
-
(
this
.
?.
?
26
:
0
)
,
0
)
;
}
layout
(
:
DOM
.
,
?
:
,
?
:
DOM
.
)
:
void
{
if
(
!
&&
this
.
===
null
)
{
this
.
=
;
this
.
=
;
return
;
}
if
(
.
<=
0
||
.
<=
0
)
{
this
.
onWillHide
(
)
;
return
;
}
const
=
this
.
.
whenContainerStylesLoaded
(
DOM
.
getWindow
(
this
.
getDomNode
(
)
)
)
;
if
(
)
{
.
then
(
(
)
=>
this
.
layoutNotebook
(
,
,
)
)
;
}
else
{
this
.
layoutNotebook
(
,
,
)
;
}
}
private
layoutNotebook
(
:
DOM
.
,
?
:
,
?
:
DOM
.
)
{
if
(
)
{
this
.
updateShadowElement
(
,
,
)
;
}
if
(
this
.
&&
this
.
.
<=
0
&&
this
.
.
<=
0
)
{
this
.
onWillHide
(
)
;
return
;
}
this
.
=
;
this
.
=
;
const
=
this
.
getBodyHeight
(
.
)
-
this
.
getLayoutInfo
(
)
.
;
DOM
.
size
(
this
.
,
.
,
)
;
const
=
;
if
(
this
.
.
getRenderHeight
(
)
<
)
{
this
.
.
updateOptions
(
{
:
this
.
_allowScrollBeyondLastLine
(
)
?
.
max
(
0
,
(
-
50
)
)
:
0
,
:
0
}
)
;
this
.
.
layout
(
,
.
)
;
}
else
{
this
.
.
layout
(
,
.
)
;
this
.
.
updateOptions
(
{
:
this
.
_allowScrollBeyondLastLine
(
)
?
.
max
(
0
,
(
-
50
)
)
:
0
,
:
0
}
)
;
}
this
.
.
=
false
;
this
.
.
.
=
'visible'
;
this
.
.
.
=
'block'
;
this
.
.
.
=
'absolute'
;
this
.
.
.
=
'hidden'
;
this
.
layoutContainerOverShadowElement
(
,
)
;
if
(
this
.
)
{
this
.
.
.
=
` ${ dimension. height} px `
;
this
.
.
.
=
` ${ dimension. width} px `
;
}
this
.
.
layout
(
this
.
)
;
this
.
.
layout
(
)
;
this
.
?.
.
emit
(
[
new
NotebookLayoutChangedEvent
(
{
:
true
,
:
true
}
,
this
.
getLayoutInfo
(
)
)
]
)
;
}
private
updateShadowElement
(
:
,
?
:
,
?
:
DOM
.
)
{
this
.
=
;
if
(
&&
)
{
this
.
=
{
:
.
,
:
.
,
:
.
,
:
.
,
}
;
}
else
{
const
=
.
getBoundingClientRect
(
)
;
this
.
=
{
:
.
,
:
.
,
:
.
,
:
.
}
;
}
}
private
layoutContainerOverShadowElement
(
?
:
DOM
.
,
?
:
DOM
.
)
:
void
{
if
(
&&
)
{
this
.
.
.
=
` ${ position. top} px `
;
this
.
.
.
=
` ${ position. left} px `
;
this
.
.
.
=
` ${ dimension. width} px `
;
this
.
.
.
=
` ${ dimension. height} px `
;
return
;
}
if
(
!
this
.
)
{
return
;
}
const
=
this
.
.
?.
getBoundingClientRect
(
)
;
this
.
.
.
=
` ${ this . _shadowElementViewInfo. top - ( elementContainerRect?. top || 0 ) } px `
;
this
.
.
.
=
` ${ this . _shadowElementViewInfo. left - ( elementContainerRect?. left || 0 ) } px `
;
this
.
.
.
=
` ${ dimension ? dimension. width : this . _shadowElementViewInfo. width} px `
;
this
.
.
.
=
` ${ dimension ? dimension. height : this . _shadowElementViewInfo. height} px `
;
}
focus
(
)
{
this
.
=
true
;
this
.
.
set
(
true
)
;
if
(
this
.
)
{
this
.
?.
focusWebview
(
)
;
}
else
{
if
(
this
.
)
{
const
=
this
.
.
getFocus
(
)
;
const
=
this
.
.
cellAt
(
.
)
;
if
(
!
this
.
hasEditorFocus
(
)
)
{
this
.
focusContainer
(
)
;
this
.
updateEditorFocus
(
)
;
}
if
(
&&
.
===
.
)
{
.
updateEditState
(
.
,
'editorWidget.focus'
)
;
.
=
.
;
this
.
focusEditor
(
)
;
return
;
}
}
this
.
.
domFocus
(
)
;
}
if
(
this
.
)
{
this
.
showProgress
(
)
;
}
}
onShow
(
)
{
this
.
=
true
;
}
private
focusEditor
(
:
)
:
void
{
for
(
const
[
,
]
of
this
.
.
entries
(
)
)
{
if
(
===
)
{
.
focus
(
)
;
return
;
}
}
}
focusContainer
(
:
boolean
=
false
)
{
if
(
this
.
)
{
this
.
?.
focusWebview
(
)
;
}
else
{
this
.
.
focusContainer
(
)
;
}
}
selectOutputContent
(
:
)
{
this
.
?.
selectOutputContents
(
)
;
}
selectInputContents
(
:
)
{
this
.
?.
selectInputContents
(
)
;
}
onWillHide
(
)
{
this
.
=
false
;
this
.
.
set
(
false
)
;
this
.
.
=
true
;
this
.
.
.
=
'hidden'
;
this
.
.
.
=
'-50000px'
;
this
.
.
.
=
'none'
;
this
.
clearActiveCellWidgets
(
)
;
}
private
clearActiveCellWidgets
(
)
{
this
.
.
forEach
(
(
,
)
=>
{
if
(
this
.
getActiveCell
(
)
===
&&
)
{
.
get
(
)
?.
cancelSuggestWidget
(
)
;
.
get
(
)
?.
clearWidgets
(
)
;
.
get
(
)
?.
clearWidgets
(
)
;
}
}
)
;
this
.
.
forEach
(
(
,
)
=>
{
const
=
.
get
(
)
;
if
(
?.
.
get
(
)
?.
.
get
(
)
)
{
.
render
(
true
)
;
}
}
)
;
}
private
editorHasDomFocus
(
)
:
boolean
{
return
DOM
.
isAncestorOfActiveElement
(
this
.
getDomNode
(
)
)
;
}
updateEditorFocus
(
)
{
this
.
.
refreshState
(
)
;
const
=
this
.
editorHasDomFocus
(
)
;
this
.
.
set
(
)
;
this
.
?.
setEditorFocus
(
)
;
}
updateCellFocusMode
(
)
{
const
=
this
.
getActiveCell
(
)
;
if
(
?.
===
.
&&
!
this
.
)
{
.
=
.
;
}
}
hasEditorFocus
(
)
{
this
.
updateEditorFocus
(
)
;
return
this
.
editorHasDomFocus
(
)
;
}
hasWebviewFocus
(
)
{
return
this
.
;
}
hasOutputTextSelection
(
)
{
if
(
!
this
.
hasEditorFocus
(
)
)
{
return
false
;
}
const
=
DOM
.
getWindow
(
this
.
getDomNode
(
)
)
.
getSelection
(
)
;
if
(
?.
!==
1
)
{
return
false
;
}
const
=
.
getRangeAt
(
0
)
;
if
(
.
===
.
&&
.
-
.
===
0
)
{
return
false
;
}
let
:
any
=
.
;
if
(
!
this
.
.
contains
(
)
)
{
return
false
;
}
while
(
&&
!==
this
.
)
{
if
(
(
as
)
.
&&
(
as
)
.
.
contains
(
'output'
)
)
{
return
true
;
}
=
.
;
}
return
false
;
}
_didFocusOutputInputChange
(
:
boolean
)
{
this
.
.
set
(
)
;
}
focusElement
(
:
)
{
this
.
?.
updateSelectionsState
(
{
:
.
,
:
.
,
:
[
.
]
}
)
;
}
get
scrollTop
(
)
{
return
this
.
.
;
}
get
scrollBottom
(
)
{
return
this
.
.
+
this
.
.
getRenderHeight
(
)
;
}
getAbsoluteTopOfElement
(
:
)
{
return
this
.
.
getCellViewScrollTop
(
)
;
}
getHeightOfElement
(
:
)
{
return
this
.
.
elementHeight
(
)
;
}
scrollToBottom
(
)
{
this
.
.
scrollToBottom
(
)
;
}
setScrollTop
(
:
number
)
:
void
{
this
.
.
=
;
}
revealCellRangeInView
(
:
)
{
return
this
.
.
revealCells
(
)
;
}
revealInView
(
:
)
{
return
this
.
.
revealCell
(
,
.
)
;
}
revealInViewAtTop
(
:
)
{
this
.
.
revealCell
(
,
.
)
;
}
revealInCenter
(
:
)
{
this
.
.
revealCell
(
,
.
)
;
}
async
revealInCenterIfOutsideViewport
(
:
)
{
await
this
.
.
revealCell
(
,
.
)
;
}
async
revealFirstLineIfOutsideViewport
(
:
)
{
await
this
.
.
revealCell
(
,
.
)
;
}
async
revealLineInViewAsync
(
:
,
:
number
)
:
Promise
<
void
>
{
return
this
.
.
revealRangeInCell
(
,
new
Range
(
,
1
,
,
1
)
,
.
)
;
}
async
revealLineInCenterAsync
(
:
,
:
number
)
:
Promise
<
void
>
{
return
this
.
.
revealRangeInCell
(
,
new
Range
(
,
1
,
,
1
)
,
.
)
;
}
async
revealLineInCenterIfOutsideViewportAsync
(
:
,
:
number
)
:
Promise
<
void
>
{
return
this
.
.
revealRangeInCell
(
,
new
Range
(
,
1
,
,
1
)
,
.
)
;
}
async
revealRangeInViewAsync
(
:
,
:
|
)
:
Promise
<
void
>
{
return
this
.
.
revealRangeInCell
(
,
,
.
)
;
}
async
revealRangeInCenterAsync
(
:
,
:
|
)
:
Promise
<
void
>
{
return
this
.
.
revealRangeInCell
(
,
,
.
)
;
}
async
revealRangeInCenterIfOutsideViewportAsync
(
:
,
:
|
)
:
Promise
<
void
>
{
return
this
.
.
revealRangeInCell
(
,
,
.
)
;
}
revealCellOffsetInCenter
(
:
,
:
number
)
{
return
this
.
.
revealCellOffsetInCenter
(
,
)
;
}
revealOffsetInCenterIfOutsideViewport
(
:
number
)
{
return
this
.
.
revealOffsetInCenterIfOutsideViewport
(
)
;
}
getViewIndexByModelIndex
(
:
number
)
:
number
{
if
(
!
this
.
)
{
return
-
1
;
}
const
=
this
.
?.
[
]
;
if
(
!
)
{
return
-
1
;
}
return
this
.
.
getViewIndex
(
)
;
}
getViewHeight
(
:
)
:
number
{
if
(
!
this
.
)
{
return
-
1
;
}
return
this
.
.
getViewHeight
(
)
;
}
getCellRangeFromViewRange
(
:
number
,
:
number
)
:
|
undefined
{
return
this
.
.
getCellRangeFromViewRange
(
,
)
;
}
getCellsInRange
(
?
:
)
:
<
>
{
return
this
.
.
getCellsInRange
(
)
;
}
setCellEditorSelection
(
:
,
:
)
:
void
{
this
.
.
setCellEditorSelection
(
,
)
;
}
setHiddenAreas
(
:
[
]
)
:
boolean
{
return
this
.
.
setHiddenAreas
(
,
true
)
;
}
getVisibleRangesPlusViewportAboveAndBelow
(
)
:
[
]
{
return
this
.
.
getVisibleRangesPlusViewportAboveAndBelow
(
)
;
}
deltaCellDecorations
(
:
string
[
]
,
:
[
]
)
:
string
[
]
{
const
=
this
.
?.
deltaCellDecorations
(
,
)
||
[
]
;
this
.
.
fire
(
)
;
return
;
}
deltaCellContainerClassNames
(
:
string
,
:
string
[
]
,
:
string
[
]
,
:
)
:
void
{
if
(
===
.
)
{
this
.
?.
deltaMarkupPreviewClassNames
(
,
,
)
;
}
else
{
this
.
?.
deltaCellOutputContainerClassNames
(
,
,
)
;
}
}
changeModelDecorations < T >
(
callback
:
(
:
)
=>
T
)
:
T
|
null
{
return
this
.
?.
changeModelDecorations < T >
(
)
||
null
;
}
changeViewZones
(
callback
:
(
:
)
=>
void
)
:
void
{
this
.
.
changeViewZones
(
)
;
this
.
.
fire
(
)
;
}
getViewZoneLayoutInfo
(
:
string
)
:
{
:
number
;
:
number
}
|
null
{
return
this
.
.
getViewZoneLayoutInfo
(
)
;
}
changeCellOverlays
(
callback
:
(
:
)
=>
void
)
:
void
{
this
.
.
changeCellOverlays
(
)
;
}
private
async
_loadKernelPreloads
(
)
:
Promise
<
void
>
{
if
(
!
this
.
hasModel
(
)
)
{
return
;
}
const
{
}
=
this
.
.
getMatchingKernel
(
this
.
)
;
if
(
!
this
.
?.
isResolved
(
)
)
{
await
this
.
_resolveWebview
(
)
;
}
this
.
?.
updateKernelPreloads
(
)
;
}
get
activeKernel
(
)
{
return
this
.
&&
this
.
.
getSelectedOrSuggestedKernel
(
this
.
)
;
}
async
cancelNotebookCells
(
?
:
<
>
)
:
Promise
<
void
>
{
if
(
!
this
.
||
!
this
.
hasModel
(
)
)
{
return
;
}
if
(
!
)
{
=
this
.
.
;
}
return
this
.
.
cancelNotebookCellHandles
(
this
.
,
Array
.
from
(
)
.
map
(
=>
.
)
)
;
}
async
executeNotebookCells
(
?
:
<
>
)
:
Promise
<
void
>
{
if
(
!
this
.
||
!
this
.
hasModel
(
)
)
{
this
.
.
info
(
'notebookEditorWidget'
,
'No NotebookViewModel, cannot execute cells'
)
;
return
;
}
if
(
!
)
{
=
this
.
.
;
}
return
this
.
.
executeNotebookCells
(
this
.
,
Array
.
from
(
)
.
map
(
=>
.
)
,
this
.
)
;
}
private
:
<
,
>
|
null
=
new
WeakMap< ICellViewModel, IDisposable>
(
)
;
private
:
<
>
=
new
Set< IDisposable>
(
)
;
async
layoutNotebookCell
(
:
,
:
number
,
?
:
)
:
Promise
<
void
>
{
this
.
_debug
(
'layout cell'
,
.
,
)
;
const
=
this
.
.
getViewIndex
(
)
;
if
(
===
undefined
)
{
return
;
}
if
(
this
.
?.
has
(
)
)
{
this
.
?.
get
(
)
!
.
dispose
(
)
;
}
const
=
new
DeferredPromise< void >
(
)
;
const
doLayout
=
(
)
=>
{
if
(
this
.
)
{
return
;
}
if
(
!
this
.
?.
hasCell
(
)
)
{
return
;
}
if
(
this
.
.
getViewIndex
(
)
===
undefined
)
{
return
;
}
if
(
this
.
.
elementHeight
(
)
===
)
{
return
;
}
const
=
this
.
?.
get
(
)
;
this
.
?.
delete
(
)
;
if
(
!
this
.
hasEditorFocus
(
)
)
{
const
=
this
.
?.
getCellIndex
(
)
;
const
=
this
.
;
if
(
!==
undefined
&&
&&
.
&&
[
0
]
.
===
&&
this
.
.
>
this
.
getAbsoluteTopOfElement
(
)
)
{
return
this
.
.
updateElementHeight2
(
,
,
.
min
(
+
1
,
this
.
getLength
(
)
-
1
)
)
;
}
}
this
.
.
updateElementHeight2
(
,
)
;
.
complete
(
undefined
)
;
if
(
)
{
.
dispose
(
)
;
this
.
.
delete
(
)
;
}
}
;
if
(
this
.
.
)
{
const
=
DOM
.
scheduleAtNextAnimationFrame
(
DOM
.
getWindow
(
this
.
getDomNode
(
)
)
,
)
;
const
=
toDisposable
(
(
)
=>
{
.
dispose
(
)
;
.
complete
(
undefined
)
;
}
)
;
this
.
?.
set
(
,
)
;
this
.
.
add
(
)
;
}
else
{
doLayout
(
)
;
}
return
.
;
}
getActiveCell
(
)
{
const
=
this
.
.
getFocusedElements
(
)
;
if
(
&&
.
)
{
return
[
0
]
;
}
return
undefined
;
}
private
_toggleNotebookCellSelection
(
:
,
:
boolean
)
:
void
{
const
=
this
.
.
getSelectedElements
(
)
;
const
=
.
includes
(
)
;
const
=
?
[
.
-
1
]
??
:
;
const
=
this
.
.
getViewIndex
(
)
!
;
const
=
this
.
.
getViewIndex
(
)
!
;
const
=
this
.
getCellsInViewRange
(
,
)
;
if
(
)
{
this
.
.
selectElements
(
.
filter
(
=>
!
.
includes
(
)
)
)
;
}
else
{
this
.
focusElement
(
)
;
this
.
.
selectElements
(
[
...
.
filter
(
=>
!
.
includes
(
)
)
,
...
]
)
;
}
}
private
getCellsInViewRange
(
:
number
,
:
number
)
:
[
]
{
const
:
[
]
=
[
]
;
for
(
let
=
0
;
<
this
.
.
;
++
)
{
const
=
this
.
.
element
(
)
;
if
(
)
{
if
(
(
>=
&&
<=
)
||
(
>=
&&
<=
)
)
{
.
push
(
)
;
}
}
}
return
;
}
async
focusNotebookCell
(
:
,
:
'editor'
|
'container'
|
'output'
,
?
:
)
{
if
(
this
.
)
{
return
;
}
.
=
undefined
;
if
(
===
'editor'
)
{
.
=
false
;
this
.
focusElement
(
)
;
this
.
.
focusView
(
)
;
.
updateEditState
(
.
,
'focusNotebookCell'
)
;
.
=
.
;
if
(
!
?.
)
{
if
(
typeof
?.
===
'number'
)
{
this
.
.
set
(
true
)
;
await
this
.
revealLineInViewAsync
(
,
.
)
;
const
=
this
.
.
get
(
)
!
;
const
=
.
;
?.
setSelection
(
{
:
,
:
1
,
:
,
:
1
}
)
;
}
else
{
const
=
.
getSelectionsStartPosition
(
)
;
if
(
?.
)
{
const
=
[
0
]
;
await
this
.
revealRangeInViewAsync
(
,
.
fromPositions
(
,
)
)
;
}
else
{
await
this
.
revealInView
(
)
;
}
}
}
}
else
if
(
===
'output'
)
{
this
.
focusElement
(
)
;
if
(
!
this
.
hasEditorFocus
(
)
)
{
this
.
.
focusView
(
)
;
}
if
(
!
this
.
)
{
return
;
}
const
=
.
.
find
(
=>
.
.
)
?.
.
;
const
=
?.
??
??
.
;
this
.
.
focusOutput
(
,
?.
,
?.
||
this
.
)
;
.
updateEditState
(
.
,
'focusNotebookCell'
)
;
.
=
.
;
.
=
?.
;
this
.
.
set
(
true
)
;
if
(
!
?.
)
{
this
.
revealInCenterIfOutsideViewport
(
)
;
}
}
else
{
const
=
this
.
.
domElementOfElement
(
)
;
if
(
&&
.
.
&&
.
contains
(
.
.
)
)
{
(
.
.
as
)
.
blur
(
)
;
}
this
.
?.
blurOutput
(
)
;
.
updateEditState
(
.
,
'focusNotebookCell'
)
;
.
=
.
;
this
.
focusElement
(
)
;
if
(
!
?.
)
{
if
(
typeof
?.
===
'number'
)
{
this
.
.
set
(
true
)
;
await
this
.
revealInView
(
)
;
}
else
if
(
?.
===
.
)
{
await
this
.
revealFirstLineIfOutsideViewport
(
)
;
}
else
if
(
?.
===
.
)
{
await
this
.
revealInView
(
)
;
}
else
{
await
this
.
revealInCenterIfOutsideViewport
(
)
;
}
}
this
.
.
focusView
(
)
;
this
.
updateEditorFocus
(
)
;
}
}
async
focusNextNotebookCell
(
:
,
:
'editor'
|
'container'
|
'output'
)
{
const
=
this
.
?.
getCellIndex
(
)
;
if
(
typeof
!==
'number'
)
{
return
;
}
const
=
this
.
?.
cellAt
(
+
1
)
;
if
(
!
)
{
return
;
}
await
this
.
focusNotebookCell
(
,
)
;
}
private
async
_warmupCell
(
:
)
{
if
(
.
)
{
return
;
}
const
=
.
;
for
(
const
of
.
slice
(
0
,
)
)
{
const
[
,
]
=
.
resolveMimeTypes
(
this
.
!
,
undefined
)
;
if
(
!
.
find
(
=>
.
)
||
.
===
0
)
{
continue
;
}
const
=
[
]
;
if
(
!
)
{
return
;
}
const
=
this
.
.
getRendererInfo
(
.
)
;
if
(
!
)
{
return
;
}
const
:
=
{
:
.
,
,
:
,
:
.
}
;
const
=
this
.
?.
.
get
(
.
)
;
if
(
!
||
!
.
)
{
const
=
new
Promise < void >
(
=>
{
this
.
_register
(
.
any
(
this
.
,
this
.
)
(
=>
{
if
(
.
===
.
.
)
{
resolve
(
)
;
}
}
)
)
;
}
)
;
this
.
createOutput
(
,
,
0
,
false
)
;
await
;
}
else
{
this
.
createOutput
(
,
,
0
,
false
)
;
}
return
;
}
}
private
async
_warmupAll
(
:
boolean
)
{
if
(
!
this
.
hasModel
(
)
||
!
this
.
)
{
return
;
}
const
=
this
.
.
;
const
=
[
]
;
for
(
let
=
0
;
<
.
;
++
)
{
if
(
[
]
.
===
.
&&
!
this
.
!
.
.
has
(
[
]
.
)
)
{
.
push
(
this
.
createMarkupPreview
(
[
]
)
)
;
}
}
if
(
&&
this
.
)
{
for
(
let
=
0
;
<
this
.
.
;
++
)
{
const
=
this
.
.
element
(
)
;
if
(
?.
===
.
)
{
.
push
(
this
.
_warmupCell
(
(
as
)
)
)
;
}
}
}
return
Promise
.
all
(
)
;
}
private
async
_warmupSelection
(
:
boolean
,
:
[
]
)
{
if
(
!
this
.
hasModel
(
)
||
!
this
.
)
{
return
;
}
const
=
this
.
.
;
const
=
[
]
;
for
(
const
of
)
{
for
(
let
=
.
;
<
.
;
++
)
{
if
(
[
]
.
===
.
&&
!
this
.
!
.
.
has
(
[
]
.
)
)
{
.
push
(
this
.
createMarkupPreview
(
[
]
)
)
;
}
}
}
if
(
&&
this
.
)
{
for
(
const
of
)
{
for
(
let
=
.
;
<
.
;
++
)
{
const
=
this
.
.
element
(
)
;
if
(
?.
===
.
)
{
.
push
(
this
.
_warmupCell
(
(
as
)
)
)
;
}
}
}
}
return
Promise
.
all
(
)
;
}
async
find
(
:
string
,
:
,
:
,
:
boolean
=
false
,
=
false
,
?
:
string
)
:
Promise
<
[
]
>
{
if
(
!
this
.
)
{
return
[
]
;
}
if
(
!
)
{
=
this
.
getId
(
)
;
}
const
=
this
.
.
find
(
,
)
.
filter
(
=>
.
>
0
)
;
if
(
(
!
.
&&
!
.
)
||
.
?.
===
.
)
{
this
.
?.
findStop
(
)
;
return
;
}
const
:
{
[
:
string
]
:
}
=
{
}
;
.
forEach
(
=>
{
[
.
.
]
=
;
}
)
;
if
(
this
.
)
{
const
=
.
now
(
)
;
if
(
.
&&
.
.
===
.
&&
.
.
)
{
await
this
.
_warmupSelection
(
!
!
.
,
.
.
)
;
}
else
{
await
this
.
_warmupAll
(
!
!
.
)
;
}
const
=
.
now
(
)
;
this
.
.
debug
(
'Find'
,
` Warmup time: ${ end - start} ms `
)
;
if
(
.
)
{
return
[
]
;
}
let
:
string
[
]
=
[
]
;
if
(
.
&&
.
.
===
.
&&
.
.
)
{
const
=
cellRangesToIndexes
(
.
.
)
;
=
.
map < string >
(
=>
this
.
?.
[
]
.
??
''
)
;
}
const
=
await
this
.
.
find
(
,
{
:
.
,
:
.
,
:
!
!
.
,
:
!
!
.
,
,
,
:
}
)
;
if
(
.
)
{
return
[
]
;
}
.
forEach
(
=>
{
const
=
this
.
!
.
.
find
(
=>
.
===
.
)
;
if
(
!
)
{
return
;
}
if
(
.
===
'preview'
)
{
if
(
.
getEditState
(
)
===
.
&&
!
.
)
{
return
;
}
if
(
.
getEditState
(
)
===
.
&&
.
)
{
return
;
}
}
else
{
if
(
!
.
)
{
return
;
}
}
const
=
[
.
]
;
if
(
)
{
.
.
push
(
)
;
}
else
{
[
.
]
=
new
CellFindMatchModel
(
this
.
!
.
.
find
(
=>
.
===
.
)
!
,
this
.
!
.
.
findIndex
(
=>
.
===
.
)
!
,
[
]
,
[
]
)
;
}
}
)
;
}
const
:
[
]
=
[
]
;
this
.
.
.
forEach
(
(
,
)
=>
{
if
(
[
.
]
)
{
.
push
(
new
CellFindMatchModel
(
,
,
[
.
]
.
,
[
.
]
.
)
)
;
}
}
)
;
return
;
}
async
findHighlightCurrent
(
:
number
,
?
:
string
)
:
Promise
<
number
>
{
if
(
!
this
.
)
{
return
0
;
}
return
this
.
?.
findHighlightCurrent
(
,
??
this
.
getId
(
)
)
;
}
async
findUnHighlightCurrent
(
:
number
,
?
:
string
)
:
Promise
<
void
>
{
if
(
!
this
.
)
{
return
;
}
return
this
.
?.
findUnHighlightCurrent
(
,
??
this
.
getId
(
)
)
;
}
findStop
(
?
:
string
)
{
this
.
?.
findStop
(
??
this
.
getId
(
)
)
;
}
getLayoutInfo
(
)
:
{
if
(
!
this
.
)
{
throw
new
Error
(
'Editor is not initalized successfully'
)
;
}
if
(
!
this
.
)
{
this
.
_generateFontInfo
(
)
;
}
return
{
:
this
.
?.
??
0
,
:
this
.
?.
??
0
,
:
this
.
?.
getScrollHeight
(
)
??
0
,
:
this
.
!
,
:
this
.
?.
getCurrentStickyHeight
(
)
??
0
}
;
}
async
createMarkupPreview
(
:
)
{
if
(
!
this
.
)
{
return
;
}
if
(
!
this
.
.
isResolved
(
)
)
{
await
this
.
_resolveWebview
(
)
;
}
if
(
!
this
.
||
!
this
.
.
)
{
return
;
}
if
(
!
this
.
||
!
this
.
.
)
{
return
;
}
if
(
this
.
.
getCellIndex
(
)
===
-
1
)
{
return
;
}
if
(
this
.
cellIsHidden
(
)
)
{
return
;
}
const
=
parseInt
(
this
.
.
.
.
.
,
10
)
;
const
=
!
!
?
(
0
-
)
:
0
;
const
=
this
.
.
getCellViewScrollTop
(
)
;
await
this
.
.
showMarkupPreview
(
{
:
.
,
:
.
,
:
.
,
:
.
getText
(
)
,
:
+
,
:
true
,
:
.
,
}
)
;
}
private
cellIsHidden
(
:
)
:
boolean
{
const
=
this
.
!
.
getCellIndex
(
)
;
const
=
this
.
!
.
getHiddenRanges
(
)
;
return
.
some
(
=>
>=
.
&&
<=
.
)
;
}
async
unhideMarkupPreviews
(
:
readonly
[
]
)
{
if
(
!
this
.
)
{
return
;
}
if
(
!
this
.
.
isResolved
(
)
)
{
await
this
.
_resolveWebview
(
)
;
}
await
this
.
?.
unhideMarkupPreviews
(
.
map
(
=>
.
)
)
;
}
async
hideMarkupPreviews
(
:
readonly
[
]
)
{
if
(
!
this
.
||
!
.
)
{
return
;
}
if
(
!
this
.
.
isResolved
(
)
)
{
await
this
.
_resolveWebview
(
)
;
}
await
this
.
?.
hideMarkupPreviews
(
.
map
(
=>
.
)
)
;
}
async
deleteMarkupPreviews
(
:
readonly
[
]
)
{
if
(
!
this
.
)
{
return
;
}
if
(
!
this
.
.
isResolved
(
)
)
{
await
this
.
_resolveWebview
(
)
;
}
await
this
.
?.
deleteMarkupPreviews
(
.
map
(
=>
.
)
)
;
}
private
async
updateSelectedMarkdownPreviews
(
)
:
Promise
<
void
>
{
if
(
!
this
.
)
{
return
;
}
if
(
!
this
.
.
isResolved
(
)
)
{
await
this
.
_resolveWebview
(
)
;
}
const
=
this
.
getSelectionViewModels
(
)
.
map
(
=>
.
)
;
await
this
.
?.
updateMarkupPreviewSelections
(
.
>
1
?
:
[
]
)
;
}
async
createOutput
(
:
,
:
,
:
number
,
:
boolean
)
:
Promise
<
void
>
{
this
.
.
queue
(
.
.
.
,
async
(
)
=>
{
if
(
this
.
||
!
this
.
)
{
return
;
}
if
(
!
this
.
.
isResolved
(
)
)
{
await
this
.
_resolveWebview
(
)
;
}
if
(
!
this
.
)
{
return
;
}
if
(
!
this
.
.
)
{
return
;
}
if
(
.
===
.
)
{
this
.
.
prepare
(
.
.
)
;
}
const
=
parseInt
(
this
.
.
.
.
.
,
10
)
;
const
=
!
!
?
(
0
-
)
:
0
;
const
=
this
.
.
getCellViewScrollTop
(
)
+
;
const
=
this
.
.
.
get
(
.
)
;
if
(
!
||
(
!
.
&&
.
===
.
)
)
{
if
(
)
{
this
.
.
requestCreateOutputWhenWebviewIdle
(
{
:
.
,
:
.
,
:
.
,
:
.
.
}
,
,
,
)
;
}
else
{
this
.
.
createOutput
(
{
:
.
,
:
.
,
:
.
,
:
.
.
}
,
,
,
)
;
}
}
else
if
(
.
&&
.
===
.
&&
.
.
!==
.
.
)
{
this
.
.
removeInsets
(
[
.
]
)
;
this
.
.
createOutput
(
{
:
.
,
:
.
,
:
.
}
,
,
,
)
;
}
else
if
(
.
!==
.
.
.
)
{
this
.
.
updateOutput
(
{
:
.
,
:
.
,
:
.
,
:
.
.
}
,
,
,
)
;
}
else
{
const
=
.
.
indexOf
(
.
)
;
const
=
.
getOutputOffset
(
)
;
this
.
.
updateScrollTops
(
[
{
,
:
.
,
,
,
:
!
.
,
}
]
,
[
]
)
;
}
}
)
;
}
async
updateOutput
(
:
,
:
,
:
number
)
:
Promise
<
void
>
{
this
.
.
queue
(
.
.
.
,
async
(
)
=>
{
if
(
this
.
||
!
this
.
||
.
)
{
return
;
}
if
(
!
this
.
.
isResolved
(
)
)
{
await
this
.
_resolveWebview
(
)
;
}
if
(
!
this
.
||
!
this
.
.
)
{
return
;
}
if
(
!
this
.
.
.
has
(
.
)
)
{
return
this
.
createOutput
(
,
,
,
false
)
;
}
if
(
.
===
.
)
{
this
.
.
prepare
(
.
.
)
;
}
const
=
parseInt
(
this
.
.
.
.
.
,
10
)
;
const
=
!
!
?
(
0
-
)
:
0
;
const
=
this
.
.
getCellViewScrollTop
(
)
+
;
this
.
.
updateOutput
(
{
:
.
,
:
.
,
:
.
}
,
,
,
)
;
}
)
;
}
async
copyOutputImage
(
:
)
:
Promise
<
void
>
{
this
.
?.
copyImage
(
)
;
}
removeInset
(
:
)
{
this
.
.
queue
(
.
.
,
async
(
)
=>
{
if
(
this
.
||
!
this
.
)
{
return
;
}
if
(
this
.
?.
isResolved
(
)
)
{
this
.
.
removeInsets
(
[
]
)
;
}
this
.
.
fire
(
)
;
}
)
;
}
hideInset
(
:
)
{
this
.
.
queue
(
.
.
,
async
(
)
=>
{
if
(
this
.
||
!
this
.
)
{
return
;
}
if
(
this
.
?.
isResolved
(
)
)
{
this
.
.
hideInset
(
)
;
}
}
)
;
}
postMessage
(
:
any
)
{
if
(
this
.
?.
isResolved
(
)
)
{
this
.
.
postKernelMessage
(
)
;
}
}
addClassName
(
:
string
)
{
this
.
.
.
add
(
)
;
}
removeClassName
(
:
string
)
{
this
.
.
.
remove
(
)
;
}
cellAt
(
:
number
)
:
|
undefined
{
return
this
.
?.
cellAt
(
)
;
}
getCellByInfo
(
:
)
:
{
const
{
}
=
;
return
this
.
?.
.
find
(
=>
.
===
)
as
;
}
getCellByHandle
(
:
number
)
:
|
undefined
{
return
this
.
?.
getCellByHandle
(
)
;
}
getCellIndex
(
:
)
{
return
this
.
?.
getCellIndexByHandle
(
.
)
;
}
getNextVisibleCellIndex
(
:
number
)
:
number
|
undefined
{
return
this
.
?.
getNextVisibleCellIndex
(
)
;
}
getPreviousVisibleCellIndex
(
:
number
)
:
number
|
undefined
{
return
this
.
?.
getPreviousVisibleCellIndex
(
)
;
}
private
_updateScrollHeight
(
)
{
if
(
this
.
||
!
this
.
?.
isResolved
(
)
)
{
return
;
}
if
(
!
this
.
.
)
{
return
;
}
const
=
this
.
.
;
this
.
.
.
.
=
` ${ scrollHeight + NOTEBOOK_WEBVIEW_BOUNDARY * 2 } px `
;
const
=
parseInt
(
this
.
.
.
.
.
,
10
)
;
const
=
!
!
?
(
0
-
)
:
0
;
const
:
[
]
=
[
]
;
const
:
[
]
=
[
]
;
this
.
?.
.
forEach
(
(
,
)
=>
{
const
=
this
.
?.
getCellByHandle
(
.
.
)
;
if
(
!
||
!
(
instanceof
CodeCellViewModel
)
)
{
return
;
}
this
.
?.
.
find
(
=>
.
===
.
.
)
;
const
=
this
.
.
getViewIndex
(
)
;
if
(
===
undefined
)
{
return
;
}
if
(
.
.
indexOf
(
)
<
0
)
{
.
push
(
)
;
}
const
=
this
.
.
getCellViewScrollTop
(
)
;
const
=
.
.
indexOf
(
)
;
const
=
.
getOutputOffset
(
)
;
.
push
(
{
,
:
,
:
+
,
,
:
false
,
}
)
;
}
)
;
this
.
.
removeInsets
(
)
;
const
:
{
:
string
;
:
number
}
[
]
=
[
]
;
for
(
const
of
this
.
.
.
keys
(
)
)
{
const
=
this
.
?.
.
find
(
=>
.
===
)
;
if
(
)
{
const
=
this
.
.
getCellViewScrollTop
(
)
;
.
push
(
{
:
,
:
+
}
)
;
}
}
if
(
.
||
.
)
{
this
.
_debug
(
'_list.onDidChangeContentHeight/markdown'
,
)
;
this
.
?.
updateScrollTops
(
,
)
;
}
}
private
_updateOutputHeight
(
:
,
:
,
:
number
,
:
boolean
,
?
:
string
)
:
void
{
const
=
this
.
?.
.
find
(
=>
.
===
.
)
;
if
(
&&
instanceof
CodeCellViewModel
)
{
const
=
.
.
indexOf
(
)
;
if
(
>
-
1
)
{
this
.
_debug
(
'update cell output'
,
.
,
)
;
.
updateOutputHeight
(
,
,
)
;
this
.
layoutNotebookCell
(
,
.
.
)
;
if
(
)
{
this
.
.
fire
(
)
;
}
}
else
{
this
.
_debug
(
'tried to update cell output that does not exist'
)
;
}
}
}
private
readonly
=
new
Map< string , IAckOutputHeight>
(
)
;
private
_scheduleOutputHeightAck
(
:
,
:
string
,
:
number
)
{
const
=
this
.
.
===
0
;
this
.
.
set
(
,
{
:
.
,
,
}
)
;
if
(
)
{
DOM
.
scheduleAtNextAnimationFrame
(
DOM
.
getWindow
(
this
.
getDomNode
(
)
)
,
(
)
=>
{
this
.
_debug
(
'ack height'
)
;
this
.
_updateScrollHeight
(
)
;
this
.
?.
ackHeight
(
[
...
this
.
.
values
(
)
]
)
;
this
.
.
clear
(
)
;
}
,
-
1
)
;
}
}
private
_getCellById
(
:
string
)
:
|
undefined
{
return
this
.
?.
.
find
(
=>
.
===
)
;
}
private
_updateMarkupCellHeight
(
:
string
,
:
number
,
:
boolean
)
{
const
=
this
.
_getCellById
(
)
;
if
(
&&
instanceof
MarkupCellViewModel
)
{
const
{
}
=
this
.
.
computeBottomToolbarDimensions
(
this
.
?.
)
;
this
.
_debug
(
'updateMarkdownCellHeight'
,
.
,
+
,
)
;
.
=
;
}
}
private
_setMarkupCellEditState
(
:
string
,
:
)
:
void
{
const
=
this
.
_getCellById
(
)
;
if
(
instanceof
MarkupCellViewModel
)
{
this
.
revealInView
(
)
;
.
updateEditState
(
,
'setMarkdownCellEditState'
)
;
}
}
private
_didStartDragMarkupCell
(
:
string
,
:
{
:
number
}
)
:
void
{
const
=
this
.
_getCellById
(
)
;
if
(
instanceof
MarkupCellViewModel
)
{
const
=
this
.
.
?
-
parseInt
(
this
.
.
.
.
.
,
10
)
:
0
;
this
.
?.
startExplicitDrag
(
,
.
-
)
;
}
}
private
_didDragMarkupCell
(
:
string
,
:
{
:
number
}
)
:
void
{
const
=
this
.
_getCellById
(
)
;
if
(
instanceof
MarkupCellViewModel
)
{
const
=
this
.
.
?
-
parseInt
(
this
.
.
.
.
.
,
10
)
:
0
;
this
.
?.
explicitDrag
(
,
.
-
)
;
}
}
private
_didDropMarkupCell
(
:
string
,
:
{
:
number
;
:
boolean
;
:
boolean
}
)
:
void
{
const
=
this
.
_getCellById
(
)
;
if
(
instanceof
MarkupCellViewModel
)
{
const
=
this
.
.
?
-
parseInt
(
this
.
.
.
.
.
,
10
)
:
0
;
.
-=
;
this
.
?.
explicitDrop
(
,
)
;
}
}
private
_didEndDragMarkupCell
(
:
string
)
:
void
{
const
=
this
.
_getCellById
(
)
;
if
(
instanceof
MarkupCellViewModel
)
{
this
.
?.
endExplicitDrag
(
)
;
}
}
private
_didResizeOutput
(
:
string
)
:
void
{
const
=
this
.
_getCellById
(
)
;
if
(
)
{
this
.
.
fire
(
)
;
}
}
private
_updatePerformanceMetadata
(
:
string
,
:
string
,
:
number
,
:
string
)
:
void
{
if
(
!
this
.
hasModel
(
)
)
{
return
;
}
const
=
this
.
_getCellById
(
)
;
const
=
!
?
undefined
:
this
.
getCellIndex
(
)
;
if
(
?.
.
===
&&
!==
undefined
)
{
const
=
.
.
||
{
}
;
[
]
=
(
[
]
??
0
)
+
;
this
.
.
applyEdits
(
[
{
:
.
,
:
,
:
{
:
,
:
}
}
]
,
true
,
undefined
,
(
)
=>
undefined
,
undefined
,
false
)
;
}
}
getContribution < T extends INotebookEditorContribution>
(
:
string
)
:
T
{
return
<
T
>
(
this
.
.
get
(
)
||
null
)
;
}
dispose
(
)
{
this
.
=
true
;
this
.
?.
dispose
(
)
;
this
.
=
null
;
this
.
.
forEach
(
=>
.
dispose
(
)
)
;
this
.
.
removeNotebookEditor
(
this
)
;
dispose
(
this
.
.
values
(
)
)
;
this
.
.
clear
(
)
;
this
.
.
clear
(
)
;
dispose
(
this
.
)
;
this
.
.
dispose
(
)
;
this
.
?.
dispose
(
)
;
this
.
.
remove
(
)
;
this
.
?.
dispose
(
)
;
this
.
.
clear
(
)
;
this
.
.
forEach
(
=>
.
dispose
(
)
)
;
this
.
.
clear
(
)
;
this
.
.
remove
(
)
;
super
.
dispose
(
)
;
this
.
=
null
;
this
.
=
null
;
this
.
=
null
;
this
.
=
null
;
this
.
=
null
;
this
.
=
undefined
;
this
.
=
null
;
this
.
=
null
!
;
this
.
=
null
!
;
this
.
=
null
!
;
this
.
=
null
;
this
.
=
null
;
}
toJSON
(
)
:
{
:
URI
|
undefined
}
{
return
{
:
this
.
?.
,
}
;
}
}
registerZIndex
(
.
,
5
,
'notebook-progress-bar'
,
)
;
registerZIndex
(
.
,
10
,
'notebook-list-insertion-indicator'
)
;
registerZIndex
(
.
,
20
,
'notebook-cell-editor-outline'
)
;
registerZIndex
(
.
,
25
,
'notebook-scrollbar'
)
;
registerZIndex
(
.
,
26
,
'notebook-cell-status'
)
;
registerZIndex
(
.
,
26
,
'notebook-folding-indicator'
)
;
registerZIndex
(
.
,
27
,
'notebook-output'
)
;
registerZIndex
(
.
,
28
,
'notebook-cell-bottom-toolbar-container'
)
;
registerZIndex
(
.
,
29
,
'notebook-run-button-container'
)
;
registerZIndex
(
.
,
29
,
'notebook-input-collapse-condicon'
)
;
registerZIndex
(
.
,
30
,
'notebook-cell-output-toolbar'
)
;
registerZIndex
(
.
,
1
,
'notebook-cell-expand-part-button'
)
;
registerZIndex
(
.
,
2
,
'notebook-cell-toolbar'
)
;
registerZIndex
(
.
,
3
,
'notebook-cell-toolbar-dropdown-active'
)
;
export
const
=
registerColor
(
'notebook.cellBorderColor'
,
{
:
transparent
(
,
1
)
,
:
transparent
(
,
1
)
,
:
PANEL_BORDER
,
:
PANEL_BORDER
}
,
.
localize
(
'notebook.cellBorderColor'
,
"The border color for notebook cells."
)
)
;
export
const
=
registerColor
(
'notebook.focusedEditorBorder'
,
,
.
localize
(
'notebook.focusedEditorBorder'
,
"The color of the notebook cell editor border."
)
)
;
export
const
=
registerColor
(
'notebookStatusSuccessIcon.foreground'
,
,
.
localize
(
'notebookStatusSuccessIcon.foreground'
,
"The error icon color of notebook cells in the cell status bar."
)
)
;
export
const
=
registerColor
(
'notebookEditorOverviewRuler.runningCellForeground'
,
,
.
localize
(
'notebookEditorOverviewRuler.runningCellForeground'
,
"The color of the running cell decoration in the notebook editor overview ruler."
)
)
;
export
const
=
registerColor
(
'notebookStatusErrorIcon.foreground'
,
,
.
localize
(
'notebookStatusErrorIcon.foreground'
,
"The error icon color of notebook cells in the cell status bar."
)
)
;
export
const
=
registerColor
(
'notebookStatusRunningIcon.foreground'
,
,
.
localize
(
'notebookStatusRunningIcon.foreground'
,
"The running icon color of notebook cells in the cell status bar."
)
)
;
export
const
=
registerColor
(
'notebook.outputContainerBorderColor'
,
null
,
.
localize
(
'notebook.outputContainerBorderColor'
,
"The border color of the notebook output container."
)
)
;
export
const
=
registerColor
(
'notebook.outputContainerBackgroundColor'
,
null
,
.
localize
(
'notebook.outputContainerBackgroundColor'
,
"The color of the notebook output container background."
)
)
;
export
const
CELL_TOOLBAR_SEPERATOR
=
registerColor
(
'notebook.cellToolbarSeparator'
,
{
:
.
fromHex
(
'#808080'
)
.
transparent
(
0.35
)
,
:
.
fromHex
(
'#808080'
)
.
transparent
(
0.35
)
,
:
,
:
}
,
.
localize
(
'notebook.cellToolbarSeparator'
,
"The color of the separator in the cell bottom toolbar"
)
)
;
export
const
=
registerColor
(
'notebook.focusedCellBackground'
,
null
,
.
localize
(
'focusedCellBackground'
,
"The background color of a cell when the cell is focused."
)
)
;
export
const
=
registerColor
(
'notebook.selectedCellBackground'
,
{
:
,
:
,
:
null
,
:
null
}
,
.
localize
(
'selectedCellBackground'
,
"The background color of a cell when the cell is selected."
)
)
;
export
const
=
registerColor
(
'notebook.cellHoverBackground'
,
{
:
transparent
(
,
.5
)
,
:
transparent
(
,
.7
)
,
:
null
,
:
null
}
,
.
localize
(
'notebook.cellHoverBackground'
,
"The background color of a cell when the cell is hovered."
)
)
;
export
const
=
registerColor
(
'notebook.selectedCellBorder'
,
{
:
,
:
,
:
,
:
}
,
.
localize
(
'notebook.selectedCellBorder'
,
"The color of the cell's top and bottom border when the cell is selected but not focused."
)
)
;
export
const
=
registerColor
(
'notebook.inactiveSelectedCellBorder'
,
{
:
null
,
:
null
,
:
,
:
}
,
.
localize
(
'notebook.inactiveSelectedCellBorder'
,
"The color of the cell's borders when multiple cells are selected."
)
)
;
export
const
=
registerColor
(
'notebook.focusedCellBorder'
,
,
.
localize
(
'notebook.focusedCellBorder'
,
"The color of the cell's focus indicator borders when the cell is focused."
)
)
;
export
const
=
registerColor
(
'notebook.inactiveFocusedCellBorder'
,
,
.
localize
(
'notebook.inactiveFocusedCellBorder'
,
"The color of the cell's top and bottom border when a cell is focused while the primary focus is outside of the editor."
)
)
;
export
const
=
registerColor
(
'notebook.cellStatusBarItemHoverBackground'
,
{
:
new
Color
(
new
RGBA
(
0
,
0
,
0
,
0.08
)
)
,
:
new
Color
(
new
RGBA
(
255
,
255
,
255
,
0.15
)
)
,
:
new
Color
(
new
RGBA
(
255
,
255
,
255
,
0.15
)
)
,
:
new
Color
(
new
RGBA
(
0
,
0
,
0
,
0.08
)
)
,
}
,
.
localize
(
'notebook.cellStatusBarItemHoverBackground'
,
"The background color of notebook cell status bar items."
)
)
;
export
const
=
registerColor
(
'notebook.cellInsertionIndicator'
,
,
.
localize
(
'notebook.cellInsertionIndicator'
,
"The color of the notebook cell insertion indicator."
)
)
;
export
const
=
registerColor
(
'notebookScrollbarSlider.background'
,
,
.
localize
(
'notebookScrollbarSliderBackground'
,
"Notebook scrollbar slider background color."
)
)
;
export
const
=
registerColor
(
'notebookScrollbarSlider.hoverBackground'
,
,
.
localize
(
'notebookScrollbarSliderHoverBackground'
,
"Notebook scrollbar slider background color when hovering."
)
)
;
export
const
=
registerColor
(
'notebookScrollbarSlider.activeBackground'
,
,
.
localize
(
'notebookScrollbarSliderActiveBackground'
,
"Notebook scrollbar slider background color when clicked on."
)
)
;
export
const
=
registerColor
(
'notebook.symbolHighlightBackground'
,
{
:
.
fromHex
(
'#ffffff0b'
)
,
:
.
fromHex
(
'#fdff0033'
)
,
:
null
,
:
null
}
,
.
localize
(
'notebook.symbolHighlightBackground'
,
"Background color of highlighted cell"
)
)
;
export
const
=
registerColor
(
'notebook.cellEditorBackground'
,
{
:
SIDE_BAR_BACKGROUND
,
:
SIDE_BAR_BACKGROUND
,
:
null
,
:
null
}
,
.
localize
(
'notebook.cellEditorBackground'
,
"Cell editor background color."
)
)
;
const
=
registerColor
(
'notebook.editorBackground'
,
{
:
EDITOR_PANE_BACKGROUND
,
:
EDITOR_PANE_BACKGROUND
,
:
null
,
:
null
}
,
.
localize
(
'notebook.editorBackground'
,
"Notebook background color."
)
)
;