@lvce-editor/process-explorer-worker 3.6.0 → 3.8.0
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/index.js +253 -706
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -181,12 +181,12 @@ const collapseAll = state => {
|
|
|
181
181
|
};
|
|
182
182
|
|
|
183
183
|
const {
|
|
184
|
-
dispose: dispose$
|
|
184
|
+
dispose: dispose$4,
|
|
185
185
|
get: get$2,
|
|
186
186
|
getCommandIds,
|
|
187
187
|
getKeys: getKeys$1,
|
|
188
188
|
registerCommands,
|
|
189
|
-
set: set$
|
|
189
|
+
set: set$6,
|
|
190
190
|
wrapCommand,
|
|
191
191
|
wrapGetter,
|
|
192
192
|
wrapLoadContent
|
|
@@ -215,14 +215,14 @@ const create$d = (id, _uri, x, y, width, height, args, parentUid, platform = 0,
|
|
|
215
215
|
parentUid,
|
|
216
216
|
platform,
|
|
217
217
|
processes: [],
|
|
218
|
-
rootPid:
|
|
218
|
+
rootPid: -1,
|
|
219
219
|
uid: id,
|
|
220
220
|
visibleProcesses: [],
|
|
221
221
|
width,
|
|
222
222
|
x,
|
|
223
223
|
y
|
|
224
224
|
};
|
|
225
|
-
set$
|
|
225
|
+
set$6(state.uid, state, state);
|
|
226
226
|
return state;
|
|
227
227
|
};
|
|
228
228
|
|
|
@@ -888,8 +888,10 @@ const getCurrentStack = () => {
|
|
|
888
888
|
const currentStack = joinLines(splitLines(new Error().stack || '').slice(stackLinesToSkip));
|
|
889
889
|
return currentStack;
|
|
890
890
|
};
|
|
891
|
-
const getNewLineIndex = (string, startIndex
|
|
892
|
-
|
|
891
|
+
const getNewLineIndex = (string, startIndex) => {
|
|
892
|
+
{
|
|
893
|
+
return string.indexOf(NewLine);
|
|
894
|
+
}
|
|
893
895
|
};
|
|
894
896
|
const getParentStack = error => {
|
|
895
897
|
let parentStack = error.stack || error.data || error.message || '';
|
|
@@ -900,55 +902,77 @@ const getParentStack = error => {
|
|
|
900
902
|
};
|
|
901
903
|
const MethodNotFound = -32601;
|
|
902
904
|
const Custom = -32001;
|
|
905
|
+
const restoreExistingError = (error, currentStack) => {
|
|
906
|
+
if (typeof error.stack === 'string') {
|
|
907
|
+
error.stack = error.stack + NewLine + currentStack;
|
|
908
|
+
}
|
|
909
|
+
return error;
|
|
910
|
+
};
|
|
911
|
+
const restoreMethodNotFoundError = (error, currentStack) => {
|
|
912
|
+
const restoredError = new JsonRpcError(error.message);
|
|
913
|
+
const parentStack = getParentStack(error);
|
|
914
|
+
restoredError.stack = parentStack + NewLine + currentStack;
|
|
915
|
+
return restoredError;
|
|
916
|
+
};
|
|
917
|
+
const restoreStackFromData = (restoredError, error, currentStack) => {
|
|
918
|
+
if (error.data.stack && error.data.type && error.message) {
|
|
919
|
+
restoredError.stack = error.data.type + ': ' + error.message + NewLine + error.data.stack + NewLine + currentStack;
|
|
920
|
+
return;
|
|
921
|
+
}
|
|
922
|
+
if (error.data.stack) {
|
|
923
|
+
restoredError.stack = error.data.stack;
|
|
924
|
+
}
|
|
925
|
+
};
|
|
926
|
+
const applyDataProperties = (restoredError, error) => {
|
|
927
|
+
if (!error.data) {
|
|
928
|
+
return;
|
|
929
|
+
}
|
|
930
|
+
restoreStackFromData(restoredError, error, getCurrentStack());
|
|
931
|
+
if (error.data.codeFrame) {
|
|
932
|
+
// @ts-ignore
|
|
933
|
+
restoredError.codeFrame = error.data.codeFrame;
|
|
934
|
+
}
|
|
935
|
+
if (error.data.code) {
|
|
936
|
+
// @ts-ignore
|
|
937
|
+
restoredError.code = error.data.code;
|
|
938
|
+
}
|
|
939
|
+
if (error.data.type) {
|
|
940
|
+
// @ts-ignore
|
|
941
|
+
restoredError.name = error.data.type;
|
|
942
|
+
}
|
|
943
|
+
};
|
|
944
|
+
const applyDirectProperties = (restoredError, error) => {
|
|
945
|
+
if (error.stack) {
|
|
946
|
+
const lowerStack = restoredError.stack || '';
|
|
947
|
+
const indexNewLine = getNewLineIndex(lowerStack);
|
|
948
|
+
const parentStack = getParentStack(error);
|
|
949
|
+
// @ts-ignore
|
|
950
|
+
restoredError.stack = parentStack + lowerStack.slice(indexNewLine);
|
|
951
|
+
}
|
|
952
|
+
if (error.codeFrame) {
|
|
953
|
+
// @ts-ignore
|
|
954
|
+
restoredError.codeFrame = error.codeFrame;
|
|
955
|
+
}
|
|
956
|
+
};
|
|
957
|
+
const restoreMessageError = (error, _currentStack) => {
|
|
958
|
+
const restoredError = constructError(error.message, error.type, error.name);
|
|
959
|
+
if (error.data) {
|
|
960
|
+
applyDataProperties(restoredError, error);
|
|
961
|
+
} else {
|
|
962
|
+
applyDirectProperties(restoredError, error);
|
|
963
|
+
}
|
|
964
|
+
return restoredError;
|
|
965
|
+
};
|
|
903
966
|
const restoreJsonRpcError = error => {
|
|
904
967
|
const currentStack = getCurrentStack();
|
|
905
968
|
if (error && error instanceof Error) {
|
|
906
|
-
|
|
907
|
-
error.stack = error.stack + NewLine + currentStack;
|
|
908
|
-
}
|
|
909
|
-
return error;
|
|
969
|
+
return restoreExistingError(error, currentStack);
|
|
910
970
|
}
|
|
911
971
|
if (error && error.code && error.code === MethodNotFound) {
|
|
912
|
-
|
|
913
|
-
const parentStack = getParentStack(error);
|
|
914
|
-
restoredError.stack = parentStack + NewLine + currentStack;
|
|
915
|
-
return restoredError;
|
|
972
|
+
return restoreMethodNotFoundError(error, currentStack);
|
|
916
973
|
}
|
|
917
974
|
if (error && error.message) {
|
|
918
|
-
|
|
919
|
-
if (error.data) {
|
|
920
|
-
if (error.data.stack && error.data.type && error.message) {
|
|
921
|
-
restoredError.stack = error.data.type + ': ' + error.message + NewLine + error.data.stack + NewLine + currentStack;
|
|
922
|
-
} else if (error.data.stack) {
|
|
923
|
-
restoredError.stack = error.data.stack;
|
|
924
|
-
}
|
|
925
|
-
if (error.data.codeFrame) {
|
|
926
|
-
// @ts-ignore
|
|
927
|
-
restoredError.codeFrame = error.data.codeFrame;
|
|
928
|
-
}
|
|
929
|
-
if (error.data.code) {
|
|
930
|
-
// @ts-ignore
|
|
931
|
-
restoredError.code = error.data.code;
|
|
932
|
-
}
|
|
933
|
-
if (error.data.type) {
|
|
934
|
-
// @ts-ignore
|
|
935
|
-
restoredError.name = error.data.type;
|
|
936
|
-
}
|
|
937
|
-
} else {
|
|
938
|
-
if (error.stack) {
|
|
939
|
-
const lowerStack = restoredError.stack || '';
|
|
940
|
-
// @ts-ignore
|
|
941
|
-
const indexNewLine = getNewLineIndex(lowerStack);
|
|
942
|
-
const parentStack = getParentStack(error);
|
|
943
|
-
// @ts-ignore
|
|
944
|
-
restoredError.stack = parentStack + lowerStack.slice(indexNewLine);
|
|
945
|
-
}
|
|
946
|
-
if (error.codeFrame) {
|
|
947
|
-
// @ts-ignore
|
|
948
|
-
restoredError.codeFrame = error.codeFrame;
|
|
949
|
-
}
|
|
950
|
-
}
|
|
951
|
-
return restoredError;
|
|
975
|
+
return restoreMessageError(error);
|
|
952
976
|
}
|
|
953
977
|
if (typeof error === 'string') {
|
|
954
978
|
return new Error(`JsonRpc Error: ${error}`);
|
|
@@ -1423,7 +1447,7 @@ const createMockRpc = ({
|
|
|
1423
1447
|
};
|
|
1424
1448
|
|
|
1425
1449
|
const rpcs = Object.create(null);
|
|
1426
|
-
const set$
|
|
1450
|
+
const set$5 = (id, rpc) => {
|
|
1427
1451
|
rpcs[id] = rpc;
|
|
1428
1452
|
};
|
|
1429
1453
|
const get = id => {
|
|
@@ -1456,7 +1480,7 @@ const create = rpcId => {
|
|
|
1456
1480
|
const mockRpc = createMockRpc({
|
|
1457
1481
|
commandMap
|
|
1458
1482
|
});
|
|
1459
|
-
set$
|
|
1483
|
+
set$5(rpcId, mockRpc);
|
|
1460
1484
|
// @ts-ignore
|
|
1461
1485
|
mockRpc[Symbol.dispose] = () => {
|
|
1462
1486
|
remove(rpcId);
|
|
@@ -1465,7 +1489,7 @@ const create = rpcId => {
|
|
|
1465
1489
|
return mockRpc;
|
|
1466
1490
|
},
|
|
1467
1491
|
set(rpc) {
|
|
1468
|
-
set$
|
|
1492
|
+
set$5(rpcId, rpc);
|
|
1469
1493
|
}
|
|
1470
1494
|
};
|
|
1471
1495
|
};
|
|
@@ -1496,8 +1520,6 @@ const DownArrow = 16;
|
|
|
1496
1520
|
const ContextMenu = 56;
|
|
1497
1521
|
const Star = 131;
|
|
1498
1522
|
|
|
1499
|
-
const Script = 2;
|
|
1500
|
-
|
|
1501
1523
|
const CtrlCmd = 1 << 11 >>> 0;
|
|
1502
1524
|
|
|
1503
1525
|
const None$1 = 0;
|
|
@@ -1505,14 +1527,9 @@ const None$1 = 0;
|
|
|
1505
1527
|
const Electron = 2;
|
|
1506
1528
|
const Remote = 3;
|
|
1507
1529
|
|
|
1508
|
-
const DebugWorker = 55;
|
|
1509
|
-
const EditorWorker = 99;
|
|
1510
1530
|
const ErrorWorker = 3308;
|
|
1511
1531
|
const FileSystemWorker$1 = 209;
|
|
1512
|
-
const
|
|
1513
|
-
const OpenerWorker = 4561;
|
|
1514
|
-
const RendererWorker$1 = 1;
|
|
1515
|
-
const TestWorker = 9001;
|
|
1532
|
+
const RendererWorker = 1;
|
|
1516
1533
|
|
|
1517
1534
|
const FocusSelector = 'Viewlet.focusSelector';
|
|
1518
1535
|
const SetDom2 = 'Viewlet.setDom2';
|
|
@@ -1522,57 +1539,28 @@ const SetPatches = 'Viewlet.setPatches';
|
|
|
1522
1539
|
const Empty = 0;
|
|
1523
1540
|
const FocusExplorer = 13;
|
|
1524
1541
|
|
|
1525
|
-
const {
|
|
1526
|
-
set: set$7
|
|
1527
|
-
} = create(EditorWorker);
|
|
1528
|
-
|
|
1529
1542
|
const {
|
|
1530
1543
|
invoke: invoke$2,
|
|
1531
|
-
set: set$
|
|
1544
|
+
set: set$4
|
|
1532
1545
|
} = create(ErrorWorker);
|
|
1533
1546
|
const prepare = async error => {
|
|
1534
1547
|
return invoke$2('Errors.prepare', error);
|
|
1535
1548
|
};
|
|
1536
1549
|
|
|
1537
1550
|
const {
|
|
1538
|
-
set: set$
|
|
1551
|
+
set: set$3
|
|
1539
1552
|
} = create(FileSystemWorker$1);
|
|
1540
1553
|
|
|
1541
1554
|
const FileSystemWorker = {
|
|
1542
1555
|
__proto__: null,
|
|
1543
|
-
set: set$5
|
|
1544
|
-
};
|
|
1545
|
-
|
|
1546
|
-
const {
|
|
1547
|
-
set: set$4
|
|
1548
|
-
} = create(OpenerWorker);
|
|
1549
|
-
|
|
1550
|
-
const {
|
|
1551
1556
|
set: set$3
|
|
1552
|
-
}
|
|
1557
|
+
};
|
|
1553
1558
|
|
|
1554
1559
|
const {
|
|
1555
|
-
dispose: dispose$2,
|
|
1556
1560
|
invoke: invoke$1,
|
|
1557
1561
|
invokeAndTransfer,
|
|
1558
|
-
registerMockRpc,
|
|
1559
1562
|
set: set$2
|
|
1560
|
-
} = create(RendererWorker
|
|
1561
|
-
const searchFileHtml = async uri => {
|
|
1562
|
-
return invoke$1('ExtensionHost.searchFileWithHtml', uri);
|
|
1563
|
-
};
|
|
1564
|
-
const getFilePathElectron = async file => {
|
|
1565
|
-
return invoke$1('FileSystemHandle.getFilePathElectron', file);
|
|
1566
|
-
};
|
|
1567
|
-
const handleModifiedStatusChange = async (uri, modified) => {
|
|
1568
|
-
return invoke$1('Main.handleModifiedStatusChange', uri, modified);
|
|
1569
|
-
};
|
|
1570
|
-
/**
|
|
1571
|
-
* @deprecated
|
|
1572
|
-
*/
|
|
1573
|
-
const showContextMenu = async (x, y, id, ...args) => {
|
|
1574
|
-
return invoke$1('ContextMenu.show', x, y, id, ...args);
|
|
1575
|
-
};
|
|
1563
|
+
} = create(RendererWorker);
|
|
1576
1564
|
const showContextMenu2 = async (uid, menuId, x, y, args) => {
|
|
1577
1565
|
number(uid);
|
|
1578
1566
|
number(menuId);
|
|
@@ -1580,548 +1568,17 @@ const showContextMenu2 = async (uid, menuId, x, y, args) => {
|
|
|
1580
1568
|
number(y);
|
|
1581
1569
|
await invoke$1('ContextMenu.show2', uid, menuId, x, y, args);
|
|
1582
1570
|
};
|
|
1583
|
-
const getElectronVersion = async () => {
|
|
1584
|
-
return invoke$1('Process.getElectronVersion');
|
|
1585
|
-
};
|
|
1586
|
-
const applyBulkReplacement = async bulkEdits => {
|
|
1587
|
-
await invoke$1('BulkReplacement.applyBulkReplacement', bulkEdits);
|
|
1588
|
-
};
|
|
1589
|
-
const setColorTheme = async id => {
|
|
1590
|
-
return invoke$1(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
|
|
1591
|
-
};
|
|
1592
|
-
const getNodeVersion = async () => {
|
|
1593
|
-
return invoke$1('Process.getNodeVersion');
|
|
1594
|
-
};
|
|
1595
|
-
const getBadgeCounts = async () => {
|
|
1596
|
-
return invoke$1('Layout.getBadgeCounts');
|
|
1597
|
-
};
|
|
1598
|
-
const getChromeVersion = async () => {
|
|
1599
|
-
return invoke$1('Process.getChromeVersion');
|
|
1600
|
-
};
|
|
1601
|
-
const getV8Version = async () => {
|
|
1602
|
-
return invoke$1('Process.getV8Version');
|
|
1603
|
-
};
|
|
1604
|
-
const getFileHandles = async fileIds => {
|
|
1605
|
-
const files = await invoke$1('FileSystemHandle.getFileHandles', fileIds);
|
|
1606
|
-
return files;
|
|
1607
|
-
};
|
|
1608
|
-
const setWorkspacePath = async path => {
|
|
1609
|
-
await invoke$1('Workspace.setPath', path);
|
|
1610
|
-
};
|
|
1611
|
-
const registerWebViewInterceptor = async (id, port) => {
|
|
1612
|
-
await invokeAndTransfer('WebView.registerInterceptor', id, port);
|
|
1613
|
-
};
|
|
1614
|
-
const unregisterWebViewInterceptor = async id => {
|
|
1615
|
-
await invoke$1('WebView.unregisterInterceptor', id);
|
|
1616
|
-
};
|
|
1617
|
-
const sendMessagePortToEditorWorker = async (port, rpcId) => {
|
|
1618
|
-
const command = 'HandleMessagePort.handleMessagePort';
|
|
1619
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToEditorWorker', port, command, rpcId);
|
|
1620
|
-
};
|
|
1621
|
-
const sendMessagePortToSettingsWorker = async (port, rpcId) => {
|
|
1622
|
-
const command = 'HandleMessagePort.handleMessagePort';
|
|
1623
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSettingsWorker', port, command, rpcId);
|
|
1624
|
-
};
|
|
1625
|
-
const sendMessagePortToClipBoardWorker = async (port, rpcId) => {
|
|
1626
|
-
const command = 'ClipBoard.handleMessagePort';
|
|
1627
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToClipBoardWorker', port, command, rpcId);
|
|
1628
|
-
};
|
|
1629
|
-
const sendMessagePortToOpenerWorker = async (port, rpcId) => {
|
|
1630
|
-
const command = 'HandleMessagePort.handleMessagePort';
|
|
1631
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToOpenerWorker', port, command, rpcId);
|
|
1632
|
-
};
|
|
1633
|
-
const sendMessagePortToChatMathWorker = async (port, rpcId) => {
|
|
1634
|
-
const command = 'HandleMessagePort.handleMessagePort';
|
|
1635
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToChatMathWorker', port, command, rpcId);
|
|
1636
|
-
};
|
|
1637
|
-
const sendMessagePortToChatCoordinatorWorker = async (port, rpcId) => {
|
|
1638
|
-
const command = 'HandleMessagePort.handleMessagePort';
|
|
1639
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToChatCoordinatorWorker', port, command, rpcId);
|
|
1640
|
-
};
|
|
1641
|
-
const sendMessagePortToChatMessageParsingWorker = async (port, rpcId) => {
|
|
1642
|
-
const command = 'HandleMessagePort.handleMessagePort';
|
|
1643
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToChatMessageParsingWorker', port, command, rpcId);
|
|
1644
|
-
};
|
|
1645
|
-
const sendMessagePortToMainAreaWorker = async (port, rpcId) => {
|
|
1646
|
-
const command = 'HandleMessagePort.handleMessagePort';
|
|
1647
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToMainAreaWorker', port, command, rpcId);
|
|
1648
|
-
};
|
|
1649
|
-
const sendMessagePortToTerminalProcess = async (port, rpcId) => {
|
|
1650
|
-
const command = 'HandleMessagePortForTerminalProcess.handleMessagePortForTerminalProcess';
|
|
1651
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToTerminalProcess', port, command, rpcId);
|
|
1652
|
-
};
|
|
1653
|
-
const sendMessagePortToTextSearchWorker = async (port, rpcId) => {
|
|
1654
|
-
const command = 'HandleMessagePort.handleMessagePort';
|
|
1655
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToTextSearchWorker', port, command, rpcId);
|
|
1656
|
-
};
|
|
1657
|
-
const sendMessagePortToAuthWorker = async (port, rpcId) => {
|
|
1658
|
-
const command = 'HandleMessagePort.handleMessagePort';
|
|
1659
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToAuthWorker', port, command, rpcId);
|
|
1660
|
-
};
|
|
1661
|
-
const sendMessagePortToAuthProcess = async (port, rpcId) => {
|
|
1662
|
-
const command = 'HandleMessagePortForAuthProcess.handleMessagePortForAuthProcess';
|
|
1663
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, command, rpcId);
|
|
1664
|
-
};
|
|
1665
1571
|
const sendMessagePortToErrorWorker$1 = async (port, rpcId) => {
|
|
1666
1572
|
const command = 'Errors.handleMessagePort';
|
|
1667
1573
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToErrorWorker', port, command, rpcId);
|
|
1668
1574
|
};
|
|
1669
|
-
const sendMessagePortToMarkdownWorker = async (port, rpcId) => {
|
|
1670
|
-
const command = 'Markdown.handleMessagePort';
|
|
1671
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToMarkdownWorker', port, command, rpcId);
|
|
1672
|
-
};
|
|
1673
|
-
const sendMessagePortToIconThemeWorker = async (port, rpcId) => {
|
|
1674
|
-
const command = 'IconTheme.handleMessagePort';
|
|
1675
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToIconThemeWorker', port, command, rpcId);
|
|
1676
|
-
};
|
|
1677
1575
|
const sendMessagePortToFileSystemWorker$1 = async (port, rpcId) => {
|
|
1678
1576
|
const command = 'FileSystem.handleMessagePort';
|
|
1679
1577
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSystemWorker', port, command, rpcId);
|
|
1680
1578
|
};
|
|
1681
|
-
const
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
const getWebViewSecret = async key => {
|
|
1685
|
-
return invoke$1('WebView.getSecret', key);
|
|
1686
|
-
};
|
|
1687
|
-
const setWebViewPort = async (uid, port, origin, portType) => {
|
|
1688
|
-
return invokeAndTransfer('WebView.setPort', uid, port, origin, portType);
|
|
1689
|
-
};
|
|
1690
|
-
const setFocus = key => {
|
|
1691
|
-
return invoke$1('Focus.setFocus', key);
|
|
1692
|
-
};
|
|
1693
|
-
const getFileIcon = async options => {
|
|
1694
|
-
return invoke$1('IconTheme.getFileIcon', options);
|
|
1695
|
-
};
|
|
1696
|
-
const getColorThemeNames = async () => {
|
|
1697
|
-
return invoke$1('ColorTheme.getColorThemeNames');
|
|
1698
|
-
};
|
|
1699
|
-
const disableExtension = async id => {
|
|
1700
|
-
return invoke$1('ExtensionManagement.disable', id);
|
|
1701
|
-
};
|
|
1702
|
-
const enableExtension = async id => {
|
|
1703
|
-
return invoke$1('ExtensionManagement.enable', id);
|
|
1704
|
-
};
|
|
1705
|
-
const disposeEditor = async uid => {
|
|
1706
|
-
return invoke$1('Viewlet.dispose', uid);
|
|
1707
|
-
};
|
|
1708
|
-
const handleDebugChange = async params => {
|
|
1709
|
-
return invoke$1('Run And Debug.handleChange', params);
|
|
1710
|
-
};
|
|
1711
|
-
const getFolderIcon = async options => {
|
|
1712
|
-
return invoke$1('IconTheme.getFolderIcon', options);
|
|
1713
|
-
};
|
|
1714
|
-
const handleWorkspaceRefresh = async () => {
|
|
1715
|
-
return invoke$1('Layout.handleWorkspaceRefresh');
|
|
1716
|
-
};
|
|
1717
|
-
const closeWidget = async widgetId => {
|
|
1718
|
-
return invoke$1('Viewlet.closeWidget', widgetId);
|
|
1719
|
-
};
|
|
1720
|
-
const createViewlet = async (viewletModuleId, editorUid, tabId, bounds, uri) => {
|
|
1721
|
-
return invoke$1('Layout.createViewlet', viewletModuleId, editorUid, tabId, bounds, uri);
|
|
1722
|
-
};
|
|
1723
|
-
const sendMessagePortToExtensionHostWorker = async (port, rpcId = 0) => {
|
|
1724
|
-
const command = 'HandleMessagePort.handleMessagePort2';
|
|
1725
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, rpcId);
|
|
1726
|
-
};
|
|
1727
|
-
const getViewletModuleId = async uri => {
|
|
1728
|
-
return invoke$1('Layout.getModuleId', uri);
|
|
1729
|
-
};
|
|
1730
|
-
const showPanel = async () => {
|
|
1731
|
-
return invoke$1('Layout.showPanel');
|
|
1732
|
-
};
|
|
1733
|
-
const showPreview = async () => {
|
|
1734
|
-
return invoke$1('Layout.showPreview');
|
|
1735
|
-
};
|
|
1736
|
-
const saveEditor = async () => {
|
|
1737
|
-
return invoke$1('Editor.save');
|
|
1738
|
-
};
|
|
1739
|
-
const sendMessagePortToFileSearchWorker2 = async (port, rpcId = 0) => {
|
|
1740
|
-
const command = 'FileSearch.handleMessagePort';
|
|
1741
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSearchWorker', port, command, rpcId);
|
|
1742
|
-
};
|
|
1743
|
-
const togglePanelView = async id => {
|
|
1744
|
-
return invoke$1('Panel.toggleView', id);
|
|
1745
|
-
};
|
|
1746
|
-
const resizeViewlet = async (uid, dimensions) => {
|
|
1747
|
-
return invoke$1('Viewlet.resize', uid, dimensions);
|
|
1748
|
-
};
|
|
1749
|
-
const sendMessagePortToFileSearchWorker = async (port, rpcId = 0) => {
|
|
1750
|
-
const command = 'QuickPick.handleMessagePort';
|
|
1751
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSearchWorker', port, command, rpcId);
|
|
1752
|
-
};
|
|
1753
|
-
const sendMessagePortToQuickPickWorker = async (port, rpcId = 0) => {
|
|
1754
|
-
const command = 'QuickPick.handleMessagePort';
|
|
1755
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToQuickPickWorker', port, command, rpcId);
|
|
1756
|
-
};
|
|
1757
|
-
const sendMessagePortToSearchProcess = async port => {
|
|
1758
|
-
await invokeAndTransfer('SendMessagePortToElectron.sendMessagePortToElectron', port, 'HandleMessagePortForSearchProcess.handleMessagePortForSearchProcess');
|
|
1759
|
-
};
|
|
1760
|
-
const sendMessagePortToChatViewModel = async port => {
|
|
1761
|
-
await invokeAndTransfer('SendMessagePortToElectron.sendMessagePortToChatViewModel', port, 'ViewModel.handleMessagePort');
|
|
1762
|
-
};
|
|
1763
|
-
const sendMessagePortToChatNetworkWorker = async port => {
|
|
1764
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToChatNetworkWorker', port, 'HandleMessagePort.handleMessagePort');
|
|
1765
|
-
};
|
|
1766
|
-
const sendMessagePortToChatToolWorker = async port => {
|
|
1767
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToChatToolWorker', port, 'HandleMessagePort.handleMessagePort');
|
|
1768
|
-
};
|
|
1769
|
-
const sendMessagePortToChatStorageWorker = async (port, rpcId) => {
|
|
1770
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToChatStorageWorker', port, 'HandleMessagePort.handleMessagePort', rpcId);
|
|
1771
|
-
};
|
|
1772
|
-
const sendMessagePortToChatDebugViewWorker = async port => {
|
|
1773
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToChatDebugViewWorker', port, 'HandleMessagePort.handleMessagePort');
|
|
1774
|
-
};
|
|
1775
|
-
const confirm = async (message, options) => {
|
|
1776
|
-
const result = await invoke$1('ConfirmPrompt.prompt', message, options);
|
|
1777
|
-
return result;
|
|
1778
|
-
};
|
|
1779
|
-
const getRecentlyOpened = async () => {
|
|
1780
|
-
return invoke$1(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
|
|
1781
|
-
};
|
|
1782
|
-
const getKeyBindings$1 = async () => {
|
|
1783
|
-
return invoke$1('KeyBindingsInitial.getKeyBindings');
|
|
1784
|
-
};
|
|
1785
|
-
const writeClipBoardText = async text => {
|
|
1786
|
-
await invoke$1('ClipBoard.writeText', /* text */text);
|
|
1787
|
-
};
|
|
1788
|
-
const writeFile = async (uri, text) => {
|
|
1789
|
-
await invoke$1('FileSystem.writeFile', uri, text);
|
|
1790
|
-
};
|
|
1791
|
-
const handleUriChange = async (uri, newUri) => {
|
|
1792
|
-
await invoke$1('Main.handleUriChange', uri, newUri);
|
|
1793
|
-
};
|
|
1794
|
-
const readClipBoardText = async () => {
|
|
1795
|
-
return invoke$1('ClipBoard.readText');
|
|
1796
|
-
};
|
|
1797
|
-
const writeClipBoardImage = async blob => {
|
|
1798
|
-
await invoke$1('ClipBoard.writeImage', /* text */blob);
|
|
1799
|
-
};
|
|
1800
|
-
const searchFileMemory = async uri => {
|
|
1801
|
-
return invoke$1('ExtensionHost.searchFileWithMemory', uri);
|
|
1802
|
-
};
|
|
1803
|
-
const searchFileFetch = async uri => {
|
|
1804
|
-
return invoke$1('ExtensionHost.searchFileWithFetch', uri);
|
|
1805
|
-
};
|
|
1806
|
-
const showMessageBox = async options => {
|
|
1807
|
-
return invoke$1('ElectronDialog.showMessageBox', options);
|
|
1808
|
-
};
|
|
1809
|
-
const handleDebugResumed = async params => {
|
|
1810
|
-
await invoke$1('Run And Debug.handleResumed', params);
|
|
1811
|
-
};
|
|
1812
|
-
const openWidget = async name => {
|
|
1813
|
-
await invoke$1('Viewlet.openWidget', name);
|
|
1814
|
-
};
|
|
1815
|
-
const getIcons = async requests => {
|
|
1816
|
-
const icons = await invoke$1('IconTheme.getIcons', requests);
|
|
1817
|
-
return icons;
|
|
1818
|
-
};
|
|
1819
|
-
const activateByEvent = (event, assetDir, platform) => {
|
|
1820
|
-
return invoke$1('ExtensionHostManagement.activateByEvent', event, assetDir, platform);
|
|
1821
|
-
};
|
|
1822
|
-
const setAdditionalFocus = focusKey => {
|
|
1823
|
-
return invoke$1('Focus.setAdditionalFocus', focusKey);
|
|
1824
|
-
};
|
|
1825
|
-
const getActiveEditorId = () => {
|
|
1826
|
-
return invoke$1('GetActiveEditor.getActiveEditorId');
|
|
1827
|
-
};
|
|
1828
|
-
const getWorkspacePath = () => {
|
|
1829
|
-
return invoke$1('Workspace.getPath');
|
|
1830
|
-
};
|
|
1831
|
-
const sendMessagePortToRendererProcess = async port => {
|
|
1832
|
-
const command = 'HandleMessagePort.handleMessagePort';
|
|
1833
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToRendererProcess', port, command, DebugWorker);
|
|
1834
|
-
};
|
|
1835
|
-
const sendMessagePortToTextMeasurementWorker = async port => {
|
|
1836
|
-
const command = 'TextMeasurement.handleMessagePort';
|
|
1837
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToTextMeasurementWorker', port, command, 0);
|
|
1838
|
-
};
|
|
1839
|
-
const sendMessagePortToSourceControlWorker = async port => {
|
|
1840
|
-
const command = 'SourceControl.handleMessagePort';
|
|
1841
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSourceControlWorker', port, command, 0);
|
|
1842
|
-
};
|
|
1843
|
-
const sendMessagePortToSharedProcess = async port => {
|
|
1844
|
-
const command = 'HandleElectronMessagePort.handleElectronMessagePort';
|
|
1845
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, command, 0);
|
|
1846
|
-
};
|
|
1847
|
-
const sendMessagePortToFileSystemProcess = async (port, rpcId) => {
|
|
1848
|
-
const command = 'HandleMessagePortForFileSystemProcess.handleMessagePortForFileSystemProcess';
|
|
1849
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, command, rpcId);
|
|
1850
|
-
};
|
|
1851
|
-
const sendMessagePortToIframeWorker = async (port, rpcId) => {
|
|
1852
|
-
const command = 'Iframes.handleMessagePort';
|
|
1853
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToIframeWorker', port, command, rpcId);
|
|
1854
|
-
};
|
|
1855
|
-
const sendMessagePortToExtensionManagementWorker = async (port, rpcId) => {
|
|
1856
|
-
const command = 'Extensions.handleMessagePort';
|
|
1857
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionManagementWorker', port, command, rpcId);
|
|
1858
|
-
};
|
|
1859
|
-
const getPreference = async key => {
|
|
1860
|
-
return await invoke$1('Preferences.get', key);
|
|
1861
|
-
};
|
|
1862
|
-
const getAllExtensions = async () => {
|
|
1863
|
-
return invoke$1('ExtensionManagement.getAllExtensions');
|
|
1864
|
-
};
|
|
1865
|
-
const rerenderEditor = async key => {
|
|
1866
|
-
return invoke$1('Editor.rerender', key);
|
|
1867
|
-
};
|
|
1868
|
-
const handleDebugPaused = async params => {
|
|
1869
|
-
await invoke$1('Run And Debug.handlePaused', params);
|
|
1870
|
-
};
|
|
1871
|
-
const openUri = async (uri, focus, options) => {
|
|
1872
|
-
await invoke$1('Main.openUri', uri, focus, options);
|
|
1873
|
-
};
|
|
1874
|
-
const sendMessagePortToSyntaxHighlightingWorker = async port => {
|
|
1875
|
-
await invokeAndTransfer('SendMessagePortToSyntaxHighlightingWorker.sendMessagePortToSyntaxHighlightingWorker', port, 'HandleMessagePort.handleMessagePort2');
|
|
1876
|
-
};
|
|
1877
|
-
const sendMessagePortToBlobWorker = async (port, rpcId = 0) => {
|
|
1878
|
-
const command = 'Blob.handleMessagePort';
|
|
1879
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToBlobWorker', port, command, rpcId);
|
|
1880
|
-
};
|
|
1881
|
-
const sendMessagePortToDiffWorker = async (port, rpcId = 0) => {
|
|
1882
|
-
const command = 'Diff.handleMessagePort';
|
|
1883
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToDiffWorker', port, command, rpcId);
|
|
1884
|
-
};
|
|
1885
|
-
const handleDebugScriptParsed = async script => {
|
|
1886
|
-
await invoke$1('Run And Debug.handleScriptParsed', script);
|
|
1887
|
-
};
|
|
1888
|
-
const getWindowId = async () => {
|
|
1889
|
-
return invoke$1('GetWindowId.getWindowId');
|
|
1890
|
-
};
|
|
1891
|
-
const getBlob = async uri => {
|
|
1892
|
-
return invoke$1('FileSystem.getBlob', uri);
|
|
1893
|
-
};
|
|
1894
|
-
const getExtensionCommands = async () => {
|
|
1895
|
-
return invoke$1('ExtensionHost.getCommands');
|
|
1896
|
-
};
|
|
1897
|
-
const showErrorDialog = async errorInfo => {
|
|
1898
|
-
await invoke$1('ErrorHandling.showErrorDialog', errorInfo);
|
|
1899
|
-
};
|
|
1900
|
-
const getFolderSize = async uri => {
|
|
1901
|
-
return await invoke$1('FileSystem.getFolderSize', uri);
|
|
1902
|
-
};
|
|
1903
|
-
const getExtension = async id => {
|
|
1904
|
-
return invoke$1('ExtensionManagement.getExtension', id);
|
|
1905
|
-
};
|
|
1906
|
-
const getMarkdownDom = async html => {
|
|
1907
|
-
return invoke$1('Markdown.getVirtualDom', html);
|
|
1908
|
-
};
|
|
1909
|
-
const renderMarkdown = async (markdown, options) => {
|
|
1910
|
-
return invoke$1('Markdown.renderMarkdown', markdown, options);
|
|
1911
|
-
};
|
|
1912
|
-
const openNativeFolder = async uri => {
|
|
1913
|
-
await invoke$1('OpenNativeFolder.openNativeFolder', uri);
|
|
1914
|
-
};
|
|
1915
|
-
const uninstallExtension = async id => {
|
|
1916
|
-
return invoke$1('ExtensionManagement.uninstall', id);
|
|
1917
|
-
};
|
|
1918
|
-
const installExtension = async id => {
|
|
1919
|
-
return invoke$1('ExtensionManagement.install', id);
|
|
1920
|
-
};
|
|
1921
|
-
const minimizeWindow = async () => {
|
|
1922
|
-
return invoke$1('ElectronWindow.minimize');
|
|
1923
|
-
};
|
|
1924
|
-
const unmaximizeWindow = async () => {
|
|
1925
|
-
return invoke$1('ElectronWindow.unmaximize');
|
|
1926
|
-
};
|
|
1927
|
-
const maximizeWindow = async () => {
|
|
1928
|
-
return invoke$1('ElectronWindow.maximize');
|
|
1929
|
-
};
|
|
1930
|
-
const showSideBar = async (id, focus) => {
|
|
1931
|
-
return invoke$1('SideBar.show', id, focus);
|
|
1932
|
-
};
|
|
1933
|
-
const closeWindow = async () => {
|
|
1934
|
-
return invoke$1('ElectronWindow.close');
|
|
1935
|
-
};
|
|
1936
|
-
const openExtensionSearch = async () => {
|
|
1937
|
-
return invoke$1('SideBar.openViewlet', 'Extensions');
|
|
1938
|
-
};
|
|
1939
|
-
const setExtensionsSearchValue = async searchValue => {
|
|
1940
|
-
return invoke$1('Extensions.handleInput', searchValue, Script);
|
|
1941
|
-
};
|
|
1942
|
-
const openExternal = async uri => {
|
|
1943
|
-
await invoke$1('Open.openExternal', uri);
|
|
1944
|
-
};
|
|
1945
|
-
const openUrl = async uri => {
|
|
1946
|
-
await invoke$1('Open.openUrl', uri);
|
|
1947
|
-
};
|
|
1948
|
-
const getAllPreferences = async () => {
|
|
1949
|
-
return invoke$1('Preferences.getAll');
|
|
1950
|
-
};
|
|
1951
|
-
const showSaveFilePicker = async () => {
|
|
1952
|
-
return invoke$1('FilePicker.showSaveFilePicker');
|
|
1953
|
-
};
|
|
1954
|
-
const getLogsDir = async () => {
|
|
1955
|
-
return invoke$1('PlatformPaths.getLogsDir');
|
|
1956
|
-
};
|
|
1957
|
-
const measureTextBlockHeight = async (actualInput, fontFamily, fontSize, lineHeightPx, width) => {
|
|
1958
|
-
return invoke$1(`MeasureTextHeight.measureTextBlockHeight`, actualInput, fontFamily, fontSize, lineHeightPx, width);
|
|
1959
|
-
};
|
|
1960
|
-
const refreshOutput = async () => {
|
|
1961
|
-
await invoke$1('Output.refresh');
|
|
1962
|
-
};
|
|
1963
|
-
const send = async (port, sourceId = 0) => {
|
|
1964
|
-
await sendMessagePortToOpenerWorker(port, sourceId);
|
|
1965
|
-
};
|
|
1966
|
-
const initializeOpenerWorker = async () => {
|
|
1967
|
-
const rpc = await create$5({
|
|
1968
|
-
commandMap: {},
|
|
1969
|
-
send
|
|
1970
|
-
});
|
|
1971
|
-
set$4(rpc);
|
|
1972
|
-
};
|
|
1973
|
-
const send2 = async port => {
|
|
1974
|
-
await sendMessagePortToEditorWorker(port, TestWorker);
|
|
1975
|
-
};
|
|
1976
|
-
const initializeEditorWorker = async () => {
|
|
1977
|
-
const rpc = await create$5({
|
|
1978
|
-
commandMap: {},
|
|
1979
|
-
send: send2
|
|
1980
|
-
});
|
|
1981
|
-
set$7(rpc);
|
|
1982
|
-
};
|
|
1983
|
-
const send3 = port => {
|
|
1984
|
-
return sendMessagePortToTextMeasurementWorker(port);
|
|
1985
|
-
};
|
|
1986
|
-
const initializeTextMeasurementWorker = async () => {
|
|
1987
|
-
const rpc = await create$5({
|
|
1988
|
-
commandMap: {},
|
|
1989
|
-
send: send3
|
|
1990
|
-
});
|
|
1991
|
-
set$3(rpc);
|
|
1992
|
-
};
|
|
1993
|
-
|
|
1994
|
-
const RendererWorker = {
|
|
1995
|
-
__proto__: null,
|
|
1996
|
-
activateByEvent,
|
|
1997
|
-
applyBulkReplacement,
|
|
1998
|
-
closeWidget,
|
|
1999
|
-
closeWindow,
|
|
2000
|
-
confirm,
|
|
2001
|
-
createViewlet,
|
|
2002
|
-
disableExtension,
|
|
2003
|
-
dispose: dispose$2,
|
|
2004
|
-
disposeEditor,
|
|
2005
|
-
enableExtension,
|
|
2006
|
-
getActiveEditorId,
|
|
2007
|
-
getAllExtensions,
|
|
2008
|
-
getAllPreferences,
|
|
2009
|
-
getBadgeCounts,
|
|
2010
|
-
getBlob,
|
|
2011
|
-
getChromeVersion,
|
|
2012
|
-
getColorThemeNames,
|
|
2013
|
-
getElectronVersion,
|
|
2014
|
-
getExtension,
|
|
2015
|
-
getExtensionCommands,
|
|
2016
|
-
getFileHandles,
|
|
2017
|
-
getFileIcon,
|
|
2018
|
-
getFilePathElectron,
|
|
2019
|
-
getFolderIcon,
|
|
2020
|
-
getFolderSize,
|
|
2021
|
-
getIcons,
|
|
2022
|
-
getKeyBindings: getKeyBindings$1,
|
|
2023
|
-
getLogsDir,
|
|
2024
|
-
getMarkdownDom,
|
|
2025
|
-
getNodeVersion,
|
|
2026
|
-
getPreference,
|
|
2027
|
-
getRecentlyOpened,
|
|
2028
|
-
getV8Version,
|
|
2029
|
-
getViewletModuleId,
|
|
2030
|
-
getWebViewSecret,
|
|
2031
|
-
getWindowId,
|
|
2032
|
-
getWorkspacePath,
|
|
2033
|
-
handleDebugChange,
|
|
2034
|
-
handleDebugPaused,
|
|
2035
|
-
handleDebugResumed,
|
|
2036
|
-
handleDebugScriptParsed,
|
|
2037
|
-
handleModifiedStatusChange,
|
|
2038
|
-
handleUriChange,
|
|
2039
|
-
handleWorkspaceRefresh,
|
|
2040
|
-
initializeEditorWorker,
|
|
2041
|
-
initializeOpenerWorker,
|
|
2042
|
-
initializeTextMeasurementWorker,
|
|
2043
|
-
installExtension,
|
|
2044
|
-
invoke: invoke$1,
|
|
2045
|
-
invokeAndTransfer,
|
|
2046
|
-
maximizeWindow,
|
|
2047
|
-
measureTextBlockHeight,
|
|
2048
|
-
minimizeWindow,
|
|
2049
|
-
openExtensionSearch,
|
|
2050
|
-
openExternal,
|
|
2051
|
-
openNativeFolder,
|
|
2052
|
-
openUri,
|
|
2053
|
-
openUrl,
|
|
2054
|
-
openWidget,
|
|
2055
|
-
readClipBoardText,
|
|
2056
|
-
readFile,
|
|
2057
|
-
refreshOutput,
|
|
2058
|
-
registerMockRpc,
|
|
2059
|
-
registerWebViewInterceptor,
|
|
2060
|
-
renderMarkdown,
|
|
2061
|
-
rerenderEditor,
|
|
2062
|
-
resizeViewlet,
|
|
2063
|
-
saveEditor,
|
|
2064
|
-
searchFileFetch,
|
|
2065
|
-
searchFileHtml,
|
|
2066
|
-
searchFileMemory,
|
|
2067
|
-
sendMessagePortToAuthProcess,
|
|
2068
|
-
sendMessagePortToAuthWorker,
|
|
2069
|
-
sendMessagePortToBlobWorker,
|
|
2070
|
-
sendMessagePortToChatCoordinatorWorker,
|
|
2071
|
-
sendMessagePortToChatDebugViewWorker,
|
|
2072
|
-
sendMessagePortToChatMathWorker,
|
|
2073
|
-
sendMessagePortToChatMessageParsingWorker,
|
|
2074
|
-
sendMessagePortToChatNetworkWorker,
|
|
2075
|
-
sendMessagePortToChatStorageWorker,
|
|
2076
|
-
sendMessagePortToChatToolWorker,
|
|
2077
|
-
sendMessagePortToChatViewModel,
|
|
2078
|
-
sendMessagePortToClipBoardWorker,
|
|
2079
|
-
sendMessagePortToDiffWorker,
|
|
2080
|
-
sendMessagePortToEditorWorker,
|
|
2081
|
-
sendMessagePortToErrorWorker: sendMessagePortToErrorWorker$1,
|
|
2082
|
-
sendMessagePortToExtensionHostWorker,
|
|
2083
|
-
sendMessagePortToExtensionManagementWorker,
|
|
2084
|
-
sendMessagePortToFileSearchWorker,
|
|
2085
|
-
sendMessagePortToFileSearchWorker2,
|
|
2086
|
-
sendMessagePortToFileSystemProcess,
|
|
2087
|
-
sendMessagePortToFileSystemWorker: sendMessagePortToFileSystemWorker$1,
|
|
2088
|
-
sendMessagePortToIconThemeWorker,
|
|
2089
|
-
sendMessagePortToIframeWorker,
|
|
2090
|
-
sendMessagePortToMainAreaWorker,
|
|
2091
|
-
sendMessagePortToMarkdownWorker,
|
|
2092
|
-
sendMessagePortToOpenerWorker,
|
|
2093
|
-
sendMessagePortToQuickPickWorker,
|
|
2094
|
-
sendMessagePortToRendererProcess,
|
|
2095
|
-
sendMessagePortToSearchProcess,
|
|
2096
|
-
sendMessagePortToSettingsWorker,
|
|
2097
|
-
sendMessagePortToSharedProcess,
|
|
2098
|
-
sendMessagePortToSourceControlWorker,
|
|
2099
|
-
sendMessagePortToSyntaxHighlightingWorker,
|
|
2100
|
-
sendMessagePortToTerminalProcess,
|
|
2101
|
-
sendMessagePortToTextMeasurementWorker,
|
|
2102
|
-
sendMessagePortToTextSearchWorker,
|
|
2103
|
-
set: set$2,
|
|
2104
|
-
setAdditionalFocus,
|
|
2105
|
-
setColorTheme,
|
|
2106
|
-
setExtensionsSearchValue,
|
|
2107
|
-
setFocus,
|
|
2108
|
-
setWebViewPort,
|
|
2109
|
-
setWorkspacePath,
|
|
2110
|
-
showContextMenu,
|
|
2111
|
-
showContextMenu2,
|
|
2112
|
-
showErrorDialog,
|
|
2113
|
-
showMessageBox,
|
|
2114
|
-
showPanel,
|
|
2115
|
-
showPreview,
|
|
2116
|
-
showSaveFilePicker,
|
|
2117
|
-
showSideBar,
|
|
2118
|
-
togglePanelView,
|
|
2119
|
-
uninstallExtension,
|
|
2120
|
-
unmaximizeWindow,
|
|
2121
|
-
unregisterWebViewInterceptor,
|
|
2122
|
-
writeClipBoardImage,
|
|
2123
|
-
writeClipBoardText,
|
|
2124
|
-
writeFile
|
|
1579
|
+
const sendMessagePortToProcessExplorer$1 = async port => {
|
|
1580
|
+
const command = 'ProcessExplorer.handleMessagePort';
|
|
1581
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToProcessExplorer', port, command, 0);
|
|
2125
1582
|
};
|
|
2126
1583
|
|
|
2127
1584
|
const debugProcess = async (state, index = state.focusedIndex) => {
|
|
@@ -2172,7 +1629,7 @@ const processExplorerUpdateInterval = 1000;
|
|
|
2172
1629
|
|
|
2173
1630
|
const intervals = new Map();
|
|
2174
1631
|
const pending = new Set();
|
|
2175
|
-
const dispose$
|
|
1632
|
+
const dispose$3 = uid => {
|
|
2176
1633
|
const interval = intervals.get(uid);
|
|
2177
1634
|
if (interval) {
|
|
2178
1635
|
clearInterval(interval);
|
|
@@ -2182,7 +1639,7 @@ const dispose$1 = uid => {
|
|
|
2182
1639
|
};
|
|
2183
1640
|
const update = async uid => {
|
|
2184
1641
|
if (!getKeys$1().includes(uid)) {
|
|
2185
|
-
dispose$
|
|
1642
|
+
dispose$3(uid);
|
|
2186
1643
|
return;
|
|
2187
1644
|
}
|
|
2188
1645
|
if (pending.has(uid)) {
|
|
@@ -2207,9 +1664,95 @@ const start = (uid, interval = processExplorerUpdateInterval) => {
|
|
|
2207
1664
|
intervals.set(uid, intervalId);
|
|
2208
1665
|
};
|
|
2209
1666
|
|
|
2210
|
-
const
|
|
2211
|
-
|
|
1667
|
+
const sendMessagePortToProcessExplorer = async port => {
|
|
1668
|
+
await sendMessagePortToProcessExplorer$1(port);
|
|
1669
|
+
};
|
|
1670
|
+
|
|
1671
|
+
const launchProcessExplorerElectron = async () => {
|
|
1672
|
+
try {
|
|
1673
|
+
const rpc = await create$5({
|
|
1674
|
+
commandMap: {},
|
|
1675
|
+
send: sendMessagePortToProcessExplorer
|
|
1676
|
+
});
|
|
1677
|
+
return rpc;
|
|
1678
|
+
} catch (error) {
|
|
1679
|
+
throw new VError(error, 'Failed to create process explorer electron rpc');
|
|
1680
|
+
}
|
|
1681
|
+
};
|
|
1682
|
+
|
|
1683
|
+
const launchProcessExplorerNode = async () => {
|
|
1684
|
+
try {
|
|
1685
|
+
const rpc = await create$2({
|
|
1686
|
+
commandMap: {},
|
|
1687
|
+
type: 'process-explorer'
|
|
1688
|
+
});
|
|
1689
|
+
return rpc;
|
|
1690
|
+
} catch (error) {
|
|
1691
|
+
throw new VError(error, 'Failed to create process explorer websocket rpc');
|
|
1692
|
+
}
|
|
1693
|
+
};
|
|
1694
|
+
|
|
1695
|
+
const state$1 = {
|
|
1696
|
+
rpc: undefined
|
|
1697
|
+
};
|
|
1698
|
+
const invoke = async (method, ...params) => {
|
|
1699
|
+
if (!state$1.rpc) {
|
|
1700
|
+
throw new Error('ProcessExplorerModule is not initialized');
|
|
1701
|
+
}
|
|
1702
|
+
return state$1.rpc.invoke(method, ...params);
|
|
1703
|
+
};
|
|
1704
|
+
const set$1 = newRpc => {
|
|
1705
|
+
state$1.rpc = newRpc;
|
|
1706
|
+
};
|
|
1707
|
+
const dispose$2 = async () => {
|
|
1708
|
+
const {
|
|
1709
|
+
rpc
|
|
1710
|
+
} = state$1;
|
|
1711
|
+
state$1.rpc = undefined;
|
|
1712
|
+
await rpc?.dispose();
|
|
1713
|
+
};
|
|
1714
|
+
|
|
1715
|
+
const state = {
|
|
1716
|
+
initializedPlatform: 0
|
|
1717
|
+
};
|
|
1718
|
+
const initializeProcessExplorer = async platform => {
|
|
1719
|
+
if (state.initializedPlatform === platform) {
|
|
1720
|
+
return;
|
|
1721
|
+
}
|
|
1722
|
+
if (platform === Electron) {
|
|
1723
|
+
const rpc = await launchProcessExplorerElectron();
|
|
1724
|
+
set$1(rpc);
|
|
1725
|
+
state.initializedPlatform = platform;
|
|
1726
|
+
return;
|
|
1727
|
+
}
|
|
1728
|
+
if (platform === Remote) {
|
|
1729
|
+
const rpc = await launchProcessExplorerNode();
|
|
1730
|
+
set$1(rpc);
|
|
1731
|
+
state.initializedPlatform = platform;
|
|
1732
|
+
}
|
|
1733
|
+
};
|
|
1734
|
+
const dispose$1 = async () => {
|
|
1735
|
+
state.initializedPlatform = 0;
|
|
1736
|
+
await dispose$2();
|
|
1737
|
+
};
|
|
1738
|
+
|
|
1739
|
+
const dispose = async uid => {
|
|
2212
1740
|
dispose$3(uid);
|
|
1741
|
+
dispose$4(uid);
|
|
1742
|
+
if (getKeys$1().length === 0) {
|
|
1743
|
+
await dispose$1();
|
|
1744
|
+
}
|
|
1745
|
+
};
|
|
1746
|
+
|
|
1747
|
+
const createE2eFixtureProcess = async (state, marker) => {
|
|
1748
|
+
const pid = await invoke('Process.createE2eFixtureProcess', marker);
|
|
1749
|
+
return {
|
|
1750
|
+
...state,
|
|
1751
|
+
rootPid: pid
|
|
1752
|
+
};
|
|
1753
|
+
};
|
|
1754
|
+
const disposeE2eFixtureProcess = async (_uid, pidOrMarker) => {
|
|
1755
|
+
await invoke('Process.disposeE2eFixtureProcess', pidOrMarker);
|
|
2213
1756
|
};
|
|
2214
1757
|
|
|
2215
1758
|
const expandAll = state => {
|
|
@@ -2439,7 +1982,7 @@ const handleContextMenu = async (state, index = state.focusedIndex, x = 0, y = 0
|
|
|
2439
1982
|
focused: false,
|
|
2440
1983
|
focusedIndex: index
|
|
2441
1984
|
};
|
|
2442
|
-
set$
|
|
1985
|
+
set$6(state.uid, state, newState);
|
|
2443
1986
|
await show2(state.uid, ProcessExplorer$1, x, y, {
|
|
2444
1987
|
index,
|
|
2445
1988
|
menuId: ProcessExplorer$1
|
|
@@ -2458,21 +2001,15 @@ const handleFocus = state => {
|
|
|
2458
2001
|
};
|
|
2459
2002
|
};
|
|
2460
2003
|
|
|
2461
|
-
const SigTerm = 'SIGTERM';
|
|
2462
|
-
|
|
2463
2004
|
const killProcess = async (state, index = state.focusedIndex) => {
|
|
2464
2005
|
const process = state.visibleProcesses[index];
|
|
2465
2006
|
if (!process) {
|
|
2466
2007
|
return state;
|
|
2467
2008
|
}
|
|
2468
|
-
await invoke
|
|
2009
|
+
await invoke('Process.kill', process.pid);
|
|
2469
2010
|
return state;
|
|
2470
2011
|
};
|
|
2471
2012
|
|
|
2472
|
-
const WindowPid = -1;
|
|
2473
|
-
const isValidMemoryValue = value => {
|
|
2474
|
-
return typeof value === 'number' && Number.isFinite(value) && value >= 0;
|
|
2475
|
-
};
|
|
2476
2013
|
const getMeasureMemory = () => {
|
|
2477
2014
|
const {
|
|
2478
2015
|
measureUserAgentSpecificMemory
|
|
@@ -2482,6 +2019,12 @@ const getMeasureMemory = () => {
|
|
|
2482
2019
|
}
|
|
2483
2020
|
return measureUserAgentSpecificMemory.bind(performance);
|
|
2484
2021
|
};
|
|
2022
|
+
|
|
2023
|
+
const isValidMemoryValue = value => {
|
|
2024
|
+
return typeof value === 'number' && Number.isFinite(value) && value >= 0;
|
|
2025
|
+
};
|
|
2026
|
+
|
|
2027
|
+
const QueryOrHashRegex = /[?#]/;
|
|
2485
2028
|
const getUrlName = url => {
|
|
2486
2029
|
if (!url || url === 'cross-origin-url') {
|
|
2487
2030
|
return url;
|
|
@@ -2491,11 +2034,12 @@ const getUrlName = url => {
|
|
|
2491
2034
|
const parts = parsed.pathname.split('/').filter(Boolean);
|
|
2492
2035
|
return parts.at(-1) || parsed.hostname || url;
|
|
2493
2036
|
} catch {
|
|
2494
|
-
const withoutQuery = url.split(
|
|
2037
|
+
const withoutQuery = url.split(QueryOrHashRegex, 1)[0];
|
|
2495
2038
|
const parts = withoutQuery.split('/').filter(Boolean);
|
|
2496
2039
|
return parts.at(-1) || url;
|
|
2497
2040
|
}
|
|
2498
2041
|
};
|
|
2042
|
+
|
|
2499
2043
|
const getAttributionName = attribution => {
|
|
2500
2044
|
const scope = attribution.scope || 'memory';
|
|
2501
2045
|
const url = attribution.url ? getUrlName(attribution.url) : '';
|
|
@@ -2504,6 +2048,7 @@ const getAttributionName = attribution => {
|
|
|
2504
2048
|
}
|
|
2505
2049
|
return scope;
|
|
2506
2050
|
};
|
|
2051
|
+
|
|
2507
2052
|
const getBreakdownName = (entry, index) => {
|
|
2508
2053
|
if (entry.attribution && entry.attribution.length > 0) {
|
|
2509
2054
|
return entry.attribution.map(getAttributionName).join(', ');
|
|
@@ -2513,6 +2058,9 @@ const getBreakdownName = (entry, index) => {
|
|
|
2513
2058
|
}
|
|
2514
2059
|
return `breakdown ${index + 1}`;
|
|
2515
2060
|
};
|
|
2061
|
+
|
|
2062
|
+
const WindowPid = -1;
|
|
2063
|
+
|
|
2516
2064
|
const toBreakdownProcess = (entry, index) => {
|
|
2517
2065
|
const name = getBreakdownName(entry, index);
|
|
2518
2066
|
return {
|
|
@@ -2524,6 +2072,7 @@ const toBreakdownProcess = (entry, index) => {
|
|
|
2524
2072
|
synthetic: true
|
|
2525
2073
|
};
|
|
2526
2074
|
};
|
|
2075
|
+
|
|
2527
2076
|
const getFrontendMemoryUsage = async rootPid => {
|
|
2528
2077
|
const measureMemory = getMeasureMemory();
|
|
2529
2078
|
if (!measureMemory) {
|
|
@@ -2549,68 +2098,6 @@ const getFrontendMemoryUsage = async rootPid => {
|
|
|
2549
2098
|
}
|
|
2550
2099
|
};
|
|
2551
2100
|
|
|
2552
|
-
const sendMessagePortToProcessExplorer = async port => {
|
|
2553
|
-
const rendererWorker = RendererWorker;
|
|
2554
|
-
await rendererWorker.sendMessagePortToProcessExplorer(port);
|
|
2555
|
-
};
|
|
2556
|
-
|
|
2557
|
-
const launchProcessExplorerElectron = async () => {
|
|
2558
|
-
try {
|
|
2559
|
-
const rpc = await create$5({
|
|
2560
|
-
commandMap: {},
|
|
2561
|
-
send: sendMessagePortToProcessExplorer
|
|
2562
|
-
});
|
|
2563
|
-
return rpc;
|
|
2564
|
-
} catch (error) {
|
|
2565
|
-
throw new VError(error, 'Failed to create process explorer electron rpc');
|
|
2566
|
-
}
|
|
2567
|
-
};
|
|
2568
|
-
|
|
2569
|
-
const launchProcessExplorerNode = async () => {
|
|
2570
|
-
try {
|
|
2571
|
-
const rpc = await create$2({
|
|
2572
|
-
commandMap: {},
|
|
2573
|
-
type: 'process-explorer'
|
|
2574
|
-
});
|
|
2575
|
-
return rpc;
|
|
2576
|
-
} catch (error) {
|
|
2577
|
-
throw new VError(error, 'Failed to create process explorer websocket rpc');
|
|
2578
|
-
}
|
|
2579
|
-
};
|
|
2580
|
-
|
|
2581
|
-
const state$1 = {
|
|
2582
|
-
rpc: undefined
|
|
2583
|
-
};
|
|
2584
|
-
const invoke = async (method, ...params) => {
|
|
2585
|
-
if (!state$1.rpc) {
|
|
2586
|
-
throw new Error('ProcessExplorerModule is not initialized');
|
|
2587
|
-
}
|
|
2588
|
-
return state$1.rpc.invoke(method, ...params);
|
|
2589
|
-
};
|
|
2590
|
-
const set$1 = newRpc => {
|
|
2591
|
-
state$1.rpc = newRpc;
|
|
2592
|
-
};
|
|
2593
|
-
|
|
2594
|
-
const state = {
|
|
2595
|
-
initializedPlatform: 0
|
|
2596
|
-
};
|
|
2597
|
-
const initializeProcessExplorer = async platform => {
|
|
2598
|
-
if (state.initializedPlatform === platform) {
|
|
2599
|
-
return;
|
|
2600
|
-
}
|
|
2601
|
-
if (platform === Electron) {
|
|
2602
|
-
const rpc = await launchProcessExplorerElectron();
|
|
2603
|
-
set$1(rpc);
|
|
2604
|
-
state.initializedPlatform = platform;
|
|
2605
|
-
return;
|
|
2606
|
-
}
|
|
2607
|
-
if (platform === Remote) {
|
|
2608
|
-
const rpc = await launchProcessExplorerNode();
|
|
2609
|
-
set$1(rpc);
|
|
2610
|
-
state.initializedPlatform = platform;
|
|
2611
|
-
}
|
|
2612
|
-
};
|
|
2613
|
-
|
|
2614
2101
|
const getErrorMessage = error => {
|
|
2615
2102
|
if (error instanceof Error) {
|
|
2616
2103
|
return error.message;
|
|
@@ -2628,6 +2115,7 @@ const prepareError = async error => {
|
|
|
2628
2115
|
};
|
|
2629
2116
|
}
|
|
2630
2117
|
};
|
|
2118
|
+
|
|
2631
2119
|
const getFocusedIndex = (oldFocusedIndex, visibleProcesses) => {
|
|
2632
2120
|
if (visibleProcesses.length === 0) {
|
|
2633
2121
|
return -1;
|
|
@@ -2641,9 +2129,9 @@ const refresh = async state => {
|
|
|
2641
2129
|
try {
|
|
2642
2130
|
await initializeProcessExplorer(state.platform);
|
|
2643
2131
|
const includeElectronData = state.platform === Electron;
|
|
2644
|
-
const rootPid = state.rootPid
|
|
2132
|
+
const rootPid = state.rootPid === -1 ? await invoke('ProcessId.getMainProcessId', {
|
|
2645
2133
|
includeElectronData
|
|
2646
|
-
})
|
|
2134
|
+
}) : state.rootPid;
|
|
2647
2135
|
const processes = await invoke('ListProcessesWithMemoryUsage.listProcessesWithMemoryUsage', rootPid, includeElectronData);
|
|
2648
2136
|
const frontendMemoryProcesses = state.includeFrontendMemoryUsage ? await getFrontendMemoryUsage(rootPid) : [];
|
|
2649
2137
|
const allProcesses = [...processes, ...frontendMemoryProcesses];
|
|
@@ -2671,9 +2159,14 @@ const refresh = async state => {
|
|
|
2671
2159
|
}
|
|
2672
2160
|
};
|
|
2673
2161
|
|
|
2162
|
+
const hasError$1 = state => {
|
|
2163
|
+
return Boolean(state.errorMessage || state.errorCodeFrame || state.errorStack);
|
|
2164
|
+
};
|
|
2674
2165
|
const loadContent = async state => {
|
|
2675
2166
|
const newState = await refresh(state);
|
|
2676
|
-
|
|
2167
|
+
if (!hasError$1(newState)) {
|
|
2168
|
+
start(newState.uid);
|
|
2169
|
+
}
|
|
2677
2170
|
return {
|
|
2678
2171
|
error: undefined,
|
|
2679
2172
|
state: newState
|
|
@@ -3190,7 +2683,7 @@ const render2 = (uid, diffResult) => {
|
|
|
3190
2683
|
oldState,
|
|
3191
2684
|
scheduledState
|
|
3192
2685
|
} = get$2(uid);
|
|
3193
|
-
set$
|
|
2686
|
+
set$6(uid, scheduledState, scheduledState);
|
|
3194
2687
|
return applyRender(oldState, scheduledState, diffResult);
|
|
3195
2688
|
};
|
|
3196
2689
|
|
|
@@ -3219,12 +2712,64 @@ const renderEventListeners = () => {
|
|
|
3219
2712
|
}];
|
|
3220
2713
|
};
|
|
3221
2714
|
|
|
2715
|
+
const isRawError = value => {
|
|
2716
|
+
return Boolean(value && typeof value === 'object');
|
|
2717
|
+
};
|
|
2718
|
+
const getRawMessage = rawError => {
|
|
2719
|
+
if (typeof rawError.message === 'string') {
|
|
2720
|
+
return rawError.message;
|
|
2721
|
+
}
|
|
2722
|
+
return String(rawError.message);
|
|
2723
|
+
};
|
|
2724
|
+
const toError = rawError => {
|
|
2725
|
+
if (rawError instanceof Error) {
|
|
2726
|
+
return rawError;
|
|
2727
|
+
}
|
|
2728
|
+
if (!isRawError(rawError)) {
|
|
2729
|
+
return new Error(String(rawError));
|
|
2730
|
+
}
|
|
2731
|
+
if (typeof rawError.stack === 'string') {
|
|
2732
|
+
return {
|
|
2733
|
+
code: rawError.code,
|
|
2734
|
+
message: getRawMessage(rawError),
|
|
2735
|
+
stack: rawError.stack
|
|
2736
|
+
};
|
|
2737
|
+
}
|
|
2738
|
+
const error = new Error(getRawMessage(rawError));
|
|
2739
|
+
if (typeof rawError.code === 'string') {
|
|
2740
|
+
Object.assign(error, {
|
|
2741
|
+
code: rawError.code
|
|
2742
|
+
});
|
|
2743
|
+
}
|
|
2744
|
+
return error;
|
|
2745
|
+
};
|
|
2746
|
+
const setError = async (state, rawError) => {
|
|
2747
|
+
const error = toError(rawError);
|
|
2748
|
+
const prettyError = await prepareError(error);
|
|
2749
|
+
return {
|
|
2750
|
+
...state,
|
|
2751
|
+
errorCodeFrame: prettyError.codeFrame || '',
|
|
2752
|
+
errorMessage: prettyError.message || getErrorMessage(error),
|
|
2753
|
+
errorStack: prettyError.stack || '',
|
|
2754
|
+
initial: false
|
|
2755
|
+
};
|
|
2756
|
+
};
|
|
2757
|
+
|
|
2758
|
+
const setRootProcessId = (state, rootPid) => {
|
|
2759
|
+
return {
|
|
2760
|
+
...state,
|
|
2761
|
+
rootPid
|
|
2762
|
+
};
|
|
2763
|
+
};
|
|
2764
|
+
|
|
3222
2765
|
const commandMap = {
|
|
3223
2766
|
'ProcessExplorer.collapseAll': wrapCommand(collapseAll),
|
|
3224
2767
|
'ProcessExplorer.create': create$d,
|
|
2768
|
+
'ProcessExplorer.createE2eFixtureProcess': wrapCommand(createE2eFixtureProcess),
|
|
3225
2769
|
'ProcessExplorer.debugProcess': wrapCommand(debugProcess),
|
|
3226
2770
|
'ProcessExplorer.diff2': diff2,
|
|
3227
2771
|
'ProcessExplorer.dispose': dispose,
|
|
2772
|
+
'ProcessExplorer.disposeE2eFixtureProcess': disposeE2eFixtureProcess,
|
|
3228
2773
|
'ProcessExplorer.expandAll': wrapCommand(expandAll),
|
|
3229
2774
|
'ProcessExplorer.focusFirst': wrapCommand(focusFirst),
|
|
3230
2775
|
'ProcessExplorer.focusLast': wrapCommand(focusLast),
|
|
@@ -3246,6 +2791,8 @@ const commandMap = {
|
|
|
3246
2791
|
'ProcessExplorer.refresh': wrapCommand(refresh),
|
|
3247
2792
|
'ProcessExplorer.render2': render2,
|
|
3248
2793
|
'ProcessExplorer.renderEventListeners': renderEventListeners,
|
|
2794
|
+
'ProcessExplorer.setError': wrapCommand(setError),
|
|
2795
|
+
'ProcessExplorer.setRootProcessId': wrapCommand(setRootProcessId),
|
|
3249
2796
|
'ProcessExplorer.terminate': terminate,
|
|
3250
2797
|
'ProcessExplorer.update': wrapCommand(refresh)
|
|
3251
2798
|
};
|
|
@@ -3268,7 +2815,7 @@ const createErrorWorkerRpc = async () => {
|
|
|
3268
2815
|
|
|
3269
2816
|
const initializeErrorWorker = async () => {
|
|
3270
2817
|
const rpc = await createErrorWorkerRpc();
|
|
3271
|
-
set$
|
|
2818
|
+
set$4(rpc);
|
|
3272
2819
|
};
|
|
3273
2820
|
|
|
3274
2821
|
const sendMessagePortToFileSystemWorker = async port => {
|