@lvce-editor/editor-worker 19.29.1 → 19.29.3
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 +326 -396
- 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;
|
|
@@ -1450,33 +1449,22 @@ const SetPatches = 'Viewlet.setPatches';
|
|
|
1450
1449
|
|
|
1451
1450
|
const FocusEditorText$1 = 12;
|
|
1452
1451
|
|
|
1453
|
-
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
1452
|
const {
|
|
1464
1453
|
invoke: invoke$f,
|
|
1465
1454
|
set: set$f
|
|
1466
|
-
} = create$a(
|
|
1467
|
-
|
|
1468
|
-
const ExtensionHost = {
|
|
1469
|
-
__proto__: null,
|
|
1470
|
-
invoke: invoke$f,
|
|
1471
|
-
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 => {
|
|
@@ -1924,9 +1903,9 @@ const codeGeneratorAccept = state => {
|
|
|
1924
1903
|
|
|
1925
1904
|
const ModuleWorkerAndWorkaroundForChromeDevtoolsBug = 6;
|
|
1926
1905
|
|
|
1927
|
-
const launchWorker = async (name, url, intializeCommand) => {
|
|
1906
|
+
const launchWorker = async (name, url, intializeCommand, commandMap = {}) => {
|
|
1928
1907
|
const rpc = await create$e({
|
|
1929
|
-
commandMap
|
|
1908
|
+
commandMap,
|
|
1930
1909
|
isMessagePortOpen: true,
|
|
1931
1910
|
async send(port) {
|
|
1932
1911
|
await invokeAndTransfer('IpcParent.create', {
|
|
@@ -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
|
|
|
@@ -2006,6 +1985,14 @@ const Empty = 0;
|
|
|
2006
1985
|
const FindWidget = 16;
|
|
2007
1986
|
const FocusEditorHover = 51;
|
|
2008
1987
|
const FocusEditorRename$1 = 11;
|
|
1988
|
+
const FocusFindWidgetCloseButton = 48;
|
|
1989
|
+
const FocusFindWidgetNextMatchButton = 49;
|
|
1990
|
+
const FocusFindWidgetOptions = 44;
|
|
1991
|
+
const FocusFindWidgetPreviousMatchButton = 50;
|
|
1992
|
+
const FocusFindWidgetReplace$1 = 43;
|
|
1993
|
+
const FocusFindWidgetReplaceAllButton = 47;
|
|
1994
|
+
const FocusFindWidgetReplaceButton = 46;
|
|
1995
|
+
const FocusFindWidgetToggleReplace = 42;
|
|
2009
1996
|
const SourceActions = 38;
|
|
2010
1997
|
const FocusCodeGenerator = 52;
|
|
2011
1998
|
|
|
@@ -2100,7 +2087,7 @@ const createEditor2 = (id, uri, x, y, width, height, platform, assetDir) => {
|
|
|
2100
2087
|
x,
|
|
2101
2088
|
y
|
|
2102
2089
|
};
|
|
2103
|
-
set$
|
|
2090
|
+
set$8(id, editor, editor);
|
|
2104
2091
|
};
|
|
2105
2092
|
|
|
2106
2093
|
// TODO use numeric enum
|
|
@@ -2123,7 +2110,7 @@ const Rename = 'rename';
|
|
|
2123
2110
|
const ToggleBlockComment$1 = 'toggleBlockComment';
|
|
2124
2111
|
|
|
2125
2112
|
const map$1 = Object.create(null);
|
|
2126
|
-
const set$
|
|
2113
|
+
const set$7 = (id, widget) => {
|
|
2127
2114
|
map$1[id] = widget;
|
|
2128
2115
|
};
|
|
2129
2116
|
const get$7 = id => {
|
|
@@ -2596,8 +2583,8 @@ const getEnabled$1 = () => {
|
|
|
2596
2583
|
};
|
|
2597
2584
|
|
|
2598
2585
|
const {
|
|
2599
|
-
invoke: invoke$
|
|
2600
|
-
set: set$
|
|
2586
|
+
invoke: invoke$7,
|
|
2587
|
+
set: set$6
|
|
2601
2588
|
} = SyntaxHighlightingWorker;
|
|
2602
2589
|
|
|
2603
2590
|
const state$9 = {
|
|
@@ -2608,7 +2595,7 @@ const state$9 = {
|
|
|
2608
2595
|
const has = languageId => {
|
|
2609
2596
|
return Object.hasOwn(state$9.tokenizers, languageId);
|
|
2610
2597
|
};
|
|
2611
|
-
const set$
|
|
2598
|
+
const set$5 = (languageId, tokenizer) => {
|
|
2612
2599
|
state$9.tokenizers[languageId] = tokenizer;
|
|
2613
2600
|
};
|
|
2614
2601
|
const get$6 = languageId => {
|
|
@@ -2632,7 +2619,7 @@ const isPending = languageId => {
|
|
|
2632
2619
|
};
|
|
2633
2620
|
|
|
2634
2621
|
const tokenMaps = Object.create(null);
|
|
2635
|
-
const set$
|
|
2622
|
+
const set$4 = (languageId, tokenMap) => {
|
|
2636
2623
|
tokenMaps[languageId] = tokenMap;
|
|
2637
2624
|
};
|
|
2638
2625
|
const get$5 = languageId => {
|
|
@@ -2647,8 +2634,8 @@ const loadTokenizer = async (languageId, tokenizePath) => {
|
|
|
2647
2634
|
setTokenizePath(languageId, tokenizePath);
|
|
2648
2635
|
if (getEnabled$1()) {
|
|
2649
2636
|
// @ts-ignore
|
|
2650
|
-
const tokenMap = await invoke$
|
|
2651
|
-
set$
|
|
2637
|
+
const tokenMap = await invoke$7('Tokenizer.load', languageId, tokenizePath);
|
|
2638
|
+
set$4(languageId, tokenMap);
|
|
2652
2639
|
return;
|
|
2653
2640
|
}
|
|
2654
2641
|
try {
|
|
@@ -2664,8 +2651,8 @@ const loadTokenizer = async (languageId, tokenizePath) => {
|
|
|
2664
2651
|
console.warn(`tokenizer.TokenMap should be an object in "${tokenizePath}"`);
|
|
2665
2652
|
return;
|
|
2666
2653
|
}
|
|
2667
|
-
set$
|
|
2668
|
-
set$
|
|
2654
|
+
set$4(languageId, tokenizer.TokenMap);
|
|
2655
|
+
set$5(languageId, tokenizer);
|
|
2669
2656
|
} catch (error) {
|
|
2670
2657
|
// TODO better error handling
|
|
2671
2658
|
console.error(error);
|
|
@@ -2682,7 +2669,7 @@ const getTokenizer = languageId => {
|
|
|
2682
2669
|
};
|
|
2683
2670
|
|
|
2684
2671
|
const tokenizers = Object.create(null);
|
|
2685
|
-
const set$
|
|
2672
|
+
const set$3 = (id, value) => {
|
|
2686
2673
|
tokenizers[id] = value;
|
|
2687
2674
|
};
|
|
2688
2675
|
const get$4 = id => {
|
|
@@ -2835,13 +2822,13 @@ const getTokensViewport2 = async (editor, startLineIndex, endLineIndex, syncIncr
|
|
|
2835
2822
|
invalidStartIndex,
|
|
2836
2823
|
languageId
|
|
2837
2824
|
};
|
|
2838
|
-
return invoke$
|
|
2825
|
+
return invoke$7('GetTokensViewport.getTokensViewport', slimEditor,
|
|
2839
2826
|
// @ts-ignore
|
|
2840
2827
|
startLineIndex, endLineIndex, hasLinesToSend, id, linesToSend);
|
|
2841
2828
|
}
|
|
2842
2829
|
// TODO only send needed lines of text
|
|
2843
2830
|
// @ts-ignore
|
|
2844
|
-
return invoke$
|
|
2831
|
+
return invoke$7('GetTokensViewport.getTokensViewport', editor, startLineIndex, endLineIndex, true, editor.id, editor.lines);
|
|
2845
2832
|
}
|
|
2846
2833
|
return getTokensViewport(editor, startLineIndex, endLineIndex);
|
|
2847
2834
|
};
|
|
@@ -3500,7 +3487,7 @@ const getIncrementalEdits = async (oldState, newState) => {
|
|
|
3500
3487
|
const oldLine = oldState.lines[rowIndex];
|
|
3501
3488
|
const newLine = lines[rowIndex];
|
|
3502
3489
|
// @ts-ignore
|
|
3503
|
-
const incrementalEdits = await invoke$
|
|
3490
|
+
const incrementalEdits = await invoke$7(
|
|
3504
3491
|
// @ts-ignore
|
|
3505
3492
|
'TokenizeIncremental.tokenizeIncremental', newState.uid,
|
|
3506
3493
|
// @ts-ignore
|
|
@@ -3780,12 +3767,12 @@ const splitLines = lines => {
|
|
|
3780
3767
|
};
|
|
3781
3768
|
|
|
3782
3769
|
const {
|
|
3783
|
-
invoke: invoke$
|
|
3770
|
+
invoke: invoke$6,
|
|
3784
3771
|
readFile} = RendererWorker;
|
|
3785
3772
|
|
|
3786
3773
|
const notifyTabModifiedStatusChange = async (uri, modified) => {
|
|
3787
3774
|
try {
|
|
3788
|
-
await invoke$
|
|
3775
|
+
await invoke$6('Main.handleModifiedStatusChange', uri, modified);
|
|
3789
3776
|
} catch {
|
|
3790
3777
|
// ignore
|
|
3791
3778
|
}
|
|
@@ -3822,7 +3809,7 @@ const measureTextWidthFast = async (text, charWidth) => {
|
|
|
3822
3809
|
};
|
|
3823
3810
|
|
|
3824
3811
|
const measureTextWidthSlow = async (text, fontWeight, fontSize, fontFamily, letterSpacing, isMonoSpaceFont, charWidth) => {
|
|
3825
|
-
const width = await invoke$
|
|
3812
|
+
const width = await invoke$b('TextMeasurement.measureTextWidth', text, fontWeight, fontSize, fontFamily, letterSpacing, isMonoSpaceFont, charWidth);
|
|
3826
3813
|
return width;
|
|
3827
3814
|
};
|
|
3828
3815
|
|
|
@@ -4090,7 +4077,7 @@ const getSelectionFromChange = change => {
|
|
|
4090
4077
|
start: newPosition
|
|
4091
4078
|
};
|
|
4092
4079
|
};
|
|
4093
|
-
const setSelections$
|
|
4080
|
+
const setSelections$2 = (editor, selections) => {
|
|
4094
4081
|
object(editor);
|
|
4095
4082
|
const {
|
|
4096
4083
|
foldingRanges = []
|
|
@@ -4208,7 +4195,7 @@ const applyAutoClosingRangesEdit = (editor, changes) => {
|
|
|
4208
4195
|
return newAutoClosingRanges;
|
|
4209
4196
|
};
|
|
4210
4197
|
const scheduleSelections = (editor, selectionEdits) => {
|
|
4211
|
-
return setSelections$
|
|
4198
|
+
return setSelections$2(editor, selectionEdits);
|
|
4212
4199
|
};
|
|
4213
4200
|
const updateLines = (editor, lines) => {
|
|
4214
4201
|
const newEditor = {
|
|
@@ -4259,7 +4246,7 @@ const scheduleDocumentAndCursorsSelections = async (editor, changes, selectionCh
|
|
|
4259
4246
|
...newEditor,
|
|
4260
4247
|
decorations: linkDecorations
|
|
4261
4248
|
};
|
|
4262
|
-
set$
|
|
4249
|
+
set$8(editor.uid, editor, newEditorWithDecorations);
|
|
4263
4250
|
|
|
4264
4251
|
// Notify main-area-worker about modified status change
|
|
4265
4252
|
if (!editor.modified) {
|
|
@@ -4453,15 +4440,6 @@ const emptyEditor = {
|
|
|
4453
4440
|
y: 0
|
|
4454
4441
|
};
|
|
4455
4442
|
|
|
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
4443
|
const getFileExtensionIndex = file => {
|
|
4466
4444
|
string(file);
|
|
4467
4445
|
return file.lastIndexOf(Dot);
|
|
@@ -4687,15 +4665,10 @@ const createEditor = async ({
|
|
|
4687
4665
|
focused: true,
|
|
4688
4666
|
textInfos
|
|
4689
4667
|
};
|
|
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);
|
|
4668
|
+
set$8(id, emptyEditor, newEditor4);
|
|
4696
4669
|
const completionsOnTypeRaw = await get$3('editor.completionsOnType');
|
|
4697
4670
|
const completionsOnType = Boolean(completionsOnTypeRaw);
|
|
4698
|
-
set$
|
|
4671
|
+
set$8(id, emptyEditor, {
|
|
4699
4672
|
...newEditor4,
|
|
4700
4673
|
completionsOnType
|
|
4701
4674
|
});
|
|
@@ -4726,7 +4699,7 @@ const createStandaloneEditor = async ({
|
|
|
4726
4699
|
const createdEditor = get$8(id).newState;
|
|
4727
4700
|
await loadTokenizer(languageId, tokenizePath);
|
|
4728
4701
|
const tokenizerId = createdEditor.tokenizerId + 1;
|
|
4729
|
-
set$
|
|
4702
|
+
set$3(tokenizerId, getTokenizer(languageId));
|
|
4730
4703
|
const configuredEditor = {
|
|
4731
4704
|
...createdEditor,
|
|
4732
4705
|
charWidth,
|
|
@@ -4768,7 +4741,7 @@ const createStandaloneEditor = async ({
|
|
|
4768
4741
|
cursorInfos,
|
|
4769
4742
|
selectionInfos
|
|
4770
4743
|
};
|
|
4771
|
-
set$
|
|
4744
|
+
set$8(id, createdEditor, finalEditor);
|
|
4772
4745
|
};
|
|
4773
4746
|
|
|
4774
4747
|
const isEqual$4 = (oldState, newState) => {
|
|
@@ -4903,7 +4876,7 @@ const renderWidgets$1 = (oldState, newState) => {
|
|
|
4903
4876
|
record(newState.uid, declaredRevision);
|
|
4904
4877
|
const widgetUids = newWidgets.map(widget => widget.newState.uid);
|
|
4905
4878
|
const allCommands = [...addCommands, ...changeCommands, ['Viewlet.setWidgets', newState.uid, declaredRevision, widgetUids]];
|
|
4906
|
-
return allCommands.filter(item => item[0] !== 'Viewlet.
|
|
4879
|
+
return allCommands.filter(item => item[0] !== 'Viewlet.appendToBody' && (item[0] !== 'Viewlet.setFocusContext' || item.length >= 3));
|
|
4907
4880
|
};
|
|
4908
4881
|
|
|
4909
4882
|
const disposeEditor = async editorUid => {
|
|
@@ -4913,7 +4886,7 @@ const disposeEditor = async editorUid => {
|
|
|
4913
4886
|
}
|
|
4914
4887
|
for (const widget of editor.widgets) {
|
|
4915
4888
|
if (widget.id === ColorPicker$1) {
|
|
4916
|
-
await invoke$
|
|
4889
|
+
await invoke$8('ColorPicker.dispose', widget.newState.uid);
|
|
4917
4890
|
}
|
|
4918
4891
|
}
|
|
4919
4892
|
const commands = renderWidgets$1(editor, {
|
|
@@ -5013,7 +4986,7 @@ const error = (...args) => {
|
|
|
5013
4986
|
console.error(...args);
|
|
5014
4987
|
};
|
|
5015
4988
|
|
|
5016
|
-
const applyDocumentEdits = (editor, edits) => {
|
|
4989
|
+
const applyDocumentEdits$1 = (editor, edits) => {
|
|
5017
4990
|
if (!Array.isArray(edits)) {
|
|
5018
4991
|
warn('something is wrong with format on save', edits);
|
|
5019
4992
|
return editor;
|
|
@@ -5104,7 +5077,7 @@ const applyWorkspaceEdit = async (editor, changes) => {
|
|
|
5104
5077
|
}
|
|
5105
5078
|
const text = await readFile(uri);
|
|
5106
5079
|
const newText = applyEditsToText(text, edits);
|
|
5107
|
-
await invoke$
|
|
5080
|
+
await invoke$6('FileSystem.writeFile', uri, newText);
|
|
5108
5081
|
}
|
|
5109
5082
|
return currentEditor;
|
|
5110
5083
|
};
|
|
@@ -5129,8 +5102,8 @@ const closeWidgetsMaybe = widgets => {
|
|
|
5129
5102
|
};
|
|
5130
5103
|
|
|
5131
5104
|
const logError = async (error, prefix) => {
|
|
5132
|
-
const prettyError = await invoke$
|
|
5133
|
-
await invoke$
|
|
5105
|
+
const prettyError = await invoke$e('Errors.prepare', error);
|
|
5106
|
+
await invoke$e('Errors.print', prettyError, prefix);
|
|
5134
5107
|
};
|
|
5135
5108
|
const logFallback = (error, prefix) => {
|
|
5136
5109
|
if (prefix) {
|
|
@@ -5155,7 +5128,7 @@ const getFormattingEdits = async editor => {
|
|
|
5155
5128
|
text: getText$1(editor),
|
|
5156
5129
|
uri: editor.uri
|
|
5157
5130
|
};
|
|
5158
|
-
return invoke$
|
|
5131
|
+
return invoke$d('Extensions.executeFormattingProvider', textDocument);
|
|
5159
5132
|
};
|
|
5160
5133
|
|
|
5161
5134
|
const expectedErrorMessage$1 = 'Failed to execute formatting provider: FormattingError:';
|
|
@@ -5389,7 +5362,7 @@ const expectedErrorMessage = 'Failed to execute formatting provider: FormattingE
|
|
|
5389
5362
|
const format = async editor => {
|
|
5390
5363
|
try {
|
|
5391
5364
|
const edits = await getFormattingEdits(editor);
|
|
5392
|
-
return applyDocumentEdits(editor, edits);
|
|
5365
|
+
return applyDocumentEdits$1(editor, edits);
|
|
5393
5366
|
} catch (error) {
|
|
5394
5367
|
if (isFormattingError(error)) {
|
|
5395
5368
|
console.error('Formatting Error:',
|
|
@@ -5416,7 +5389,7 @@ const isUntitledFile = uri => {
|
|
|
5416
5389
|
};
|
|
5417
5390
|
|
|
5418
5391
|
const saveNormalFile = async (uri, content) => {
|
|
5419
|
-
await invoke$
|
|
5392
|
+
await invoke$a('FileSystem.writeFile', uri, content);
|
|
5420
5393
|
};
|
|
5421
5394
|
|
|
5422
5395
|
const showFilePicker = async platform => {
|
|
@@ -5424,7 +5397,7 @@ const showFilePicker = async platform => {
|
|
|
5424
5397
|
const {
|
|
5425
5398
|
canceled,
|
|
5426
5399
|
filePath
|
|
5427
|
-
} = await invoke$
|
|
5400
|
+
} = await invoke$c('Open.showSaveDialog', dialogTitle, [], platform);
|
|
5428
5401
|
if (canceled) {
|
|
5429
5402
|
return '';
|
|
5430
5403
|
}
|
|
@@ -5436,9 +5409,9 @@ const saveUntitledFile = async (uri, content, platform) => {
|
|
|
5436
5409
|
if (!filePath) {
|
|
5437
5410
|
return;
|
|
5438
5411
|
}
|
|
5439
|
-
await invoke$
|
|
5412
|
+
await invoke$a('FileSystem.writeFile', filePath, content);
|
|
5440
5413
|
await handleWorkspaceRefresh();
|
|
5441
|
-
await invoke$
|
|
5414
|
+
await invoke$a('Main.handleUriChange', uri, filePath);
|
|
5442
5415
|
return filePath;
|
|
5443
5416
|
};
|
|
5444
5417
|
|
|
@@ -5448,7 +5421,7 @@ const isPermissionDeniedError = error => {
|
|
|
5448
5421
|
};
|
|
5449
5422
|
const showSaveErrorDialog = async error => {
|
|
5450
5423
|
if (isPermissionDeniedError(error)) {
|
|
5451
|
-
await invoke$
|
|
5424
|
+
await invoke$f('ElectronDialog.showMessageBox', {
|
|
5452
5425
|
buttons: ['OK'],
|
|
5453
5426
|
defaultId: 0,
|
|
5454
5427
|
message: "You don't have permission to save changes to this file.",
|
|
@@ -5457,7 +5430,7 @@ const showSaveErrorDialog = async error => {
|
|
|
5457
5430
|
});
|
|
5458
5431
|
return;
|
|
5459
5432
|
}
|
|
5460
|
-
await invoke$
|
|
5433
|
+
await invoke$f('ElectronDialog.showMessageBox', {
|
|
5461
5434
|
buttons: ['OK'],
|
|
5462
5435
|
defaultId: 0,
|
|
5463
5436
|
detail: error.message,
|
|
@@ -5534,6 +5507,27 @@ const handleBlur$1 = async editor => {
|
|
|
5534
5507
|
return save(newEditor);
|
|
5535
5508
|
};
|
|
5536
5509
|
|
|
5510
|
+
const getTextDocument$3 = editor => ({
|
|
5511
|
+
documentId: editor.id || editor.uid,
|
|
5512
|
+
languageId: editor.languageId,
|
|
5513
|
+
text: getText$1(editor),
|
|
5514
|
+
uri: editor.uri
|
|
5515
|
+
});
|
|
5516
|
+
const execute = async ({
|
|
5517
|
+
args,
|
|
5518
|
+
editor,
|
|
5519
|
+
kind,
|
|
5520
|
+
method,
|
|
5521
|
+
noProviderFoundResult = undefined
|
|
5522
|
+
}) => {
|
|
5523
|
+
const textDocument = getTextDocument$3(editor);
|
|
5524
|
+
const result = await invoke$d('Extensions.executeLanguageProvider', kind, method, textDocument, ...args);
|
|
5525
|
+
if (!result.found) {
|
|
5526
|
+
return noProviderFoundResult;
|
|
5527
|
+
}
|
|
5528
|
+
return result.result;
|
|
5529
|
+
};
|
|
5530
|
+
|
|
5537
5531
|
const replaceRange = (editor, ranges, replacement, origin) => {
|
|
5538
5532
|
const changes = [];
|
|
5539
5533
|
const columnDeltas = new Map();
|
|
@@ -5604,8 +5598,12 @@ const getMatchingClosingBrace$1 = brace => {
|
|
|
5604
5598
|
const braceCompletion = async (editor, text) => {
|
|
5605
5599
|
try {
|
|
5606
5600
|
const offset = getCursorOffset(editor);
|
|
5607
|
-
|
|
5608
|
-
|
|
5601
|
+
const result = await execute({
|
|
5602
|
+
args: [offset, text],
|
|
5603
|
+
editor,
|
|
5604
|
+
kind: 'brace completion',
|
|
5605
|
+
method: 'provideBraceCompletion'
|
|
5606
|
+
});
|
|
5609
5607
|
if (result) {
|
|
5610
5608
|
const closingBrace = getMatchingClosingBrace$1(text);
|
|
5611
5609
|
const insertText = text + closingBrace;
|
|
@@ -5693,7 +5691,7 @@ const closeCompletion = editor => {
|
|
|
5693
5691
|
const isMatchingWidget$1 = widget => {
|
|
5694
5692
|
return widget.id === Find;
|
|
5695
5693
|
};
|
|
5696
|
-
const closeFind = editor => {
|
|
5694
|
+
const closeFind$1 = editor => {
|
|
5697
5695
|
const {
|
|
5698
5696
|
widgets
|
|
5699
5697
|
} = editor;
|
|
@@ -6758,7 +6756,7 @@ const deleteWordRight = editor => {
|
|
|
6758
6756
|
|
|
6759
6757
|
const findAllReferences$1 = async editor => {
|
|
6760
6758
|
// @ts-ignore
|
|
6761
|
-
await invoke$
|
|
6759
|
+
await invoke$a('SideBar.show', 'References', /* focus */true);
|
|
6762
6760
|
return editor;
|
|
6763
6761
|
};
|
|
6764
6762
|
|
|
@@ -6840,9 +6838,12 @@ const getWordBefore = (editor, rowIndex, columnIndex) => {
|
|
|
6840
6838
|
|
|
6841
6839
|
// @ts-ignore
|
|
6842
6840
|
const getDefinition = async (editor, offset) => {
|
|
6843
|
-
|
|
6844
|
-
|
|
6845
|
-
|
|
6841
|
+
return execute({
|
|
6842
|
+
args: [offset],
|
|
6843
|
+
editor,
|
|
6844
|
+
kind: 'definition',
|
|
6845
|
+
method: 'provideDefinition'
|
|
6846
|
+
});
|
|
6846
6847
|
};
|
|
6847
6848
|
|
|
6848
6849
|
const emptyObject = {};
|
|
@@ -7130,9 +7131,12 @@ const getNoLocationFoundMessage = info => {
|
|
|
7130
7131
|
};
|
|
7131
7132
|
|
|
7132
7133
|
const getTypeDefinition = async (editor, offset) => {
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
|
|
7134
|
+
return execute({
|
|
7135
|
+
args: [offset],
|
|
7136
|
+
editor,
|
|
7137
|
+
kind: 'type definition',
|
|
7138
|
+
method: 'provideTypeDefinition'
|
|
7139
|
+
});
|
|
7136
7140
|
};
|
|
7137
7141
|
|
|
7138
7142
|
const getLocation = async (editor, rowIndex, columnIndex) => {
|
|
@@ -7582,26 +7586,6 @@ const create$5 = () => {
|
|
|
7582
7586
|
return widget;
|
|
7583
7587
|
};
|
|
7584
7588
|
|
|
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
7589
|
const getTextDocument$2 = editor => {
|
|
7606
7590
|
return {
|
|
7607
7591
|
documentId: editor.id || editor.uid,
|
|
@@ -7612,22 +7596,12 @@ const getTextDocument$2 = editor => {
|
|
|
7612
7596
|
};
|
|
7613
7597
|
const executeIsolatedHoverProvider = async (editor, offset) => {
|
|
7614
7598
|
const textDocument = getTextDocument$2(editor);
|
|
7615
|
-
return invoke$
|
|
7599
|
+
return invoke$d('Extensions.executeHoverProvider', textDocument, offset);
|
|
7616
7600
|
};
|
|
7617
7601
|
const executeHoverProvider = async (editor, offset) => {
|
|
7618
7602
|
object(editor);
|
|
7619
7603
|
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
|
-
});
|
|
7604
|
+
return executeIsolatedHoverProvider(editor, offset);
|
|
7631
7605
|
};
|
|
7632
7606
|
|
|
7633
7607
|
const getHover = async (editor, offset) => {
|
|
@@ -7805,8 +7779,8 @@ const showHover = async (editor, position, token) => {
|
|
|
7805
7779
|
if (latestEditor === newEditor || !latestInstance || latestInstance.newState !== latestEditor || get$1().token !== token) {
|
|
7806
7780
|
return;
|
|
7807
7781
|
}
|
|
7808
|
-
set$
|
|
7809
|
-
await invoke$
|
|
7782
|
+
set$8(editor.uid, latestInstance.oldState, newEditor);
|
|
7783
|
+
await invoke$a('Editor.renderPending', editor.uid);
|
|
7810
7784
|
};
|
|
7811
7785
|
|
|
7812
7786
|
// TODO several things can happen:
|
|
@@ -8108,7 +8082,7 @@ const continueScrollingAndMovingSelection = async editorUid => {
|
|
|
8108
8082
|
}
|
|
8109
8083
|
};
|
|
8110
8084
|
const newEditorWithDerivedState = await updateDerivedState(editor, nextEditor);
|
|
8111
|
-
set$
|
|
8085
|
+
set$8(editor.uid, editor, newEditorWithDerivedState);
|
|
8112
8086
|
requestAnimationFrame(() => continueScrollingAndMovingSelection(editorUid));
|
|
8113
8087
|
};
|
|
8114
8088
|
|
|
@@ -8381,8 +8355,6 @@ const handleTouchMove = (editor, touchEvent) => {
|
|
|
8381
8355
|
};
|
|
8382
8356
|
|
|
8383
8357
|
const handleUriChange = async (editor, newUri) => {
|
|
8384
|
-
const content = getText$1(editor);
|
|
8385
|
-
await invoke$6(TextDocumentSyncFull, newUri, editor.id, editor.languageId, content);
|
|
8386
8358
|
return {
|
|
8387
8359
|
...editor,
|
|
8388
8360
|
uri: newUri
|
|
@@ -8468,7 +8440,7 @@ const indentMore = editor => {
|
|
|
8468
8440
|
|
|
8469
8441
|
const getLanguageConfiguration = async editor => {
|
|
8470
8442
|
// @ts-ignore
|
|
8471
|
-
return invoke$
|
|
8443
|
+
return invoke$a('Languages.getLanguageConfiguration', {
|
|
8472
8444
|
languageId: editor.languageId,
|
|
8473
8445
|
uri: editor.uri
|
|
8474
8446
|
});
|
|
@@ -8707,10 +8679,83 @@ const addWidget = (widget, id, render) => {
|
|
|
8707
8679
|
return allCommands;
|
|
8708
8680
|
};
|
|
8709
8681
|
|
|
8682
|
+
const getEditor$1 = editorUid => {
|
|
8683
|
+
const instance = get$8(editorUid);
|
|
8684
|
+
if (!instance) {
|
|
8685
|
+
throw new Error(`editor ${editorUid} not found`);
|
|
8686
|
+
}
|
|
8687
|
+
const {
|
|
8688
|
+
newState
|
|
8689
|
+
} = instance;
|
|
8690
|
+
return newState;
|
|
8691
|
+
};
|
|
8692
|
+
|
|
8693
|
+
const setFocus = async focusKey => {
|
|
8694
|
+
await invoke$a('Focus.setFocus', focusKey);
|
|
8695
|
+
};
|
|
8696
|
+
const unsetAdditionalFocus = async focusKey => {
|
|
8697
|
+
if (!focusKey) {
|
|
8698
|
+
return;
|
|
8699
|
+
}
|
|
8700
|
+
// @ts-ignore
|
|
8701
|
+
await invoke$a('Focus.removeAdditionalFocus', focusKey);
|
|
8702
|
+
};
|
|
8703
|
+
|
|
8704
|
+
const FocusEditor = 12;
|
|
8705
|
+
const FocusEditorCompletions = 9;
|
|
8706
|
+
const FocusEditorRename = 11;
|
|
8707
|
+
const FocusEditorText = 12;
|
|
8708
|
+
const FocusFindWidget = 16;
|
|
8709
|
+
const FocusSourceActions = 38;
|
|
8710
|
+
const FocusFindWidgetReplace = 43;
|
|
8711
|
+
const FocusEditorCodeGenerator = 52;
|
|
8712
|
+
const FocusColorPicker = 41;
|
|
8713
|
+
|
|
8714
|
+
const updateEditor = async (editorUid, editor, newEditor) => {
|
|
8715
|
+
if (newEditor === editor) {
|
|
8716
|
+
return;
|
|
8717
|
+
}
|
|
8718
|
+
const newEditorWithDerivedState = await updateDerivedState(editor, newEditor);
|
|
8719
|
+
set$8(editorUid, editor, newEditorWithDerivedState);
|
|
8720
|
+
};
|
|
8721
|
+
const applyDocumentEdits = async (editorUid, edits) => {
|
|
8722
|
+
const editor = getEditor$1(editorUid);
|
|
8723
|
+
const newEditor = await applyDocumentEdits$1(editor, edits);
|
|
8724
|
+
await updateEditor(editorUid, editor, newEditor);
|
|
8725
|
+
};
|
|
8726
|
+
const closeFind = async editorUid => {
|
|
8727
|
+
const editor = getEditor$1(editorUid);
|
|
8728
|
+
const newEditor = closeFind$1(editor);
|
|
8729
|
+
await updateEditor(editorUid, editor, newEditor);
|
|
8730
|
+
await setFocus(FocusEditorText);
|
|
8731
|
+
};
|
|
8732
|
+
const getLines = editorUid => {
|
|
8733
|
+
return getEditor$1(editorUid).lines;
|
|
8734
|
+
};
|
|
8735
|
+
const getSelections$1 = editorUid => {
|
|
8736
|
+
return getEditor$1(editorUid).selections;
|
|
8737
|
+
};
|
|
8738
|
+
const setSelections$1 = async (editorUid, selections) => {
|
|
8739
|
+
const editor = getEditor$1(editorUid);
|
|
8740
|
+
const newEditor = {
|
|
8741
|
+
...editor,
|
|
8742
|
+
selections
|
|
8743
|
+
};
|
|
8744
|
+
await updateEditor(editorUid, editor, newEditor);
|
|
8745
|
+
};
|
|
8746
|
+
|
|
8747
|
+
const getFindWidgetWorkerCommandMap = () => ({
|
|
8748
|
+
'Editor.applyDocumentEdits': applyDocumentEdits,
|
|
8749
|
+
'Editor.closeFind2': closeFind,
|
|
8750
|
+
'Editor.getLines2': getLines,
|
|
8751
|
+
'Editor.getSelections2': getSelections$1,
|
|
8752
|
+
'Editor.setSelections2': setSelections$1
|
|
8753
|
+
});
|
|
8754
|
+
|
|
8710
8755
|
const launchFindWidgetWorker = async () => {
|
|
8711
8756
|
const name = 'Find Widget Worker';
|
|
8712
8757
|
const url = 'findWidgetWorkerMain.js';
|
|
8713
|
-
return launchWorker(name, url);
|
|
8758
|
+
return launchWorker(name, url, undefined, getFindWidgetWorkerCommandMap());
|
|
8714
8759
|
};
|
|
8715
8760
|
|
|
8716
8761
|
const rpcId = 9002;
|
|
@@ -8720,7 +8765,7 @@ const launch = async () => {
|
|
|
8720
8765
|
return;
|
|
8721
8766
|
}
|
|
8722
8767
|
const rpc = await launchFindWidgetWorker();
|
|
8723
|
-
set$
|
|
8768
|
+
set$g(rpcId, rpc);
|
|
8724
8769
|
};
|
|
8725
8770
|
const invoke$3 = async (method, ...params) => {
|
|
8726
8771
|
const rpc = get$9(rpcId);
|
|
@@ -8781,7 +8826,7 @@ const invoke$1 = async (method, ...params) => {
|
|
|
8781
8826
|
const getWidgetInvoke = widgetId => {
|
|
8782
8827
|
switch (widgetId) {
|
|
8783
8828
|
case ColorPicker$1:
|
|
8784
|
-
return invoke$
|
|
8829
|
+
return invoke$8;
|
|
8785
8830
|
case Completion:
|
|
8786
8831
|
return invoke$4;
|
|
8787
8832
|
case Find:
|
|
@@ -8835,7 +8880,7 @@ const getEditorByWidgetUid = (widgetUid, widgetId) => {
|
|
|
8835
8880
|
}
|
|
8836
8881
|
return undefined;
|
|
8837
8882
|
};
|
|
8838
|
-
const getEditor
|
|
8883
|
+
const getEditor = (editorOrUid, widgetId) => {
|
|
8839
8884
|
if (editorOrUid && editorOrUid.widgets) {
|
|
8840
8885
|
return editorOrUid;
|
|
8841
8886
|
}
|
|
@@ -8853,7 +8898,7 @@ const createFn = (key, name, widgetId) => {
|
|
|
8853
8898
|
return key === 'close' || key === 'handleClickButton' && args.includes(Close);
|
|
8854
8899
|
};
|
|
8855
8900
|
const fn = async (editorOrUid, ...args) => {
|
|
8856
|
-
const editor = getEditor
|
|
8901
|
+
const editor = getEditor(editorOrUid, widgetId);
|
|
8857
8902
|
if (!editor) {
|
|
8858
8903
|
return editorOrUid;
|
|
8859
8904
|
}
|
|
@@ -8886,7 +8931,7 @@ const createFn = (key, name, widgetId) => {
|
|
|
8886
8931
|
widgetRevision,
|
|
8887
8932
|
widgets: removeEditorWidget(latest.widgets, widgetId)
|
|
8888
8933
|
};
|
|
8889
|
-
set$
|
|
8934
|
+
set$8(editor.uid, latest, newEditor);
|
|
8890
8935
|
return newEditor;
|
|
8891
8936
|
}
|
|
8892
8937
|
const newState = {
|
|
@@ -8894,7 +8939,7 @@ const createFn = (key, name, widgetId) => {
|
|
|
8894
8939
|
commands
|
|
8895
8940
|
};
|
|
8896
8941
|
const newEditor = updateWidget(latest, widgetId, newState);
|
|
8897
|
-
set$
|
|
8942
|
+
set$8(editor.uid, editor, newEditor);
|
|
8898
8943
|
return newEditor;
|
|
8899
8944
|
};
|
|
8900
8945
|
return fn;
|
|
@@ -8931,10 +8976,13 @@ const render$c = widget => {
|
|
|
8931
8976
|
const commands = renderFull$4(widget.oldState, widget.newState);
|
|
8932
8977
|
const wrappedCommands = [];
|
|
8933
8978
|
const {
|
|
8979
|
+
editorUid,
|
|
8934
8980
|
uid
|
|
8935
8981
|
} = widget.newState;
|
|
8936
8982
|
for (const command of commands) {
|
|
8937
|
-
if (
|
|
8983
|
+
if (command[0] === SetFocusContext) {
|
|
8984
|
+
wrappedCommands.push([command[0], editorUid, ...command.slice(1)]);
|
|
8985
|
+
} else if (commandsToForward$5.includes(command[0])) {
|
|
8938
8986
|
wrappedCommands.push(command);
|
|
8939
8987
|
} else {
|
|
8940
8988
|
wrappedCommands.push(['Viewlet.send', uid, ...command]);
|
|
@@ -9053,22 +9101,11 @@ const create$2 = () => {
|
|
|
9053
9101
|
return widget;
|
|
9054
9102
|
};
|
|
9055
9103
|
|
|
9056
|
-
const getEditor = editorUid => {
|
|
9057
|
-
const instance = get$8(editorUid);
|
|
9058
|
-
if (!instance) {
|
|
9059
|
-
throw new Error(`editor ${editorUid} not found`);
|
|
9060
|
-
}
|
|
9061
|
-
const {
|
|
9062
|
-
newState
|
|
9063
|
-
} = instance;
|
|
9064
|
-
return newState;
|
|
9065
|
-
};
|
|
9066
|
-
|
|
9067
9104
|
const loadContent$2 = async (state, parentUid) => {
|
|
9068
9105
|
const {
|
|
9069
9106
|
uid
|
|
9070
9107
|
} = state;
|
|
9071
|
-
const editor = getEditor(parentUid);
|
|
9108
|
+
const editor = getEditor$1(parentUid);
|
|
9072
9109
|
const {
|
|
9073
9110
|
height,
|
|
9074
9111
|
width,
|
|
@@ -9200,18 +9237,19 @@ const openRename = async editor => {
|
|
|
9200
9237
|
};
|
|
9201
9238
|
|
|
9202
9239
|
const getOrganizeImportEdits = async editor => {
|
|
9203
|
-
const
|
|
9204
|
-
|
|
9205
|
-
editor,
|
|
9206
|
-
|
|
9207
|
-
|
|
9208
|
-
}
|
|
9209
|
-
|
|
9240
|
+
const textDocument = {
|
|
9241
|
+
documentId: editor.id || editor.uid,
|
|
9242
|
+
languageId: editor.languageId,
|
|
9243
|
+
text: getText$1(editor),
|
|
9244
|
+
uri: editor.uri
|
|
9245
|
+
};
|
|
9246
|
+
const result = await invoke$d('Extensions.executeOrganizeImportsProvider', textDocument);
|
|
9247
|
+
return result.found ? result.result ?? [] : [];
|
|
9210
9248
|
};
|
|
9211
9249
|
|
|
9212
9250
|
const organizeImports = async editor => {
|
|
9213
9251
|
const edits = await getOrganizeImportEdits(editor);
|
|
9214
|
-
return applyDocumentEdits(editor, edits);
|
|
9252
|
+
return applyDocumentEdits$1(editor, edits);
|
|
9215
9253
|
};
|
|
9216
9254
|
|
|
9217
9255
|
// @ts-ignore
|
|
@@ -9497,11 +9535,14 @@ const selectInsideString = editor => {
|
|
|
9497
9535
|
return scheduleSelections(editor, newSelections);
|
|
9498
9536
|
};
|
|
9499
9537
|
|
|
9500
|
-
// import * as ExtensionHostSelection from '../ExtensionHost/ExtensionHostSelection.ts'
|
|
9501
|
-
|
|
9502
9538
|
const getNewSelections = async (editor, selections) => {
|
|
9503
|
-
|
|
9504
|
-
|
|
9539
|
+
const newSelections = await execute({
|
|
9540
|
+
args: [selections],
|
|
9541
|
+
editor,
|
|
9542
|
+
kind: 'selection',
|
|
9543
|
+
method: 'provideSelections',
|
|
9544
|
+
noProviderFoundResult: []
|
|
9545
|
+
});
|
|
9505
9546
|
if (newSelections.length === 0) {
|
|
9506
9547
|
return selections;
|
|
9507
9548
|
}
|
|
@@ -9754,7 +9795,7 @@ const setLanguageId = async (editor, languageId, tokenizePath) => {
|
|
|
9754
9795
|
await loadTokenizer(languageId, tokenizePath);
|
|
9755
9796
|
const tokenizer = getTokenizer(languageId);
|
|
9756
9797
|
const newTokenizerId = tokenizerId + 1;
|
|
9757
|
-
set$
|
|
9798
|
+
set$3(newTokenizerId, tokenizer);
|
|
9758
9799
|
return {
|
|
9759
9800
|
...editor,
|
|
9760
9801
|
focused: true,
|
|
@@ -9865,7 +9906,7 @@ const executeSignatureHelpProvider = async (editor, offset) => {
|
|
|
9865
9906
|
object(editor);
|
|
9866
9907
|
number(offset);
|
|
9867
9908
|
const textDocument = getTextDocument$1(editor);
|
|
9868
|
-
return invoke$
|
|
9909
|
+
return invoke$d('Extensions.executeSignatureHelpProvider', textDocument, offset);
|
|
9869
9910
|
};
|
|
9870
9911
|
|
|
9871
9912
|
const getSignatureHelp = async (editor, offset) => {
|
|
@@ -10066,9 +10107,8 @@ const executeTabCompletionProvider = async (editor, offset) => {
|
|
|
10066
10107
|
return execute({
|
|
10067
10108
|
args: [offset],
|
|
10068
10109
|
editor,
|
|
10069
|
-
|
|
10070
|
-
method:
|
|
10071
|
-
noProviderFoundMessage: 'No tab completion provider found',
|
|
10110
|
+
kind: 'tab completion',
|
|
10111
|
+
method: 'provideTabCompletion',
|
|
10072
10112
|
noProviderFoundResult: undefined
|
|
10073
10113
|
});
|
|
10074
10114
|
};
|
|
@@ -10195,18 +10235,13 @@ const tabCompletion = async editor => {
|
|
|
10195
10235
|
};
|
|
10196
10236
|
|
|
10197
10237
|
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
10238
|
try {
|
|
10207
|
-
await
|
|
10208
|
-
|
|
10209
|
-
|
|
10239
|
+
const blockComment = await execute({
|
|
10240
|
+
args: [offset],
|
|
10241
|
+
editor,
|
|
10242
|
+
kind: 'comment',
|
|
10243
|
+
method: 'provideComment'
|
|
10244
|
+
});
|
|
10210
10245
|
if (blockComment) {
|
|
10211
10246
|
return blockComment;
|
|
10212
10247
|
}
|
|
@@ -10566,8 +10601,12 @@ const typeWithAutoClosingQuote = (editor, text) => {
|
|
|
10566
10601
|
|
|
10567
10602
|
const typeWithAutoClosingTag = async (editor, text) => {
|
|
10568
10603
|
const offset = offsetAt(editor, editor.selections[0], editor.selections[1]);
|
|
10569
|
-
|
|
10570
|
-
|
|
10604
|
+
const result = await execute({
|
|
10605
|
+
args: [offset, text],
|
|
10606
|
+
editor,
|
|
10607
|
+
kind: 'closing tag',
|
|
10608
|
+
method: 'provideClosingTag'
|
|
10609
|
+
});
|
|
10571
10610
|
if (!result) {
|
|
10572
10611
|
const changes = editorReplaceSelections(editor, [text], EditorType);
|
|
10573
10612
|
return scheduleDocumentAndCursorsSelections(editor, changes);
|
|
@@ -11219,7 +11258,7 @@ const executeWidgetCommand = async (editor, name, method, _uid, widgetId, ...par
|
|
|
11219
11258
|
const isWidget = widget => {
|
|
11220
11259
|
return widget.id === widgetId;
|
|
11221
11260
|
};
|
|
11222
|
-
const latestEditor = getEditor(editor.uid);
|
|
11261
|
+
const latestEditor = getEditor$1(editor.uid);
|
|
11223
11262
|
const childIndex1 = latestEditor.widgets.findIndex(isWidget);
|
|
11224
11263
|
if (childIndex1 === -1) {
|
|
11225
11264
|
return latestEditor;
|
|
@@ -11246,13 +11285,8 @@ const getEditorSourceActions = async editorId => {
|
|
|
11246
11285
|
const {
|
|
11247
11286
|
newState
|
|
11248
11287
|
} = get$8(editorId);
|
|
11249
|
-
const
|
|
11250
|
-
return
|
|
11251
|
-
args: [offset],
|
|
11252
|
-
editor: newState,
|
|
11253
|
-
event: 'onLanguage',
|
|
11254
|
-
method: 'ExtensionHostCodeActions.getSourceActions'
|
|
11255
|
-
});
|
|
11288
|
+
const extensions = await invoke$d('Extensions.getAllExtensions', newState.assetDir, newState.platform);
|
|
11289
|
+
return extensions.flatMap(extension => extension.codeActions || []).filter(action => action.languageId === newState.languageId);
|
|
11256
11290
|
};
|
|
11257
11291
|
|
|
11258
11292
|
/* eslint-disable sonarjs/super-linear-regex */
|
|
@@ -11274,90 +11308,64 @@ const getWordAtOffset = editor => {
|
|
|
11274
11308
|
return '';
|
|
11275
11309
|
};
|
|
11276
11310
|
|
|
11277
|
-
const setFocus = async focusKey => {
|
|
11278
|
-
await invoke$b('Focus.setFocus', focusKey);
|
|
11279
|
-
};
|
|
11280
|
-
const unsetAdditionalFocus = async focusKey => {
|
|
11281
|
-
if (!focusKey) {
|
|
11282
|
-
return;
|
|
11283
|
-
}
|
|
11284
|
-
// @ts-ignore
|
|
11285
|
-
await invoke$b('Focus.removeAdditionalFocus', focusKey);
|
|
11286
|
-
};
|
|
11287
|
-
|
|
11288
|
-
const FocusEditor = 12;
|
|
11289
|
-
const FocusEditorCompletions = 9;
|
|
11290
|
-
const FocusEditorRename = 11;
|
|
11291
|
-
const FocusEditorText = 12;
|
|
11292
|
-
const FocusFindWidget = 16;
|
|
11293
|
-
const FocusSourceActions = 38;
|
|
11294
|
-
const FocusFindWidgetReplace = 43;
|
|
11295
|
-
const FocusFindWidgetReplaceButton = 46;
|
|
11296
|
-
const FocusFindWidgetReplaceAllButton = 47;
|
|
11297
|
-
const FocusFindWidgetCloseButton = 48;
|
|
11298
|
-
const FocusFindWidgetNextMatchButton = 49;
|
|
11299
|
-
const FocusFindWidgetPreviousMatchButton = 50;
|
|
11300
|
-
const FocusEditorCodeGenerator = 52;
|
|
11301
|
-
const FocusColorPicker = 41;
|
|
11302
|
-
|
|
11303
11311
|
const getPositionAtCursor = editorUid => {
|
|
11304
|
-
const editor = getEditor(editorUid);
|
|
11312
|
+
const editor = getEditor$1(editorUid);
|
|
11305
11313
|
return getPositionAtCursor$1(editor);
|
|
11306
11314
|
};
|
|
11307
11315
|
const getUri = editorUid => {
|
|
11308
|
-
const editor = getEditor(editorUid);
|
|
11316
|
+
const editor = getEditor$1(editorUid);
|
|
11309
11317
|
return editor.uri;
|
|
11310
11318
|
};
|
|
11311
11319
|
const getLanguageId = editorUid => {
|
|
11312
|
-
const editor = getEditor(editorUid);
|
|
11320
|
+
const editor = getEditor$1(editorUid);
|
|
11313
11321
|
return editor.languageId;
|
|
11314
11322
|
};
|
|
11315
11323
|
const getOffsetAtCursor = editorUid => {
|
|
11316
|
-
const editor = getEditor(editorUid);
|
|
11324
|
+
const editor = getEditor$1(editorUid);
|
|
11317
11325
|
return getOffsetAtCursor$1(editor);
|
|
11318
11326
|
};
|
|
11319
11327
|
const getWordAt = (editorUid, rowIndex, columnIndex) => {
|
|
11320
|
-
const editor = getEditor(editorUid);
|
|
11328
|
+
const editor = getEditor$1(editorUid);
|
|
11321
11329
|
const {
|
|
11322
11330
|
word
|
|
11323
11331
|
} = getWordAt$1(editor, rowIndex, columnIndex);
|
|
11324
11332
|
return word;
|
|
11325
11333
|
};
|
|
11326
11334
|
const getWordAtOffset2 = editorUid => {
|
|
11327
|
-
const editor = getEditor(editorUid);
|
|
11335
|
+
const editor = getEditor$1(editorUid);
|
|
11328
11336
|
const word = getWordAtOffset(editor);
|
|
11329
11337
|
return word;
|
|
11330
11338
|
};
|
|
11331
11339
|
const getWordBefore2 = (editorUid, rowIndex, columnIndex) => {
|
|
11332
|
-
const editor = getEditor(editorUid);
|
|
11340
|
+
const editor = getEditor$1(editorUid);
|
|
11333
11341
|
const word = getWordBefore(editor, rowIndex, columnIndex);
|
|
11334
11342
|
return word;
|
|
11335
11343
|
};
|
|
11336
11344
|
const getLines2 = editorUid => {
|
|
11337
|
-
const editor = getEditor(editorUid);
|
|
11345
|
+
const editor = getEditor$1(editorUid);
|
|
11338
11346
|
const {
|
|
11339
11347
|
lines
|
|
11340
11348
|
} = editor;
|
|
11341
11349
|
return lines;
|
|
11342
11350
|
};
|
|
11343
11351
|
const getSelections2 = editorUid => {
|
|
11344
|
-
const editor = getEditor(editorUid);
|
|
11352
|
+
const editor = getEditor$1(editorUid);
|
|
11345
11353
|
const {
|
|
11346
11354
|
selections
|
|
11347
11355
|
} = editor;
|
|
11348
11356
|
return selections;
|
|
11349
11357
|
};
|
|
11350
11358
|
const setSelections2 = async (editorUid, selections) => {
|
|
11351
|
-
const editor = getEditor(editorUid);
|
|
11359
|
+
const editor = getEditor$1(editorUid);
|
|
11352
11360
|
const newEditor = {
|
|
11353
11361
|
...editor,
|
|
11354
11362
|
selections
|
|
11355
11363
|
};
|
|
11356
11364
|
const newEditorWithDerivedState = await updateDerivedState(editor, newEditor);
|
|
11357
|
-
set$
|
|
11365
|
+
set$8(editorUid, editor, newEditorWithDerivedState);
|
|
11358
11366
|
};
|
|
11359
11367
|
const closeWidget2 = async (editorUid, widgetId, widgetName, unsetAdditionalFocus$1) => {
|
|
11360
|
-
const editor = getEditor(editorUid);
|
|
11368
|
+
const editor = getEditor$1(editorUid);
|
|
11361
11369
|
const widgetRevision = next(editorUid);
|
|
11362
11370
|
const invoke = getWidgetInvoke(widgetId);
|
|
11363
11371
|
const {
|
|
@@ -11377,7 +11385,7 @@ const closeWidget2 = async (editorUid, widgetId, widgetName, unsetAdditionalFocu
|
|
|
11377
11385
|
widgets: newWidgets
|
|
11378
11386
|
};
|
|
11379
11387
|
const newEditorWithDerivedState = await updateDerivedState(editor, newEditor);
|
|
11380
|
-
set$
|
|
11388
|
+
set$8(editorUid, editor, newEditorWithDerivedState);
|
|
11381
11389
|
await setFocus(FocusEditorText);
|
|
11382
11390
|
if (unsetAdditionalFocus$1) {
|
|
11383
11391
|
await unsetAdditionalFocus(unsetAdditionalFocus$1);
|
|
@@ -11387,17 +11395,17 @@ const closeFind2 = async editorUid => {
|
|
|
11387
11395
|
await closeWidget2(editorUid, Find, 'FindWidget', 0);
|
|
11388
11396
|
};
|
|
11389
11397
|
const applyEdits2 = async (editorUid, edits) => {
|
|
11390
|
-
const editor = getEditor(editorUid);
|
|
11398
|
+
const editor = getEditor$1(editorUid);
|
|
11391
11399
|
const newEditor = await applyEdit(editor, edits);
|
|
11392
11400
|
const newEditorWithDerivedState = await updateDerivedState(editor, newEditor);
|
|
11393
|
-
set$
|
|
11401
|
+
set$8(editorUid, editor, newEditorWithDerivedState);
|
|
11394
11402
|
};
|
|
11395
11403
|
const getSourceActions = async editorUid => {
|
|
11396
11404
|
const actions = await getEditorSourceActions(editorUid);
|
|
11397
11405
|
return actions;
|
|
11398
11406
|
};
|
|
11399
11407
|
const getDiagnostics$1 = async editorUid => {
|
|
11400
|
-
const editor = getEditor(editorUid);
|
|
11408
|
+
const editor = getEditor$1(editorUid);
|
|
11401
11409
|
const {
|
|
11402
11410
|
diagnostics
|
|
11403
11411
|
} = editor;
|
|
@@ -11405,9 +11413,21 @@ const getDiagnostics$1 = async editorUid => {
|
|
|
11405
11413
|
};
|
|
11406
11414
|
|
|
11407
11415
|
const ensure = async (fontName, fontUrl) => {
|
|
11408
|
-
await invoke$
|
|
11416
|
+
await invoke$b('TextMeasurement.ensureFont', fontName, fontUrl);
|
|
11409
11417
|
};
|
|
11410
11418
|
|
|
11419
|
+
const findWidgetFocusContexts = [FindWidget, FocusFindWidgetReplace$1, FocusFindWidgetOptions, FocusFindWidgetToggleReplace, FocusFindWidgetPreviousMatchButton, FocusFindWidgetNextMatchButton, FocusFindWidgetCloseButton, FocusFindWidgetReplaceButton, FocusFindWidgetReplaceAllButton];
|
|
11420
|
+
const getFindWidgetFocusKeyBindings = () => {
|
|
11421
|
+
return findWidgetFocusContexts.flatMap(focusContext => [{
|
|
11422
|
+
command: 'FindWidget.focusNextElement',
|
|
11423
|
+
key: Tab$1,
|
|
11424
|
+
when: focusContext
|
|
11425
|
+
}, {
|
|
11426
|
+
command: 'FindWidget.focusPreviousElement',
|
|
11427
|
+
key: Shift | Tab$1,
|
|
11428
|
+
when: focusContext
|
|
11429
|
+
}]);
|
|
11430
|
+
};
|
|
11411
11431
|
const getKeyBindings = () => {
|
|
11412
11432
|
return [{
|
|
11413
11433
|
command: 'Editor.closeColorPicker',
|
|
@@ -11437,6 +11457,10 @@ const getKeyBindings = () => {
|
|
|
11437
11457
|
command: 'EditorSourceActions.selectCurrent',
|
|
11438
11458
|
key: Enter,
|
|
11439
11459
|
when: FocusSourceActions
|
|
11460
|
+
}, {
|
|
11461
|
+
command: 'FindWidget.replace',
|
|
11462
|
+
key: Enter,
|
|
11463
|
+
when: FocusFindWidgetReplace
|
|
11440
11464
|
}, {
|
|
11441
11465
|
command: 'FindWidget.focusNext',
|
|
11442
11466
|
key: Enter,
|
|
@@ -11457,62 +11481,10 @@ const getKeyBindings = () => {
|
|
|
11457
11481
|
command: 'FindWidget.focusNext',
|
|
11458
11482
|
key: F4,
|
|
11459
11483
|
when: FocusFindWidget
|
|
11460
|
-
}, {
|
|
11461
|
-
command: 'FindWidget.focusToggleReplace',
|
|
11462
|
-
key: Shift | Tab$1,
|
|
11463
|
-
when: FocusFindWidget
|
|
11464
|
-
}, {
|
|
11465
|
-
command: 'FindWidget.focusReplace',
|
|
11466
|
-
key: Tab$1,
|
|
11467
|
-
when: FocusFindWidget
|
|
11468
|
-
}, {
|
|
11469
|
-
command: 'FindWidget.focusPreviousMatchButton',
|
|
11470
|
-
key: Tab$1,
|
|
11471
|
-
when: FocusFindWidgetReplace
|
|
11472
|
-
}, {
|
|
11484
|
+
}, ...getFindWidgetFocusKeyBindings(), {
|
|
11473
11485
|
command: 'FindWidget.replaceAll',
|
|
11474
11486
|
key: Alt$1 | CtrlCmd | Enter,
|
|
11475
11487
|
when: FocusFindWidgetReplace
|
|
11476
|
-
}, {
|
|
11477
|
-
command: 'FindWidget.focusNextMatchButton',
|
|
11478
|
-
key: Tab$1,
|
|
11479
|
-
when: FocusFindWidgetPreviousMatchButton
|
|
11480
|
-
}, {
|
|
11481
|
-
command: 'FindWidget.focusReplace',
|
|
11482
|
-
key: Shift | Tab$1,
|
|
11483
|
-
when: FocusFindWidgetPreviousMatchButton
|
|
11484
|
-
}, {
|
|
11485
|
-
command: 'FindWidget.focusPreviousMatchButton',
|
|
11486
|
-
key: Shift | Tab$1,
|
|
11487
|
-
when: FocusFindWidgetNextMatchButton
|
|
11488
|
-
}, {
|
|
11489
|
-
command: 'FindWidget.focusCloseButton',
|
|
11490
|
-
key: Tab$1,
|
|
11491
|
-
when: FocusFindWidgetNextMatchButton
|
|
11492
|
-
}, {
|
|
11493
|
-
command: 'FindWidget.focusNextMatchButton',
|
|
11494
|
-
key: Shift | Tab$1,
|
|
11495
|
-
when: FocusFindWidgetCloseButton
|
|
11496
|
-
}, {
|
|
11497
|
-
command: 'FindWidget.focusReplaceButton',
|
|
11498
|
-
key: Tab$1,
|
|
11499
|
-
when: FocusFindWidgetCloseButton
|
|
11500
|
-
}, {
|
|
11501
|
-
command: 'FindWidget.focusFind',
|
|
11502
|
-
key: Shift | Tab$1,
|
|
11503
|
-
when: FocusFindWidgetReplace
|
|
11504
|
-
}, {
|
|
11505
|
-
command: 'FindWidget.focusReplaceAllButton',
|
|
11506
|
-
key: Tab$1,
|
|
11507
|
-
when: FocusFindWidgetReplaceButton
|
|
11508
|
-
}, {
|
|
11509
|
-
command: 'FindWidget.focusCloseButton',
|
|
11510
|
-
key: Shift | Tab$1,
|
|
11511
|
-
when: FocusFindWidgetReplaceButton
|
|
11512
|
-
}, {
|
|
11513
|
-
command: 'FindWidget.focusReplaceButton',
|
|
11514
|
-
key: Shift | Tab$1,
|
|
11515
|
-
when: FocusFindWidgetReplaceAllButton
|
|
11516
11488
|
}, {
|
|
11517
11489
|
command: 'EditorCompletion.focusNext',
|
|
11518
11490
|
key: DownArrow,
|
|
@@ -11990,7 +11962,7 @@ const getQuickPickMenuEntries = () => {
|
|
|
11990
11962
|
};
|
|
11991
11963
|
|
|
11992
11964
|
const getSelections = editorUid => {
|
|
11993
|
-
const editor = getEditor(editorUid);
|
|
11965
|
+
const editor = getEditor$1(editorUid);
|
|
11994
11966
|
const {
|
|
11995
11967
|
selections
|
|
11996
11968
|
} = editor;
|
|
@@ -11999,7 +11971,7 @@ const getSelections = editorUid => {
|
|
|
11999
11971
|
|
|
12000
11972
|
const getText = editorUid => {
|
|
12001
11973
|
number(editorUid);
|
|
12002
|
-
const editor = getEditor(editorUid);
|
|
11974
|
+
const editor = getEditor$1(editorUid);
|
|
12003
11975
|
const {
|
|
12004
11976
|
lines
|
|
12005
11977
|
} = editor;
|
|
@@ -12023,7 +11995,7 @@ const handleMessagePort = async (port, rpcId) => {
|
|
|
12023
11995
|
messagePort: port
|
|
12024
11996
|
});
|
|
12025
11997
|
if (rpcId) {
|
|
12026
|
-
set$
|
|
11998
|
+
set$g(rpcId, rpc);
|
|
12027
11999
|
}
|
|
12028
12000
|
};
|
|
12029
12001
|
|
|
@@ -12277,12 +12249,12 @@ const hotReload = async () => {
|
|
|
12277
12249
|
await relaunchWorkers();
|
|
12278
12250
|
const newEditors = await restoreWidgetState(keys, savedStates);
|
|
12279
12251
|
for (const editor of newEditors) {
|
|
12280
|
-
set$
|
|
12252
|
+
set$8(editor.newState.uid, editor.oldState, editor.newState);
|
|
12281
12253
|
}
|
|
12282
12254
|
|
|
12283
12255
|
// TODO ask renderer worker to rerender all editors
|
|
12284
12256
|
// @ts-ignore
|
|
12285
|
-
await invoke$
|
|
12257
|
+
await invoke$a(`Editor.rerender`);
|
|
12286
12258
|
} finally {
|
|
12287
12259
|
state.isReloading = false;
|
|
12288
12260
|
}
|
|
@@ -12315,7 +12287,7 @@ const initializeSyntaxHighlighting = async (syntaxHighlightingEnabled, syncIncre
|
|
|
12315
12287
|
if (syntaxHighlightingEnabled) {
|
|
12316
12288
|
setEnabled$1(true);
|
|
12317
12289
|
const syntaxRpc = await createSyntaxHighlightingWorkerRpc();
|
|
12318
|
-
set$
|
|
12290
|
+
set$6(syntaxRpc);
|
|
12319
12291
|
}
|
|
12320
12292
|
if (syncIncremental) {
|
|
12321
12293
|
setEnabled(true);
|
|
@@ -12385,7 +12357,7 @@ const loadContent = async (state, savedState) => {
|
|
|
12385
12357
|
await loadTokenizer(computedLanguageId, tokenizePath);
|
|
12386
12358
|
const tokenizer = getTokenizer(computedLanguageId);
|
|
12387
12359
|
const newTokenizerId = state.tokenizerId + 1;
|
|
12388
|
-
set$
|
|
12360
|
+
set$3(newTokenizerId, tokenizer);
|
|
12389
12361
|
const newEditor0 = {
|
|
12390
12362
|
...state,
|
|
12391
12363
|
charWidth,
|
|
@@ -12456,11 +12428,6 @@ const loadContent = async (state, savedState) => {
|
|
|
12456
12428
|
focused: true,
|
|
12457
12429
|
textInfos
|
|
12458
12430
|
};
|
|
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
12431
|
const completionsOnTypeRaw = await get$3('editor.completionsOnType');
|
|
12465
12432
|
const completionsOnType = Boolean(completionsOnTypeRaw);
|
|
12466
12433
|
const newEditor5 = {
|
|
@@ -13286,7 +13253,7 @@ const render2 = (uid, diffResult) => {
|
|
|
13286
13253
|
newState,
|
|
13287
13254
|
oldState
|
|
13288
13255
|
} = get$8(uid);
|
|
13289
|
-
set$
|
|
13256
|
+
set$8(uid, newState, newState);
|
|
13290
13257
|
const commands = applyRender(oldState, newState, diffResult);
|
|
13291
13258
|
return commands;
|
|
13292
13259
|
};
|
|
@@ -13383,7 +13350,7 @@ const renderEditor = async id => {
|
|
|
13383
13350
|
oldState
|
|
13384
13351
|
} = instance;
|
|
13385
13352
|
const commands = [];
|
|
13386
|
-
set$
|
|
13353
|
+
set$8(id, newState, newState);
|
|
13387
13354
|
for (const item of render$7) {
|
|
13388
13355
|
if (item.isEqual(oldState, newState)) {
|
|
13389
13356
|
continue;
|
|
@@ -13487,13 +13454,12 @@ const saveState = (state, savedState) => {
|
|
|
13487
13454
|
};
|
|
13488
13455
|
};
|
|
13489
13456
|
|
|
13490
|
-
const sendMessagePortToExtensionHostWorker2 = async (port, initialCommand, rpcId) => {
|
|
13491
|
-
await sendMessagePortToExtensionHostWorker(port, rpcId);
|
|
13492
|
-
};
|
|
13493
|
-
|
|
13494
13457
|
const sendMessagePortToExtensionManagementWorker = async (port, rpcId) => {
|
|
13495
13458
|
await sendMessagePortToExtensionManagementWorker$1(port, rpcId);
|
|
13496
13459
|
};
|
|
13460
|
+
const sendDeprecatedExtensionHostPortToExtensionManagementWorker = async (port, _initialCommand, rpcId) => {
|
|
13461
|
+
await sendMessagePortToExtensionManagementWorker$1(port, rpcId);
|
|
13462
|
+
};
|
|
13497
13463
|
|
|
13498
13464
|
const setDebugEnabled = (state, enabled) => {
|
|
13499
13465
|
return state;
|
|
@@ -13539,9 +13505,9 @@ const updateDebugInfo = async debugId => {
|
|
|
13539
13505
|
...newState,
|
|
13540
13506
|
highlightedLine: newInfo.rowIndex
|
|
13541
13507
|
};
|
|
13542
|
-
set$
|
|
13508
|
+
set$8(key, oldState, newEditor);
|
|
13543
13509
|
// @ts-ignore
|
|
13544
|
-
await invoke$
|
|
13510
|
+
await invoke$a('Editor.rerender', key);
|
|
13545
13511
|
};
|
|
13546
13512
|
|
|
13547
13513
|
const getTextDocument = editor => {
|
|
@@ -13554,26 +13520,10 @@ const getTextDocument = editor => {
|
|
|
13554
13520
|
};
|
|
13555
13521
|
const executeIsolatedDiagnosticProvider = async editor => {
|
|
13556
13522
|
const textDocument = getTextDocument(editor);
|
|
13557
|
-
return invoke$
|
|
13523
|
+
return invoke$d('Extensions.executeDiagnosticProvider', textDocument);
|
|
13558
13524
|
};
|
|
13559
13525
|
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
|
-
});
|
|
13526
|
+
return executeIsolatedDiagnosticProvider(editor);
|
|
13577
13527
|
};
|
|
13578
13528
|
|
|
13579
13529
|
const getDiagnosticType = diagnostic => {
|
|
@@ -13654,9 +13604,6 @@ const mergeLinksWithDiagnosticDecorations = (editor, diagnosticDecorations) => {
|
|
|
13654
13604
|
};
|
|
13655
13605
|
|
|
13656
13606
|
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
13607
|
return executeDiagnosticProvider(editor);
|
|
13661
13608
|
};
|
|
13662
13609
|
const addDiagnostics = async (editor, diagnostics) => {
|
|
@@ -13688,7 +13635,7 @@ const updateDiagnostics = async editor => {
|
|
|
13688
13635
|
return editor;
|
|
13689
13636
|
}
|
|
13690
13637
|
const newEditor = await addDiagnostics(latest.newState, diagnostics);
|
|
13691
|
-
set$
|
|
13638
|
+
set$8(editor.id, latest.oldState, newEditor);
|
|
13692
13639
|
return newEditor;
|
|
13693
13640
|
} catch (error) {
|
|
13694
13641
|
return handleError(error, editor);
|
|
@@ -13729,14 +13676,14 @@ const wrapCommand = fn => async (uid, ...args) => {
|
|
|
13729
13676
|
return newEditor;
|
|
13730
13677
|
}
|
|
13731
13678
|
const newEditorWithDerivedState = await updateDerivedState(state, newEditor);
|
|
13732
|
-
set$
|
|
13679
|
+
set$8(uid, state, newEditorWithDerivedState);
|
|
13733
13680
|
let finalEditor = newEditorWithDerivedState;
|
|
13734
13681
|
if (editorDiagnosticEffect.isActive(state, newEditorWithDerivedState)) {
|
|
13735
13682
|
finalEditor = await editorDiagnosticEffect.apply(newEditorWithDerivedState);
|
|
13736
13683
|
if (!get$8(uid)) {
|
|
13737
13684
|
return finalEditor;
|
|
13738
13685
|
}
|
|
13739
|
-
set$
|
|
13686
|
+
set$8(uid, state, finalEditor);
|
|
13740
13687
|
}
|
|
13741
13688
|
const {
|
|
13742
13689
|
initial,
|
|
@@ -13766,7 +13713,7 @@ const wrapCommand = fn => async (uid, ...args) => {
|
|
|
13766
13713
|
undoStack: finalEditor.undoStack,
|
|
13767
13714
|
visualDecorations: finalEditor.visualDecorations
|
|
13768
13715
|
});
|
|
13769
|
-
set$
|
|
13716
|
+
set$8(otherUid, instance.oldState, synchronizedEditor);
|
|
13770
13717
|
}
|
|
13771
13718
|
}
|
|
13772
13719
|
return finalEditor;
|
|
@@ -13784,7 +13731,7 @@ const commandMap = {
|
|
|
13784
13731
|
'ColorPicker.loadContent': loadContent$3,
|
|
13785
13732
|
'Editor.addCursorAbove': wrapCommand(addCursorAbove),
|
|
13786
13733
|
'Editor.addCursorBelow': wrapCommand(addCursorBelow),
|
|
13787
|
-
'Editor.applyDocumentEdits': wrapCommand(applyDocumentEdits),
|
|
13734
|
+
'Editor.applyDocumentEdits': wrapCommand(applyDocumentEdits$1),
|
|
13788
13735
|
'Editor.applyEdit': wrapCommand(applyEdit),
|
|
13789
13736
|
'Editor.applyEdit2': applyEdits2,
|
|
13790
13737
|
'Editor.applyWorkspaceEdit': wrapCommand(applyWorkspaceEdit),
|
|
@@ -13793,7 +13740,7 @@ const commandMap = {
|
|
|
13793
13740
|
'Editor.closeCodeGenerator': wrapCommand(closeCodeGenerator),
|
|
13794
13741
|
'Editor.closeColorPicker': wrapCommand(closeColorPicker),
|
|
13795
13742
|
'Editor.closeCompletion': wrapCommand(closeCompletion),
|
|
13796
|
-
'Editor.closeFind': wrapCommand(closeFind),
|
|
13743
|
+
'Editor.closeFind': wrapCommand(closeFind$1),
|
|
13797
13744
|
'Editor.closeFind2': closeFind2,
|
|
13798
13745
|
'Editor.closeRename': wrapCommand(closeRename),
|
|
13799
13746
|
'Editor.closeSourceAction': wrapCommand(closeSourceAction),
|
|
@@ -14008,7 +13955,6 @@ const commandMap = {
|
|
|
14008
13955
|
'EditorSourceAction.selectItem': selectItem,
|
|
14009
13956
|
'EditorSourceAction.toggleDetails': toggleDetails,
|
|
14010
13957
|
'EditorSourceActions.focusNext': focusNext$1,
|
|
14011
|
-
'ExtensionHostManagement.activateByEvent': activateByEvent,
|
|
14012
13958
|
'FindWidget.close': close$4,
|
|
14013
13959
|
'FindWidget.focusCloseButton': focusCloseButton,
|
|
14014
13960
|
'FindWidget.focusFind': focusFind,
|
|
@@ -14049,7 +13995,7 @@ const commandMap = {
|
|
|
14049
13995
|
'Listener.register': registerListener,
|
|
14050
13996
|
'Listener.registerListener': registerListener$1,
|
|
14051
13997
|
'Listener.unregister': unregisterListener,
|
|
14052
|
-
'SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker':
|
|
13998
|
+
'SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker': sendDeprecatedExtensionHostPortToExtensionManagementWorker,
|
|
14053
13999
|
'SendMessagePortToExtensionManagementWorker.sendMessagePortToExtensionManagementWorker': sendMessagePortToExtensionManagementWorker
|
|
14054
14000
|
};
|
|
14055
14001
|
for (const [key, value] of Object.entries(commandMap)) {
|
|
@@ -14066,23 +14012,7 @@ const initializeErrorWorker = async () => {
|
|
|
14066
14012
|
return sendMessagePortToErrorWorker(port, EditorWorker);
|
|
14067
14013
|
}
|
|
14068
14014
|
});
|
|
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);
|
|
14015
|
+
set$e(rpc);
|
|
14086
14016
|
};
|
|
14087
14017
|
|
|
14088
14018
|
const createExtensionManagementWorkerRpc = async () => {
|
|
@@ -14098,7 +14028,7 @@ const createExtensionManagementWorkerRpc = async () => {
|
|
|
14098
14028
|
const initializeExtensionManagementWorker = async () => {
|
|
14099
14029
|
try {
|
|
14100
14030
|
const rpc = await createExtensionManagementWorkerRpc();
|
|
14101
|
-
set$
|
|
14031
|
+
set$d(rpc);
|
|
14102
14032
|
} catch {
|
|
14103
14033
|
// ignore
|
|
14104
14034
|
}
|
|
@@ -14113,14 +14043,14 @@ const initializeOpenerWorker = async () => {
|
|
|
14113
14043
|
commandMap: {},
|
|
14114
14044
|
send: send$1
|
|
14115
14045
|
});
|
|
14116
|
-
set$
|
|
14046
|
+
set$c(rpc);
|
|
14117
14047
|
};
|
|
14118
14048
|
|
|
14119
14049
|
const initializeRendererWorker = async () => {
|
|
14120
14050
|
const rpc = await create$b({
|
|
14121
14051
|
commandMap: commandMap
|
|
14122
14052
|
});
|
|
14123
|
-
set$
|
|
14053
|
+
set$a(rpc);
|
|
14124
14054
|
};
|
|
14125
14055
|
|
|
14126
14056
|
const send = port => {
|
|
@@ -14131,17 +14061,17 @@ const initializeTextMeasurementWorker = async () => {
|
|
|
14131
14061
|
commandMap: {},
|
|
14132
14062
|
send
|
|
14133
14063
|
});
|
|
14134
|
-
set$
|
|
14064
|
+
set$b(rpc);
|
|
14135
14065
|
};
|
|
14136
14066
|
|
|
14137
14067
|
const listen = async () => {
|
|
14138
14068
|
registerCommands(commandMap);
|
|
14139
|
-
await Promise.all([initializeRendererWorker(), initializeErrorWorker(),
|
|
14069
|
+
await Promise.all([initializeRendererWorker(), initializeErrorWorker(), initializeExtensionManagementWorker(), initializeTextMeasurementWorker(), initializeOpenerWorker()]);
|
|
14140
14070
|
const dialogRpc = await create$d({
|
|
14141
14071
|
commandMap: {},
|
|
14142
14072
|
send: sendMessagePortToDialogWorker
|
|
14143
14073
|
});
|
|
14144
|
-
set$
|
|
14074
|
+
set$f(dialogRpc);
|
|
14145
14075
|
};
|
|
14146
14076
|
|
|
14147
14077
|
const CodeGeneratorInput = 'CodeGeneratorInput';
|
|
@@ -14461,15 +14391,15 @@ const EditorMessageWidget = {
|
|
|
14461
14391
|
};
|
|
14462
14392
|
|
|
14463
14393
|
const registerWidgets = () => {
|
|
14464
|
-
set$
|
|
14465
|
-
set$
|
|
14466
|
-
set$
|
|
14467
|
-
set$
|
|
14468
|
-
set$
|
|
14469
|
-
set$
|
|
14470
|
-
set$
|
|
14471
|
-
set$
|
|
14472
|
-
set$
|
|
14394
|
+
set$7(ColorPicker$1, EditorColorPickerWidget);
|
|
14395
|
+
set$7(Completion, EditorCompletionWidget);
|
|
14396
|
+
set$7(CompletionDetail, EditorCompletionDetailWidget);
|
|
14397
|
+
set$7(Find, EditorFindWidget);
|
|
14398
|
+
set$7(Hover, EditorHoverWidget);
|
|
14399
|
+
set$7(Message, EditorMessageWidget);
|
|
14400
|
+
set$7(Rename$1, EditorRenameWidget);
|
|
14401
|
+
set$7(SourceAction$1, EditorSourceActionWidget);
|
|
14402
|
+
set$7(CodeGenerator, EditorCodeGeneratorWidget);
|
|
14473
14403
|
};
|
|
14474
14404
|
|
|
14475
14405
|
const handleUnhandledRejection = event => {
|