@lvce-editor/extension-host-worker 8.2.0 → 8.4.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/dist/extensionHostWorkerMain.js +320 -260
- package/package.json +1 -1
|
@@ -579,7 +579,7 @@ const registerMethod = ({
|
|
|
579
579
|
}
|
|
580
580
|
};
|
|
581
581
|
};
|
|
582
|
-
const create$
|
|
582
|
+
const create$c = ({
|
|
583
583
|
additionalMethodNames = [],
|
|
584
584
|
executeKey = '',
|
|
585
585
|
name,
|
|
@@ -632,7 +632,7 @@ const String$1 = 'string';
|
|
|
632
632
|
|
|
633
633
|
const {
|
|
634
634
|
executeBraceCompletionProvider,
|
|
635
|
-
registerBraceCompletionProvider} = create$
|
|
635
|
+
registerBraceCompletionProvider} = create$c({
|
|
636
636
|
name: 'BraceCompletion',
|
|
637
637
|
resultShape: {
|
|
638
638
|
type: Boolean$1
|
|
@@ -642,7 +642,7 @@ const {
|
|
|
642
642
|
const {
|
|
643
643
|
executeClosingTagProvider,
|
|
644
644
|
registerClosingTagProvider
|
|
645
|
-
} = create$
|
|
645
|
+
} = create$c({
|
|
646
646
|
name: 'ClosingTag',
|
|
647
647
|
resultShape: {
|
|
648
648
|
allowUndefined: true,
|
|
@@ -654,7 +654,7 @@ const {
|
|
|
654
654
|
const {
|
|
655
655
|
executeCodeActionProvider,
|
|
656
656
|
registerCodeActionProvider
|
|
657
|
-
} = create$
|
|
657
|
+
} = create$c({
|
|
658
658
|
name: 'CodeAction',
|
|
659
659
|
resultShape: {
|
|
660
660
|
items: {
|
|
@@ -736,7 +736,7 @@ const executeCommand$1 = async (id, ...args) => {
|
|
|
736
736
|
const {
|
|
737
737
|
executeCommentProvider,
|
|
738
738
|
registerCommentProvider
|
|
739
|
-
} = create$
|
|
739
|
+
} = create$c({
|
|
740
740
|
name: 'Comment',
|
|
741
741
|
resultShape() {
|
|
742
742
|
return '';
|
|
@@ -747,7 +747,7 @@ const {
|
|
|
747
747
|
executeCompletionProvider,
|
|
748
748
|
executeresolveCompletionItemProvider,
|
|
749
749
|
registerCompletionProvider
|
|
750
|
-
} = create$
|
|
750
|
+
} = create$c({
|
|
751
751
|
additionalMethodNames: [
|
|
752
752
|
// @ts-ignore
|
|
753
753
|
{
|
|
@@ -782,17 +782,14 @@ const ExtensionManagementWorker = 9006;
|
|
|
782
782
|
const RendererWorker$1 = 1;
|
|
783
783
|
|
|
784
784
|
const rpcs$2 = Object.create(null);
|
|
785
|
-
const set$
|
|
786
|
-
if (rpcs$2[id]) {
|
|
787
|
-
throw new Error(`rpc with id ${id} is already registered`);
|
|
788
|
-
}
|
|
785
|
+
const set$d = (id, rpc) => {
|
|
789
786
|
rpcs$2[id] = rpc;
|
|
790
787
|
};
|
|
791
788
|
const get$b = id => {
|
|
792
789
|
return rpcs$2[id];
|
|
793
790
|
};
|
|
794
791
|
|
|
795
|
-
const create$
|
|
792
|
+
const create$b = rpcId => {
|
|
796
793
|
return {
|
|
797
794
|
async dispose() {
|
|
798
795
|
const rpc = get$b(rpcId);
|
|
@@ -811,24 +808,24 @@ const create$9 = rpcId => {
|
|
|
811
808
|
return rpc.invokeAndTransfer(method, ...params);
|
|
812
809
|
},
|
|
813
810
|
set(rpc) {
|
|
814
|
-
set$
|
|
811
|
+
set$d(rpcId, rpc);
|
|
815
812
|
}
|
|
816
813
|
};
|
|
817
814
|
};
|
|
818
815
|
|
|
819
816
|
const {
|
|
820
817
|
dispose,
|
|
821
|
-
invoke: invoke$
|
|
822
|
-
invokeAndTransfer: invokeAndTransfer$
|
|
823
|
-
set: set$
|
|
824
|
-
} = create$
|
|
818
|
+
invoke: invoke$6,
|
|
819
|
+
invokeAndTransfer: invokeAndTransfer$4,
|
|
820
|
+
set: set$c
|
|
821
|
+
} = create$b(DebugWorker$1);
|
|
825
822
|
|
|
826
823
|
const DebugWorker = {
|
|
827
824
|
__proto__: null,
|
|
828
825
|
dispose,
|
|
829
|
-
invoke: invoke$
|
|
830
|
-
invokeAndTransfer: invokeAndTransfer$
|
|
831
|
-
set: set$
|
|
826
|
+
invoke: invoke$6,
|
|
827
|
+
invokeAndTransfer: invokeAndTransfer$4,
|
|
828
|
+
set: set$c
|
|
832
829
|
};
|
|
833
830
|
|
|
834
831
|
const isMessagePort = value => {
|
|
@@ -959,8 +956,8 @@ const getModuleNotFoundError = stderr => {
|
|
|
959
956
|
const messageIndex = lines.findIndex(isModuleNotFoundMessage);
|
|
960
957
|
const message = lines[messageIndex];
|
|
961
958
|
return {
|
|
962
|
-
|
|
963
|
-
|
|
959
|
+
code: ERR_MODULE_NOT_FOUND,
|
|
960
|
+
message
|
|
964
961
|
};
|
|
965
962
|
};
|
|
966
963
|
const isModuleNotFoundError = stderr => {
|
|
@@ -983,14 +980,14 @@ const isUnhelpfulNativeModuleError = stderr => {
|
|
|
983
980
|
const getNativeModuleErrorMessage = stderr => {
|
|
984
981
|
const message = getMessageCodeBlock(stderr);
|
|
985
982
|
return {
|
|
986
|
-
|
|
987
|
-
|
|
983
|
+
code: E_INCOMPATIBLE_NATIVE_MODULE,
|
|
984
|
+
message: `Incompatible native node module: ${message}`
|
|
988
985
|
};
|
|
989
986
|
};
|
|
990
987
|
const getModuleSyntaxError = () => {
|
|
991
988
|
return {
|
|
992
|
-
|
|
993
|
-
|
|
989
|
+
code: E_MODULES_NOT_SUPPORTED_IN_ELECTRON,
|
|
990
|
+
message: `ES Modules are not supported in electron`
|
|
994
991
|
};
|
|
995
992
|
};
|
|
996
993
|
const getHelpfulChildProcessError = (stdout, stderr) => {
|
|
@@ -1009,8 +1006,8 @@ const getHelpfulChildProcessError = (stdout, stderr) => {
|
|
|
1009
1006
|
rest
|
|
1010
1007
|
} = getDetails(lines);
|
|
1011
1008
|
return {
|
|
1012
|
-
message: actualMessage,
|
|
1013
1009
|
code: '',
|
|
1010
|
+
message: actualMessage,
|
|
1014
1011
|
stack: rest
|
|
1015
1012
|
};
|
|
1016
1013
|
};
|
|
@@ -1020,8 +1017,8 @@ class IpcError extends VError {
|
|
|
1020
1017
|
if (stdout || stderr) {
|
|
1021
1018
|
// @ts-ignore
|
|
1022
1019
|
const {
|
|
1023
|
-
message,
|
|
1024
1020
|
code,
|
|
1021
|
+
message,
|
|
1025
1022
|
stack
|
|
1026
1023
|
} = getHelpfulChildProcessError(stdout, stderr);
|
|
1027
1024
|
const cause = new Error(message);
|
|
@@ -1121,8 +1118,8 @@ const wrap$f = global => {
|
|
|
1121
1118
|
};
|
|
1122
1119
|
const waitForFirstMessage = async port => {
|
|
1123
1120
|
const {
|
|
1124
|
-
|
|
1125
|
-
|
|
1121
|
+
promise,
|
|
1122
|
+
resolve
|
|
1126
1123
|
} = Promise.withResolvers();
|
|
1127
1124
|
port.addEventListener('message', resolve, {
|
|
1128
1125
|
once: true
|
|
@@ -1142,8 +1139,8 @@ const listen$6 = async () => {
|
|
|
1142
1139
|
const type = firstMessage.params[0];
|
|
1143
1140
|
if (type === 'message-port') {
|
|
1144
1141
|
parentIpc.send({
|
|
1145
|
-
jsonrpc: '2.0',
|
|
1146
1142
|
id: firstMessage.id,
|
|
1143
|
+
jsonrpc: '2.0',
|
|
1147
1144
|
result: null
|
|
1148
1145
|
});
|
|
1149
1146
|
parentIpc.dispose();
|
|
@@ -1203,8 +1200,8 @@ const removeListener = (emitter, type, callback) => {
|
|
|
1203
1200
|
};
|
|
1204
1201
|
const getFirstEvent = (eventEmitter, eventMap) => {
|
|
1205
1202
|
const {
|
|
1206
|
-
|
|
1207
|
-
|
|
1203
|
+
promise,
|
|
1204
|
+
resolve
|
|
1208
1205
|
} = Promise.withResolvers();
|
|
1209
1206
|
const listenerMap = Object.create(null);
|
|
1210
1207
|
const cleanup = value => {
|
|
@@ -1216,8 +1213,8 @@ const getFirstEvent = (eventEmitter, eventMap) => {
|
|
|
1216
1213
|
for (const [event, type] of Object.entries(eventMap)) {
|
|
1217
1214
|
const listener = event => {
|
|
1218
1215
|
cleanup({
|
|
1219
|
-
|
|
1220
|
-
|
|
1216
|
+
event,
|
|
1217
|
+
type
|
|
1221
1218
|
});
|
|
1222
1219
|
};
|
|
1223
1220
|
addListener(eventEmitter, event, listener);
|
|
@@ -1227,8 +1224,8 @@ const getFirstEvent = (eventEmitter, eventMap) => {
|
|
|
1227
1224
|
};
|
|
1228
1225
|
const Message$1 = 3;
|
|
1229
1226
|
const create$5$2 = async ({
|
|
1230
|
-
|
|
1231
|
-
|
|
1227
|
+
isMessagePortOpen,
|
|
1228
|
+
messagePort
|
|
1232
1229
|
}) => {
|
|
1233
1230
|
if (!isMessagePort(messagePort)) {
|
|
1234
1231
|
throw new IpcError('port must be of type MessagePort');
|
|
@@ -1241,8 +1238,8 @@ const create$5$2 = async ({
|
|
|
1241
1238
|
});
|
|
1242
1239
|
messagePort.start();
|
|
1243
1240
|
const {
|
|
1244
|
-
|
|
1245
|
-
|
|
1241
|
+
event,
|
|
1242
|
+
type
|
|
1246
1243
|
} = await eventPromise;
|
|
1247
1244
|
if (type !== Message$1) {
|
|
1248
1245
|
throw new IpcError('Failed to wait for ipc message');
|
|
@@ -1296,12 +1293,12 @@ const parse$1 = content => {
|
|
|
1296
1293
|
};
|
|
1297
1294
|
const waitForWebSocketToBeOpen = webSocket => {
|
|
1298
1295
|
return getFirstEvent(webSocket, {
|
|
1299
|
-
open: Open,
|
|
1300
1296
|
close: Close,
|
|
1301
|
-
error: Error$3
|
|
1297
|
+
error: Error$3,
|
|
1298
|
+
open: Open
|
|
1302
1299
|
});
|
|
1303
1300
|
};
|
|
1304
|
-
const create$
|
|
1301
|
+
const create$a = async ({
|
|
1305
1302
|
webSocket
|
|
1306
1303
|
}) => {
|
|
1307
1304
|
const firstWebSocketEvent = await waitForWebSocketToBeOpen(webSocket);
|
|
@@ -1338,60 +1335,18 @@ const wrap$1 = webSocket => {
|
|
|
1338
1335
|
};
|
|
1339
1336
|
const IpcParentWithWebSocket$1$1 = {
|
|
1340
1337
|
__proto__: null,
|
|
1341
|
-
create: create$
|
|
1338
|
+
create: create$a,
|
|
1342
1339
|
wrap: wrap$1
|
|
1343
1340
|
};
|
|
1344
1341
|
|
|
1345
|
-
const Two = '2.0';
|
|
1346
|
-
const create$4$2 = (method, params) => {
|
|
1347
|
-
return {
|
|
1348
|
-
jsonrpc: Two,
|
|
1349
|
-
method,
|
|
1350
|
-
params
|
|
1351
|
-
};
|
|
1352
|
-
};
|
|
1342
|
+
const Two$1 = '2.0';
|
|
1353
1343
|
const callbacks = Object.create(null);
|
|
1354
|
-
const set$a = (id, fn) => {
|
|
1355
|
-
callbacks[id] = fn;
|
|
1356
|
-
};
|
|
1357
1344
|
const get$a = id => {
|
|
1358
1345
|
return callbacks[id];
|
|
1359
1346
|
};
|
|
1360
1347
|
const remove$4 = id => {
|
|
1361
1348
|
delete callbacks[id];
|
|
1362
1349
|
};
|
|
1363
|
-
let id$1 = 0;
|
|
1364
|
-
const create$3$2 = () => {
|
|
1365
|
-
return ++id$1;
|
|
1366
|
-
};
|
|
1367
|
-
const registerPromise = () => {
|
|
1368
|
-
const id = create$3$2();
|
|
1369
|
-
const {
|
|
1370
|
-
resolve,
|
|
1371
|
-
promise
|
|
1372
|
-
} = Promise.withResolvers();
|
|
1373
|
-
set$a(id, resolve);
|
|
1374
|
-
return {
|
|
1375
|
-
id,
|
|
1376
|
-
promise
|
|
1377
|
-
};
|
|
1378
|
-
};
|
|
1379
|
-
const create$2$2 = (method, params) => {
|
|
1380
|
-
const {
|
|
1381
|
-
id,
|
|
1382
|
-
promise
|
|
1383
|
-
} = registerPromise();
|
|
1384
|
-
const message = {
|
|
1385
|
-
jsonrpc: Two,
|
|
1386
|
-
method,
|
|
1387
|
-
params,
|
|
1388
|
-
id
|
|
1389
|
-
};
|
|
1390
|
-
return {
|
|
1391
|
-
message,
|
|
1392
|
-
promise
|
|
1393
|
-
};
|
|
1394
|
-
};
|
|
1395
1350
|
class JsonRpcError extends Error {
|
|
1396
1351
|
constructor(message) {
|
|
1397
1352
|
super(message);
|
|
@@ -1587,7 +1542,7 @@ const getErrorProperty = (error, prettyError) => {
|
|
|
1587
1542
|
};
|
|
1588
1543
|
const create$1$1 = (id, error) => {
|
|
1589
1544
|
return {
|
|
1590
|
-
jsonrpc: Two,
|
|
1545
|
+
jsonrpc: Two$1,
|
|
1591
1546
|
id,
|
|
1592
1547
|
error
|
|
1593
1548
|
};
|
|
@@ -1598,20 +1553,20 @@ const getErrorResponse = (id, error, preparePrettyError, logError) => {
|
|
|
1598
1553
|
const errorProperty = getErrorProperty(error, prettyError);
|
|
1599
1554
|
return create$1$1(id, errorProperty);
|
|
1600
1555
|
};
|
|
1601
|
-
const create$
|
|
1556
|
+
const create$9 = (message, result) => {
|
|
1602
1557
|
return {
|
|
1603
|
-
jsonrpc: Two,
|
|
1558
|
+
jsonrpc: Two$1,
|
|
1604
1559
|
id: message.id,
|
|
1605
1560
|
result: result ?? null
|
|
1606
1561
|
};
|
|
1607
1562
|
};
|
|
1608
1563
|
const getSuccessResponse = (message, result) => {
|
|
1609
1564
|
const resultProperty = result ?? null;
|
|
1610
|
-
return create$
|
|
1565
|
+
return create$9(message, resultProperty);
|
|
1611
1566
|
};
|
|
1612
1567
|
const getErrorResponseSimple = (id, error) => {
|
|
1613
1568
|
return {
|
|
1614
|
-
jsonrpc: Two,
|
|
1569
|
+
jsonrpc: Two$1,
|
|
1615
1570
|
id,
|
|
1616
1571
|
error: {
|
|
1617
1572
|
code: Custom,
|
|
@@ -1698,29 +1653,6 @@ const handleJsonRpcMessage = async (...args) => {
|
|
|
1698
1653
|
}
|
|
1699
1654
|
throw new JsonRpcError('unexpected message');
|
|
1700
1655
|
};
|
|
1701
|
-
const invokeHelper = async (ipc, method, params, useSendAndTransfer) => {
|
|
1702
|
-
const {
|
|
1703
|
-
message,
|
|
1704
|
-
promise
|
|
1705
|
-
} = create$2$2(method, params);
|
|
1706
|
-
if (useSendAndTransfer && ipc.sendAndTransfer) {
|
|
1707
|
-
ipc.sendAndTransfer(message);
|
|
1708
|
-
} else {
|
|
1709
|
-
ipc.send(message);
|
|
1710
|
-
}
|
|
1711
|
-
const responseMessage = await promise;
|
|
1712
|
-
return unwrapJsonRpcResult(responseMessage);
|
|
1713
|
-
};
|
|
1714
|
-
const send$1 = (transport, method, ...params) => {
|
|
1715
|
-
const message = create$4$2(method, params);
|
|
1716
|
-
transport.send(message);
|
|
1717
|
-
};
|
|
1718
|
-
const invoke$6 = (ipc, method, ...params) => {
|
|
1719
|
-
return invokeHelper(ipc, method, params, false);
|
|
1720
|
-
};
|
|
1721
|
-
const invokeAndTransfer$4 = (ipc, method, ...params) => {
|
|
1722
|
-
return invokeHelper(ipc, method, params, true);
|
|
1723
|
-
};
|
|
1724
1656
|
|
|
1725
1657
|
class CommandNotFoundError extends Error {
|
|
1726
1658
|
constructor(command) {
|
|
@@ -1743,24 +1675,87 @@ const execute = (command, ...args) => {
|
|
|
1743
1675
|
return fn(...args);
|
|
1744
1676
|
};
|
|
1745
1677
|
|
|
1678
|
+
const Two = '2.0';
|
|
1679
|
+
const create$p = (method, params) => {
|
|
1680
|
+
return {
|
|
1681
|
+
jsonrpc: Two,
|
|
1682
|
+
method,
|
|
1683
|
+
params
|
|
1684
|
+
};
|
|
1685
|
+
};
|
|
1686
|
+
const create$o = (id, method, params) => {
|
|
1687
|
+
const message = {
|
|
1688
|
+
id,
|
|
1689
|
+
jsonrpc: Two,
|
|
1690
|
+
method,
|
|
1691
|
+
params
|
|
1692
|
+
};
|
|
1693
|
+
return message;
|
|
1694
|
+
};
|
|
1695
|
+
let id$2 = 0;
|
|
1696
|
+
const create$n = () => {
|
|
1697
|
+
return ++id$2;
|
|
1698
|
+
};
|
|
1699
|
+
|
|
1700
|
+
/* eslint-disable n/no-unsupported-features/es-syntax */
|
|
1701
|
+
|
|
1702
|
+
const registerPromise = map => {
|
|
1703
|
+
const id = create$n();
|
|
1704
|
+
const {
|
|
1705
|
+
promise,
|
|
1706
|
+
resolve
|
|
1707
|
+
} = Promise.withResolvers();
|
|
1708
|
+
map[id] = resolve;
|
|
1709
|
+
return {
|
|
1710
|
+
id,
|
|
1711
|
+
promise
|
|
1712
|
+
};
|
|
1713
|
+
};
|
|
1714
|
+
|
|
1715
|
+
// @ts-ignore
|
|
1716
|
+
const invokeHelper = async (callbacks, ipc, method, params, useSendAndTransfer) => {
|
|
1717
|
+
const {
|
|
1718
|
+
id,
|
|
1719
|
+
promise
|
|
1720
|
+
} = registerPromise(callbacks);
|
|
1721
|
+
const message = create$o(id, method, params);
|
|
1722
|
+
if (useSendAndTransfer && ipc.sendAndTransfer) {
|
|
1723
|
+
ipc.sendAndTransfer(message);
|
|
1724
|
+
} else {
|
|
1725
|
+
ipc.send(message);
|
|
1726
|
+
}
|
|
1727
|
+
const responseMessage = await promise;
|
|
1728
|
+
return unwrapJsonRpcResult(responseMessage);
|
|
1729
|
+
};
|
|
1746
1730
|
const createRpc$1 = ipc => {
|
|
1731
|
+
const callbacks = Object.create(null);
|
|
1732
|
+
ipc._resolve = (id, response) => {
|
|
1733
|
+
const fn = callbacks[id];
|
|
1734
|
+
if (!fn) {
|
|
1735
|
+
console.warn(`callback ${id} may already be disposed`);
|
|
1736
|
+
return;
|
|
1737
|
+
}
|
|
1738
|
+
fn(response);
|
|
1739
|
+
delete callbacks[id];
|
|
1740
|
+
};
|
|
1747
1741
|
const rpc = {
|
|
1742
|
+
async dispose() {
|
|
1743
|
+
await ipc?.dispose();
|
|
1744
|
+
},
|
|
1745
|
+
invoke(method, ...params) {
|
|
1746
|
+
return invokeHelper(callbacks, ipc, method, params, false);
|
|
1747
|
+
},
|
|
1748
|
+
invokeAndTransfer(method, ...params) {
|
|
1749
|
+
return invokeHelper(callbacks, ipc, method, params, true);
|
|
1750
|
+
},
|
|
1748
1751
|
// @ts-ignore
|
|
1749
1752
|
ipc,
|
|
1750
1753
|
/**
|
|
1751
1754
|
* @deprecated
|
|
1752
1755
|
*/
|
|
1753
1756
|
send(method, ...params) {
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
invoke(method, ...params) {
|
|
1757
|
-
return invoke$6(ipc, method, ...params);
|
|
1758
|
-
},
|
|
1759
|
-
invokeAndTransfer(method, ...params) {
|
|
1760
|
-
return invokeAndTransfer$4(ipc, method, ...params);
|
|
1761
|
-
},
|
|
1762
|
-
async dispose() {
|
|
1763
|
-
await ipc?.dispose();
|
|
1757
|
+
const message = create$p(method, params);
|
|
1758
|
+
ipc.send(message);
|
|
1764
1759
|
}
|
|
1765
1760
|
};
|
|
1766
1761
|
return rpc;
|
|
@@ -1777,7 +1772,7 @@ const logError = () => {
|
|
|
1777
1772
|
const handleMessage = event => {
|
|
1778
1773
|
const actualRequiresSocket = event?.target?.requiresSocket || requiresSocket;
|
|
1779
1774
|
const actualExecute = event?.target?.execute || execute;
|
|
1780
|
-
return handleJsonRpcMessage(event.target, event.data, actualExecute,
|
|
1775
|
+
return handleJsonRpcMessage(event.target, event.data, actualExecute, event.target._resolve, preparePrettyError, logError, actualRequiresSocket);
|
|
1781
1776
|
};
|
|
1782
1777
|
const handleIpc = ipc => {
|
|
1783
1778
|
if ('addEventListener' in ipc) {
|
|
@@ -1795,7 +1790,7 @@ const listen$1 = async (module, options) => {
|
|
|
1795
1790
|
const ipc = module.wrap(rawIpc);
|
|
1796
1791
|
return ipc;
|
|
1797
1792
|
};
|
|
1798
|
-
const create$
|
|
1793
|
+
const create$h = async ({
|
|
1799
1794
|
commandMap,
|
|
1800
1795
|
messagePort
|
|
1801
1796
|
}) => {
|
|
@@ -1810,18 +1805,18 @@ const create$f = async ({
|
|
|
1810
1805
|
};
|
|
1811
1806
|
const MessagePortRpcClient = {
|
|
1812
1807
|
__proto__: null,
|
|
1813
|
-
create: create$
|
|
1808
|
+
create: create$h
|
|
1814
1809
|
};
|
|
1815
|
-
const create$
|
|
1810
|
+
const create$g = async ({
|
|
1816
1811
|
commandMap,
|
|
1817
|
-
|
|
1818
|
-
|
|
1812
|
+
isMessagePortOpen,
|
|
1813
|
+
messagePort
|
|
1819
1814
|
}) => {
|
|
1820
1815
|
// TODO create a commandMap per rpc instance
|
|
1821
1816
|
register$1(commandMap);
|
|
1822
1817
|
const rawIpc = await IpcParentWithMessagePort$1.create({
|
|
1823
|
-
|
|
1824
|
-
|
|
1818
|
+
isMessagePortOpen,
|
|
1819
|
+
messagePort
|
|
1825
1820
|
});
|
|
1826
1821
|
const ipc = IpcParentWithMessagePort$1.wrap(rawIpc);
|
|
1827
1822
|
handleIpc(ipc);
|
|
@@ -1830,17 +1825,18 @@ const create$e = async ({
|
|
|
1830
1825
|
};
|
|
1831
1826
|
const MessagePortRpcParent = {
|
|
1832
1827
|
__proto__: null,
|
|
1833
|
-
create: create$
|
|
1828
|
+
create: create$g
|
|
1834
1829
|
};
|
|
1835
|
-
const create$
|
|
1830
|
+
const create$7 = async ({
|
|
1836
1831
|
commandMap,
|
|
1832
|
+
isMessagePortOpen = true,
|
|
1837
1833
|
messagePort
|
|
1838
1834
|
}) => {
|
|
1839
1835
|
// TODO create a commandMap per rpc instance
|
|
1840
1836
|
register$1(commandMap);
|
|
1841
1837
|
const rawIpc = await IpcParentWithMessagePort$1.create({
|
|
1842
|
-
|
|
1843
|
-
|
|
1838
|
+
isMessagePortOpen,
|
|
1839
|
+
messagePort
|
|
1844
1840
|
});
|
|
1845
1841
|
const ipc = IpcParentWithMessagePort$1.wrap(rawIpc);
|
|
1846
1842
|
handleIpc(ipc);
|
|
@@ -1848,21 +1844,22 @@ const create$5$1 = async ({
|
|
|
1848
1844
|
messagePort.start();
|
|
1849
1845
|
return rpc;
|
|
1850
1846
|
};
|
|
1851
|
-
const create$
|
|
1847
|
+
const create$6$1 = async ({
|
|
1852
1848
|
commandMap,
|
|
1853
1849
|
messagePort
|
|
1854
1850
|
}) => {
|
|
1855
|
-
return create$
|
|
1851
|
+
return create$7({
|
|
1856
1852
|
commandMap,
|
|
1857
1853
|
messagePort
|
|
1858
1854
|
});
|
|
1859
1855
|
};
|
|
1860
1856
|
const PlainMessagePortRpcParent = {
|
|
1861
1857
|
__proto__: null,
|
|
1862
|
-
create: create$
|
|
1858
|
+
create: create$6$1
|
|
1863
1859
|
};
|
|
1864
|
-
const create$
|
|
1860
|
+
const create$5$1 = async ({
|
|
1865
1861
|
commandMap,
|
|
1862
|
+
isMessagePortOpen,
|
|
1866
1863
|
send
|
|
1867
1864
|
}) => {
|
|
1868
1865
|
const {
|
|
@@ -1870,16 +1867,17 @@ const create$3$1 = async ({
|
|
|
1870
1867
|
port2
|
|
1871
1868
|
} = new MessageChannel();
|
|
1872
1869
|
await send(port1);
|
|
1873
|
-
return create$
|
|
1870
|
+
return create$7({
|
|
1874
1871
|
commandMap,
|
|
1872
|
+
isMessagePortOpen,
|
|
1875
1873
|
messagePort: port2
|
|
1876
1874
|
});
|
|
1877
1875
|
};
|
|
1878
1876
|
const TransferMessagePortRpcParent = {
|
|
1879
1877
|
__proto__: null,
|
|
1880
|
-
create: create$
|
|
1878
|
+
create: create$5$1
|
|
1881
1879
|
};
|
|
1882
|
-
const create$
|
|
1880
|
+
const create$4$1 = async ({
|
|
1883
1881
|
commandMap,
|
|
1884
1882
|
webSocket
|
|
1885
1883
|
}) => {
|
|
@@ -1895,9 +1893,9 @@ const create$2$1 = async ({
|
|
|
1895
1893
|
};
|
|
1896
1894
|
const WebSocketRpcParent = {
|
|
1897
1895
|
__proto__: null,
|
|
1898
|
-
create: create$
|
|
1896
|
+
create: create$4$1
|
|
1899
1897
|
};
|
|
1900
|
-
const create$
|
|
1898
|
+
const create$2$1 = async ({
|
|
1901
1899
|
commandMap
|
|
1902
1900
|
}) => {
|
|
1903
1901
|
// TODO create a commandMap per rpc instance
|
|
@@ -1909,56 +1907,80 @@ const create$6 = async ({
|
|
|
1909
1907
|
};
|
|
1910
1908
|
const WebWorkerRpcClient = {
|
|
1911
1909
|
__proto__: null,
|
|
1912
|
-
create: create$
|
|
1910
|
+
create: create$2$1
|
|
1913
1911
|
};
|
|
1914
1912
|
|
|
1915
|
-
|
|
1916
|
-
invoke: invoke$5} = create$9(ExtensionManagementWorker);
|
|
1917
|
-
|
|
1918
|
-
const {
|
|
1919
|
-
invoke: invoke$4,
|
|
1920
|
-
invokeAndTransfer: invokeAndTransfer$3} = create$9(RendererWorker$1);
|
|
1921
|
-
const sendMessagePortToIframeWorker = async (port, rpcId) => {
|
|
1922
|
-
const command = 'Iframes.handleMessagePort';
|
|
1923
|
-
await invokeAndTransfer$3('SendMessagePortToExtensionHostWorker.sendMessagePortToIframeWorker', port, command, rpcId);
|
|
1924
|
-
};
|
|
1925
|
-
const sendMessagePortToExtensionManagementWorker = async (port, rpcId) => {
|
|
1926
|
-
const command = 'Extensions.handleMessagePort';
|
|
1927
|
-
await invokeAndTransfer$3('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionManagementWorker', port, command, rpcId);
|
|
1928
|
-
};
|
|
1913
|
+
/* eslint-disable @typescript-eslint/no-misused-promises */
|
|
1929
1914
|
|
|
1930
|
-
const
|
|
1915
|
+
const create$8 = async ({
|
|
1916
|
+
commandMap,
|
|
1917
|
+
isMessagePortOpen,
|
|
1918
|
+
send
|
|
1919
|
+
}) => {
|
|
1931
1920
|
let rpcPromise;
|
|
1932
|
-
|
|
1933
|
-
const createRpc = async () => {
|
|
1934
|
-
const rpc = await factory();
|
|
1935
|
-
set$c(rpcId, rpc);
|
|
1936
|
-
};
|
|
1937
|
-
const ensureRpc = async () => {
|
|
1921
|
+
const getOrCreate = () => {
|
|
1938
1922
|
if (!rpcPromise) {
|
|
1939
|
-
rpcPromise =
|
|
1923
|
+
rpcPromise = create$5$1({
|
|
1924
|
+
commandMap,
|
|
1925
|
+
isMessagePortOpen,
|
|
1926
|
+
send
|
|
1927
|
+
});
|
|
1940
1928
|
}
|
|
1941
|
-
|
|
1929
|
+
return rpcPromise;
|
|
1942
1930
|
};
|
|
1943
1931
|
return {
|
|
1932
|
+
async dispose() {
|
|
1933
|
+
const rpc = await getOrCreate();
|
|
1934
|
+
await rpc.dispose();
|
|
1935
|
+
},
|
|
1944
1936
|
async invoke(method, ...params) {
|
|
1945
|
-
await
|
|
1946
|
-
const rpc = get$b(rpcId);
|
|
1937
|
+
const rpc = await getOrCreate();
|
|
1947
1938
|
return rpc.invoke(method, ...params);
|
|
1948
1939
|
},
|
|
1949
1940
|
async invokeAndTransfer(method, ...params) {
|
|
1950
|
-
await
|
|
1951
|
-
const rpc = get$b(rpcId);
|
|
1941
|
+
const rpc = await getOrCreate();
|
|
1952
1942
|
return rpc.invokeAndTransfer(method, ...params);
|
|
1953
1943
|
},
|
|
1954
|
-
|
|
1955
|
-
|
|
1944
|
+
async send(method, ...params) {
|
|
1945
|
+
const rpc = await getOrCreate();
|
|
1946
|
+
rpc.send(method, ...params);
|
|
1956
1947
|
}
|
|
1957
1948
|
};
|
|
1958
1949
|
};
|
|
1950
|
+
const LazyTransferMessagePortRpcParent = {
|
|
1951
|
+
__proto__: null,
|
|
1952
|
+
create: create$8
|
|
1953
|
+
};
|
|
1954
|
+
|
|
1955
|
+
const {
|
|
1956
|
+
invoke: invoke$5,
|
|
1957
|
+
invokeAndTransfer: invokeAndTransfer$3,
|
|
1958
|
+
set: set$b
|
|
1959
|
+
} = create$b(ExtensionManagementWorker);
|
|
1960
|
+
|
|
1961
|
+
const {
|
|
1962
|
+
invoke: invoke$4,
|
|
1963
|
+
set: set$a
|
|
1964
|
+
} = create$b(7013);
|
|
1965
|
+
|
|
1966
|
+
const {
|
|
1967
|
+
invoke: invoke$3,
|
|
1968
|
+
invokeAndTransfer: invokeAndTransfer$2} = create$b(RendererWorker$1);
|
|
1969
|
+
const sendMessagePortToFileSearchWorker = async (port, rpcId = 0) => {
|
|
1970
|
+
const command = 'QuickPick.handleMessagePort';
|
|
1971
|
+
await invokeAndTransfer$2('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSearchWorker', port, command, rpcId);
|
|
1972
|
+
};
|
|
1973
|
+
const sendMessagePortToIframeWorker = async (port, rpcId) => {
|
|
1974
|
+
const command = 'Iframes.handleMessagePort';
|
|
1975
|
+
await invokeAndTransfer$2('SendMessagePortToExtensionHostWorker.sendMessagePortToIframeWorker', port, command, rpcId);
|
|
1976
|
+
};
|
|
1977
|
+
const sendMessagePortToExtensionManagementWorker = async (port, rpcId) => {
|
|
1978
|
+
const command = 'Extensions.handleMessagePort';
|
|
1979
|
+
await invokeAndTransfer$2('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionManagementWorker', port, command, rpcId);
|
|
1980
|
+
};
|
|
1959
1981
|
|
|
1960
1982
|
const {
|
|
1961
|
-
invoke: invoke$
|
|
1983
|
+
invoke: invoke$2
|
|
1962
1984
|
} = DebugWorker;
|
|
1963
1985
|
|
|
1964
1986
|
const state$8 = {
|
|
@@ -1980,20 +2002,20 @@ const registerDebugProvider = debugProvider => {
|
|
|
1980
2002
|
};
|
|
1981
2003
|
const handlePaused = async params => {
|
|
1982
2004
|
// @ts-ignore
|
|
1983
|
-
await invoke$
|
|
2005
|
+
await invoke$2('Debug.paused', params);
|
|
1984
2006
|
};
|
|
1985
2007
|
const handleResumed = async () => {
|
|
1986
2008
|
// @ts-ignore
|
|
1987
|
-
await invoke$
|
|
2009
|
+
await invoke$2('Debug.resumed');
|
|
1988
2010
|
};
|
|
1989
2011
|
const handleScriptParsed = async parsedScript => {
|
|
1990
2012
|
// @ts-ignore
|
|
1991
|
-
await invoke$
|
|
2013
|
+
await invoke$2('Debug.scriptParsed', parsedScript);
|
|
1992
2014
|
};
|
|
1993
2015
|
const handleChange = async params => {
|
|
1994
2016
|
object(params);
|
|
1995
2017
|
// @ts-ignore
|
|
1996
|
-
await invoke$
|
|
2018
|
+
await invoke$2('Debug.handleChange', params);
|
|
1997
2019
|
};
|
|
1998
2020
|
const start = async (protocol, path) => {
|
|
1999
2021
|
try {
|
|
@@ -2145,7 +2167,7 @@ const setPauseOnExceptions = async (protocol, value) => {
|
|
|
2145
2167
|
|
|
2146
2168
|
const {
|
|
2147
2169
|
executeDefinitionProvider,
|
|
2148
|
-
registerDefinitionProvider} = create$
|
|
2170
|
+
registerDefinitionProvider} = create$c({
|
|
2149
2171
|
name: 'Definition',
|
|
2150
2172
|
resultShape: {
|
|
2151
2173
|
allowUndefined: true,
|
|
@@ -2167,7 +2189,7 @@ const {
|
|
|
2167
2189
|
const {
|
|
2168
2190
|
executeDiagnosticProvider,
|
|
2169
2191
|
registerDiagnosticProvider
|
|
2170
|
-
} = create$
|
|
2192
|
+
} = create$c({
|
|
2171
2193
|
name: 'Diagnostic',
|
|
2172
2194
|
resultShape: {
|
|
2173
2195
|
items: {
|
|
@@ -2179,18 +2201,18 @@ const {
|
|
|
2179
2201
|
|
|
2180
2202
|
const RendererWorker = 1;
|
|
2181
2203
|
|
|
2182
|
-
const invoke$
|
|
2204
|
+
const invoke$1 = (method, ...params) => {
|
|
2183
2205
|
const rpc = get$b(RendererWorker);
|
|
2184
2206
|
return rpc.invoke(method, ...params);
|
|
2185
2207
|
};
|
|
2186
|
-
const invokeAndTransfer$
|
|
2208
|
+
const invokeAndTransfer$1 = (method, ...params) => {
|
|
2187
2209
|
const rpc = get$b(RendererWorker);
|
|
2188
2210
|
return rpc.invokeAndTransfer(method, ...params);
|
|
2189
2211
|
};
|
|
2190
2212
|
|
|
2191
2213
|
const showInformationMessage = message => {
|
|
2192
2214
|
string(message);
|
|
2193
|
-
const result = invoke$
|
|
2215
|
+
const result = invoke$1('ExtensionHostDialog.showInformationMessage', message);
|
|
2194
2216
|
return result;
|
|
2195
2217
|
};
|
|
2196
2218
|
|
|
@@ -2253,24 +2275,24 @@ const readFileExternal = async path => {
|
|
|
2253
2275
|
// this avoid parsing the potentially large message
|
|
2254
2276
|
// and improve performance by not blocking the renderer worker
|
|
2255
2277
|
// when reading / writing large files
|
|
2256
|
-
const content = await invoke$
|
|
2278
|
+
const content = await invoke$1('FileSystem.readFile', path);
|
|
2257
2279
|
return content;
|
|
2258
2280
|
};
|
|
2259
2281
|
const removeExternal = async path => {
|
|
2260
|
-
const content = await invoke$
|
|
2282
|
+
const content = await invoke$1('FileSystem.remove', path);
|
|
2261
2283
|
return content;
|
|
2262
2284
|
};
|
|
2263
2285
|
const existsExternal = async uri => {
|
|
2264
|
-
return await invoke$
|
|
2286
|
+
return await invoke$1('FileSystem.exists', uri);
|
|
2265
2287
|
};
|
|
2266
2288
|
const mkdirExternal = async uri => {
|
|
2267
|
-
return await invoke$
|
|
2289
|
+
return await invoke$1('FileSystem.mkdir', uri);
|
|
2268
2290
|
};
|
|
2269
2291
|
const writeFileExternal = async (uri, content) => {
|
|
2270
|
-
return await invoke$
|
|
2292
|
+
return await invoke$1('FileSystem.writeFile', uri, content);
|
|
2271
2293
|
};
|
|
2272
2294
|
const statExternal = async uri => {
|
|
2273
|
-
return await invoke$
|
|
2295
|
+
return await invoke$1('FileSystem.stat', uri);
|
|
2274
2296
|
};
|
|
2275
2297
|
const readDirWithFileTypesExternal = async path => {
|
|
2276
2298
|
// TODO when file is local,
|
|
@@ -2279,7 +2301,7 @@ const readDirWithFileTypesExternal = async path => {
|
|
|
2279
2301
|
// this avoid parsing the potentially large message
|
|
2280
2302
|
// and improve performance by not blocking the renderer worker
|
|
2281
2303
|
// when reading / writing large files
|
|
2282
|
-
const content = await invoke$
|
|
2304
|
+
const content = await invoke$1('FileSystem.readDirWithFileTypes', path);
|
|
2283
2305
|
return content;
|
|
2284
2306
|
};
|
|
2285
2307
|
const remove$3 = async (protocol, path) => {
|
|
@@ -2317,7 +2339,7 @@ const getPathSeparator = protocol => {
|
|
|
2317
2339
|
|
|
2318
2340
|
const {
|
|
2319
2341
|
executeFormattingProvider,
|
|
2320
|
-
registerFormattingProvider} = create$
|
|
2342
|
+
registerFormattingProvider} = create$c({
|
|
2321
2343
|
executeKey: 'format',
|
|
2322
2344
|
name: 'Formatting',
|
|
2323
2345
|
resultShape: {
|
|
@@ -2379,7 +2401,7 @@ const getPosition = (textDocument, offset) => {
|
|
|
2379
2401
|
|
|
2380
2402
|
const {
|
|
2381
2403
|
executeHoverProvider,
|
|
2382
|
-
registerHoverProvider} = create$
|
|
2404
|
+
registerHoverProvider} = create$c({
|
|
2383
2405
|
name: 'Hover',
|
|
2384
2406
|
resultShape: {
|
|
2385
2407
|
allowUndefined: true,
|
|
@@ -2390,7 +2412,7 @@ const {
|
|
|
2390
2412
|
|
|
2391
2413
|
const {
|
|
2392
2414
|
executeImplementationProvider,
|
|
2393
|
-
registerImplementationProvider} = create$
|
|
2415
|
+
registerImplementationProvider} = create$c({
|
|
2394
2416
|
name: 'Implementation',
|
|
2395
2417
|
resultShape: {
|
|
2396
2418
|
items: {
|
|
@@ -2422,7 +2444,7 @@ const sendPort = async ({
|
|
|
2422
2444
|
port,
|
|
2423
2445
|
url
|
|
2424
2446
|
}) => {
|
|
2425
|
-
await invokeAndTransfer$
|
|
2447
|
+
await invokeAndTransfer$1('IpcParent.create', {
|
|
2426
2448
|
method: ModuleWorkerAndWorkaroundForChromeDevtoolsBug,
|
|
2427
2449
|
name,
|
|
2428
2450
|
port,
|
|
@@ -2430,7 +2452,7 @@ const sendPort = async ({
|
|
|
2430
2452
|
url
|
|
2431
2453
|
});
|
|
2432
2454
|
};
|
|
2433
|
-
const create$
|
|
2455
|
+
const create$6 = async ({
|
|
2434
2456
|
commandMap,
|
|
2435
2457
|
name,
|
|
2436
2458
|
url
|
|
@@ -2459,11 +2481,11 @@ const create$5 = async ({
|
|
|
2459
2481
|
|
|
2460
2482
|
const IpcParentWithModuleWorkerAndWorkaroundForChromeDevtoolsBug = {
|
|
2461
2483
|
__proto__: null,
|
|
2462
|
-
create: create$
|
|
2484
|
+
create: create$6
|
|
2463
2485
|
};
|
|
2464
2486
|
|
|
2465
2487
|
const sendMessagePortToElectron = async (port, initialCommand) => {
|
|
2466
|
-
await invokeAndTransfer$
|
|
2488
|
+
await invokeAndTransfer$1('SendMessagePortToElectron.sendMessagePortToElectron', port, initialCommand);
|
|
2467
2489
|
};
|
|
2468
2490
|
|
|
2469
2491
|
const getPort = async type => {
|
|
@@ -2474,7 +2496,7 @@ const getPort = async type => {
|
|
|
2474
2496
|
await sendMessagePortToElectron(port1, 'HandleMessagePortForExtensionHostHelperProcess.handleMessagePortForExtensionHostHelperProcess');
|
|
2475
2497
|
return port2;
|
|
2476
2498
|
};
|
|
2477
|
-
const create$
|
|
2499
|
+
const create$5 = async ({
|
|
2478
2500
|
type
|
|
2479
2501
|
}) => {
|
|
2480
2502
|
const port = await getPort();
|
|
@@ -2490,7 +2512,7 @@ const create$4 = async ({
|
|
|
2490
2512
|
|
|
2491
2513
|
const IpcParentWithElectronMessagePort = {
|
|
2492
2514
|
__proto__: null,
|
|
2493
|
-
create: create$
|
|
2515
|
+
create: create$5
|
|
2494
2516
|
};
|
|
2495
2517
|
|
|
2496
2518
|
const getWebSocketProtocol = () => {
|
|
@@ -2502,7 +2524,7 @@ const getWebSocketUrl = (type, host) => {
|
|
|
2502
2524
|
return `${wsProtocol}//${host}/websocket/${type}`;
|
|
2503
2525
|
};
|
|
2504
2526
|
|
|
2505
|
-
const create$
|
|
2527
|
+
const create$4 = async ({
|
|
2506
2528
|
type
|
|
2507
2529
|
}) => {
|
|
2508
2530
|
string(type);
|
|
@@ -2517,7 +2539,7 @@ const create$3 = async ({
|
|
|
2517
2539
|
|
|
2518
2540
|
const IpcParentWithWebSocket = {
|
|
2519
2541
|
__proto__: null,
|
|
2520
|
-
create: create$
|
|
2542
|
+
create: create$4
|
|
2521
2543
|
};
|
|
2522
2544
|
|
|
2523
2545
|
const Electron = 'electron';
|
|
@@ -2554,7 +2576,7 @@ const getModule$1 = platform => {
|
|
|
2554
2576
|
return IpcParentWithElectronMessagePort;
|
|
2555
2577
|
}
|
|
2556
2578
|
};
|
|
2557
|
-
const create$
|
|
2579
|
+
const create$3 = async ({
|
|
2558
2580
|
raw,
|
|
2559
2581
|
type
|
|
2560
2582
|
}) => {
|
|
@@ -2567,7 +2589,7 @@ const create$2 = async ({
|
|
|
2567
2589
|
|
|
2568
2590
|
const IpcParentWithNode = {
|
|
2569
2591
|
__proto__: null,
|
|
2570
|
-
create: create$
|
|
2592
|
+
create: create$3
|
|
2571
2593
|
};
|
|
2572
2594
|
|
|
2573
2595
|
const getModule = method => {
|
|
@@ -2583,7 +2605,7 @@ const getModule = method => {
|
|
|
2583
2605
|
}
|
|
2584
2606
|
};
|
|
2585
2607
|
|
|
2586
|
-
const create$
|
|
2608
|
+
const create$2 = async ({
|
|
2587
2609
|
method,
|
|
2588
2610
|
...options
|
|
2589
2611
|
}) => {
|
|
@@ -2608,7 +2630,7 @@ const createNodeRpc = async ({
|
|
|
2608
2630
|
try {
|
|
2609
2631
|
string(path);
|
|
2610
2632
|
fn(execute);
|
|
2611
|
-
const rpc = await create$
|
|
2633
|
+
const rpc = await create$2({
|
|
2612
2634
|
commandMap: {},
|
|
2613
2635
|
method: ElectronMessagePort,
|
|
2614
2636
|
name,
|
|
@@ -2623,7 +2645,7 @@ const createNodeRpc = async ({
|
|
|
2623
2645
|
|
|
2624
2646
|
const send = async port => {
|
|
2625
2647
|
const initialCommand = 'FileSystem.handleMessagePort';
|
|
2626
|
-
await invokeAndTransfer$
|
|
2648
|
+
await invokeAndTransfer$1('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSystemWorker', port, initialCommand);
|
|
2627
2649
|
};
|
|
2628
2650
|
const launchFileSystemProcess = async () => {
|
|
2629
2651
|
const rpc = await TransferMessagePortRpcParent.create({
|
|
@@ -2704,10 +2726,15 @@ const getEnabledProviders = () => {
|
|
|
2704
2726
|
|
|
2705
2727
|
const confirm = message => {
|
|
2706
2728
|
string(message);
|
|
2707
|
-
const result = invoke$
|
|
2729
|
+
const result = invoke$1('ConfirmPrompt.prompt', message);
|
|
2708
2730
|
return result;
|
|
2709
2731
|
};
|
|
2710
2732
|
|
|
2733
|
+
let id$1 = 0;
|
|
2734
|
+
const create$1 = () => {
|
|
2735
|
+
return ++id$1;
|
|
2736
|
+
};
|
|
2737
|
+
|
|
2711
2738
|
const ExtensionHostQuickPickShow = 'ExtensionHostQuickPick.show';
|
|
2712
2739
|
|
|
2713
2740
|
const showQuickPick = async ({
|
|
@@ -2716,14 +2743,37 @@ const showQuickPick = async ({
|
|
|
2716
2743
|
}) => {
|
|
2717
2744
|
const rawPicks = await getPicks();
|
|
2718
2745
|
const picks = rawPicks.map(toPick);
|
|
2719
|
-
return invoke$
|
|
2746
|
+
return invoke$1(ExtensionHostQuickPickShow, picks);
|
|
2747
|
+
};
|
|
2748
|
+
const quickInputs = Object.create(null);
|
|
2749
|
+
const showQuickInput = async ({
|
|
2750
|
+
ignoreFocusOut,
|
|
2751
|
+
initialValue,
|
|
2752
|
+
render
|
|
2753
|
+
}) => {
|
|
2754
|
+
const id = create$1();
|
|
2755
|
+
quickInputs[id] = render;
|
|
2756
|
+
// TODO create direct connection to file search worker
|
|
2757
|
+
const {
|
|
2758
|
+
canceled,
|
|
2759
|
+
inputValue
|
|
2760
|
+
} = await invoke$4('QuickPick.showQuickInput', {
|
|
2761
|
+
ignoreFocusOut,
|
|
2762
|
+
initialValue,
|
|
2763
|
+
render
|
|
2764
|
+
});
|
|
2765
|
+
delete quickInputs[id];
|
|
2766
|
+
return {
|
|
2767
|
+
canceled,
|
|
2768
|
+
inputValue
|
|
2769
|
+
};
|
|
2720
2770
|
};
|
|
2721
2771
|
|
|
2722
2772
|
const {
|
|
2723
2773
|
executefileReferenceProvider,
|
|
2724
2774
|
executeReferenceProvider,
|
|
2725
2775
|
getProvider: getProvider$1,
|
|
2726
|
-
registerReferenceProvider} = create$
|
|
2776
|
+
registerReferenceProvider} = create$c({
|
|
2727
2777
|
additionalMethodNames: [
|
|
2728
2778
|
// @ts-ignore
|
|
2729
2779
|
{
|
|
@@ -2785,7 +2835,7 @@ const validateResult = renameResult => {
|
|
|
2785
2835
|
const {
|
|
2786
2836
|
executeprepareRenameProvider,
|
|
2787
2837
|
executeRenameProvider,
|
|
2788
|
-
registerRenameProvider} = create$
|
|
2838
|
+
registerRenameProvider} = create$c({
|
|
2789
2839
|
additionalMethodNames: [
|
|
2790
2840
|
// @ts-ignore
|
|
2791
2841
|
{
|
|
@@ -2807,7 +2857,7 @@ const extensionHostSubWorkerUrl = getExtensionHostSubWorkerUrl();
|
|
|
2807
2857
|
|
|
2808
2858
|
const set$8 = async (url, contentSecurityPolicy) => {
|
|
2809
2859
|
const pathName = new URL(url).pathname;
|
|
2810
|
-
await invoke$
|
|
2860
|
+
await invoke$1('ExtensionHostWorkerContentSecurityPolicy.set', pathName, contentSecurityPolicy);
|
|
2811
2861
|
};
|
|
2812
2862
|
|
|
2813
2863
|
/**
|
|
@@ -2827,7 +2877,7 @@ const createLegacyRpc = async ({
|
|
|
2827
2877
|
if (contentSecurityPolicy) {
|
|
2828
2878
|
await set$8(url, contentSecurityPolicy);
|
|
2829
2879
|
}
|
|
2830
|
-
const rpc = await create$
|
|
2880
|
+
const rpc = await create$2({
|
|
2831
2881
|
commandMap,
|
|
2832
2882
|
method: ModuleWorkerAndWorkaroundForChromeDevtoolsBug$1,
|
|
2833
2883
|
name,
|
|
@@ -2867,7 +2917,7 @@ const createRpcWithId$1 = async (id, commandMap, execute) => {
|
|
|
2867
2917
|
if (!info) {
|
|
2868
2918
|
throw new Error(`rpc with id ${id} not found`);
|
|
2869
2919
|
}
|
|
2870
|
-
const rpc = await create$
|
|
2920
|
+
const rpc = await create$2({
|
|
2871
2921
|
commandMap,
|
|
2872
2922
|
isMessagePortOpen: true,
|
|
2873
2923
|
method: ModuleWorkerAndWorkaroundForChromeDevtoolsBug$1,
|
|
@@ -2942,7 +2992,7 @@ const createRpc = ({
|
|
|
2942
2992
|
|
|
2943
2993
|
const {
|
|
2944
2994
|
executeSelectionProvider,
|
|
2945
|
-
registerSelectionProvider} = create$
|
|
2995
|
+
registerSelectionProvider} = create$c({
|
|
2946
2996
|
name: 'Selection',
|
|
2947
2997
|
resultShape: {
|
|
2948
2998
|
allowUndefined: true,
|
|
@@ -2962,16 +3012,8 @@ const getProtocol = uri => {
|
|
|
2962
3012
|
return '';
|
|
2963
3013
|
};
|
|
2964
3014
|
|
|
2965
|
-
// @ts-ignore
|
|
2966
|
-
|
|
2967
|
-
const {
|
|
2968
|
-
invoke: invoke$1,
|
|
2969
|
-
invokeAndTransfer: invokeAndTransfer$1,
|
|
2970
|
-
setFactory
|
|
2971
|
-
} = createLazyRpc(ExtensionManagementWorker);
|
|
2972
|
-
|
|
2973
3015
|
const getRemoteUrlForWebView = async (uri, options = {}) => {
|
|
2974
|
-
return await invoke$
|
|
3016
|
+
return await invoke$5('Extensions.getRemoteUrlForWebView', uri, options);
|
|
2975
3017
|
};
|
|
2976
3018
|
|
|
2977
3019
|
const isFileProtocol = protocol => {
|
|
@@ -3008,7 +3050,7 @@ const getRemoteUrl$1 = async (uri, options = {}) => {
|
|
|
3008
3050
|
return getRemoteUrlForWebView(uri, options);
|
|
3009
3051
|
}
|
|
3010
3052
|
if (uri.startsWith('html://')) {
|
|
3011
|
-
const url = await invoke$
|
|
3053
|
+
const url = await invoke$1('Blob.getSrc', uri);
|
|
3012
3054
|
return url;
|
|
3013
3055
|
}
|
|
3014
3056
|
throw new Error(`unsupported platform for remote url`);
|
|
@@ -3047,10 +3089,10 @@ const getWebExtensions = async () => {
|
|
|
3047
3089
|
};
|
|
3048
3090
|
|
|
3049
3091
|
const getSharedProcessExtensions = () => {
|
|
3050
|
-
return invoke$
|
|
3092
|
+
return invoke$1(/* ExtensionManagement.getExtensions */'ExtensionManagement.getExtensions');
|
|
3051
3093
|
};
|
|
3052
3094
|
const doGetExtensions = async () => {
|
|
3053
|
-
const meta = await invoke$
|
|
3095
|
+
const meta = await invoke$5('Extensions.getDynamicWebExtensions');
|
|
3054
3096
|
if (platform === Web) {
|
|
3055
3097
|
const webExtensions = await getWebExtensions();
|
|
3056
3098
|
return [...webExtensions, ...meta];
|
|
@@ -3212,7 +3254,7 @@ const getFileDecorations = async (providerId, uris) => {
|
|
|
3212
3254
|
|
|
3213
3255
|
const {
|
|
3214
3256
|
executeTabCompletionProvider,
|
|
3215
|
-
registerTabCompletionProvider} = create$
|
|
3257
|
+
registerTabCompletionProvider} = create$c({
|
|
3216
3258
|
name: 'TabCompletion',
|
|
3217
3259
|
resultShape: {
|
|
3218
3260
|
allowUndefined: true,
|
|
@@ -3251,7 +3293,7 @@ const executeTextSearchProvider = async (scheme, query) => {
|
|
|
3251
3293
|
|
|
3252
3294
|
const {
|
|
3253
3295
|
executeTypeDefinitionProvider,
|
|
3254
|
-
registerTypeDefinitionProvider} = create$
|
|
3296
|
+
registerTypeDefinitionProvider} = create$c({
|
|
3255
3297
|
name: 'TypeDefinition',
|
|
3256
3298
|
resultShape: {
|
|
3257
3299
|
allowUndefined: true,
|
|
@@ -3355,7 +3397,7 @@ const createWorker = async ({
|
|
|
3355
3397
|
string(method);
|
|
3356
3398
|
string(url);
|
|
3357
3399
|
string(name);
|
|
3358
|
-
const rpc = create$
|
|
3400
|
+
const rpc = create$2({
|
|
3359
3401
|
method: ModuleWorkerAndWorkaroundForChromeDevtoolsBug$1,
|
|
3360
3402
|
name,
|
|
3361
3403
|
url
|
|
@@ -3374,7 +3416,7 @@ const getWorkspaceFolder = path => {
|
|
|
3374
3416
|
};
|
|
3375
3417
|
const handleWorkspaceRefresh = async () => {
|
|
3376
3418
|
// @ts-ignore
|
|
3377
|
-
await invoke$
|
|
3419
|
+
await invoke$3('Layout.handleWorkspaceRefresh');
|
|
3378
3420
|
};
|
|
3379
3421
|
|
|
3380
3422
|
class FormattingError extends Error {
|
|
@@ -3495,6 +3537,7 @@ const api = {
|
|
|
3495
3537
|
// Dialog
|
|
3496
3538
|
showInformationMessage: showInformationMessage,
|
|
3497
3539
|
// QuickPick
|
|
3540
|
+
showQuickInput: showQuickInput,
|
|
3498
3541
|
showQuickPick: showQuickPick,
|
|
3499
3542
|
stat: statExternal,
|
|
3500
3543
|
TextSearchResultType,
|
|
@@ -3587,6 +3630,30 @@ const setup = ({
|
|
|
3587
3630
|
global.vscode = api;
|
|
3588
3631
|
};
|
|
3589
3632
|
|
|
3633
|
+
const launchExtensionManagementWorker = async () => {
|
|
3634
|
+
const rpc = await LazyTransferMessagePortRpcParent.create({
|
|
3635
|
+
commandMap: {},
|
|
3636
|
+
async send(port) {
|
|
3637
|
+
await sendMessagePortToExtensionManagementWorker(port, 0);
|
|
3638
|
+
}
|
|
3639
|
+
});
|
|
3640
|
+
set$b(rpc);
|
|
3641
|
+
};
|
|
3642
|
+
|
|
3643
|
+
const launchFileSearchWorker = async () => {
|
|
3644
|
+
try {
|
|
3645
|
+
const rpc = await LazyTransferMessagePortRpcParent.create({
|
|
3646
|
+
commandMap: {},
|
|
3647
|
+
async send(port) {
|
|
3648
|
+
await sendMessagePortToFileSearchWorker(port, 0);
|
|
3649
|
+
}
|
|
3650
|
+
});
|
|
3651
|
+
set$a(rpc);
|
|
3652
|
+
} catch {
|
|
3653
|
+
// ignore
|
|
3654
|
+
}
|
|
3655
|
+
};
|
|
3656
|
+
|
|
3590
3657
|
const create = () => {
|
|
3591
3658
|
return {
|
|
3592
3659
|
finished: false
|
|
@@ -4148,7 +4215,7 @@ const activateExtension = async (extension, absolutePath, activationEvent) => {
|
|
|
4148
4215
|
};
|
|
4149
4216
|
|
|
4150
4217
|
const addWebExtension = async path => {
|
|
4151
|
-
const manifest = await invoke$
|
|
4218
|
+
const manifest = await invoke$5('Extensions.addWebExtension', path);
|
|
4152
4219
|
return manifest;
|
|
4153
4220
|
};
|
|
4154
4221
|
|
|
@@ -4163,7 +4230,7 @@ const applyBulkReplacement = async (files, ranges, replacement) => {
|
|
|
4163
4230
|
};
|
|
4164
4231
|
|
|
4165
4232
|
const addCssStyleSheet = (id, css) => {
|
|
4166
|
-
return invoke$
|
|
4233
|
+
return invoke$1('Css.addCssStyleSheet', id, css);
|
|
4167
4234
|
};
|
|
4168
4235
|
|
|
4169
4236
|
const NewLine = '\n';
|
|
@@ -4598,10 +4665,10 @@ const GetColorThemeCssCachedIndexedDb = {
|
|
|
4598
4665
|
};
|
|
4599
4666
|
|
|
4600
4667
|
const getText$1 = key => {
|
|
4601
|
-
return invoke$
|
|
4668
|
+
return invoke$1('LocalStorage.getText', key);
|
|
4602
4669
|
};
|
|
4603
4670
|
const setText = (key, value) => {
|
|
4604
|
-
return invoke$
|
|
4671
|
+
return invoke$1('LocalStorage.setText', key, value);
|
|
4605
4672
|
};
|
|
4606
4673
|
|
|
4607
4674
|
const getCacheKey = colorThemeId => {
|
|
@@ -4636,7 +4703,7 @@ const GetColorThemeCssCachedNoop = {
|
|
|
4636
4703
|
};
|
|
4637
4704
|
|
|
4638
4705
|
const get = key => {
|
|
4639
|
-
return invoke$
|
|
4706
|
+
return invoke$1('Preferences.get', key);
|
|
4640
4707
|
};
|
|
4641
4708
|
|
|
4642
4709
|
const getCacheFn = config => {
|
|
@@ -4662,7 +4729,7 @@ const getColorThemeCssCached = async (colorThemeId, getData) => {
|
|
|
4662
4729
|
};
|
|
4663
4730
|
|
|
4664
4731
|
const readJson = url => {
|
|
4665
|
-
return invoke$
|
|
4732
|
+
return invoke$1('FileSystem.readJson', url);
|
|
4666
4733
|
};
|
|
4667
4734
|
|
|
4668
4735
|
const dirname = (pathSeparator, path) => {
|
|
@@ -4744,7 +4811,7 @@ const getMetaThemeColor = colorThemeJson => {
|
|
|
4744
4811
|
};
|
|
4745
4812
|
|
|
4746
4813
|
const setThemeColor = async themeColor => {
|
|
4747
|
-
await invoke$
|
|
4814
|
+
await invoke$1(/* Meta.setThemeColor */'Meta.setThemeColor', /* color */themeColor);
|
|
4748
4815
|
};
|
|
4749
4816
|
|
|
4750
4817
|
// TODO by default color theme should come from local storage, session storage, cache storage, indexeddb or blob url -> fast initial load
|
|
@@ -4780,7 +4847,7 @@ const watch = async id => {
|
|
|
4780
4847
|
return;
|
|
4781
4848
|
}
|
|
4782
4849
|
state$1.watchedTheme = id;
|
|
4783
|
-
await invoke$
|
|
4850
|
+
await invoke$1('ExtensionHost.watchColorTheme', id);
|
|
4784
4851
|
};
|
|
4785
4852
|
const getPreferredColorTheme = () => {
|
|
4786
4853
|
const preferredColorTheme = get('workbench.colorTheme');
|
|
@@ -4853,18 +4920,18 @@ const createWebView3 = async ({
|
|
|
4853
4920
|
};
|
|
4854
4921
|
|
|
4855
4922
|
const createWebViewWorkerRpc2 = async (rpcInfo, port) => {
|
|
4856
|
-
await invokeAndTransfer$
|
|
4923
|
+
await invokeAndTransfer$3('Extensions.createWebViewWorkerRpc2', rpcInfo, port);
|
|
4857
4924
|
};
|
|
4858
4925
|
|
|
4859
4926
|
/**
|
|
4860
4927
|
* @deprecated use createWebViewWorkerRpc2 which passes the worker url as a parameter
|
|
4861
4928
|
*/
|
|
4862
4929
|
const createWebViewWorkerRpc = async (rpcInfo, port) => {
|
|
4863
|
-
await invokeAndTransfer$
|
|
4930
|
+
await invokeAndTransfer$3('Extensions.createWebViewWorkerRpc', rpcInfo, port);
|
|
4864
4931
|
};
|
|
4865
4932
|
|
|
4866
4933
|
const executeExternalCommand = (method, ...params) => {
|
|
4867
|
-
return invoke$
|
|
4934
|
+
return invoke$1(method, ...params);
|
|
4868
4935
|
};
|
|
4869
4936
|
|
|
4870
4937
|
const BraceCompletionExecuteBraceCompletionProvider = 'ExtensionHostBraceCompletion.executeBraceCompletionProvider';
|
|
@@ -4932,7 +4999,7 @@ const mockExec = () => {
|
|
|
4932
4999
|
try {
|
|
4933
5000
|
// @ts-ignore
|
|
4934
5001
|
api.exec = async (command, args, options) => {
|
|
4935
|
-
const result = await invoke$
|
|
5002
|
+
const result = await invoke$1('Test.executeMockExecFunction', command, args, options);
|
|
4936
5003
|
const {
|
|
4937
5004
|
exitCode,
|
|
4938
5005
|
stderr,
|
|
@@ -4958,7 +5025,7 @@ const mockRpc = () => {
|
|
|
4958
5025
|
try {
|
|
4959
5026
|
return {
|
|
4960
5027
|
async invoke(method, ...params) {
|
|
4961
|
-
const result = await invoke$
|
|
5028
|
+
const result = await invoke$1('Test.executeMockRpcFunction', options.name, method, ...params);
|
|
4962
5029
|
return result;
|
|
4963
5030
|
}
|
|
4964
5031
|
};
|
|
@@ -5382,7 +5449,7 @@ const getIconThemeJson = async iconThemeId => {
|
|
|
5382
5449
|
};
|
|
5383
5450
|
|
|
5384
5451
|
const getRpcInfo = async rpcId => {
|
|
5385
|
-
return await invoke$
|
|
5452
|
+
return await invoke$5('Extensions.getRpcInfo', rpcId);
|
|
5386
5453
|
};
|
|
5387
5454
|
|
|
5388
5455
|
const emptyStatus = {
|
|
@@ -5454,7 +5521,7 @@ const handleMessagePort2 = async (port, rpcId) => {
|
|
|
5454
5521
|
messagePort: port
|
|
5455
5522
|
});
|
|
5456
5523
|
if (rpcId) {
|
|
5457
|
-
set$
|
|
5524
|
+
set$d(rpcId, rpc);
|
|
5458
5525
|
}
|
|
5459
5526
|
};
|
|
5460
5527
|
|
|
@@ -5464,12 +5531,12 @@ const handleMessagePort = async (port, rpcId) => {
|
|
|
5464
5531
|
messagePort: port
|
|
5465
5532
|
});
|
|
5466
5533
|
if (rpcId) {
|
|
5467
|
-
set$
|
|
5534
|
+
set$d(rpcId, rpc);
|
|
5468
5535
|
}
|
|
5469
5536
|
};
|
|
5470
5537
|
|
|
5471
5538
|
const handleIconThemeChange = async () => {
|
|
5472
|
-
await invoke$
|
|
5539
|
+
await invoke$1('IconTheme.handleIconThemeChange');
|
|
5473
5540
|
};
|
|
5474
5541
|
|
|
5475
5542
|
const initialIconTheme = undefined;
|
|
@@ -6224,22 +6291,15 @@ const commandMap = {
|
|
|
6224
6291
|
'WebViews.getWebViews': getWebViews
|
|
6225
6292
|
};
|
|
6226
6293
|
|
|
6227
|
-
const
|
|
6228
|
-
const rpc = await
|
|
6229
|
-
commandMap:
|
|
6230
|
-
async send(port) {
|
|
6231
|
-
await sendMessagePortToExtensionManagementWorker(port, 0);
|
|
6232
|
-
}
|
|
6294
|
+
const launchRendererWorker = async () => {
|
|
6295
|
+
const rpc = await WebWorkerRpcClient.create({
|
|
6296
|
+
commandMap: commandMap
|
|
6233
6297
|
});
|
|
6234
|
-
|
|
6298
|
+
set$d(RendererWorker, rpc);
|
|
6235
6299
|
};
|
|
6236
6300
|
|
|
6237
6301
|
const listen = async () => {
|
|
6238
|
-
|
|
6239
|
-
const rpc = await WebWorkerRpcClient.create({
|
|
6240
|
-
commandMap: commandMap
|
|
6241
|
-
});
|
|
6242
|
-
set$c(RendererWorker, rpc);
|
|
6302
|
+
await Promise.all([launchExtensionManagementWorker(), launchFileSearchWorker(), launchRendererWorker()]);
|
|
6243
6303
|
};
|
|
6244
6304
|
|
|
6245
6305
|
const main = async () => {
|