@lvce-editor/editor-worker 19.29.1 → 19.29.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/editorWorkerMain.js +195 -276
- package/package.json +1 -1
package/dist/editorWorkerMain.js
CHANGED
|
@@ -1151,7 +1151,7 @@ const createMockRpc = ({
|
|
|
1151
1151
|
};
|
|
1152
1152
|
|
|
1153
1153
|
const rpcs = Object.create(null);
|
|
1154
|
-
const set$
|
|
1154
|
+
const set$g = (id, rpc) => {
|
|
1155
1155
|
rpcs[id] = rpc;
|
|
1156
1156
|
};
|
|
1157
1157
|
const get$9 = id => {
|
|
@@ -1184,7 +1184,7 @@ const create$a = rpcId => {
|
|
|
1184
1184
|
const mockRpc = createMockRpc({
|
|
1185
1185
|
commandMap
|
|
1186
1186
|
});
|
|
1187
|
-
set$
|
|
1187
|
+
set$g(rpcId, mockRpc);
|
|
1188
1188
|
// @ts-ignore
|
|
1189
1189
|
mockRpc[Symbol.dispose] = () => {
|
|
1190
1190
|
remove$8(rpcId);
|
|
@@ -1193,7 +1193,7 @@ const create$a = rpcId => {
|
|
|
1193
1193
|
return mockRpc;
|
|
1194
1194
|
},
|
|
1195
1195
|
set(rpc) {
|
|
1196
|
-
set$
|
|
1196
|
+
set$g(rpcId, rpc);
|
|
1197
1197
|
}
|
|
1198
1198
|
};
|
|
1199
1199
|
};
|
|
@@ -1436,7 +1436,6 @@ const DebugWorker = 55;
|
|
|
1436
1436
|
const DialogWorker = 7014;
|
|
1437
1437
|
const EditorWorker = 99;
|
|
1438
1438
|
const ErrorWorker = 3308;
|
|
1439
|
-
const ExtensionHostWorker = 44;
|
|
1440
1439
|
const ExtensionManagementWorker = 9006;
|
|
1441
1440
|
const IconThemeWorker = 7009;
|
|
1442
1441
|
const MarkdownWorker = 300;
|
|
@@ -1451,32 +1450,21 @@ const SetPatches = 'Viewlet.setPatches';
|
|
|
1451
1450
|
const FocusEditorText$1 = 12;
|
|
1452
1451
|
|
|
1453
1452
|
const {
|
|
1454
|
-
invoke: invoke$h,
|
|
1455
|
-
set: set$h
|
|
1456
|
-
} = create$a(DialogWorker);
|
|
1457
|
-
|
|
1458
|
-
const {
|
|
1459
|
-
invoke: invoke$g,
|
|
1460
|
-
set: set$g
|
|
1461
|
-
} = create$a(ErrorWorker);
|
|
1462
|
-
|
|
1463
|
-
const {
|
|
1464
|
-
invoke: invoke$f,
|
|
1465
|
-
set: set$f
|
|
1466
|
-
} = create$a(ExtensionHostWorker);
|
|
1467
|
-
|
|
1468
|
-
const ExtensionHost = {
|
|
1469
|
-
__proto__: null,
|
|
1470
1453
|
invoke: invoke$f,
|
|
1471
1454
|
set: set$f
|
|
1472
|
-
};
|
|
1455
|
+
} = create$a(DialogWorker);
|
|
1473
1456
|
|
|
1474
1457
|
const {
|
|
1475
1458
|
invoke: invoke$e,
|
|
1476
1459
|
set: set$e
|
|
1460
|
+
} = create$a(ErrorWorker);
|
|
1461
|
+
|
|
1462
|
+
const {
|
|
1463
|
+
invoke: invoke$d,
|
|
1464
|
+
set: set$d
|
|
1477
1465
|
} = create$a(ExtensionManagementWorker);
|
|
1478
1466
|
const getLanguages$1 = (platform, assetDir) => {
|
|
1479
|
-
return invoke$
|
|
1467
|
+
return invoke$d('Extensions.getLanguages', platform, assetDir);
|
|
1480
1468
|
};
|
|
1481
1469
|
|
|
1482
1470
|
const createLazyRpc = rpcId => {
|
|
@@ -1492,7 +1480,7 @@ const createLazyRpc = rpcId => {
|
|
|
1492
1480
|
throw new Error('Lazy RPC launch was superseded');
|
|
1493
1481
|
}
|
|
1494
1482
|
activeRpc = rpc;
|
|
1495
|
-
set$
|
|
1483
|
+
set$g(rpcId, rpc);
|
|
1496
1484
|
return rpc;
|
|
1497
1485
|
};
|
|
1498
1486
|
const ensureRpc = async () => {
|
|
@@ -1553,29 +1541,29 @@ const createLazyRpc = rpcId => {
|
|
|
1553
1541
|
};
|
|
1554
1542
|
|
|
1555
1543
|
const {
|
|
1556
|
-
invoke: invoke$
|
|
1557
|
-
set: set$
|
|
1544
|
+
invoke: invoke$c,
|
|
1545
|
+
set: set$c
|
|
1558
1546
|
} = create$a(OpenerWorker);
|
|
1559
1547
|
const openUrl = async (url, platform) => {
|
|
1560
|
-
return invoke$
|
|
1548
|
+
return invoke$c('Open.openUrl', url, platform);
|
|
1561
1549
|
};
|
|
1562
1550
|
|
|
1563
1551
|
const {
|
|
1564
|
-
invoke: invoke$
|
|
1565
|
-
set: set$
|
|
1552
|
+
invoke: invoke$b,
|
|
1553
|
+
set: set$b
|
|
1566
1554
|
} = create$a(IconThemeWorker);
|
|
1567
1555
|
|
|
1568
1556
|
const {
|
|
1569
|
-
invoke: invoke$
|
|
1557
|
+
invoke: invoke$a,
|
|
1570
1558
|
invokeAndTransfer,
|
|
1571
|
-
set: set$
|
|
1559
|
+
set: set$a
|
|
1572
1560
|
} = create$a(RendererWorker$1);
|
|
1573
1561
|
const showContextMenu2 = async (uid, menuId, x, y, args) => {
|
|
1574
1562
|
number(uid);
|
|
1575
1563
|
number(menuId);
|
|
1576
1564
|
number(x);
|
|
1577
1565
|
number(y);
|
|
1578
|
-
await invoke$
|
|
1566
|
+
await invoke$a('ContextMenu.show2', uid, menuId, x, y, args);
|
|
1579
1567
|
};
|
|
1580
1568
|
const sendMessagePortToOpenerWorker = async (port, rpcId) => {
|
|
1581
1569
|
const command = 'HandleMessagePort.handleMessagePort';
|
|
@@ -1590,23 +1578,16 @@ const sendMessagePortToErrorWorker = async (port, rpcId) => {
|
|
|
1590
1578
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToErrorWorker', port, command, rpcId);
|
|
1591
1579
|
};
|
|
1592
1580
|
const readFile$1 = async uri => {
|
|
1593
|
-
return invoke$
|
|
1581
|
+
return invoke$a('FileSystem.readFile', uri);
|
|
1594
1582
|
};
|
|
1595
1583
|
const handleWorkspaceRefresh = async () => {
|
|
1596
|
-
return invoke$
|
|
1597
|
-
};
|
|
1598
|
-
const sendMessagePortToExtensionHostWorker = async (port, rpcId = 0) => {
|
|
1599
|
-
const command = 'HandleMessagePort.handleMessagePort2';
|
|
1600
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, rpcId);
|
|
1584
|
+
return invoke$a('Layout.handleWorkspaceRefresh');
|
|
1601
1585
|
};
|
|
1602
1586
|
const writeClipBoardText = async text => {
|
|
1603
|
-
await invoke$
|
|
1587
|
+
await invoke$a('ClipBoard.writeText', /* text */text);
|
|
1604
1588
|
};
|
|
1605
1589
|
const readClipBoardText = async () => {
|
|
1606
|
-
return invoke$
|
|
1607
|
-
};
|
|
1608
|
-
const activateByEvent$1 = (event, assetDir, platform) => {
|
|
1609
|
-
return invoke$b('ExtensionHostManagement.activateByEvent', event, assetDir, platform);
|
|
1590
|
+
return invoke$a('ClipBoard.readText');
|
|
1610
1591
|
};
|
|
1611
1592
|
const sendMessagePortToTextMeasurementWorker = async port => {
|
|
1612
1593
|
const command = 'TextMeasurement.handleMessagePort';
|
|
@@ -1617,10 +1598,10 @@ const sendMessagePortToExtensionManagementWorker$1 = async (port, rpcId) => {
|
|
|
1617
1598
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionManagementWorker', port, command, rpcId);
|
|
1618
1599
|
};
|
|
1619
1600
|
const getPreference = async key => {
|
|
1620
|
-
return await invoke$
|
|
1601
|
+
return await invoke$a('Preferences.get', key);
|
|
1621
1602
|
};
|
|
1622
1603
|
const openUri = async (uri, focus, options) => {
|
|
1623
|
-
await invoke$
|
|
1604
|
+
await invoke$a('Main.openUri', {
|
|
1624
1605
|
...options,
|
|
1625
1606
|
focus,
|
|
1626
1607
|
uri
|
|
@@ -1632,35 +1613,33 @@ const sendMessagePortToSyntaxHighlightingWorker$1 = async port => {
|
|
|
1632
1613
|
|
|
1633
1614
|
const RendererWorker = {
|
|
1634
1615
|
__proto__: null,
|
|
1635
|
-
activateByEvent: activateByEvent$1,
|
|
1636
1616
|
getPreference,
|
|
1637
1617
|
handleWorkspaceRefresh,
|
|
1638
|
-
invoke: invoke$
|
|
1618
|
+
invoke: invoke$a,
|
|
1639
1619
|
invokeAndTransfer,
|
|
1640
1620
|
openUri,
|
|
1641
1621
|
readClipBoardText,
|
|
1642
1622
|
readFile: readFile$1,
|
|
1643
1623
|
sendMessagePortToDialogWorker,
|
|
1644
1624
|
sendMessagePortToErrorWorker,
|
|
1645
|
-
sendMessagePortToExtensionHostWorker,
|
|
1646
1625
|
sendMessagePortToExtensionManagementWorker: sendMessagePortToExtensionManagementWorker$1,
|
|
1647
1626
|
sendMessagePortToOpenerWorker,
|
|
1648
1627
|
sendMessagePortToSyntaxHighlightingWorker: sendMessagePortToSyntaxHighlightingWorker$1,
|
|
1649
1628
|
sendMessagePortToTextMeasurementWorker,
|
|
1650
|
-
set: set$
|
|
1629
|
+
set: set$a,
|
|
1651
1630
|
showContextMenu2,
|
|
1652
1631
|
writeClipBoardText
|
|
1653
1632
|
};
|
|
1654
1633
|
|
|
1655
1634
|
const {
|
|
1656
|
-
invoke: invoke$
|
|
1657
|
-
set: set$
|
|
1635
|
+
invoke: invoke$9,
|
|
1636
|
+
set: set$9
|
|
1658
1637
|
} = create$a(MarkdownWorker);
|
|
1659
1638
|
|
|
1660
1639
|
const SyntaxHighlightingWorker = {
|
|
1661
1640
|
__proto__: null,
|
|
1662
|
-
invoke: invoke$
|
|
1663
|
-
set: set$
|
|
1641
|
+
invoke: invoke$9,
|
|
1642
|
+
set: set$9
|
|
1664
1643
|
};
|
|
1665
1644
|
|
|
1666
1645
|
const toCommandId = key => {
|
|
@@ -1914,7 +1893,7 @@ const activateByEvent = async (event, assetDir, platform) => {
|
|
|
1914
1893
|
string(event);
|
|
1915
1894
|
// Assert.string(assetDir)
|
|
1916
1895
|
// Assert.number(platform)
|
|
1917
|
-
await
|
|
1896
|
+
await invoke$d('Extensions.activateByEvent', event);
|
|
1918
1897
|
};
|
|
1919
1898
|
|
|
1920
1899
|
const codeGeneratorAccept = state => {
|
|
@@ -1957,7 +1936,7 @@ const getOrCreate$3 = () => {
|
|
|
1957
1936
|
}
|
|
1958
1937
|
return state$c.workerPromise;
|
|
1959
1938
|
};
|
|
1960
|
-
const invoke$
|
|
1939
|
+
const invoke$8 = async (method, ...params) => {
|
|
1961
1940
|
const worker = await getOrCreate$3();
|
|
1962
1941
|
return await worker.invoke(method, ...params);
|
|
1963
1942
|
};
|
|
@@ -1970,10 +1949,10 @@ const loadContent$3 = async (state, parentUid) => {
|
|
|
1970
1949
|
x,
|
|
1971
1950
|
y
|
|
1972
1951
|
} = state;
|
|
1973
|
-
await invoke$
|
|
1974
|
-
await invoke$
|
|
1975
|
-
const diff = await invoke$
|
|
1976
|
-
const commands = await invoke$
|
|
1952
|
+
await invoke$8('ColorPicker.create', uid, x, y, width, height, parentUid);
|
|
1953
|
+
await invoke$8('ColorPicker.loadContent', uid);
|
|
1954
|
+
const diff = await invoke$8('ColorPicker.diff2', uid);
|
|
1955
|
+
const commands = await invoke$8('ColorPicker.render2', uid, diff);
|
|
1977
1956
|
return {
|
|
1978
1957
|
...state,
|
|
1979
1958
|
commands
|
|
@@ -1994,7 +1973,7 @@ const getKeys$2 = () => {
|
|
|
1994
1973
|
const keys = editorStates.getKeys();
|
|
1995
1974
|
return keys.map(String);
|
|
1996
1975
|
};
|
|
1997
|
-
const set$
|
|
1976
|
+
const set$8 = (id, oldEditor, newEditor) => {
|
|
1998
1977
|
editorStates.set(id, oldEditor, newEditor);
|
|
1999
1978
|
};
|
|
2000
1979
|
|
|
@@ -2100,7 +2079,7 @@ const createEditor2 = (id, uri, x, y, width, height, platform, assetDir) => {
|
|
|
2100
2079
|
x,
|
|
2101
2080
|
y
|
|
2102
2081
|
};
|
|
2103
|
-
set$
|
|
2082
|
+
set$8(id, editor, editor);
|
|
2104
2083
|
};
|
|
2105
2084
|
|
|
2106
2085
|
// TODO use numeric enum
|
|
@@ -2123,7 +2102,7 @@ const Rename = 'rename';
|
|
|
2123
2102
|
const ToggleBlockComment$1 = 'toggleBlockComment';
|
|
2124
2103
|
|
|
2125
2104
|
const map$1 = Object.create(null);
|
|
2126
|
-
const set$
|
|
2105
|
+
const set$7 = (id, widget) => {
|
|
2127
2106
|
map$1[id] = widget;
|
|
2128
2107
|
};
|
|
2129
2108
|
const get$7 = id => {
|
|
@@ -2596,8 +2575,8 @@ const getEnabled$1 = () => {
|
|
|
2596
2575
|
};
|
|
2597
2576
|
|
|
2598
2577
|
const {
|
|
2599
|
-
invoke: invoke$
|
|
2600
|
-
set: set$
|
|
2578
|
+
invoke: invoke$7,
|
|
2579
|
+
set: set$6
|
|
2601
2580
|
} = SyntaxHighlightingWorker;
|
|
2602
2581
|
|
|
2603
2582
|
const state$9 = {
|
|
@@ -2608,7 +2587,7 @@ const state$9 = {
|
|
|
2608
2587
|
const has = languageId => {
|
|
2609
2588
|
return Object.hasOwn(state$9.tokenizers, languageId);
|
|
2610
2589
|
};
|
|
2611
|
-
const set$
|
|
2590
|
+
const set$5 = (languageId, tokenizer) => {
|
|
2612
2591
|
state$9.tokenizers[languageId] = tokenizer;
|
|
2613
2592
|
};
|
|
2614
2593
|
const get$6 = languageId => {
|
|
@@ -2632,7 +2611,7 @@ const isPending = languageId => {
|
|
|
2632
2611
|
};
|
|
2633
2612
|
|
|
2634
2613
|
const tokenMaps = Object.create(null);
|
|
2635
|
-
const set$
|
|
2614
|
+
const set$4 = (languageId, tokenMap) => {
|
|
2636
2615
|
tokenMaps[languageId] = tokenMap;
|
|
2637
2616
|
};
|
|
2638
2617
|
const get$5 = languageId => {
|
|
@@ -2647,8 +2626,8 @@ const loadTokenizer = async (languageId, tokenizePath) => {
|
|
|
2647
2626
|
setTokenizePath(languageId, tokenizePath);
|
|
2648
2627
|
if (getEnabled$1()) {
|
|
2649
2628
|
// @ts-ignore
|
|
2650
|
-
const tokenMap = await invoke$
|
|
2651
|
-
set$
|
|
2629
|
+
const tokenMap = await invoke$7('Tokenizer.load', languageId, tokenizePath);
|
|
2630
|
+
set$4(languageId, tokenMap);
|
|
2652
2631
|
return;
|
|
2653
2632
|
}
|
|
2654
2633
|
try {
|
|
@@ -2664,8 +2643,8 @@ const loadTokenizer = async (languageId, tokenizePath) => {
|
|
|
2664
2643
|
console.warn(`tokenizer.TokenMap should be an object in "${tokenizePath}"`);
|
|
2665
2644
|
return;
|
|
2666
2645
|
}
|
|
2667
|
-
set$
|
|
2668
|
-
set$
|
|
2646
|
+
set$4(languageId, tokenizer.TokenMap);
|
|
2647
|
+
set$5(languageId, tokenizer);
|
|
2669
2648
|
} catch (error) {
|
|
2670
2649
|
// TODO better error handling
|
|
2671
2650
|
console.error(error);
|
|
@@ -2682,7 +2661,7 @@ const getTokenizer = languageId => {
|
|
|
2682
2661
|
};
|
|
2683
2662
|
|
|
2684
2663
|
const tokenizers = Object.create(null);
|
|
2685
|
-
const set$
|
|
2664
|
+
const set$3 = (id, value) => {
|
|
2686
2665
|
tokenizers[id] = value;
|
|
2687
2666
|
};
|
|
2688
2667
|
const get$4 = id => {
|
|
@@ -2835,13 +2814,13 @@ const getTokensViewport2 = async (editor, startLineIndex, endLineIndex, syncIncr
|
|
|
2835
2814
|
invalidStartIndex,
|
|
2836
2815
|
languageId
|
|
2837
2816
|
};
|
|
2838
|
-
return invoke$
|
|
2817
|
+
return invoke$7('GetTokensViewport.getTokensViewport', slimEditor,
|
|
2839
2818
|
// @ts-ignore
|
|
2840
2819
|
startLineIndex, endLineIndex, hasLinesToSend, id, linesToSend);
|
|
2841
2820
|
}
|
|
2842
2821
|
// TODO only send needed lines of text
|
|
2843
2822
|
// @ts-ignore
|
|
2844
|
-
return invoke$
|
|
2823
|
+
return invoke$7('GetTokensViewport.getTokensViewport', editor, startLineIndex, endLineIndex, true, editor.id, editor.lines);
|
|
2845
2824
|
}
|
|
2846
2825
|
return getTokensViewport(editor, startLineIndex, endLineIndex);
|
|
2847
2826
|
};
|
|
@@ -3500,7 +3479,7 @@ const getIncrementalEdits = async (oldState, newState) => {
|
|
|
3500
3479
|
const oldLine = oldState.lines[rowIndex];
|
|
3501
3480
|
const newLine = lines[rowIndex];
|
|
3502
3481
|
// @ts-ignore
|
|
3503
|
-
const incrementalEdits = await invoke$
|
|
3482
|
+
const incrementalEdits = await invoke$7(
|
|
3504
3483
|
// @ts-ignore
|
|
3505
3484
|
'TokenizeIncremental.tokenizeIncremental', newState.uid,
|
|
3506
3485
|
// @ts-ignore
|
|
@@ -3780,12 +3759,12 @@ const splitLines = lines => {
|
|
|
3780
3759
|
};
|
|
3781
3760
|
|
|
3782
3761
|
const {
|
|
3783
|
-
invoke: invoke$
|
|
3762
|
+
invoke: invoke$6,
|
|
3784
3763
|
readFile} = RendererWorker;
|
|
3785
3764
|
|
|
3786
3765
|
const notifyTabModifiedStatusChange = async (uri, modified) => {
|
|
3787
3766
|
try {
|
|
3788
|
-
await invoke$
|
|
3767
|
+
await invoke$6('Main.handleModifiedStatusChange', uri, modified);
|
|
3789
3768
|
} catch {
|
|
3790
3769
|
// ignore
|
|
3791
3770
|
}
|
|
@@ -3822,7 +3801,7 @@ const measureTextWidthFast = async (text, charWidth) => {
|
|
|
3822
3801
|
};
|
|
3823
3802
|
|
|
3824
3803
|
const measureTextWidthSlow = async (text, fontWeight, fontSize, fontFamily, letterSpacing, isMonoSpaceFont, charWidth) => {
|
|
3825
|
-
const width = await invoke$
|
|
3804
|
+
const width = await invoke$b('TextMeasurement.measureTextWidth', text, fontWeight, fontSize, fontFamily, letterSpacing, isMonoSpaceFont, charWidth);
|
|
3826
3805
|
return width;
|
|
3827
3806
|
};
|
|
3828
3807
|
|
|
@@ -4259,7 +4238,7 @@ const scheduleDocumentAndCursorsSelections = async (editor, changes, selectionCh
|
|
|
4259
4238
|
...newEditor,
|
|
4260
4239
|
decorations: linkDecorations
|
|
4261
4240
|
};
|
|
4262
|
-
set$
|
|
4241
|
+
set$8(editor.uid, editor, newEditorWithDecorations);
|
|
4263
4242
|
|
|
4264
4243
|
// Notify main-area-worker about modified status change
|
|
4265
4244
|
if (!editor.modified) {
|
|
@@ -4453,15 +4432,6 @@ const emptyEditor = {
|
|
|
4453
4432
|
y: 0
|
|
4454
4433
|
};
|
|
4455
4434
|
|
|
4456
|
-
const HoverExecute = 'ExtensionHostHover.execute';
|
|
4457
|
-
const TabCompletionExecuteTabCompletionProvider = 'ExtensionHost.executeTabCompletionProvider';
|
|
4458
|
-
const TextDocumentSyncFull = 'ExtensionHostTextDocument.syncFull';
|
|
4459
|
-
|
|
4460
|
-
const {
|
|
4461
|
-
invoke: invoke$6,
|
|
4462
|
-
set: set$3
|
|
4463
|
-
} = ExtensionHost;
|
|
4464
|
-
|
|
4465
4435
|
const getFileExtensionIndex = file => {
|
|
4466
4436
|
string(file);
|
|
4467
4437
|
return file.lastIndexOf(Dot);
|
|
@@ -4687,15 +4657,10 @@ const createEditor = async ({
|
|
|
4687
4657
|
focused: true,
|
|
4688
4658
|
textInfos
|
|
4689
4659
|
};
|
|
4690
|
-
set$
|
|
4691
|
-
|
|
4692
|
-
// TODO only sync when needed
|
|
4693
|
-
// e.g. it might not always be necessary to send text to extension host worker
|
|
4694
|
-
// @ts-ignore
|
|
4695
|
-
await invoke$6(TextDocumentSyncFull, uri, id, languageId, content);
|
|
4660
|
+
set$8(id, emptyEditor, newEditor4);
|
|
4696
4661
|
const completionsOnTypeRaw = await get$3('editor.completionsOnType');
|
|
4697
4662
|
const completionsOnType = Boolean(completionsOnTypeRaw);
|
|
4698
|
-
set$
|
|
4663
|
+
set$8(id, emptyEditor, {
|
|
4699
4664
|
...newEditor4,
|
|
4700
4665
|
completionsOnType
|
|
4701
4666
|
});
|
|
@@ -4726,7 +4691,7 @@ const createStandaloneEditor = async ({
|
|
|
4726
4691
|
const createdEditor = get$8(id).newState;
|
|
4727
4692
|
await loadTokenizer(languageId, tokenizePath);
|
|
4728
4693
|
const tokenizerId = createdEditor.tokenizerId + 1;
|
|
4729
|
-
set$
|
|
4694
|
+
set$3(tokenizerId, getTokenizer(languageId));
|
|
4730
4695
|
const configuredEditor = {
|
|
4731
4696
|
...createdEditor,
|
|
4732
4697
|
charWidth,
|
|
@@ -4768,7 +4733,7 @@ const createStandaloneEditor = async ({
|
|
|
4768
4733
|
cursorInfos,
|
|
4769
4734
|
selectionInfos
|
|
4770
4735
|
};
|
|
4771
|
-
set$
|
|
4736
|
+
set$8(id, createdEditor, finalEditor);
|
|
4772
4737
|
};
|
|
4773
4738
|
|
|
4774
4739
|
const isEqual$4 = (oldState, newState) => {
|
|
@@ -4913,7 +4878,7 @@ const disposeEditor = async editorUid => {
|
|
|
4913
4878
|
}
|
|
4914
4879
|
for (const widget of editor.widgets) {
|
|
4915
4880
|
if (widget.id === ColorPicker$1) {
|
|
4916
|
-
await invoke$
|
|
4881
|
+
await invoke$8('ColorPicker.dispose', widget.newState.uid);
|
|
4917
4882
|
}
|
|
4918
4883
|
}
|
|
4919
4884
|
const commands = renderWidgets$1(editor, {
|
|
@@ -5104,7 +5069,7 @@ const applyWorkspaceEdit = async (editor, changes) => {
|
|
|
5104
5069
|
}
|
|
5105
5070
|
const text = await readFile(uri);
|
|
5106
5071
|
const newText = applyEditsToText(text, edits);
|
|
5107
|
-
await invoke$
|
|
5072
|
+
await invoke$6('FileSystem.writeFile', uri, newText);
|
|
5108
5073
|
}
|
|
5109
5074
|
return currentEditor;
|
|
5110
5075
|
};
|
|
@@ -5129,8 +5094,8 @@ const closeWidgetsMaybe = widgets => {
|
|
|
5129
5094
|
};
|
|
5130
5095
|
|
|
5131
5096
|
const logError = async (error, prefix) => {
|
|
5132
|
-
const prettyError = await invoke$
|
|
5133
|
-
await invoke$
|
|
5097
|
+
const prettyError = await invoke$e('Errors.prepare', error);
|
|
5098
|
+
await invoke$e('Errors.print', prettyError, prefix);
|
|
5134
5099
|
};
|
|
5135
5100
|
const logFallback = (error, prefix) => {
|
|
5136
5101
|
if (prefix) {
|
|
@@ -5155,7 +5120,7 @@ const getFormattingEdits = async editor => {
|
|
|
5155
5120
|
text: getText$1(editor),
|
|
5156
5121
|
uri: editor.uri
|
|
5157
5122
|
};
|
|
5158
|
-
return invoke$
|
|
5123
|
+
return invoke$d('Extensions.executeFormattingProvider', textDocument);
|
|
5159
5124
|
};
|
|
5160
5125
|
|
|
5161
5126
|
const expectedErrorMessage$1 = 'Failed to execute formatting provider: FormattingError:';
|
|
@@ -5416,7 +5381,7 @@ const isUntitledFile = uri => {
|
|
|
5416
5381
|
};
|
|
5417
5382
|
|
|
5418
5383
|
const saveNormalFile = async (uri, content) => {
|
|
5419
|
-
await invoke$
|
|
5384
|
+
await invoke$a('FileSystem.writeFile', uri, content);
|
|
5420
5385
|
};
|
|
5421
5386
|
|
|
5422
5387
|
const showFilePicker = async platform => {
|
|
@@ -5424,7 +5389,7 @@ const showFilePicker = async platform => {
|
|
|
5424
5389
|
const {
|
|
5425
5390
|
canceled,
|
|
5426
5391
|
filePath
|
|
5427
|
-
} = await invoke$
|
|
5392
|
+
} = await invoke$c('Open.showSaveDialog', dialogTitle, [], platform);
|
|
5428
5393
|
if (canceled) {
|
|
5429
5394
|
return '';
|
|
5430
5395
|
}
|
|
@@ -5436,9 +5401,9 @@ const saveUntitledFile = async (uri, content, platform) => {
|
|
|
5436
5401
|
if (!filePath) {
|
|
5437
5402
|
return;
|
|
5438
5403
|
}
|
|
5439
|
-
await invoke$
|
|
5404
|
+
await invoke$a('FileSystem.writeFile', filePath, content);
|
|
5440
5405
|
await handleWorkspaceRefresh();
|
|
5441
|
-
await invoke$
|
|
5406
|
+
await invoke$a('Main.handleUriChange', uri, filePath);
|
|
5442
5407
|
return filePath;
|
|
5443
5408
|
};
|
|
5444
5409
|
|
|
@@ -5448,7 +5413,7 @@ const isPermissionDeniedError = error => {
|
|
|
5448
5413
|
};
|
|
5449
5414
|
const showSaveErrorDialog = async error => {
|
|
5450
5415
|
if (isPermissionDeniedError(error)) {
|
|
5451
|
-
await invoke$
|
|
5416
|
+
await invoke$f('ElectronDialog.showMessageBox', {
|
|
5452
5417
|
buttons: ['OK'],
|
|
5453
5418
|
defaultId: 0,
|
|
5454
5419
|
message: "You don't have permission to save changes to this file.",
|
|
@@ -5457,7 +5422,7 @@ const showSaveErrorDialog = async error => {
|
|
|
5457
5422
|
});
|
|
5458
5423
|
return;
|
|
5459
5424
|
}
|
|
5460
|
-
await invoke$
|
|
5425
|
+
await invoke$f('ElectronDialog.showMessageBox', {
|
|
5461
5426
|
buttons: ['OK'],
|
|
5462
5427
|
defaultId: 0,
|
|
5463
5428
|
detail: error.message,
|
|
@@ -5534,6 +5499,27 @@ const handleBlur$1 = async editor => {
|
|
|
5534
5499
|
return save(newEditor);
|
|
5535
5500
|
};
|
|
5536
5501
|
|
|
5502
|
+
const getTextDocument$3 = editor => ({
|
|
5503
|
+
documentId: editor.id || editor.uid,
|
|
5504
|
+
languageId: editor.languageId,
|
|
5505
|
+
text: getText$1(editor),
|
|
5506
|
+
uri: editor.uri
|
|
5507
|
+
});
|
|
5508
|
+
const execute = async ({
|
|
5509
|
+
args,
|
|
5510
|
+
editor,
|
|
5511
|
+
kind,
|
|
5512
|
+
method,
|
|
5513
|
+
noProviderFoundResult = undefined
|
|
5514
|
+
}) => {
|
|
5515
|
+
const textDocument = getTextDocument$3(editor);
|
|
5516
|
+
const result = await invoke$d('Extensions.executeLanguageProvider', kind, method, textDocument, ...args);
|
|
5517
|
+
if (!result.found) {
|
|
5518
|
+
return noProviderFoundResult;
|
|
5519
|
+
}
|
|
5520
|
+
return result.result;
|
|
5521
|
+
};
|
|
5522
|
+
|
|
5537
5523
|
const replaceRange = (editor, ranges, replacement, origin) => {
|
|
5538
5524
|
const changes = [];
|
|
5539
5525
|
const columnDeltas = new Map();
|
|
@@ -5604,8 +5590,12 @@ const getMatchingClosingBrace$1 = brace => {
|
|
|
5604
5590
|
const braceCompletion = async (editor, text) => {
|
|
5605
5591
|
try {
|
|
5606
5592
|
const offset = getCursorOffset(editor);
|
|
5607
|
-
|
|
5608
|
-
|
|
5593
|
+
const result = await execute({
|
|
5594
|
+
args: [offset, text],
|
|
5595
|
+
editor,
|
|
5596
|
+
kind: 'brace completion',
|
|
5597
|
+
method: 'provideBraceCompletion'
|
|
5598
|
+
});
|
|
5609
5599
|
if (result) {
|
|
5610
5600
|
const closingBrace = getMatchingClosingBrace$1(text);
|
|
5611
5601
|
const insertText = text + closingBrace;
|
|
@@ -6758,7 +6748,7 @@ const deleteWordRight = editor => {
|
|
|
6758
6748
|
|
|
6759
6749
|
const findAllReferences$1 = async editor => {
|
|
6760
6750
|
// @ts-ignore
|
|
6761
|
-
await invoke$
|
|
6751
|
+
await invoke$a('SideBar.show', 'References', /* focus */true);
|
|
6762
6752
|
return editor;
|
|
6763
6753
|
};
|
|
6764
6754
|
|
|
@@ -6840,9 +6830,12 @@ const getWordBefore = (editor, rowIndex, columnIndex) => {
|
|
|
6840
6830
|
|
|
6841
6831
|
// @ts-ignore
|
|
6842
6832
|
const getDefinition = async (editor, offset) => {
|
|
6843
|
-
|
|
6844
|
-
|
|
6845
|
-
|
|
6833
|
+
return execute({
|
|
6834
|
+
args: [offset],
|
|
6835
|
+
editor,
|
|
6836
|
+
kind: 'definition',
|
|
6837
|
+
method: 'provideDefinition'
|
|
6838
|
+
});
|
|
6846
6839
|
};
|
|
6847
6840
|
|
|
6848
6841
|
const emptyObject = {};
|
|
@@ -7130,9 +7123,12 @@ const getNoLocationFoundMessage = info => {
|
|
|
7130
7123
|
};
|
|
7131
7124
|
|
|
7132
7125
|
const getTypeDefinition = async (editor, offset) => {
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
|
|
7126
|
+
return execute({
|
|
7127
|
+
args: [offset],
|
|
7128
|
+
editor,
|
|
7129
|
+
kind: 'type definition',
|
|
7130
|
+
method: 'provideTypeDefinition'
|
|
7131
|
+
});
|
|
7136
7132
|
};
|
|
7137
7133
|
|
|
7138
7134
|
const getLocation = async (editor, rowIndex, columnIndex) => {
|
|
@@ -7582,26 +7578,6 @@ const create$5 = () => {
|
|
|
7582
7578
|
return widget;
|
|
7583
7579
|
};
|
|
7584
7580
|
|
|
7585
|
-
const OnDiagnostic = 'onDiagnostic';
|
|
7586
|
-
const OnHover = 'onHover';
|
|
7587
|
-
const OnTabCompletion = 'onTabCompletion';
|
|
7588
|
-
|
|
7589
|
-
const execute = async ({
|
|
7590
|
-
args,
|
|
7591
|
-
assetDir,
|
|
7592
|
-
editor,
|
|
7593
|
-
event,
|
|
7594
|
-
method,
|
|
7595
|
-
noProviderFoundMessage,
|
|
7596
|
-
noProviderFoundResult = undefined,
|
|
7597
|
-
platform
|
|
7598
|
-
}) => {
|
|
7599
|
-
const fullEvent = `${event}:${editor.languageId}`;
|
|
7600
|
-
await activateByEvent(fullEvent, assetDir, platform);
|
|
7601
|
-
const result = await invoke$6(method, editor.uid, ...args);
|
|
7602
|
-
return result;
|
|
7603
|
-
};
|
|
7604
|
-
|
|
7605
7581
|
const getTextDocument$2 = editor => {
|
|
7606
7582
|
return {
|
|
7607
7583
|
documentId: editor.id || editor.uid,
|
|
@@ -7612,22 +7588,12 @@ const getTextDocument$2 = editor => {
|
|
|
7612
7588
|
};
|
|
7613
7589
|
const executeIsolatedHoverProvider = async (editor, offset) => {
|
|
7614
7590
|
const textDocument = getTextDocument$2(editor);
|
|
7615
|
-
return invoke$
|
|
7591
|
+
return invoke$d('Extensions.executeHoverProvider', textDocument, offset);
|
|
7616
7592
|
};
|
|
7617
7593
|
const executeHoverProvider = async (editor, offset) => {
|
|
7618
7594
|
object(editor);
|
|
7619
7595
|
number(offset);
|
|
7620
|
-
|
|
7621
|
-
if (isolatedHover) {
|
|
7622
|
-
return isolatedHover;
|
|
7623
|
-
}
|
|
7624
|
-
return execute({
|
|
7625
|
-
args: [offset],
|
|
7626
|
-
editor,
|
|
7627
|
-
event: OnHover,
|
|
7628
|
-
method: HoverExecute,
|
|
7629
|
-
noProviderFoundMessage: 'No hover provider found'
|
|
7630
|
-
});
|
|
7596
|
+
return executeIsolatedHoverProvider(editor, offset);
|
|
7631
7597
|
};
|
|
7632
7598
|
|
|
7633
7599
|
const getHover = async (editor, offset) => {
|
|
@@ -7805,8 +7771,8 @@ const showHover = async (editor, position, token) => {
|
|
|
7805
7771
|
if (latestEditor === newEditor || !latestInstance || latestInstance.newState !== latestEditor || get$1().token !== token) {
|
|
7806
7772
|
return;
|
|
7807
7773
|
}
|
|
7808
|
-
set$
|
|
7809
|
-
await invoke$
|
|
7774
|
+
set$8(editor.uid, latestInstance.oldState, newEditor);
|
|
7775
|
+
await invoke$a('Editor.renderPending', editor.uid);
|
|
7810
7776
|
};
|
|
7811
7777
|
|
|
7812
7778
|
// TODO several things can happen:
|
|
@@ -8108,7 +8074,7 @@ const continueScrollingAndMovingSelection = async editorUid => {
|
|
|
8108
8074
|
}
|
|
8109
8075
|
};
|
|
8110
8076
|
const newEditorWithDerivedState = await updateDerivedState(editor, nextEditor);
|
|
8111
|
-
set$
|
|
8077
|
+
set$8(editor.uid, editor, newEditorWithDerivedState);
|
|
8112
8078
|
requestAnimationFrame(() => continueScrollingAndMovingSelection(editorUid));
|
|
8113
8079
|
};
|
|
8114
8080
|
|
|
@@ -8381,8 +8347,6 @@ const handleTouchMove = (editor, touchEvent) => {
|
|
|
8381
8347
|
};
|
|
8382
8348
|
|
|
8383
8349
|
const handleUriChange = async (editor, newUri) => {
|
|
8384
|
-
const content = getText$1(editor);
|
|
8385
|
-
await invoke$6(TextDocumentSyncFull, newUri, editor.id, editor.languageId, content);
|
|
8386
8350
|
return {
|
|
8387
8351
|
...editor,
|
|
8388
8352
|
uri: newUri
|
|
@@ -8468,7 +8432,7 @@ const indentMore = editor => {
|
|
|
8468
8432
|
|
|
8469
8433
|
const getLanguageConfiguration = async editor => {
|
|
8470
8434
|
// @ts-ignore
|
|
8471
|
-
return invoke$
|
|
8435
|
+
return invoke$a('Languages.getLanguageConfiguration', {
|
|
8472
8436
|
languageId: editor.languageId,
|
|
8473
8437
|
uri: editor.uri
|
|
8474
8438
|
});
|
|
@@ -8720,7 +8684,7 @@ const launch = async () => {
|
|
|
8720
8684
|
return;
|
|
8721
8685
|
}
|
|
8722
8686
|
const rpc = await launchFindWidgetWorker();
|
|
8723
|
-
set$
|
|
8687
|
+
set$g(rpcId, rpc);
|
|
8724
8688
|
};
|
|
8725
8689
|
const invoke$3 = async (method, ...params) => {
|
|
8726
8690
|
const rpc = get$9(rpcId);
|
|
@@ -8781,7 +8745,7 @@ const invoke$1 = async (method, ...params) => {
|
|
|
8781
8745
|
const getWidgetInvoke = widgetId => {
|
|
8782
8746
|
switch (widgetId) {
|
|
8783
8747
|
case ColorPicker$1:
|
|
8784
|
-
return invoke$
|
|
8748
|
+
return invoke$8;
|
|
8785
8749
|
case Completion:
|
|
8786
8750
|
return invoke$4;
|
|
8787
8751
|
case Find:
|
|
@@ -8886,7 +8850,7 @@ const createFn = (key, name, widgetId) => {
|
|
|
8886
8850
|
widgetRevision,
|
|
8887
8851
|
widgets: removeEditorWidget(latest.widgets, widgetId)
|
|
8888
8852
|
};
|
|
8889
|
-
set$
|
|
8853
|
+
set$8(editor.uid, latest, newEditor);
|
|
8890
8854
|
return newEditor;
|
|
8891
8855
|
}
|
|
8892
8856
|
const newState = {
|
|
@@ -8894,7 +8858,7 @@ const createFn = (key, name, widgetId) => {
|
|
|
8894
8858
|
commands
|
|
8895
8859
|
};
|
|
8896
8860
|
const newEditor = updateWidget(latest, widgetId, newState);
|
|
8897
|
-
set$
|
|
8861
|
+
set$8(editor.uid, latest, newEditor);
|
|
8898
8862
|
return newEditor;
|
|
8899
8863
|
};
|
|
8900
8864
|
return fn;
|
|
@@ -9200,13 +9164,14 @@ const openRename = async editor => {
|
|
|
9200
9164
|
};
|
|
9201
9165
|
|
|
9202
9166
|
const getOrganizeImportEdits = async editor => {
|
|
9203
|
-
const
|
|
9204
|
-
|
|
9205
|
-
editor,
|
|
9206
|
-
|
|
9207
|
-
|
|
9208
|
-
}
|
|
9209
|
-
|
|
9167
|
+
const textDocument = {
|
|
9168
|
+
documentId: editor.id || editor.uid,
|
|
9169
|
+
languageId: editor.languageId,
|
|
9170
|
+
text: getText$1(editor),
|
|
9171
|
+
uri: editor.uri
|
|
9172
|
+
};
|
|
9173
|
+
const result = await invoke$d('Extensions.executeOrganizeImportsProvider', textDocument);
|
|
9174
|
+
return result.found ? result.result ?? [] : [];
|
|
9210
9175
|
};
|
|
9211
9176
|
|
|
9212
9177
|
const organizeImports = async editor => {
|
|
@@ -9497,11 +9462,14 @@ const selectInsideString = editor => {
|
|
|
9497
9462
|
return scheduleSelections(editor, newSelections);
|
|
9498
9463
|
};
|
|
9499
9464
|
|
|
9500
|
-
// import * as ExtensionHostSelection from '../ExtensionHost/ExtensionHostSelection.ts'
|
|
9501
|
-
|
|
9502
9465
|
const getNewSelections = async (editor, selections) => {
|
|
9503
|
-
|
|
9504
|
-
|
|
9466
|
+
const newSelections = await execute({
|
|
9467
|
+
args: [selections],
|
|
9468
|
+
editor,
|
|
9469
|
+
kind: 'selection',
|
|
9470
|
+
method: 'provideSelections',
|
|
9471
|
+
noProviderFoundResult: []
|
|
9472
|
+
});
|
|
9505
9473
|
if (newSelections.length === 0) {
|
|
9506
9474
|
return selections;
|
|
9507
9475
|
}
|
|
@@ -9754,7 +9722,7 @@ const setLanguageId = async (editor, languageId, tokenizePath) => {
|
|
|
9754
9722
|
await loadTokenizer(languageId, tokenizePath);
|
|
9755
9723
|
const tokenizer = getTokenizer(languageId);
|
|
9756
9724
|
const newTokenizerId = tokenizerId + 1;
|
|
9757
|
-
set$
|
|
9725
|
+
set$3(newTokenizerId, tokenizer);
|
|
9758
9726
|
return {
|
|
9759
9727
|
...editor,
|
|
9760
9728
|
focused: true,
|
|
@@ -9865,7 +9833,7 @@ const executeSignatureHelpProvider = async (editor, offset) => {
|
|
|
9865
9833
|
object(editor);
|
|
9866
9834
|
number(offset);
|
|
9867
9835
|
const textDocument = getTextDocument$1(editor);
|
|
9868
|
-
return invoke$
|
|
9836
|
+
return invoke$d('Extensions.executeSignatureHelpProvider', textDocument, offset);
|
|
9869
9837
|
};
|
|
9870
9838
|
|
|
9871
9839
|
const getSignatureHelp = async (editor, offset) => {
|
|
@@ -10066,9 +10034,8 @@ const executeTabCompletionProvider = async (editor, offset) => {
|
|
|
10066
10034
|
return execute({
|
|
10067
10035
|
args: [offset],
|
|
10068
10036
|
editor,
|
|
10069
|
-
|
|
10070
|
-
method:
|
|
10071
|
-
noProviderFoundMessage: 'No tab completion provider found',
|
|
10037
|
+
kind: 'tab completion',
|
|
10038
|
+
method: 'provideTabCompletion',
|
|
10072
10039
|
noProviderFoundResult: undefined
|
|
10073
10040
|
});
|
|
10074
10041
|
};
|
|
@@ -10195,18 +10162,13 @@ const tabCompletion = async editor => {
|
|
|
10195
10162
|
};
|
|
10196
10163
|
|
|
10197
10164
|
const getBlockComment = async (editor, offset) => {
|
|
10198
|
-
const {
|
|
10199
|
-
assetDir,
|
|
10200
|
-
platform
|
|
10201
|
-
} = editor;
|
|
10202
|
-
// TODO ask extension host worker,
|
|
10203
|
-
// execute block comment provider with
|
|
10204
|
-
// URI, language id, offset
|
|
10205
|
-
// and the extension returns a matching block comment or undefined
|
|
10206
10165
|
try {
|
|
10207
|
-
await
|
|
10208
|
-
|
|
10209
|
-
|
|
10166
|
+
const blockComment = await execute({
|
|
10167
|
+
args: [offset],
|
|
10168
|
+
editor,
|
|
10169
|
+
kind: 'comment',
|
|
10170
|
+
method: 'provideComment'
|
|
10171
|
+
});
|
|
10210
10172
|
if (blockComment) {
|
|
10211
10173
|
return blockComment;
|
|
10212
10174
|
}
|
|
@@ -10566,8 +10528,12 @@ const typeWithAutoClosingQuote = (editor, text) => {
|
|
|
10566
10528
|
|
|
10567
10529
|
const typeWithAutoClosingTag = async (editor, text) => {
|
|
10568
10530
|
const offset = offsetAt(editor, editor.selections[0], editor.selections[1]);
|
|
10569
|
-
|
|
10570
|
-
|
|
10531
|
+
const result = await execute({
|
|
10532
|
+
args: [offset, text],
|
|
10533
|
+
editor,
|
|
10534
|
+
kind: 'closing tag',
|
|
10535
|
+
method: 'provideClosingTag'
|
|
10536
|
+
});
|
|
10571
10537
|
if (!result) {
|
|
10572
10538
|
const changes = editorReplaceSelections(editor, [text], EditorType);
|
|
10573
10539
|
return scheduleDocumentAndCursorsSelections(editor, changes);
|
|
@@ -11246,13 +11212,8 @@ const getEditorSourceActions = async editorId => {
|
|
|
11246
11212
|
const {
|
|
11247
11213
|
newState
|
|
11248
11214
|
} = get$8(editorId);
|
|
11249
|
-
const
|
|
11250
|
-
return
|
|
11251
|
-
args: [offset],
|
|
11252
|
-
editor: newState,
|
|
11253
|
-
event: 'onLanguage',
|
|
11254
|
-
method: 'ExtensionHostCodeActions.getSourceActions'
|
|
11255
|
-
});
|
|
11215
|
+
const extensions = await invoke$d('Extensions.getAllExtensions', newState.assetDir, newState.platform);
|
|
11216
|
+
return extensions.flatMap(extension => extension.codeActions || []).filter(action => action.languageId === newState.languageId);
|
|
11256
11217
|
};
|
|
11257
11218
|
|
|
11258
11219
|
/* eslint-disable sonarjs/super-linear-regex */
|
|
@@ -11275,14 +11236,14 @@ const getWordAtOffset = editor => {
|
|
|
11275
11236
|
};
|
|
11276
11237
|
|
|
11277
11238
|
const setFocus = async focusKey => {
|
|
11278
|
-
await invoke$
|
|
11239
|
+
await invoke$a('Focus.setFocus', focusKey);
|
|
11279
11240
|
};
|
|
11280
11241
|
const unsetAdditionalFocus = async focusKey => {
|
|
11281
11242
|
if (!focusKey) {
|
|
11282
11243
|
return;
|
|
11283
11244
|
}
|
|
11284
11245
|
// @ts-ignore
|
|
11285
|
-
await invoke$
|
|
11246
|
+
await invoke$a('Focus.removeAdditionalFocus', focusKey);
|
|
11286
11247
|
};
|
|
11287
11248
|
|
|
11288
11249
|
const FocusEditor = 12;
|
|
@@ -11354,7 +11315,7 @@ const setSelections2 = async (editorUid, selections) => {
|
|
|
11354
11315
|
selections
|
|
11355
11316
|
};
|
|
11356
11317
|
const newEditorWithDerivedState = await updateDerivedState(editor, newEditor);
|
|
11357
|
-
set$
|
|
11318
|
+
set$8(editorUid, editor, newEditorWithDerivedState);
|
|
11358
11319
|
};
|
|
11359
11320
|
const closeWidget2 = async (editorUid, widgetId, widgetName, unsetAdditionalFocus$1) => {
|
|
11360
11321
|
const editor = getEditor(editorUid);
|
|
@@ -11377,7 +11338,7 @@ const closeWidget2 = async (editorUid, widgetId, widgetName, unsetAdditionalFocu
|
|
|
11377
11338
|
widgets: newWidgets
|
|
11378
11339
|
};
|
|
11379
11340
|
const newEditorWithDerivedState = await updateDerivedState(editor, newEditor);
|
|
11380
|
-
set$
|
|
11341
|
+
set$8(editorUid, editor, newEditorWithDerivedState);
|
|
11381
11342
|
await setFocus(FocusEditorText);
|
|
11382
11343
|
if (unsetAdditionalFocus$1) {
|
|
11383
11344
|
await unsetAdditionalFocus(unsetAdditionalFocus$1);
|
|
@@ -11390,7 +11351,7 @@ const applyEdits2 = async (editorUid, edits) => {
|
|
|
11390
11351
|
const editor = getEditor(editorUid);
|
|
11391
11352
|
const newEditor = await applyEdit(editor, edits);
|
|
11392
11353
|
const newEditorWithDerivedState = await updateDerivedState(editor, newEditor);
|
|
11393
|
-
set$
|
|
11354
|
+
set$8(editorUid, editor, newEditorWithDerivedState);
|
|
11394
11355
|
};
|
|
11395
11356
|
const getSourceActions = async editorUid => {
|
|
11396
11357
|
const actions = await getEditorSourceActions(editorUid);
|
|
@@ -11405,7 +11366,7 @@ const getDiagnostics$1 = async editorUid => {
|
|
|
11405
11366
|
};
|
|
11406
11367
|
|
|
11407
11368
|
const ensure = async (fontName, fontUrl) => {
|
|
11408
|
-
await invoke$
|
|
11369
|
+
await invoke$b('TextMeasurement.ensureFont', fontName, fontUrl);
|
|
11409
11370
|
};
|
|
11410
11371
|
|
|
11411
11372
|
const getKeyBindings = () => {
|
|
@@ -12023,7 +11984,7 @@ const handleMessagePort = async (port, rpcId) => {
|
|
|
12023
11984
|
messagePort: port
|
|
12024
11985
|
});
|
|
12025
11986
|
if (rpcId) {
|
|
12026
|
-
set$
|
|
11987
|
+
set$g(rpcId, rpc);
|
|
12027
11988
|
}
|
|
12028
11989
|
};
|
|
12029
11990
|
|
|
@@ -12277,12 +12238,12 @@ const hotReload = async () => {
|
|
|
12277
12238
|
await relaunchWorkers();
|
|
12278
12239
|
const newEditors = await restoreWidgetState(keys, savedStates);
|
|
12279
12240
|
for (const editor of newEditors) {
|
|
12280
|
-
set$
|
|
12241
|
+
set$8(editor.newState.uid, editor.oldState, editor.newState);
|
|
12281
12242
|
}
|
|
12282
12243
|
|
|
12283
12244
|
// TODO ask renderer worker to rerender all editors
|
|
12284
12245
|
// @ts-ignore
|
|
12285
|
-
await invoke$
|
|
12246
|
+
await invoke$a(`Editor.rerender`);
|
|
12286
12247
|
} finally {
|
|
12287
12248
|
state.isReloading = false;
|
|
12288
12249
|
}
|
|
@@ -12315,7 +12276,7 @@ const initializeSyntaxHighlighting = async (syntaxHighlightingEnabled, syncIncre
|
|
|
12315
12276
|
if (syntaxHighlightingEnabled) {
|
|
12316
12277
|
setEnabled$1(true);
|
|
12317
12278
|
const syntaxRpc = await createSyntaxHighlightingWorkerRpc();
|
|
12318
|
-
set$
|
|
12279
|
+
set$6(syntaxRpc);
|
|
12319
12280
|
}
|
|
12320
12281
|
if (syncIncremental) {
|
|
12321
12282
|
setEnabled(true);
|
|
@@ -12385,7 +12346,7 @@ const loadContent = async (state, savedState) => {
|
|
|
12385
12346
|
await loadTokenizer(computedLanguageId, tokenizePath);
|
|
12386
12347
|
const tokenizer = getTokenizer(computedLanguageId);
|
|
12387
12348
|
const newTokenizerId = state.tokenizerId + 1;
|
|
12388
|
-
set$
|
|
12349
|
+
set$3(newTokenizerId, tokenizer);
|
|
12389
12350
|
const newEditor0 = {
|
|
12390
12351
|
...state,
|
|
12391
12352
|
charWidth,
|
|
@@ -12456,11 +12417,6 @@ const loadContent = async (state, savedState) => {
|
|
|
12456
12417
|
focused: true,
|
|
12457
12418
|
textInfos
|
|
12458
12419
|
};
|
|
12459
|
-
|
|
12460
|
-
// TODO only sync when needed
|
|
12461
|
-
// e.g. it might not always be necessary to send text to extension host worker
|
|
12462
|
-
// @ts-ignore
|
|
12463
|
-
await invoke$6(TextDocumentSyncFull, uri, id, computedLanguageId, content);
|
|
12464
12420
|
const completionsOnTypeRaw = await get$3('editor.completionsOnType');
|
|
12465
12421
|
const completionsOnType = Boolean(completionsOnTypeRaw);
|
|
12466
12422
|
const newEditor5 = {
|
|
@@ -13286,7 +13242,7 @@ const render2 = (uid, diffResult) => {
|
|
|
13286
13242
|
newState,
|
|
13287
13243
|
oldState
|
|
13288
13244
|
} = get$8(uid);
|
|
13289
|
-
set$
|
|
13245
|
+
set$8(uid, newState, newState);
|
|
13290
13246
|
const commands = applyRender(oldState, newState, diffResult);
|
|
13291
13247
|
return commands;
|
|
13292
13248
|
};
|
|
@@ -13383,7 +13339,7 @@ const renderEditor = async id => {
|
|
|
13383
13339
|
oldState
|
|
13384
13340
|
} = instance;
|
|
13385
13341
|
const commands = [];
|
|
13386
|
-
set$
|
|
13342
|
+
set$8(id, newState, newState);
|
|
13387
13343
|
for (const item of render$7) {
|
|
13388
13344
|
if (item.isEqual(oldState, newState)) {
|
|
13389
13345
|
continue;
|
|
@@ -13487,13 +13443,12 @@ const saveState = (state, savedState) => {
|
|
|
13487
13443
|
};
|
|
13488
13444
|
};
|
|
13489
13445
|
|
|
13490
|
-
const sendMessagePortToExtensionHostWorker2 = async (port, initialCommand, rpcId) => {
|
|
13491
|
-
await sendMessagePortToExtensionHostWorker(port, rpcId);
|
|
13492
|
-
};
|
|
13493
|
-
|
|
13494
13446
|
const sendMessagePortToExtensionManagementWorker = async (port, rpcId) => {
|
|
13495
13447
|
await sendMessagePortToExtensionManagementWorker$1(port, rpcId);
|
|
13496
13448
|
};
|
|
13449
|
+
const sendDeprecatedExtensionHostPortToExtensionManagementWorker = async (port, _initialCommand, rpcId) => {
|
|
13450
|
+
await sendMessagePortToExtensionManagementWorker$1(port, rpcId);
|
|
13451
|
+
};
|
|
13497
13452
|
|
|
13498
13453
|
const setDebugEnabled = (state, enabled) => {
|
|
13499
13454
|
return state;
|
|
@@ -13539,9 +13494,9 @@ const updateDebugInfo = async debugId => {
|
|
|
13539
13494
|
...newState,
|
|
13540
13495
|
highlightedLine: newInfo.rowIndex
|
|
13541
13496
|
};
|
|
13542
|
-
set$
|
|
13497
|
+
set$8(key, oldState, newEditor);
|
|
13543
13498
|
// @ts-ignore
|
|
13544
|
-
await invoke$
|
|
13499
|
+
await invoke$a('Editor.rerender', key);
|
|
13545
13500
|
};
|
|
13546
13501
|
|
|
13547
13502
|
const getTextDocument = editor => {
|
|
@@ -13554,26 +13509,10 @@ const getTextDocument = editor => {
|
|
|
13554
13509
|
};
|
|
13555
13510
|
const executeIsolatedDiagnosticProvider = async editor => {
|
|
13556
13511
|
const textDocument = getTextDocument(editor);
|
|
13557
|
-
return invoke$
|
|
13512
|
+
return invoke$d('Extensions.executeDiagnosticProvider', textDocument);
|
|
13558
13513
|
};
|
|
13559
13514
|
const executeDiagnosticProvider = async editor => {
|
|
13560
|
-
|
|
13561
|
-
if (isolatedDiagnostics.length > 0) {
|
|
13562
|
-
return isolatedDiagnostics;
|
|
13563
|
-
}
|
|
13564
|
-
const {
|
|
13565
|
-
assetDir,
|
|
13566
|
-
platform
|
|
13567
|
-
} = editor;
|
|
13568
|
-
return execute({
|
|
13569
|
-
args: [],
|
|
13570
|
-
assetDir,
|
|
13571
|
-
editor,
|
|
13572
|
-
event: OnDiagnostic,
|
|
13573
|
-
method: 'ExtensionHost.executeDiagnosticProvider',
|
|
13574
|
-
noProviderFoundMessage: 'no diagnostic provider found',
|
|
13575
|
-
platform
|
|
13576
|
-
});
|
|
13515
|
+
return executeIsolatedDiagnosticProvider(editor);
|
|
13577
13516
|
};
|
|
13578
13517
|
|
|
13579
13518
|
const getDiagnosticType = diagnostic => {
|
|
@@ -13654,9 +13593,6 @@ const mergeLinksWithDiagnosticDecorations = (editor, diagnosticDecorations) => {
|
|
|
13654
13593
|
};
|
|
13655
13594
|
|
|
13656
13595
|
const getDiagnostics = async editor => {
|
|
13657
|
-
const content = getText$1(editor);
|
|
13658
|
-
// @ts-ignore
|
|
13659
|
-
await invoke$6(TextDocumentSyncFull, editor.uri, editor.id, editor.languageId, content);
|
|
13660
13596
|
return executeDiagnosticProvider(editor);
|
|
13661
13597
|
};
|
|
13662
13598
|
const addDiagnostics = async (editor, diagnostics) => {
|
|
@@ -13688,7 +13624,7 @@ const updateDiagnostics = async editor => {
|
|
|
13688
13624
|
return editor;
|
|
13689
13625
|
}
|
|
13690
13626
|
const newEditor = await addDiagnostics(latest.newState, diagnostics);
|
|
13691
|
-
set$
|
|
13627
|
+
set$8(editor.id, latest.oldState, newEditor);
|
|
13692
13628
|
return newEditor;
|
|
13693
13629
|
} catch (error) {
|
|
13694
13630
|
return handleError(error, editor);
|
|
@@ -13729,14 +13665,14 @@ const wrapCommand = fn => async (uid, ...args) => {
|
|
|
13729
13665
|
return newEditor;
|
|
13730
13666
|
}
|
|
13731
13667
|
const newEditorWithDerivedState = await updateDerivedState(state, newEditor);
|
|
13732
|
-
set$
|
|
13668
|
+
set$8(uid, state, newEditorWithDerivedState);
|
|
13733
13669
|
let finalEditor = newEditorWithDerivedState;
|
|
13734
13670
|
if (editorDiagnosticEffect.isActive(state, newEditorWithDerivedState)) {
|
|
13735
13671
|
finalEditor = await editorDiagnosticEffect.apply(newEditorWithDerivedState);
|
|
13736
13672
|
if (!get$8(uid)) {
|
|
13737
13673
|
return finalEditor;
|
|
13738
13674
|
}
|
|
13739
|
-
set$
|
|
13675
|
+
set$8(uid, state, finalEditor);
|
|
13740
13676
|
}
|
|
13741
13677
|
const {
|
|
13742
13678
|
initial,
|
|
@@ -13766,7 +13702,7 @@ const wrapCommand = fn => async (uid, ...args) => {
|
|
|
13766
13702
|
undoStack: finalEditor.undoStack,
|
|
13767
13703
|
visualDecorations: finalEditor.visualDecorations
|
|
13768
13704
|
});
|
|
13769
|
-
set$
|
|
13705
|
+
set$8(otherUid, instance.oldState, synchronizedEditor);
|
|
13770
13706
|
}
|
|
13771
13707
|
}
|
|
13772
13708
|
return finalEditor;
|
|
@@ -14008,7 +13944,6 @@ const commandMap = {
|
|
|
14008
13944
|
'EditorSourceAction.selectItem': selectItem,
|
|
14009
13945
|
'EditorSourceAction.toggleDetails': toggleDetails,
|
|
14010
13946
|
'EditorSourceActions.focusNext': focusNext$1,
|
|
14011
|
-
'ExtensionHostManagement.activateByEvent': activateByEvent,
|
|
14012
13947
|
'FindWidget.close': close$4,
|
|
14013
13948
|
'FindWidget.focusCloseButton': focusCloseButton,
|
|
14014
13949
|
'FindWidget.focusFind': focusFind,
|
|
@@ -14049,7 +13984,7 @@ const commandMap = {
|
|
|
14049
13984
|
'Listener.register': registerListener,
|
|
14050
13985
|
'Listener.registerListener': registerListener$1,
|
|
14051
13986
|
'Listener.unregister': unregisterListener,
|
|
14052
|
-
'SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker':
|
|
13987
|
+
'SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker': sendDeprecatedExtensionHostPortToExtensionManagementWorker,
|
|
14053
13988
|
'SendMessagePortToExtensionManagementWorker.sendMessagePortToExtensionManagementWorker': sendMessagePortToExtensionManagementWorker
|
|
14054
13989
|
};
|
|
14055
13990
|
for (const [key, value] of Object.entries(commandMap)) {
|
|
@@ -14066,23 +14001,7 @@ const initializeErrorWorker = async () => {
|
|
|
14066
14001
|
return sendMessagePortToErrorWorker(port, EditorWorker);
|
|
14067
14002
|
}
|
|
14068
14003
|
});
|
|
14069
|
-
set$
|
|
14070
|
-
};
|
|
14071
|
-
|
|
14072
|
-
const createExtensionHostRpc = async () => {
|
|
14073
|
-
const initialCommand = 'HandleMessagePort.handleMessagePort2';
|
|
14074
|
-
const rpc = await create$d({
|
|
14075
|
-
commandMap: {},
|
|
14076
|
-
async send(port) {
|
|
14077
|
-
await sendMessagePortToExtensionHostWorker2(port, initialCommand, EditorWorker);
|
|
14078
|
-
}
|
|
14079
|
-
});
|
|
14080
|
-
return rpc;
|
|
14081
|
-
};
|
|
14082
|
-
|
|
14083
|
-
const initializeExtensionHost = async () => {
|
|
14084
|
-
const extensionHostRpc = await createExtensionHostRpc();
|
|
14085
|
-
set$3(extensionHostRpc);
|
|
14004
|
+
set$e(rpc);
|
|
14086
14005
|
};
|
|
14087
14006
|
|
|
14088
14007
|
const createExtensionManagementWorkerRpc = async () => {
|
|
@@ -14098,7 +14017,7 @@ const createExtensionManagementWorkerRpc = async () => {
|
|
|
14098
14017
|
const initializeExtensionManagementWorker = async () => {
|
|
14099
14018
|
try {
|
|
14100
14019
|
const rpc = await createExtensionManagementWorkerRpc();
|
|
14101
|
-
set$
|
|
14020
|
+
set$d(rpc);
|
|
14102
14021
|
} catch {
|
|
14103
14022
|
// ignore
|
|
14104
14023
|
}
|
|
@@ -14113,14 +14032,14 @@ const initializeOpenerWorker = async () => {
|
|
|
14113
14032
|
commandMap: {},
|
|
14114
14033
|
send: send$1
|
|
14115
14034
|
});
|
|
14116
|
-
set$
|
|
14035
|
+
set$c(rpc);
|
|
14117
14036
|
};
|
|
14118
14037
|
|
|
14119
14038
|
const initializeRendererWorker = async () => {
|
|
14120
14039
|
const rpc = await create$b({
|
|
14121
14040
|
commandMap: commandMap
|
|
14122
14041
|
});
|
|
14123
|
-
set$
|
|
14042
|
+
set$a(rpc);
|
|
14124
14043
|
};
|
|
14125
14044
|
|
|
14126
14045
|
const send = port => {
|
|
@@ -14131,17 +14050,17 @@ const initializeTextMeasurementWorker = async () => {
|
|
|
14131
14050
|
commandMap: {},
|
|
14132
14051
|
send
|
|
14133
14052
|
});
|
|
14134
|
-
set$
|
|
14053
|
+
set$b(rpc);
|
|
14135
14054
|
};
|
|
14136
14055
|
|
|
14137
14056
|
const listen = async () => {
|
|
14138
14057
|
registerCommands(commandMap);
|
|
14139
|
-
await Promise.all([initializeRendererWorker(), initializeErrorWorker(),
|
|
14058
|
+
await Promise.all([initializeRendererWorker(), initializeErrorWorker(), initializeExtensionManagementWorker(), initializeTextMeasurementWorker(), initializeOpenerWorker()]);
|
|
14140
14059
|
const dialogRpc = await create$d({
|
|
14141
14060
|
commandMap: {},
|
|
14142
14061
|
send: sendMessagePortToDialogWorker
|
|
14143
14062
|
});
|
|
14144
|
-
set$
|
|
14063
|
+
set$f(dialogRpc);
|
|
14145
14064
|
};
|
|
14146
14065
|
|
|
14147
14066
|
const CodeGeneratorInput = 'CodeGeneratorInput';
|
|
@@ -14461,15 +14380,15 @@ const EditorMessageWidget = {
|
|
|
14461
14380
|
};
|
|
14462
14381
|
|
|
14463
14382
|
const registerWidgets = () => {
|
|
14464
|
-
set$
|
|
14465
|
-
set$
|
|
14466
|
-
set$
|
|
14467
|
-
set$
|
|
14468
|
-
set$
|
|
14469
|
-
set$
|
|
14470
|
-
set$
|
|
14471
|
-
set$
|
|
14472
|
-
set$
|
|
14383
|
+
set$7(ColorPicker$1, EditorColorPickerWidget);
|
|
14384
|
+
set$7(Completion, EditorCompletionWidget);
|
|
14385
|
+
set$7(CompletionDetail, EditorCompletionDetailWidget);
|
|
14386
|
+
set$7(Find, EditorFindWidget);
|
|
14387
|
+
set$7(Hover, EditorHoverWidget);
|
|
14388
|
+
set$7(Message, EditorMessageWidget);
|
|
14389
|
+
set$7(Rename$1, EditorRenameWidget);
|
|
14390
|
+
set$7(SourceAction$1, EditorSourceActionWidget);
|
|
14391
|
+
set$7(CodeGenerator, EditorCodeGeneratorWidget);
|
|
14473
14392
|
};
|
|
14474
14393
|
|
|
14475
14394
|
const handleUnhandledRejection = event => {
|