@lvce-editor/process-explorer-worker 3.1.0 → 3.2.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 +849 -39
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -2,7 +2,7 @@ const toCommandId = key => {
|
|
|
2
2
|
const dotIndex = key.indexOf('.');
|
|
3
3
|
return key.slice(dotIndex + 1);
|
|
4
4
|
};
|
|
5
|
-
const create$
|
|
5
|
+
const create$e = () => {
|
|
6
6
|
const states = Object.create(null);
|
|
7
7
|
const commandMapRef = {};
|
|
8
8
|
return {
|
|
@@ -184,12 +184,12 @@ const {
|
|
|
184
184
|
get: get$2,
|
|
185
185
|
getCommandIds,
|
|
186
186
|
registerCommands,
|
|
187
|
-
set: set$
|
|
187
|
+
set: set$9,
|
|
188
188
|
wrapCommand,
|
|
189
189
|
wrapLoadContent
|
|
190
|
-
} = create$
|
|
190
|
+
} = create$e();
|
|
191
191
|
|
|
192
|
-
const create$
|
|
192
|
+
const create$d = (id, _uri, x, y, width, height, _args, parentUid, platform = 0, assetDir = '') => {
|
|
193
193
|
const state = {
|
|
194
194
|
assetDir,
|
|
195
195
|
collapsedPids: [],
|
|
@@ -202,6 +202,7 @@ const create$9 = (id, _uri, x, y, width, height, _args, parentUid, _platform = 0
|
|
|
202
202
|
height,
|
|
203
203
|
initial: true,
|
|
204
204
|
parentUid,
|
|
205
|
+
platform,
|
|
205
206
|
processes: [],
|
|
206
207
|
rootPid: 0,
|
|
207
208
|
uid: id,
|
|
@@ -210,7 +211,7 @@ const create$9 = (id, _uri, x, y, width, height, _args, parentUid, _platform = 0
|
|
|
210
211
|
x,
|
|
211
212
|
y
|
|
212
213
|
};
|
|
213
|
-
set$
|
|
214
|
+
set$9(state.uid, state, state);
|
|
214
215
|
return state;
|
|
215
216
|
};
|
|
216
217
|
|
|
@@ -324,11 +325,21 @@ const DownArrow = 16;
|
|
|
324
325
|
const ContextMenu = 56;
|
|
325
326
|
const Star = 131;
|
|
326
327
|
|
|
328
|
+
const Script = 2;
|
|
329
|
+
|
|
327
330
|
const CtrlCmd = 1 << 11 >>> 0;
|
|
328
331
|
|
|
332
|
+
const Electron = 2;
|
|
333
|
+
const Remote = 3;
|
|
334
|
+
|
|
335
|
+
const DebugWorker = 55;
|
|
336
|
+
const EditorWorker = 99;
|
|
329
337
|
const ErrorWorker = 3308;
|
|
330
338
|
const FileSystemWorker$1 = 209;
|
|
331
|
-
const
|
|
339
|
+
const IconThemeWorker = 7009;
|
|
340
|
+
const OpenerWorker = 4561;
|
|
341
|
+
const RendererWorker$1 = 1;
|
|
342
|
+
const TestWorker = 9001;
|
|
332
343
|
|
|
333
344
|
const FocusSelector = 'Viewlet.focusSelector';
|
|
334
345
|
const SetDom2 = 'Viewlet.setDom2';
|
|
@@ -337,7 +348,7 @@ const SetFocusContext = 'Viewlet.setFocusContext';
|
|
|
337
348
|
const Empty = 0;
|
|
338
349
|
const FocusExplorer = 13;
|
|
339
350
|
|
|
340
|
-
const getKeyBindings = () => {
|
|
351
|
+
const getKeyBindings$1 = () => {
|
|
341
352
|
return [{
|
|
342
353
|
command: 'ProcessExplorer.handleArrowRight',
|
|
343
354
|
key: RightArrow,
|
|
@@ -518,6 +529,49 @@ class VError extends Error {
|
|
|
518
529
|
}
|
|
519
530
|
}
|
|
520
531
|
|
|
532
|
+
class AssertionError extends Error {
|
|
533
|
+
constructor(message) {
|
|
534
|
+
super(message);
|
|
535
|
+
this.name = 'AssertionError';
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
const Object$1 = 1;
|
|
539
|
+
const Number$1 = 2;
|
|
540
|
+
const Array$1 = 3;
|
|
541
|
+
const String$1 = 4;
|
|
542
|
+
const Boolean$1 = 5;
|
|
543
|
+
const Function = 6;
|
|
544
|
+
const Null = 7;
|
|
545
|
+
const Unknown = 8;
|
|
546
|
+
const getType = value => {
|
|
547
|
+
switch (typeof value) {
|
|
548
|
+
case 'number':
|
|
549
|
+
return Number$1;
|
|
550
|
+
case 'function':
|
|
551
|
+
return Function;
|
|
552
|
+
case 'string':
|
|
553
|
+
return String$1;
|
|
554
|
+
case 'object':
|
|
555
|
+
if (value === null) {
|
|
556
|
+
return Null;
|
|
557
|
+
}
|
|
558
|
+
if (Array.isArray(value)) {
|
|
559
|
+
return Array$1;
|
|
560
|
+
}
|
|
561
|
+
return Object$1;
|
|
562
|
+
case 'boolean':
|
|
563
|
+
return Boolean$1;
|
|
564
|
+
default:
|
|
565
|
+
return Unknown;
|
|
566
|
+
}
|
|
567
|
+
};
|
|
568
|
+
const number = value => {
|
|
569
|
+
const type = getType(value);
|
|
570
|
+
if (type !== Number$1) {
|
|
571
|
+
throw new AssertionError('expected value to be of type number');
|
|
572
|
+
}
|
|
573
|
+
};
|
|
574
|
+
|
|
521
575
|
const isMessagePort = value => {
|
|
522
576
|
return value && value instanceof MessagePort;
|
|
523
577
|
};
|
|
@@ -832,6 +886,9 @@ const IpcChildWithModuleWorkerAndMessagePort$1 = {
|
|
|
832
886
|
listen: listen$6,
|
|
833
887
|
wrap: wrap$e
|
|
834
888
|
};
|
|
889
|
+
const Error$3 = 1;
|
|
890
|
+
const Open = 2;
|
|
891
|
+
const Close = 3;
|
|
835
892
|
const addListener = (emitter, type, callback) => {
|
|
836
893
|
if ('addEventListener' in emitter) {
|
|
837
894
|
emitter.addEventListener(type, callback);
|
|
@@ -926,6 +983,66 @@ const IpcParentWithMessagePort$1 = {
|
|
|
926
983
|
signal: signal$1,
|
|
927
984
|
wrap: wrap$5
|
|
928
985
|
};
|
|
986
|
+
const stringifyCompact = value => {
|
|
987
|
+
return JSON.stringify(value);
|
|
988
|
+
};
|
|
989
|
+
const parse = content => {
|
|
990
|
+
if (content === 'undefined') {
|
|
991
|
+
return null;
|
|
992
|
+
}
|
|
993
|
+
try {
|
|
994
|
+
return JSON.parse(content);
|
|
995
|
+
} catch (error) {
|
|
996
|
+
throw new VError(error, 'failed to parse json');
|
|
997
|
+
}
|
|
998
|
+
};
|
|
999
|
+
const waitForWebSocketToBeOpen = webSocket => {
|
|
1000
|
+
return getFirstEvent(webSocket, {
|
|
1001
|
+
close: Close,
|
|
1002
|
+
error: Error$3,
|
|
1003
|
+
open: Open
|
|
1004
|
+
});
|
|
1005
|
+
};
|
|
1006
|
+
const create$c = async ({
|
|
1007
|
+
webSocket
|
|
1008
|
+
}) => {
|
|
1009
|
+
const firstWebSocketEvent = await waitForWebSocketToBeOpen(webSocket);
|
|
1010
|
+
if (firstWebSocketEvent.type === Error$3) {
|
|
1011
|
+
throw new IpcError(`WebSocket connection error`);
|
|
1012
|
+
}
|
|
1013
|
+
if (firstWebSocketEvent.type === Close) {
|
|
1014
|
+
throw new IpcError('Websocket connection was immediately closed');
|
|
1015
|
+
}
|
|
1016
|
+
return webSocket;
|
|
1017
|
+
};
|
|
1018
|
+
class IpcParentWithWebSocket extends Ipc {
|
|
1019
|
+
getData(event) {
|
|
1020
|
+
return parse(event.data);
|
|
1021
|
+
}
|
|
1022
|
+
send(message) {
|
|
1023
|
+
this._rawIpc.send(stringifyCompact(message));
|
|
1024
|
+
}
|
|
1025
|
+
sendAndTransfer(message) {
|
|
1026
|
+
throw new Error('sendAndTransfer not supported');
|
|
1027
|
+
}
|
|
1028
|
+
dispose() {
|
|
1029
|
+
this._rawIpc.close();
|
|
1030
|
+
}
|
|
1031
|
+
onClose(callback) {
|
|
1032
|
+
this._rawIpc.addEventListener('close', callback);
|
|
1033
|
+
}
|
|
1034
|
+
onMessage(callback) {
|
|
1035
|
+
this._rawIpc.addEventListener('message', callback);
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
const wrap = webSocket => {
|
|
1039
|
+
return new IpcParentWithWebSocket(webSocket);
|
|
1040
|
+
};
|
|
1041
|
+
const IpcParentWithWebSocket$1 = {
|
|
1042
|
+
__proto__: null,
|
|
1043
|
+
create: create$c,
|
|
1044
|
+
wrap
|
|
1045
|
+
};
|
|
929
1046
|
|
|
930
1047
|
class CommandNotFoundError extends Error {
|
|
931
1048
|
constructor(command) {
|
|
@@ -1162,7 +1279,7 @@ const getErrorResponse = (id, error, preparePrettyError, logError) => {
|
|
|
1162
1279
|
const errorProperty = getErrorProperty(error, prettyError);
|
|
1163
1280
|
return create$1$1(id, errorProperty);
|
|
1164
1281
|
};
|
|
1165
|
-
const create$
|
|
1282
|
+
const create$b = (message, result) => {
|
|
1166
1283
|
return {
|
|
1167
1284
|
id: message.id,
|
|
1168
1285
|
jsonrpc: Two$1,
|
|
@@ -1171,7 +1288,7 @@ const create$8 = (message, result) => {
|
|
|
1171
1288
|
};
|
|
1172
1289
|
const getSuccessResponse = (message, result) => {
|
|
1173
1290
|
const resultProperty = result ?? null;
|
|
1174
|
-
return create$
|
|
1291
|
+
return create$b(message, resultProperty);
|
|
1175
1292
|
};
|
|
1176
1293
|
const getErrorResponseSimple = (id, error) => {
|
|
1177
1294
|
return {
|
|
@@ -1265,7 +1382,7 @@ const handleJsonRpcMessage = async (...args) => {
|
|
|
1265
1382
|
|
|
1266
1383
|
const Two = '2.0';
|
|
1267
1384
|
|
|
1268
|
-
const create$
|
|
1385
|
+
const create$a = (method, params) => {
|
|
1269
1386
|
return {
|
|
1270
1387
|
jsonrpc: Two,
|
|
1271
1388
|
method,
|
|
@@ -1273,7 +1390,7 @@ const create$7 = (method, params) => {
|
|
|
1273
1390
|
};
|
|
1274
1391
|
};
|
|
1275
1392
|
|
|
1276
|
-
const create$
|
|
1393
|
+
const create$9 = (id, method, params) => {
|
|
1277
1394
|
const message = {
|
|
1278
1395
|
id,
|
|
1279
1396
|
jsonrpc: Two,
|
|
@@ -1284,12 +1401,12 @@ const create$6 = (id, method, params) => {
|
|
|
1284
1401
|
};
|
|
1285
1402
|
|
|
1286
1403
|
let id = 0;
|
|
1287
|
-
const create$
|
|
1404
|
+
const create$8 = () => {
|
|
1288
1405
|
return ++id;
|
|
1289
1406
|
};
|
|
1290
1407
|
|
|
1291
1408
|
const registerPromise = map => {
|
|
1292
|
-
const id = create$
|
|
1409
|
+
const id = create$8();
|
|
1293
1410
|
const {
|
|
1294
1411
|
promise,
|
|
1295
1412
|
resolve
|
|
@@ -1306,7 +1423,7 @@ const invokeHelper = async (callbacks, ipc, method, params, useSendAndTransfer)
|
|
|
1306
1423
|
id,
|
|
1307
1424
|
promise
|
|
1308
1425
|
} = registerPromise(callbacks);
|
|
1309
|
-
const message = create$
|
|
1426
|
+
const message = create$9(id, method, params);
|
|
1310
1427
|
if (useSendAndTransfer && ipc.sendAndTransfer) {
|
|
1311
1428
|
ipc.sendAndTransfer(message);
|
|
1312
1429
|
} else {
|
|
@@ -1342,7 +1459,7 @@ const createRpc = ipc => {
|
|
|
1342
1459
|
* @deprecated
|
|
1343
1460
|
*/
|
|
1344
1461
|
send(method, ...params) {
|
|
1345
|
-
const message = create$
|
|
1462
|
+
const message = create$a(method, params);
|
|
1346
1463
|
ipc.send(message);
|
|
1347
1464
|
}
|
|
1348
1465
|
};
|
|
@@ -1382,7 +1499,7 @@ const listen$1 = async (module, options) => {
|
|
|
1382
1499
|
return ipc;
|
|
1383
1500
|
};
|
|
1384
1501
|
|
|
1385
|
-
const create$
|
|
1502
|
+
const create$7 = async ({
|
|
1386
1503
|
commandMap,
|
|
1387
1504
|
isMessagePortOpen = true,
|
|
1388
1505
|
messagePort
|
|
@@ -1400,7 +1517,7 @@ const create$4 = async ({
|
|
|
1400
1517
|
return rpc;
|
|
1401
1518
|
};
|
|
1402
1519
|
|
|
1403
|
-
const create$
|
|
1520
|
+
const create$6 = async ({
|
|
1404
1521
|
commandMap,
|
|
1405
1522
|
isMessagePortOpen,
|
|
1406
1523
|
send
|
|
@@ -1410,7 +1527,7 @@ const create$3 = async ({
|
|
|
1410
1527
|
port2
|
|
1411
1528
|
} = new MessageChannel();
|
|
1412
1529
|
await send(port1);
|
|
1413
|
-
return create$
|
|
1530
|
+
return create$7({
|
|
1414
1531
|
commandMap,
|
|
1415
1532
|
isMessagePortOpen,
|
|
1416
1533
|
messagePort: port2
|
|
@@ -1445,13 +1562,13 @@ const createSharedLazyRpc = factory => {
|
|
|
1445
1562
|
};
|
|
1446
1563
|
};
|
|
1447
1564
|
|
|
1448
|
-
const create$
|
|
1565
|
+
const create$5 = async ({
|
|
1449
1566
|
commandMap,
|
|
1450
1567
|
isMessagePortOpen,
|
|
1451
1568
|
send
|
|
1452
1569
|
}) => {
|
|
1453
1570
|
return createSharedLazyRpc(() => {
|
|
1454
|
-
return create$
|
|
1571
|
+
return create$6({
|
|
1455
1572
|
commandMap,
|
|
1456
1573
|
isMessagePortOpen,
|
|
1457
1574
|
send
|
|
@@ -1459,6 +1576,68 @@ const create$2 = async ({
|
|
|
1459
1576
|
});
|
|
1460
1577
|
};
|
|
1461
1578
|
|
|
1579
|
+
const Https = 'https:';
|
|
1580
|
+
const Ws = 'ws:';
|
|
1581
|
+
const Wss = 'wss:';
|
|
1582
|
+
|
|
1583
|
+
const getWebSocketProtocol = locationProtocol => {
|
|
1584
|
+
return locationProtocol === Https ? Wss : Ws;
|
|
1585
|
+
};
|
|
1586
|
+
|
|
1587
|
+
const getWebSocketUrl = (type, host, locationProtocol) => {
|
|
1588
|
+
const wsProtocol = getWebSocketProtocol(locationProtocol);
|
|
1589
|
+
return `${wsProtocol}//${host}/websocket/${type}`;
|
|
1590
|
+
};
|
|
1591
|
+
|
|
1592
|
+
const getHost = () => {
|
|
1593
|
+
return location.host;
|
|
1594
|
+
};
|
|
1595
|
+
const getProtocol = () => {
|
|
1596
|
+
return location.protocol;
|
|
1597
|
+
};
|
|
1598
|
+
|
|
1599
|
+
const create$4 = async ({
|
|
1600
|
+
commandMap,
|
|
1601
|
+
webSocket
|
|
1602
|
+
}) => {
|
|
1603
|
+
// TODO create a commandMap per rpc instance
|
|
1604
|
+
register(commandMap);
|
|
1605
|
+
const rawIpc = await IpcParentWithWebSocket$1.create({
|
|
1606
|
+
webSocket
|
|
1607
|
+
});
|
|
1608
|
+
const ipc = IpcParentWithWebSocket$1.wrap(rawIpc);
|
|
1609
|
+
handleIpc(ipc);
|
|
1610
|
+
const rpc = createRpc(ipc);
|
|
1611
|
+
return rpc;
|
|
1612
|
+
};
|
|
1613
|
+
|
|
1614
|
+
const create$3 = async ({
|
|
1615
|
+
commandMap,
|
|
1616
|
+
type
|
|
1617
|
+
}) => {
|
|
1618
|
+
const host = getHost();
|
|
1619
|
+
const protocol = getProtocol();
|
|
1620
|
+
const wsUrl = getWebSocketUrl(type, host, protocol);
|
|
1621
|
+
const webSocket = new WebSocket(wsUrl);
|
|
1622
|
+
const rpc = await create$4({
|
|
1623
|
+
commandMap,
|
|
1624
|
+
webSocket
|
|
1625
|
+
});
|
|
1626
|
+
return rpc;
|
|
1627
|
+
};
|
|
1628
|
+
|
|
1629
|
+
const create$2 = async ({
|
|
1630
|
+
commandMap,
|
|
1631
|
+
type
|
|
1632
|
+
}) => {
|
|
1633
|
+
return createSharedLazyRpc(() => {
|
|
1634
|
+
return create$3({
|
|
1635
|
+
commandMap,
|
|
1636
|
+
type
|
|
1637
|
+
});
|
|
1638
|
+
});
|
|
1639
|
+
};
|
|
1640
|
+
|
|
1462
1641
|
const create$1 = async ({
|
|
1463
1642
|
commandMap
|
|
1464
1643
|
}) => {
|
|
@@ -1491,7 +1670,7 @@ const createMockRpc = ({
|
|
|
1491
1670
|
};
|
|
1492
1671
|
|
|
1493
1672
|
const rpcs = Object.create(null);
|
|
1494
|
-
const set$
|
|
1673
|
+
const set$8 = (id, rpc) => {
|
|
1495
1674
|
rpcs[id] = rpc;
|
|
1496
1675
|
};
|
|
1497
1676
|
const get = id => {
|
|
@@ -1524,7 +1703,7 @@ const create = rpcId => {
|
|
|
1524
1703
|
const mockRpc = createMockRpc({
|
|
1525
1704
|
commandMap
|
|
1526
1705
|
});
|
|
1527
|
-
set$
|
|
1706
|
+
set$8(rpcId, mockRpc);
|
|
1528
1707
|
// @ts-ignore
|
|
1529
1708
|
mockRpc[Symbol.dispose] = () => {
|
|
1530
1709
|
remove(rpcId);
|
|
@@ -1533,41 +1712,612 @@ const create = rpcId => {
|
|
|
1533
1712
|
return mockRpc;
|
|
1534
1713
|
},
|
|
1535
1714
|
set(rpc) {
|
|
1536
|
-
set$
|
|
1715
|
+
set$8(rpcId, rpc);
|
|
1537
1716
|
}
|
|
1538
1717
|
};
|
|
1539
1718
|
};
|
|
1540
1719
|
|
|
1720
|
+
const {
|
|
1721
|
+
set: set$7
|
|
1722
|
+
} = create(EditorWorker);
|
|
1723
|
+
|
|
1541
1724
|
const {
|
|
1542
1725
|
invoke: invoke$2,
|
|
1543
|
-
set: set$
|
|
1726
|
+
set: set$6
|
|
1544
1727
|
} = create(ErrorWorker);
|
|
1545
1728
|
const prepare = async error => {
|
|
1546
1729
|
return invoke$2('Errors.prepare', error);
|
|
1547
1730
|
};
|
|
1548
1731
|
|
|
1549
1732
|
const {
|
|
1550
|
-
set: set$
|
|
1733
|
+
set: set$5
|
|
1551
1734
|
} = create(FileSystemWorker$1);
|
|
1552
1735
|
|
|
1553
1736
|
const FileSystemWorker = {
|
|
1554
1737
|
__proto__: null,
|
|
1555
|
-
set: set$
|
|
1738
|
+
set: set$5
|
|
1556
1739
|
};
|
|
1557
1740
|
|
|
1558
1741
|
const {
|
|
1742
|
+
set: set$4
|
|
1743
|
+
} = create(OpenerWorker);
|
|
1744
|
+
|
|
1745
|
+
const {
|
|
1746
|
+
set: set$3
|
|
1747
|
+
} = create(IconThemeWorker);
|
|
1748
|
+
|
|
1749
|
+
const {
|
|
1750
|
+
dispose,
|
|
1559
1751
|
invoke: invoke$1,
|
|
1560
1752
|
invokeAndTransfer,
|
|
1561
|
-
|
|
1562
|
-
|
|
1753
|
+
registerMockRpc,
|
|
1754
|
+
set: set$2
|
|
1755
|
+
} = create(RendererWorker$1);
|
|
1756
|
+
const searchFileHtml = async uri => {
|
|
1757
|
+
return invoke$1('ExtensionHost.searchFileWithHtml', uri);
|
|
1758
|
+
};
|
|
1759
|
+
const getFilePathElectron = async file => {
|
|
1760
|
+
return invoke$1('FileSystemHandle.getFilePathElectron', file);
|
|
1761
|
+
};
|
|
1762
|
+
const handleModifiedStatusChange = async (uri, modified) => {
|
|
1763
|
+
return invoke$1('Main.handleModifiedStatusChange', uri, modified);
|
|
1764
|
+
};
|
|
1765
|
+
/**
|
|
1766
|
+
* @deprecated
|
|
1767
|
+
*/
|
|
1768
|
+
const showContextMenu = async (x, y, id, ...args) => {
|
|
1769
|
+
return invoke$1('ContextMenu.show', x, y, id, ...args);
|
|
1770
|
+
};
|
|
1771
|
+
const showContextMenu2 = async (uid, menuId, x, y, args) => {
|
|
1772
|
+
number(uid);
|
|
1773
|
+
number(menuId);
|
|
1774
|
+
number(x);
|
|
1775
|
+
number(y);
|
|
1776
|
+
await invoke$1('ContextMenu.show2', uid, menuId, x, y, args);
|
|
1777
|
+
};
|
|
1778
|
+
const getElectronVersion = async () => {
|
|
1779
|
+
return invoke$1('Process.getElectronVersion');
|
|
1780
|
+
};
|
|
1781
|
+
const applyBulkReplacement = async bulkEdits => {
|
|
1782
|
+
await invoke$1('BulkReplacement.applyBulkReplacement', bulkEdits);
|
|
1783
|
+
};
|
|
1784
|
+
const setColorTheme = async id => {
|
|
1785
|
+
return invoke$1(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
|
|
1786
|
+
};
|
|
1787
|
+
const getNodeVersion = async () => {
|
|
1788
|
+
return invoke$1('Process.getNodeVersion');
|
|
1789
|
+
};
|
|
1790
|
+
const getBadgeCounts = async () => {
|
|
1791
|
+
return invoke$1('Layout.getBadgeCounts');
|
|
1792
|
+
};
|
|
1793
|
+
const getChromeVersion = async () => {
|
|
1794
|
+
return invoke$1('Process.getChromeVersion');
|
|
1795
|
+
};
|
|
1796
|
+
const getV8Version = async () => {
|
|
1797
|
+
return invoke$1('Process.getV8Version');
|
|
1798
|
+
};
|
|
1799
|
+
const getFileHandles = async fileIds => {
|
|
1800
|
+
const files = await invoke$1('FileSystemHandle.getFileHandles', fileIds);
|
|
1801
|
+
return files;
|
|
1802
|
+
};
|
|
1803
|
+
const setWorkspacePath = async path => {
|
|
1804
|
+
await invoke$1('Workspace.setPath', path);
|
|
1805
|
+
};
|
|
1806
|
+
const registerWebViewInterceptor = async (id, port) => {
|
|
1807
|
+
await invokeAndTransfer('WebView.registerInterceptor', id, port);
|
|
1808
|
+
};
|
|
1809
|
+
const unregisterWebViewInterceptor = async id => {
|
|
1810
|
+
await invoke$1('WebView.unregisterInterceptor', id);
|
|
1811
|
+
};
|
|
1812
|
+
const sendMessagePortToEditorWorker = async (port, rpcId) => {
|
|
1813
|
+
const command = 'HandleMessagePort.handleMessagePort';
|
|
1814
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToEditorWorker', port, command, rpcId);
|
|
1815
|
+
};
|
|
1816
|
+
const sendMessagePortToSettingsWorker = async (port, rpcId) => {
|
|
1817
|
+
const command = 'HandleMessagePort.handleMessagePort';
|
|
1818
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSettingsWorker', port, command, rpcId);
|
|
1819
|
+
};
|
|
1820
|
+
const sendMessagePortToClipBoardWorker = async (port, rpcId) => {
|
|
1821
|
+
const command = 'ClipBoard.handleMessagePort';
|
|
1822
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToClipBoardWorker', port, command, rpcId);
|
|
1823
|
+
};
|
|
1824
|
+
const sendMessagePortToOpenerWorker = async (port, rpcId) => {
|
|
1825
|
+
const command = 'HandleMessagePort.handleMessagePort';
|
|
1826
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToOpenerWorker', port, command, rpcId);
|
|
1827
|
+
};
|
|
1828
|
+
const sendMessagePortToChatMathWorker = async (port, rpcId) => {
|
|
1829
|
+
const command = 'HandleMessagePort.handleMessagePort';
|
|
1830
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToChatMathWorker', port, command, rpcId);
|
|
1831
|
+
};
|
|
1832
|
+
const sendMessagePortToChatCoordinatorWorker = async (port, rpcId) => {
|
|
1833
|
+
const command = 'HandleMessagePort.handleMessagePort';
|
|
1834
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToChatCoordinatorWorker', port, command, rpcId);
|
|
1835
|
+
};
|
|
1836
|
+
const sendMessagePortToChatMessageParsingWorker = async (port, rpcId) => {
|
|
1837
|
+
const command = 'HandleMessagePort.handleMessagePort';
|
|
1838
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToChatMessageParsingWorker', port, command, rpcId);
|
|
1839
|
+
};
|
|
1840
|
+
const sendMessagePortToMainAreaWorker = async (port, rpcId) => {
|
|
1841
|
+
const command = 'HandleMessagePort.handleMessagePort';
|
|
1842
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToMainAreaWorker', port, command, rpcId);
|
|
1843
|
+
};
|
|
1844
|
+
const sendMessagePortToTerminalProcess = async (port, rpcId) => {
|
|
1845
|
+
const command = 'HandleMessagePortForTerminalProcess.handleMessagePortForTerminalProcess';
|
|
1846
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToTerminalProcess', port, command, rpcId);
|
|
1847
|
+
};
|
|
1848
|
+
const sendMessagePortToTextSearchWorker = async (port, rpcId) => {
|
|
1849
|
+
const command = 'HandleMessagePort.handleMessagePort';
|
|
1850
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToTextSearchWorker', port, command, rpcId);
|
|
1851
|
+
};
|
|
1852
|
+
const sendMessagePortToAuthWorker = async (port, rpcId) => {
|
|
1853
|
+
const command = 'HandleMessagePort.handleMessagePort';
|
|
1854
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToAuthWorker', port, command, rpcId);
|
|
1855
|
+
};
|
|
1856
|
+
const sendMessagePortToAuthProcess = async (port, rpcId) => {
|
|
1857
|
+
const command = 'HandleMessagePortForAuthProcess.handleMessagePortForAuthProcess';
|
|
1858
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, command, rpcId);
|
|
1859
|
+
};
|
|
1563
1860
|
const sendMessagePortToErrorWorker$1 = async (port, rpcId) => {
|
|
1564
1861
|
const command = 'Errors.handleMessagePort';
|
|
1565
1862
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToErrorWorker', port, command, rpcId);
|
|
1566
1863
|
};
|
|
1864
|
+
const sendMessagePortToMarkdownWorker = async (port, rpcId) => {
|
|
1865
|
+
const command = 'Markdown.handleMessagePort';
|
|
1866
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToMarkdownWorker', port, command, rpcId);
|
|
1867
|
+
};
|
|
1868
|
+
const sendMessagePortToIconThemeWorker = async (port, rpcId) => {
|
|
1869
|
+
const command = 'IconTheme.handleMessagePort';
|
|
1870
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToIconThemeWorker', port, command, rpcId);
|
|
1871
|
+
};
|
|
1567
1872
|
const sendMessagePortToFileSystemWorker$1 = async (port, rpcId) => {
|
|
1568
1873
|
const command = 'FileSystem.handleMessagePort';
|
|
1569
1874
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSystemWorker', port, command, rpcId);
|
|
1570
1875
|
};
|
|
1876
|
+
const readFile = async uri => {
|
|
1877
|
+
return invoke$1('FileSystem.readFile', uri);
|
|
1878
|
+
};
|
|
1879
|
+
const getWebViewSecret = async key => {
|
|
1880
|
+
return invoke$1('WebView.getSecret', key);
|
|
1881
|
+
};
|
|
1882
|
+
const setWebViewPort = async (uid, port, origin, portType) => {
|
|
1883
|
+
return invokeAndTransfer('WebView.setPort', uid, port, origin, portType);
|
|
1884
|
+
};
|
|
1885
|
+
const setFocus = key => {
|
|
1886
|
+
return invoke$1('Focus.setFocus', key);
|
|
1887
|
+
};
|
|
1888
|
+
const getFileIcon = async options => {
|
|
1889
|
+
return invoke$1('IconTheme.getFileIcon', options);
|
|
1890
|
+
};
|
|
1891
|
+
const getColorThemeNames = async () => {
|
|
1892
|
+
return invoke$1('ColorTheme.getColorThemeNames');
|
|
1893
|
+
};
|
|
1894
|
+
const disableExtension = async id => {
|
|
1895
|
+
return invoke$1('ExtensionManagement.disable', id);
|
|
1896
|
+
};
|
|
1897
|
+
const enableExtension = async id => {
|
|
1898
|
+
return invoke$1('ExtensionManagement.enable', id);
|
|
1899
|
+
};
|
|
1900
|
+
const disposeEditor = async uid => {
|
|
1901
|
+
return invoke$1('Viewlet.dispose', uid);
|
|
1902
|
+
};
|
|
1903
|
+
const handleDebugChange = async params => {
|
|
1904
|
+
return invoke$1('Run And Debug.handleChange', params);
|
|
1905
|
+
};
|
|
1906
|
+
const getFolderIcon = async options => {
|
|
1907
|
+
return invoke$1('IconTheme.getFolderIcon', options);
|
|
1908
|
+
};
|
|
1909
|
+
const handleWorkspaceRefresh = async () => {
|
|
1910
|
+
return invoke$1('Layout.handleWorkspaceRefresh');
|
|
1911
|
+
};
|
|
1912
|
+
const closeWidget = async widgetId => {
|
|
1913
|
+
return invoke$1('Viewlet.closeWidget', widgetId);
|
|
1914
|
+
};
|
|
1915
|
+
const createViewlet = async (viewletModuleId, editorUid, tabId, bounds, uri) => {
|
|
1916
|
+
return invoke$1('Layout.createViewlet', viewletModuleId, editorUid, tabId, bounds, uri);
|
|
1917
|
+
};
|
|
1918
|
+
const sendMessagePortToExtensionHostWorker = async (port, rpcId = 0) => {
|
|
1919
|
+
const command = 'HandleMessagePort.handleMessagePort2';
|
|
1920
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, rpcId);
|
|
1921
|
+
};
|
|
1922
|
+
const getViewletModuleId = async uri => {
|
|
1923
|
+
return invoke$1('Layout.getModuleId', uri);
|
|
1924
|
+
};
|
|
1925
|
+
const showPanel = async () => {
|
|
1926
|
+
return invoke$1('Layout.showPanel');
|
|
1927
|
+
};
|
|
1928
|
+
const showPreview = async () => {
|
|
1929
|
+
return invoke$1('Layout.showPreview');
|
|
1930
|
+
};
|
|
1931
|
+
const saveEditor = async () => {
|
|
1932
|
+
return invoke$1('Editor.save');
|
|
1933
|
+
};
|
|
1934
|
+
const sendMessagePortToFileSearchWorker2 = async (port, rpcId = 0) => {
|
|
1935
|
+
const command = 'FileSearch.handleMessagePort';
|
|
1936
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSearchWorker', port, command, rpcId);
|
|
1937
|
+
};
|
|
1938
|
+
const togglePanelView = async id => {
|
|
1939
|
+
return invoke$1('Panel.toggleView', id);
|
|
1940
|
+
};
|
|
1941
|
+
const resizeViewlet = async (uid, dimensions) => {
|
|
1942
|
+
return invoke$1('Viewlet.resize', uid, dimensions);
|
|
1943
|
+
};
|
|
1944
|
+
const sendMessagePortToFileSearchWorker = async (port, rpcId = 0) => {
|
|
1945
|
+
const command = 'QuickPick.handleMessagePort';
|
|
1946
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSearchWorker', port, command, rpcId);
|
|
1947
|
+
};
|
|
1948
|
+
const sendMessagePortToQuickPickWorker = async (port, rpcId = 0) => {
|
|
1949
|
+
const command = 'QuickPick.handleMessagePort';
|
|
1950
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToQuickPickWorker', port, command, rpcId);
|
|
1951
|
+
};
|
|
1952
|
+
const sendMessagePortToSearchProcess = async port => {
|
|
1953
|
+
await invokeAndTransfer('SendMessagePortToElectron.sendMessagePortToElectron', port, 'HandleMessagePortForSearchProcess.handleMessagePortForSearchProcess');
|
|
1954
|
+
};
|
|
1955
|
+
const sendMessagePortToChatViewModel = async port => {
|
|
1956
|
+
await invokeAndTransfer('SendMessagePortToElectron.sendMessagePortToChatViewModel', port, 'ViewModel.handleMessagePort');
|
|
1957
|
+
};
|
|
1958
|
+
const sendMessagePortToChatNetworkWorker = async port => {
|
|
1959
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToChatNetworkWorker', port, 'HandleMessagePort.handleMessagePort');
|
|
1960
|
+
};
|
|
1961
|
+
const sendMessagePortToChatToolWorker = async port => {
|
|
1962
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToChatToolWorker', port, 'HandleMessagePort.handleMessagePort');
|
|
1963
|
+
};
|
|
1964
|
+
const sendMessagePortToChatStorageWorker = async (port, rpcId) => {
|
|
1965
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToChatStorageWorker', port, 'HandleMessagePort.handleMessagePort', rpcId);
|
|
1966
|
+
};
|
|
1967
|
+
const sendMessagePortToChatDebugViewWorker = async port => {
|
|
1968
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToChatDebugViewWorker', port, 'HandleMessagePort.handleMessagePort');
|
|
1969
|
+
};
|
|
1970
|
+
const confirm = async (message, options) => {
|
|
1971
|
+
const result = await invoke$1('ConfirmPrompt.prompt', message, options);
|
|
1972
|
+
return result;
|
|
1973
|
+
};
|
|
1974
|
+
const getRecentlyOpened = async () => {
|
|
1975
|
+
return invoke$1(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
|
|
1976
|
+
};
|
|
1977
|
+
const getKeyBindings = async () => {
|
|
1978
|
+
return invoke$1('KeyBindingsInitial.getKeyBindings');
|
|
1979
|
+
};
|
|
1980
|
+
const writeClipBoardText = async text => {
|
|
1981
|
+
await invoke$1('ClipBoard.writeText', /* text */text);
|
|
1982
|
+
};
|
|
1983
|
+
const writeFile = async (uri, text) => {
|
|
1984
|
+
await invoke$1('FileSystem.writeFile', uri, text);
|
|
1985
|
+
};
|
|
1986
|
+
const handleUriChange = async (uri, newUri) => {
|
|
1987
|
+
await invoke$1('Main.handleUriChange', uri, newUri);
|
|
1988
|
+
};
|
|
1989
|
+
const readClipBoardText = async () => {
|
|
1990
|
+
return invoke$1('ClipBoard.readText');
|
|
1991
|
+
};
|
|
1992
|
+
const writeClipBoardImage = async blob => {
|
|
1993
|
+
await invoke$1('ClipBoard.writeImage', /* text */blob);
|
|
1994
|
+
};
|
|
1995
|
+
const searchFileMemory = async uri => {
|
|
1996
|
+
return invoke$1('ExtensionHost.searchFileWithMemory', uri);
|
|
1997
|
+
};
|
|
1998
|
+
const searchFileFetch = async uri => {
|
|
1999
|
+
return invoke$1('ExtensionHost.searchFileWithFetch', uri);
|
|
2000
|
+
};
|
|
2001
|
+
const showMessageBox = async options => {
|
|
2002
|
+
return invoke$1('ElectronDialog.showMessageBox', options);
|
|
2003
|
+
};
|
|
2004
|
+
const handleDebugResumed = async params => {
|
|
2005
|
+
await invoke$1('Run And Debug.handleResumed', params);
|
|
2006
|
+
};
|
|
2007
|
+
const openWidget = async name => {
|
|
2008
|
+
await invoke$1('Viewlet.openWidget', name);
|
|
2009
|
+
};
|
|
2010
|
+
const getIcons = async requests => {
|
|
2011
|
+
const icons = await invoke$1('IconTheme.getIcons', requests);
|
|
2012
|
+
return icons;
|
|
2013
|
+
};
|
|
2014
|
+
const activateByEvent = (event, assetDir, platform) => {
|
|
2015
|
+
return invoke$1('ExtensionHostManagement.activateByEvent', event, assetDir, platform);
|
|
2016
|
+
};
|
|
2017
|
+
const setAdditionalFocus = focusKey => {
|
|
2018
|
+
return invoke$1('Focus.setAdditionalFocus', focusKey);
|
|
2019
|
+
};
|
|
2020
|
+
const getActiveEditorId = () => {
|
|
2021
|
+
return invoke$1('GetActiveEditor.getActiveEditorId');
|
|
2022
|
+
};
|
|
2023
|
+
const getWorkspacePath = () => {
|
|
2024
|
+
return invoke$1('Workspace.getPath');
|
|
2025
|
+
};
|
|
2026
|
+
const sendMessagePortToRendererProcess = async port => {
|
|
2027
|
+
const command = 'HandleMessagePort.handleMessagePort';
|
|
2028
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToRendererProcess', port, command, DebugWorker);
|
|
2029
|
+
};
|
|
2030
|
+
const sendMessagePortToTextMeasurementWorker = async port => {
|
|
2031
|
+
const command = 'TextMeasurement.handleMessagePort';
|
|
2032
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToTextMeasurementWorker', port, command, 0);
|
|
2033
|
+
};
|
|
2034
|
+
const sendMessagePortToSourceControlWorker = async port => {
|
|
2035
|
+
const command = 'SourceControl.handleMessagePort';
|
|
2036
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSourceControlWorker', port, command, 0);
|
|
2037
|
+
};
|
|
2038
|
+
const sendMessagePortToSharedProcess = async port => {
|
|
2039
|
+
const command = 'HandleElectronMessagePort.handleElectronMessagePort';
|
|
2040
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, command, 0);
|
|
2041
|
+
};
|
|
2042
|
+
const sendMessagePortToFileSystemProcess = async (port, rpcId) => {
|
|
2043
|
+
const command = 'HandleMessagePortForFileSystemProcess.handleMessagePortForFileSystemProcess';
|
|
2044
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, command, rpcId);
|
|
2045
|
+
};
|
|
2046
|
+
const sendMessagePortToIframeWorker = async (port, rpcId) => {
|
|
2047
|
+
const command = 'Iframes.handleMessagePort';
|
|
2048
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToIframeWorker', port, command, rpcId);
|
|
2049
|
+
};
|
|
2050
|
+
const sendMessagePortToExtensionManagementWorker = async (port, rpcId) => {
|
|
2051
|
+
const command = 'Extensions.handleMessagePort';
|
|
2052
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionManagementWorker', port, command, rpcId);
|
|
2053
|
+
};
|
|
2054
|
+
const getPreference = async key => {
|
|
2055
|
+
return await invoke$1('Preferences.get', key);
|
|
2056
|
+
};
|
|
2057
|
+
const getAllExtensions = async () => {
|
|
2058
|
+
return invoke$1('ExtensionManagement.getAllExtensions');
|
|
2059
|
+
};
|
|
2060
|
+
const rerenderEditor = async key => {
|
|
2061
|
+
return invoke$1('Editor.rerender', key);
|
|
2062
|
+
};
|
|
2063
|
+
const handleDebugPaused = async params => {
|
|
2064
|
+
await invoke$1('Run And Debug.handlePaused', params);
|
|
2065
|
+
};
|
|
2066
|
+
const openUri = async (uri, focus, options) => {
|
|
2067
|
+
await invoke$1('Main.openUri', uri, focus, options);
|
|
2068
|
+
};
|
|
2069
|
+
const sendMessagePortToSyntaxHighlightingWorker = async port => {
|
|
2070
|
+
await invokeAndTransfer('SendMessagePortToSyntaxHighlightingWorker.sendMessagePortToSyntaxHighlightingWorker', port, 'HandleMessagePort.handleMessagePort2');
|
|
2071
|
+
};
|
|
2072
|
+
const sendMessagePortToBlobWorker = async (port, rpcId = 0) => {
|
|
2073
|
+
const command = 'Blob.handleMessagePort';
|
|
2074
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToBlobWorker', port, command, rpcId);
|
|
2075
|
+
};
|
|
2076
|
+
const sendMessagePortToDiffWorker = async (port, rpcId = 0) => {
|
|
2077
|
+
const command = 'Diff.handleMessagePort';
|
|
2078
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToDiffWorker', port, command, rpcId);
|
|
2079
|
+
};
|
|
2080
|
+
const handleDebugScriptParsed = async script => {
|
|
2081
|
+
await invoke$1('Run And Debug.handleScriptParsed', script);
|
|
2082
|
+
};
|
|
2083
|
+
const getWindowId = async () => {
|
|
2084
|
+
return invoke$1('GetWindowId.getWindowId');
|
|
2085
|
+
};
|
|
2086
|
+
const getBlob = async uri => {
|
|
2087
|
+
return invoke$1('FileSystem.getBlob', uri);
|
|
2088
|
+
};
|
|
2089
|
+
const getExtensionCommands = async () => {
|
|
2090
|
+
return invoke$1('ExtensionHost.getCommands');
|
|
2091
|
+
};
|
|
2092
|
+
const showErrorDialog = async errorInfo => {
|
|
2093
|
+
await invoke$1('ErrorHandling.showErrorDialog', errorInfo);
|
|
2094
|
+
};
|
|
2095
|
+
const getFolderSize = async uri => {
|
|
2096
|
+
return await invoke$1('FileSystem.getFolderSize', uri);
|
|
2097
|
+
};
|
|
2098
|
+
const getExtension = async id => {
|
|
2099
|
+
return invoke$1('ExtensionManagement.getExtension', id);
|
|
2100
|
+
};
|
|
2101
|
+
const getMarkdownDom = async html => {
|
|
2102
|
+
return invoke$1('Markdown.getVirtualDom', html);
|
|
2103
|
+
};
|
|
2104
|
+
const renderMarkdown = async (markdown, options) => {
|
|
2105
|
+
return invoke$1('Markdown.renderMarkdown', markdown, options);
|
|
2106
|
+
};
|
|
2107
|
+
const openNativeFolder = async uri => {
|
|
2108
|
+
await invoke$1('OpenNativeFolder.openNativeFolder', uri);
|
|
2109
|
+
};
|
|
2110
|
+
const uninstallExtension = async id => {
|
|
2111
|
+
return invoke$1('ExtensionManagement.uninstall', id);
|
|
2112
|
+
};
|
|
2113
|
+
const installExtension = async id => {
|
|
2114
|
+
return invoke$1('ExtensionManagement.install', id);
|
|
2115
|
+
};
|
|
2116
|
+
const minimizeWindow = async () => {
|
|
2117
|
+
return invoke$1('ElectronWindow.minimize');
|
|
2118
|
+
};
|
|
2119
|
+
const unmaximizeWindow = async () => {
|
|
2120
|
+
return invoke$1('ElectronWindow.unmaximize');
|
|
2121
|
+
};
|
|
2122
|
+
const maximizeWindow = async () => {
|
|
2123
|
+
return invoke$1('ElectronWindow.maximize');
|
|
2124
|
+
};
|
|
2125
|
+
const showSideBar = async (id, focus) => {
|
|
2126
|
+
return invoke$1('SideBar.show', id, focus);
|
|
2127
|
+
};
|
|
2128
|
+
const closeWindow = async () => {
|
|
2129
|
+
return invoke$1('ElectronWindow.close');
|
|
2130
|
+
};
|
|
2131
|
+
const openExtensionSearch = async () => {
|
|
2132
|
+
return invoke$1('SideBar.openViewlet', 'Extensions');
|
|
2133
|
+
};
|
|
2134
|
+
const setExtensionsSearchValue = async searchValue => {
|
|
2135
|
+
return invoke$1('Extensions.handleInput', searchValue, Script);
|
|
2136
|
+
};
|
|
2137
|
+
const openExternal = async uri => {
|
|
2138
|
+
await invoke$1('Open.openExternal', uri);
|
|
2139
|
+
};
|
|
2140
|
+
const openUrl = async uri => {
|
|
2141
|
+
await invoke$1('Open.openUrl', uri);
|
|
2142
|
+
};
|
|
2143
|
+
const getAllPreferences = async () => {
|
|
2144
|
+
return invoke$1('Preferences.getAll');
|
|
2145
|
+
};
|
|
2146
|
+
const showSaveFilePicker = async () => {
|
|
2147
|
+
return invoke$1('FilePicker.showSaveFilePicker');
|
|
2148
|
+
};
|
|
2149
|
+
const getLogsDir = async () => {
|
|
2150
|
+
return invoke$1('PlatformPaths.getLogsDir');
|
|
2151
|
+
};
|
|
2152
|
+
const measureTextBlockHeight = async (actualInput, fontFamily, fontSize, lineHeightPx, width) => {
|
|
2153
|
+
return invoke$1(`MeasureTextHeight.measureTextBlockHeight`, actualInput, fontFamily, fontSize, lineHeightPx, width);
|
|
2154
|
+
};
|
|
2155
|
+
const refreshOutput = async () => {
|
|
2156
|
+
await invoke$1('Output.refresh');
|
|
2157
|
+
};
|
|
2158
|
+
const send = async (port, sourceId = 0) => {
|
|
2159
|
+
await sendMessagePortToOpenerWorker(port, sourceId);
|
|
2160
|
+
};
|
|
2161
|
+
const initializeOpenerWorker = async () => {
|
|
2162
|
+
const rpc = await create$5({
|
|
2163
|
+
commandMap: {},
|
|
2164
|
+
send
|
|
2165
|
+
});
|
|
2166
|
+
set$4(rpc);
|
|
2167
|
+
};
|
|
2168
|
+
const send2 = async port => {
|
|
2169
|
+
await sendMessagePortToEditorWorker(port, TestWorker);
|
|
2170
|
+
};
|
|
2171
|
+
const initializeEditorWorker = async () => {
|
|
2172
|
+
const rpc = await create$5({
|
|
2173
|
+
commandMap: {},
|
|
2174
|
+
send: send2
|
|
2175
|
+
});
|
|
2176
|
+
set$7(rpc);
|
|
2177
|
+
};
|
|
2178
|
+
const send3 = port => {
|
|
2179
|
+
return sendMessagePortToTextMeasurementWorker(port);
|
|
2180
|
+
};
|
|
2181
|
+
const initializeTextMeasurementWorker = async () => {
|
|
2182
|
+
const rpc = await create$5({
|
|
2183
|
+
commandMap: {},
|
|
2184
|
+
send: send3
|
|
2185
|
+
});
|
|
2186
|
+
set$3(rpc);
|
|
2187
|
+
};
|
|
2188
|
+
|
|
2189
|
+
const RendererWorker = {
|
|
2190
|
+
__proto__: null,
|
|
2191
|
+
activateByEvent,
|
|
2192
|
+
applyBulkReplacement,
|
|
2193
|
+
closeWidget,
|
|
2194
|
+
closeWindow,
|
|
2195
|
+
confirm,
|
|
2196
|
+
createViewlet,
|
|
2197
|
+
disableExtension,
|
|
2198
|
+
dispose,
|
|
2199
|
+
disposeEditor,
|
|
2200
|
+
enableExtension,
|
|
2201
|
+
getActiveEditorId,
|
|
2202
|
+
getAllExtensions,
|
|
2203
|
+
getAllPreferences,
|
|
2204
|
+
getBadgeCounts,
|
|
2205
|
+
getBlob,
|
|
2206
|
+
getChromeVersion,
|
|
2207
|
+
getColorThemeNames,
|
|
2208
|
+
getElectronVersion,
|
|
2209
|
+
getExtension,
|
|
2210
|
+
getExtensionCommands,
|
|
2211
|
+
getFileHandles,
|
|
2212
|
+
getFileIcon,
|
|
2213
|
+
getFilePathElectron,
|
|
2214
|
+
getFolderIcon,
|
|
2215
|
+
getFolderSize,
|
|
2216
|
+
getIcons,
|
|
2217
|
+
getKeyBindings,
|
|
2218
|
+
getLogsDir,
|
|
2219
|
+
getMarkdownDom,
|
|
2220
|
+
getNodeVersion,
|
|
2221
|
+
getPreference,
|
|
2222
|
+
getRecentlyOpened,
|
|
2223
|
+
getV8Version,
|
|
2224
|
+
getViewletModuleId,
|
|
2225
|
+
getWebViewSecret,
|
|
2226
|
+
getWindowId,
|
|
2227
|
+
getWorkspacePath,
|
|
2228
|
+
handleDebugChange,
|
|
2229
|
+
handleDebugPaused,
|
|
2230
|
+
handleDebugResumed,
|
|
2231
|
+
handleDebugScriptParsed,
|
|
2232
|
+
handleModifiedStatusChange,
|
|
2233
|
+
handleUriChange,
|
|
2234
|
+
handleWorkspaceRefresh,
|
|
2235
|
+
initializeEditorWorker,
|
|
2236
|
+
initializeOpenerWorker,
|
|
2237
|
+
initializeTextMeasurementWorker,
|
|
2238
|
+
installExtension,
|
|
2239
|
+
invoke: invoke$1,
|
|
2240
|
+
invokeAndTransfer,
|
|
2241
|
+
maximizeWindow,
|
|
2242
|
+
measureTextBlockHeight,
|
|
2243
|
+
minimizeWindow,
|
|
2244
|
+
openExtensionSearch,
|
|
2245
|
+
openExternal,
|
|
2246
|
+
openNativeFolder,
|
|
2247
|
+
openUri,
|
|
2248
|
+
openUrl,
|
|
2249
|
+
openWidget,
|
|
2250
|
+
readClipBoardText,
|
|
2251
|
+
readFile,
|
|
2252
|
+
refreshOutput,
|
|
2253
|
+
registerMockRpc,
|
|
2254
|
+
registerWebViewInterceptor,
|
|
2255
|
+
renderMarkdown,
|
|
2256
|
+
rerenderEditor,
|
|
2257
|
+
resizeViewlet,
|
|
2258
|
+
saveEditor,
|
|
2259
|
+
searchFileFetch,
|
|
2260
|
+
searchFileHtml,
|
|
2261
|
+
searchFileMemory,
|
|
2262
|
+
sendMessagePortToAuthProcess,
|
|
2263
|
+
sendMessagePortToAuthWorker,
|
|
2264
|
+
sendMessagePortToBlobWorker,
|
|
2265
|
+
sendMessagePortToChatCoordinatorWorker,
|
|
2266
|
+
sendMessagePortToChatDebugViewWorker,
|
|
2267
|
+
sendMessagePortToChatMathWorker,
|
|
2268
|
+
sendMessagePortToChatMessageParsingWorker,
|
|
2269
|
+
sendMessagePortToChatNetworkWorker,
|
|
2270
|
+
sendMessagePortToChatStorageWorker,
|
|
2271
|
+
sendMessagePortToChatToolWorker,
|
|
2272
|
+
sendMessagePortToChatViewModel,
|
|
2273
|
+
sendMessagePortToClipBoardWorker,
|
|
2274
|
+
sendMessagePortToDiffWorker,
|
|
2275
|
+
sendMessagePortToEditorWorker,
|
|
2276
|
+
sendMessagePortToErrorWorker: sendMessagePortToErrorWorker$1,
|
|
2277
|
+
sendMessagePortToExtensionHostWorker,
|
|
2278
|
+
sendMessagePortToExtensionManagementWorker,
|
|
2279
|
+
sendMessagePortToFileSearchWorker,
|
|
2280
|
+
sendMessagePortToFileSearchWorker2,
|
|
2281
|
+
sendMessagePortToFileSystemProcess,
|
|
2282
|
+
sendMessagePortToFileSystemWorker: sendMessagePortToFileSystemWorker$1,
|
|
2283
|
+
sendMessagePortToIconThemeWorker,
|
|
2284
|
+
sendMessagePortToIframeWorker,
|
|
2285
|
+
sendMessagePortToMainAreaWorker,
|
|
2286
|
+
sendMessagePortToMarkdownWorker,
|
|
2287
|
+
sendMessagePortToOpenerWorker,
|
|
2288
|
+
sendMessagePortToQuickPickWorker,
|
|
2289
|
+
sendMessagePortToRendererProcess,
|
|
2290
|
+
sendMessagePortToSearchProcess,
|
|
2291
|
+
sendMessagePortToSettingsWorker,
|
|
2292
|
+
sendMessagePortToSharedProcess,
|
|
2293
|
+
sendMessagePortToSourceControlWorker,
|
|
2294
|
+
sendMessagePortToSyntaxHighlightingWorker,
|
|
2295
|
+
sendMessagePortToTerminalProcess,
|
|
2296
|
+
sendMessagePortToTextMeasurementWorker,
|
|
2297
|
+
sendMessagePortToTextSearchWorker,
|
|
2298
|
+
set: set$2,
|
|
2299
|
+
setAdditionalFocus,
|
|
2300
|
+
setColorTheme,
|
|
2301
|
+
setExtensionsSearchValue,
|
|
2302
|
+
setFocus,
|
|
2303
|
+
setWebViewPort,
|
|
2304
|
+
setWorkspacePath,
|
|
2305
|
+
showContextMenu,
|
|
2306
|
+
showContextMenu2,
|
|
2307
|
+
showErrorDialog,
|
|
2308
|
+
showMessageBox,
|
|
2309
|
+
showPanel,
|
|
2310
|
+
showPreview,
|
|
2311
|
+
showSaveFilePicker,
|
|
2312
|
+
showSideBar,
|
|
2313
|
+
togglePanelView,
|
|
2314
|
+
uninstallExtension,
|
|
2315
|
+
unmaximizeWindow,
|
|
2316
|
+
unregisterWebViewInterceptor,
|
|
2317
|
+
writeClipBoardImage,
|
|
2318
|
+
writeClipBoardText,
|
|
2319
|
+
writeFile
|
|
2320
|
+
};
|
|
1571
2321
|
|
|
1572
2322
|
const isDebuggable = command => {
|
|
1573
2323
|
return command.includes('node ') || command.includes('node.exe') || command.includes('node.mojom.NodeService');
|
|
@@ -1626,12 +2376,67 @@ const handleFocus = state => {
|
|
|
1626
2376
|
};
|
|
1627
2377
|
};
|
|
1628
2378
|
|
|
2379
|
+
const sendMessagePortToProcessExplorer = async port => {
|
|
2380
|
+
const rendererWorker = RendererWorker;
|
|
2381
|
+
await rendererWorker.sendMessagePortToProcessExplorer(port);
|
|
2382
|
+
};
|
|
2383
|
+
|
|
2384
|
+
const launchProcessExplorerElectron = async () => {
|
|
2385
|
+
try {
|
|
2386
|
+
const rpc = await create$5({
|
|
2387
|
+
commandMap: {},
|
|
2388
|
+
send: sendMessagePortToProcessExplorer
|
|
2389
|
+
});
|
|
2390
|
+
return rpc;
|
|
2391
|
+
} catch (error) {
|
|
2392
|
+
throw new VError(error, 'Failed to create process explorer electron rpc');
|
|
2393
|
+
}
|
|
2394
|
+
};
|
|
2395
|
+
|
|
2396
|
+
const launchProcessExplorerNode = async () => {
|
|
2397
|
+
try {
|
|
2398
|
+
const rpc = await create$2({
|
|
2399
|
+
commandMap: {},
|
|
2400
|
+
type: 'process-explorer'
|
|
2401
|
+
});
|
|
2402
|
+
return rpc;
|
|
2403
|
+
} catch (error) {
|
|
2404
|
+
throw new VError(error, 'Failed to create process explorer websocket rpc');
|
|
2405
|
+
}
|
|
2406
|
+
};
|
|
2407
|
+
|
|
2408
|
+
const state$1 = {
|
|
2409
|
+
rpc: undefined
|
|
2410
|
+
};
|
|
1629
2411
|
const invoke = async (method, ...params) => {
|
|
1630
|
-
|
|
2412
|
+
if (!state$1.rpc) {
|
|
2413
|
+
throw new Error('ProcessExplorerModule is not initialized');
|
|
2414
|
+
}
|
|
2415
|
+
return state$1.rpc.invoke(method, ...params);
|
|
2416
|
+
};
|
|
2417
|
+
const set$1 = newRpc => {
|
|
2418
|
+
state$1.rpc = newRpc;
|
|
2419
|
+
};
|
|
2420
|
+
|
|
2421
|
+
const state = {
|
|
2422
|
+
initializedPlatform: 0
|
|
2423
|
+
};
|
|
2424
|
+
const initializeProcessExplorer = async platform => {
|
|
2425
|
+
if (state.initializedPlatform === platform) {
|
|
2426
|
+
return;
|
|
2427
|
+
}
|
|
2428
|
+
if (platform === Electron) {
|
|
2429
|
+
const rpc = await launchProcessExplorerElectron();
|
|
2430
|
+
set$1(rpc);
|
|
2431
|
+
state.initializedPlatform = platform;
|
|
2432
|
+
return;
|
|
2433
|
+
}
|
|
2434
|
+
if (platform === Remote) {
|
|
2435
|
+
const rpc = await launchProcessExplorerNode();
|
|
2436
|
+
set$1(rpc);
|
|
2437
|
+
state.initializedPlatform = platform;
|
|
2438
|
+
}
|
|
1631
2439
|
};
|
|
1632
|
-
const {
|
|
1633
|
-
set
|
|
1634
|
-
} = FileSystemWorker;
|
|
1635
2440
|
|
|
1636
2441
|
const getErrorMessage = error => {
|
|
1637
2442
|
if (error instanceof Error) {
|
|
@@ -1661,6 +2466,7 @@ const getFocusedIndex = (oldFocusedIndex, visibleProcesses) => {
|
|
|
1661
2466
|
};
|
|
1662
2467
|
const refresh = async state => {
|
|
1663
2468
|
try {
|
|
2469
|
+
await initializeProcessExplorer(state.platform);
|
|
1664
2470
|
const rootPid = state.rootPid || (await invoke('ProcessId.getMainProcessId'));
|
|
1665
2471
|
const processes = await invoke('ListProcessesWithMemoryUsage.listProcessesWithMemoryUsage', rootPid);
|
|
1666
2472
|
const visibleProcesses = getVisibleProcesses(processes, state.collapsedPids, rootPid);
|
|
@@ -1935,7 +2741,7 @@ const render2 = (uid, diffResult) => {
|
|
|
1935
2741
|
oldState,
|
|
1936
2742
|
scheduledState
|
|
1937
2743
|
} = get$2(uid);
|
|
1938
|
-
set$
|
|
2744
|
+
set$9(uid, scheduledState, scheduledState);
|
|
1939
2745
|
return applyRender(oldState, scheduledState, diffResult);
|
|
1940
2746
|
};
|
|
1941
2747
|
|
|
@@ -1966,7 +2772,7 @@ const renderEventListeners = () => {
|
|
|
1966
2772
|
|
|
1967
2773
|
const commandMap = {
|
|
1968
2774
|
'ProcessExplorer.collapseAll': wrapCommand(collapseAll),
|
|
1969
|
-
'ProcessExplorer.create': create$
|
|
2775
|
+
'ProcessExplorer.create': create$d,
|
|
1970
2776
|
'ProcessExplorer.diff2': diff2,
|
|
1971
2777
|
'ProcessExplorer.expandAll': wrapCommand(expandAll),
|
|
1972
2778
|
'ProcessExplorer.focusFirst': wrapCommand(focusFirst),
|
|
@@ -1974,7 +2780,7 @@ const commandMap = {
|
|
|
1974
2780
|
'ProcessExplorer.focusNext': wrapCommand(focusNext),
|
|
1975
2781
|
'ProcessExplorer.focusPrevious': wrapCommand(focusPrevious),
|
|
1976
2782
|
'ProcessExplorer.getCommandIds': getCommandIds,
|
|
1977
|
-
'ProcessExplorer.getKeyBindings': getKeyBindings,
|
|
2783
|
+
'ProcessExplorer.getKeyBindings': getKeyBindings$1,
|
|
1978
2784
|
'ProcessExplorer.handleArrowLeft': wrapCommand(handleArrowLeft),
|
|
1979
2785
|
'ProcessExplorer.handleArrowRight': wrapCommand(handleArrowRight),
|
|
1980
2786
|
'ProcessExplorer.handleBlur': wrapCommand(handleBlur),
|
|
@@ -1995,7 +2801,7 @@ const sendMessagePortToErrorWorker = async port => {
|
|
|
1995
2801
|
|
|
1996
2802
|
const createErrorWorkerRpc = async () => {
|
|
1997
2803
|
try {
|
|
1998
|
-
const rpc = await create$
|
|
2804
|
+
const rpc = await create$5({
|
|
1999
2805
|
commandMap: {},
|
|
2000
2806
|
send: sendMessagePortToErrorWorker
|
|
2001
2807
|
});
|
|
@@ -2007,7 +2813,7 @@ const createErrorWorkerRpc = async () => {
|
|
|
2007
2813
|
|
|
2008
2814
|
const initializeErrorWorker = async () => {
|
|
2009
2815
|
const rpc = await createErrorWorkerRpc();
|
|
2010
|
-
set$
|
|
2816
|
+
set$6(rpc);
|
|
2011
2817
|
};
|
|
2012
2818
|
|
|
2013
2819
|
const sendMessagePortToFileSystemWorker = async port => {
|
|
@@ -2016,7 +2822,7 @@ const sendMessagePortToFileSystemWorker = async port => {
|
|
|
2016
2822
|
|
|
2017
2823
|
const createFileSystemWorkerRpc = async () => {
|
|
2018
2824
|
try {
|
|
2019
|
-
const rpc = await create$
|
|
2825
|
+
const rpc = await create$5({
|
|
2020
2826
|
commandMap: {},
|
|
2021
2827
|
send: sendMessagePortToFileSystemWorker
|
|
2022
2828
|
});
|
|
@@ -2026,6 +2832,10 @@ const createFileSystemWorkerRpc = async () => {
|
|
|
2026
2832
|
}
|
|
2027
2833
|
};
|
|
2028
2834
|
|
|
2835
|
+
const {
|
|
2836
|
+
set
|
|
2837
|
+
} = FileSystemWorker;
|
|
2838
|
+
|
|
2029
2839
|
const initializeFileSystemWorker = async () => {
|
|
2030
2840
|
const rpc = await createFileSystemWorkerRpc();
|
|
2031
2841
|
set(rpc);
|
|
@@ -2035,7 +2845,7 @@ const initializeRendererWorker = async () => {
|
|
|
2035
2845
|
const rpc = await create$1({
|
|
2036
2846
|
commandMap: commandMap
|
|
2037
2847
|
});
|
|
2038
|
-
set$
|
|
2848
|
+
set$2(rpc);
|
|
2039
2849
|
};
|
|
2040
2850
|
|
|
2041
2851
|
const listen = async () => {
|