@lvce-editor/extension-host-worker 3.0.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/dist/extensionHostWorkerMain.js +610 -643
- package/package.json +1 -1
|
@@ -89,7 +89,7 @@ const fn = value => {
|
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
91
|
|
|
92
|
-
const state$
|
|
92
|
+
const state$b = {
|
|
93
93
|
/** @type{any[]} */
|
|
94
94
|
onDidOpenEditorListeners: [],
|
|
95
95
|
/** @type{any[]} */
|
|
@@ -101,19 +101,19 @@ const state$a = {
|
|
|
101
101
|
textDocuments: Object.create(null)
|
|
102
102
|
};
|
|
103
103
|
const setDocument = (textDocumentId, textDocument) => {
|
|
104
|
-
state$
|
|
104
|
+
state$b.textDocuments[textDocumentId] = textDocument;
|
|
105
105
|
};
|
|
106
106
|
const getDidOpenListeners = () => {
|
|
107
|
-
return state$
|
|
107
|
+
return state$b.onDidSaveTextDocumentListeners;
|
|
108
108
|
};
|
|
109
109
|
const getWillChangeListeners = () => {
|
|
110
|
-
return state$
|
|
110
|
+
return state$b.onWillChangeEditorListeners;
|
|
111
111
|
};
|
|
112
112
|
const getDidChangeListeners = () => {
|
|
113
|
-
return state$
|
|
113
|
+
return state$b.onDidChangeTextDocumentListeners;
|
|
114
114
|
};
|
|
115
115
|
const getDocument = textDocumentId => {
|
|
116
|
-
return state$
|
|
116
|
+
return state$b.textDocuments[textDocumentId];
|
|
117
117
|
};
|
|
118
118
|
|
|
119
119
|
const getOffset$1 = (textDocument, position) => {
|
|
@@ -303,7 +303,7 @@ const syncIncremental = (textDocumentId, changes) => {
|
|
|
303
303
|
textDocument.text = before + syntheticChange.inserted + after;
|
|
304
304
|
runListenersSafe(getDidChangeListeners(), textDocument, syntheticChanges);
|
|
305
305
|
};
|
|
306
|
-
const get$
|
|
306
|
+
const get$6 = textDocumentId => {
|
|
307
307
|
const textDocument = getDocument(textDocumentId);
|
|
308
308
|
return textDocument;
|
|
309
309
|
};
|
|
@@ -535,7 +535,7 @@ const registerMethod = ({
|
|
|
535
535
|
}) => {
|
|
536
536
|
context[`execute${name}Provider`] = async function (textDocumentId, ...params) {
|
|
537
537
|
try {
|
|
538
|
-
const textDocument = get$
|
|
538
|
+
const textDocument = get$6(textDocumentId);
|
|
539
539
|
if (!textDocument) {
|
|
540
540
|
throw new Error(`textDocument with id ${textDocumentId} not found`);
|
|
541
541
|
}
|
|
@@ -571,7 +571,7 @@ const registerMethod = ({
|
|
|
571
571
|
}
|
|
572
572
|
};
|
|
573
573
|
};
|
|
574
|
-
const create$
|
|
574
|
+
const create$a = ({
|
|
575
575
|
name,
|
|
576
576
|
resultShape,
|
|
577
577
|
executeKey = '',
|
|
@@ -623,7 +623,7 @@ const {
|
|
|
623
623
|
registerBraceCompletionProvider,
|
|
624
624
|
executeBraceCompletionProvider,
|
|
625
625
|
reset: reset$9
|
|
626
|
-
} = create$
|
|
626
|
+
} = create$a({
|
|
627
627
|
name: 'BraceCompletion',
|
|
628
628
|
resultShape: {
|
|
629
629
|
type: Boolean
|
|
@@ -633,7 +633,7 @@ const {
|
|
|
633
633
|
const {
|
|
634
634
|
registerClosingTagProvider,
|
|
635
635
|
executeClosingTagProvider
|
|
636
|
-
} = create$
|
|
636
|
+
} = create$a({
|
|
637
637
|
name: 'ClosingTag',
|
|
638
638
|
returnUndefinedWhenNoProviderFound: true,
|
|
639
639
|
resultShape: {
|
|
@@ -645,7 +645,7 @@ const {
|
|
|
645
645
|
const {
|
|
646
646
|
registerCodeActionProvider,
|
|
647
647
|
executeCodeActionProvider
|
|
648
|
-
} = create$
|
|
648
|
+
} = create$a({
|
|
649
649
|
name: 'CodeAction',
|
|
650
650
|
resultShape: {
|
|
651
651
|
type: Array$1,
|
|
@@ -670,12 +670,12 @@ const executeOrganizeImports = async uid => {
|
|
|
670
670
|
if (!organizeImportsAction) {
|
|
671
671
|
return [];
|
|
672
672
|
}
|
|
673
|
-
const textDocument = get$
|
|
673
|
+
const textDocument = get$6(uid);
|
|
674
674
|
const edits = await organizeImportsAction.execute(textDocument);
|
|
675
675
|
return edits;
|
|
676
676
|
};
|
|
677
677
|
|
|
678
|
-
const state$
|
|
678
|
+
const state$a = {
|
|
679
679
|
commands: Object.create(null)
|
|
680
680
|
};
|
|
681
681
|
const getCommandDisplay = command => {
|
|
@@ -698,10 +698,10 @@ const registerCommand = command => {
|
|
|
698
698
|
if (!command.execute) {
|
|
699
699
|
throw new Error('command is missing execute function');
|
|
700
700
|
}
|
|
701
|
-
if (command.id in state$
|
|
701
|
+
if (command.id in state$a.commands) {
|
|
702
702
|
throw new Error(`command cannot be registered multiple times`);
|
|
703
703
|
}
|
|
704
|
-
state$
|
|
704
|
+
state$a.commands[command.id] = command;
|
|
705
705
|
} catch (error) {
|
|
706
706
|
const commandDisplayId = getCommandDisplay(command);
|
|
707
707
|
throw new VError(error, `Failed to register command${commandDisplayId}`);
|
|
@@ -709,7 +709,7 @@ const registerCommand = command => {
|
|
|
709
709
|
};
|
|
710
710
|
const executeCommand = async (id, ...args) => {
|
|
711
711
|
try {
|
|
712
|
-
const command = state$
|
|
712
|
+
const command = state$a.commands[id];
|
|
713
713
|
if (!command) {
|
|
714
714
|
throw new Error(`command ${id} not found`);
|
|
715
715
|
}
|
|
@@ -728,7 +728,7 @@ const {
|
|
|
728
728
|
registerCompletionProvider,
|
|
729
729
|
executeCompletionProvider,
|
|
730
730
|
executeresolveCompletionItemProvider
|
|
731
|
-
} = create$
|
|
731
|
+
} = create$a({
|
|
732
732
|
name: 'Completion',
|
|
733
733
|
resultShape: {
|
|
734
734
|
type: Array$1,
|
|
@@ -748,40 +748,40 @@ const {
|
|
|
748
748
|
}]
|
|
749
749
|
});
|
|
750
750
|
|
|
751
|
-
const state$
|
|
751
|
+
const state$9 = {
|
|
752
752
|
configuration: Object.create(null)
|
|
753
753
|
};
|
|
754
754
|
const getConfiguration = key => {
|
|
755
|
-
return state$
|
|
755
|
+
return state$9.configuration[key] ?? '';
|
|
756
756
|
};
|
|
757
757
|
const setConfigurations = preferences => {
|
|
758
|
-
state$
|
|
758
|
+
state$9.configuration = preferences;
|
|
759
759
|
};
|
|
760
760
|
|
|
761
|
-
const state$
|
|
761
|
+
const state$8 = {
|
|
762
762
|
rpc: undefined
|
|
763
763
|
};
|
|
764
|
-
const invoke$
|
|
765
|
-
const rpc = state$
|
|
764
|
+
const invoke$2 = (method, ...params) => {
|
|
765
|
+
const rpc = state$8.rpc;
|
|
766
766
|
return rpc.invoke(method, ...params);
|
|
767
767
|
};
|
|
768
768
|
const send$1 = (method, ...params) => {
|
|
769
|
-
const rpc = state$
|
|
769
|
+
const rpc = state$8.rpc;
|
|
770
770
|
return rpc.send(method, ...params);
|
|
771
771
|
};
|
|
772
772
|
const invokeAndTransfer$1 = (method, ...params) => {
|
|
773
|
-
const rpc = state$
|
|
773
|
+
const rpc = state$8.rpc;
|
|
774
774
|
return rpc.invokeAndTransfer(method, ...params);
|
|
775
775
|
};
|
|
776
776
|
const setRpc = rpc => {
|
|
777
|
-
state$
|
|
777
|
+
state$8.rpc = rpc;
|
|
778
778
|
};
|
|
779
779
|
|
|
780
|
-
const state$
|
|
780
|
+
const state$7 = {
|
|
781
781
|
debugProviderMap: Object.create(null)
|
|
782
782
|
};
|
|
783
783
|
const getDebugProvider = id => {
|
|
784
|
-
const provider = state$
|
|
784
|
+
const provider = state$7.debugProviderMap[id];
|
|
785
785
|
if (!provider) {
|
|
786
786
|
// @ts-ignore
|
|
787
787
|
throw new VError(`no debug provider "${id}" found`);
|
|
@@ -792,7 +792,7 @@ const registerDebugProvider = debugProvider => {
|
|
|
792
792
|
if (!debugProvider.id) {
|
|
793
793
|
throw new Error('Failed to register debug system provider: missing id');
|
|
794
794
|
}
|
|
795
|
-
state$
|
|
795
|
+
state$7.debugProviderMap[debugProvider.id] = debugProvider;
|
|
796
796
|
};
|
|
797
797
|
const start = async (protocol, path) => {
|
|
798
798
|
try {
|
|
@@ -903,7 +903,7 @@ const {
|
|
|
903
903
|
registerDefinitionProvider,
|
|
904
904
|
executeDefinitionProvider,
|
|
905
905
|
reset: reset$8
|
|
906
|
-
} = create$
|
|
906
|
+
} = create$a({
|
|
907
907
|
name: 'Definition',
|
|
908
908
|
resultShape: {
|
|
909
909
|
allowUndefined: true,
|
|
@@ -925,7 +925,7 @@ const {
|
|
|
925
925
|
const {
|
|
926
926
|
registerDiagnosticProvider,
|
|
927
927
|
executeDiagnosticProvider
|
|
928
|
-
} = create$
|
|
928
|
+
} = create$a({
|
|
929
929
|
name: 'Diagnostic',
|
|
930
930
|
resultShape: {
|
|
931
931
|
type: Array$1,
|
|
@@ -937,7 +937,7 @@ const {
|
|
|
937
937
|
|
|
938
938
|
const showInformationMessage = message => {
|
|
939
939
|
string(message);
|
|
940
|
-
const result = invoke$
|
|
940
|
+
const result = invoke$2('ExtensionHostDialog.showInformationMessage', message);
|
|
941
941
|
return result;
|
|
942
942
|
};
|
|
943
943
|
|
|
@@ -948,7 +948,7 @@ const exec = async (command, args, options) => {
|
|
|
948
948
|
};
|
|
949
949
|
|
|
950
950
|
const fileSystemProviderMap = Object.create(null);
|
|
951
|
-
const get$
|
|
951
|
+
const get$5 = protocol => {
|
|
952
952
|
const provider = fileSystemProviderMap[protocol];
|
|
953
953
|
if (!provider) {
|
|
954
954
|
// @ts-ignore
|
|
@@ -971,7 +971,7 @@ const registerFileSystemProvider = fileSystemProvider => {
|
|
|
971
971
|
};
|
|
972
972
|
const readDirWithFileTypes = async (protocol, path) => {
|
|
973
973
|
try {
|
|
974
|
-
const provider = get$
|
|
974
|
+
const provider = get$5(protocol);
|
|
975
975
|
return await provider.readDirWithFileTypes(path);
|
|
976
976
|
} catch (error) {
|
|
977
977
|
throw new VError(error, 'Failed to execute file system provider');
|
|
@@ -979,7 +979,7 @@ const readDirWithFileTypes = async (protocol, path) => {
|
|
|
979
979
|
};
|
|
980
980
|
const readFile = async (protocol, path) => {
|
|
981
981
|
try {
|
|
982
|
-
const provider = get$
|
|
982
|
+
const provider = get$5(protocol);
|
|
983
983
|
return await provider.readFile(path);
|
|
984
984
|
} catch (error) {
|
|
985
985
|
throw new VError(error, 'Failed to execute file system provider');
|
|
@@ -992,7 +992,7 @@ const readFileExternal = async path => {
|
|
|
992
992
|
// this avoid parsing the potentially large message
|
|
993
993
|
// and improve performance by not blocking the renderer worker
|
|
994
994
|
// when reading / writing large files
|
|
995
|
-
const content = await invoke$
|
|
995
|
+
const content = await invoke$2('FileSystem.readFile', path);
|
|
996
996
|
return content;
|
|
997
997
|
};
|
|
998
998
|
const readDirWithFileTypesExternal = async path => {
|
|
@@ -1002,12 +1002,12 @@ const readDirWithFileTypesExternal = async path => {
|
|
|
1002
1002
|
// this avoid parsing the potentially large message
|
|
1003
1003
|
// and improve performance by not blocking the renderer worker
|
|
1004
1004
|
// when reading / writing large files
|
|
1005
|
-
const content = await invoke$
|
|
1005
|
+
const content = await invoke$2('FileSystem.readDirWithFileTypes', path);
|
|
1006
1006
|
return content;
|
|
1007
1007
|
};
|
|
1008
1008
|
const writeFile = async (protocol, uri, content) => {
|
|
1009
1009
|
try {
|
|
1010
|
-
const provider = get$
|
|
1010
|
+
const provider = get$5(protocol);
|
|
1011
1011
|
return await provider.writeFile(uri, content);
|
|
1012
1012
|
} catch (error) {
|
|
1013
1013
|
throw new VError(error, 'Failed to execute file system provider');
|
|
@@ -1015,7 +1015,7 @@ const writeFile = async (protocol, uri, content) => {
|
|
|
1015
1015
|
};
|
|
1016
1016
|
const getPathSeparator = protocol => {
|
|
1017
1017
|
try {
|
|
1018
|
-
const provider = get$
|
|
1018
|
+
const provider = get$5(protocol);
|
|
1019
1019
|
return provider.pathSeparator;
|
|
1020
1020
|
} catch (error) {
|
|
1021
1021
|
throw new VError(error, 'Failed to execute file system provider');
|
|
@@ -1026,7 +1026,7 @@ const {
|
|
|
1026
1026
|
registerFormattingProvider,
|
|
1027
1027
|
executeFormattingProvider,
|
|
1028
1028
|
reset: reset$7
|
|
1029
|
-
} = create$
|
|
1029
|
+
} = create$a({
|
|
1030
1030
|
name: 'Formatting',
|
|
1031
1031
|
executeKey: 'format',
|
|
1032
1032
|
resultShape: {
|
|
@@ -1088,7 +1088,7 @@ const {
|
|
|
1088
1088
|
registerHoverProvider,
|
|
1089
1089
|
executeHoverProvider,
|
|
1090
1090
|
reset: reset$6
|
|
1091
|
-
} = create$
|
|
1091
|
+
} = create$a({
|
|
1092
1092
|
name: 'Hover',
|
|
1093
1093
|
resultShape: {
|
|
1094
1094
|
allowUndefined: true,
|
|
@@ -1101,7 +1101,7 @@ const {
|
|
|
1101
1101
|
registerImplementationProvider,
|
|
1102
1102
|
executeImplementationProvider,
|
|
1103
1103
|
reset: reset$5
|
|
1104
|
-
} = create$
|
|
1104
|
+
} = create$a({
|
|
1105
1105
|
name: 'Implementation',
|
|
1106
1106
|
resultShape: {
|
|
1107
1107
|
type: Array$1,
|
|
@@ -1115,131 +1115,6 @@ const WebSocket$1 = 5;
|
|
|
1115
1115
|
const ElectronMessagePort = 6;
|
|
1116
1116
|
const ModuleWorkerAndWorkaroundForChromeDevtoolsBug$1 = 7;
|
|
1117
1117
|
|
|
1118
|
-
const getPortTuple = () => {
|
|
1119
|
-
const {
|
|
1120
|
-
port1,
|
|
1121
|
-
port2
|
|
1122
|
-
} = new MessageChannel();
|
|
1123
|
-
return {
|
|
1124
|
-
port1,
|
|
1125
|
-
port2
|
|
1126
|
-
};
|
|
1127
|
-
};
|
|
1128
|
-
|
|
1129
|
-
const ModuleWorkerAndWorkaroundForChromeDevtoolsBug = 6;
|
|
1130
|
-
|
|
1131
|
-
const create$b = async ({
|
|
1132
|
-
url,
|
|
1133
|
-
name
|
|
1134
|
-
}) => {
|
|
1135
|
-
string(url);
|
|
1136
|
-
string(name);
|
|
1137
|
-
const {
|
|
1138
|
-
port1,
|
|
1139
|
-
port2
|
|
1140
|
-
} = getPortTuple();
|
|
1141
|
-
await invokeAndTransfer$1('IpcParent.create', {
|
|
1142
|
-
method: ModuleWorkerAndWorkaroundForChromeDevtoolsBug,
|
|
1143
|
-
url,
|
|
1144
|
-
name,
|
|
1145
|
-
raw: true,
|
|
1146
|
-
port: port1
|
|
1147
|
-
});
|
|
1148
|
-
return port2;
|
|
1149
|
-
};
|
|
1150
|
-
const wrap$5 = port => {
|
|
1151
|
-
return {
|
|
1152
|
-
port,
|
|
1153
|
-
/**
|
|
1154
|
-
* @type {any}
|
|
1155
|
-
*/
|
|
1156
|
-
handleMessage: undefined,
|
|
1157
|
-
get onmessage() {
|
|
1158
|
-
return this.handleMessage;
|
|
1159
|
-
},
|
|
1160
|
-
set onmessage(listener) {
|
|
1161
|
-
if (listener) {
|
|
1162
|
-
// @ts-ignore
|
|
1163
|
-
this.handleMessage = event => {
|
|
1164
|
-
// TODO why are some events not instance of message event?
|
|
1165
|
-
if (event instanceof MessageEvent) {
|
|
1166
|
-
const message = event.data;
|
|
1167
|
-
// @ts-ignore
|
|
1168
|
-
listener(message, event);
|
|
1169
|
-
} else {
|
|
1170
|
-
// @ts-ignore
|
|
1171
|
-
|
|
1172
|
-
listener(event);
|
|
1173
|
-
}
|
|
1174
|
-
};
|
|
1175
|
-
} else {
|
|
1176
|
-
// @ts-ignore
|
|
1177
|
-
this.handleMessage = null;
|
|
1178
|
-
}
|
|
1179
|
-
this.port.onmessage = this.handleMessage;
|
|
1180
|
-
},
|
|
1181
|
-
send(message) {
|
|
1182
|
-
this.port.postMessage(message);
|
|
1183
|
-
},
|
|
1184
|
-
sendAndTransfer(message, transfer) {
|
|
1185
|
-
this.port.postMessage(message, transfer);
|
|
1186
|
-
}
|
|
1187
|
-
};
|
|
1188
|
-
};
|
|
1189
|
-
|
|
1190
|
-
const IpcParentWithModuleWorkerAndWorkaroundForChromeDevtoolsBug = {
|
|
1191
|
-
__proto__: null,
|
|
1192
|
-
create: create$b,
|
|
1193
|
-
wrap: wrap$5
|
|
1194
|
-
};
|
|
1195
|
-
|
|
1196
|
-
const sendMessagePortToElectron = async (port, initialCommand) => {
|
|
1197
|
-
await invokeAndTransfer$1('SendMessagePortToElectron.sendMessagePortToElectron', port, initialCommand);
|
|
1198
|
-
};
|
|
1199
|
-
|
|
1200
|
-
const getPort = async type => {
|
|
1201
|
-
const {
|
|
1202
|
-
port1,
|
|
1203
|
-
port2
|
|
1204
|
-
} = getPortTuple();
|
|
1205
|
-
await sendMessagePortToElectron(port1, 'HandleMessagePortForExtensionHostHelperProcess.handleMessagePortForExtensionHostHelperProcess');
|
|
1206
|
-
return port2;
|
|
1207
|
-
};
|
|
1208
|
-
const create$a = async ({
|
|
1209
|
-
type
|
|
1210
|
-
}) => {
|
|
1211
|
-
const port = await getPort();
|
|
1212
|
-
return port;
|
|
1213
|
-
};
|
|
1214
|
-
const wrap$4 = port => {
|
|
1215
|
-
let handleMessage;
|
|
1216
|
-
return {
|
|
1217
|
-
get onmessage() {
|
|
1218
|
-
return handleMessage;
|
|
1219
|
-
},
|
|
1220
|
-
set onmessage(listener) {
|
|
1221
|
-
let handleMessage;
|
|
1222
|
-
if (listener) {
|
|
1223
|
-
handleMessage = event => {
|
|
1224
|
-
listener(event.data);
|
|
1225
|
-
};
|
|
1226
|
-
} else {
|
|
1227
|
-
handleMessage = null;
|
|
1228
|
-
}
|
|
1229
|
-
port.onmessage = handleMessage;
|
|
1230
|
-
},
|
|
1231
|
-
send(message) {
|
|
1232
|
-
port.postMessage(message);
|
|
1233
|
-
}
|
|
1234
|
-
};
|
|
1235
|
-
};
|
|
1236
|
-
|
|
1237
|
-
const IpcParentWithElectronMessagePort = {
|
|
1238
|
-
__proto__: null,
|
|
1239
|
-
create: create$a,
|
|
1240
|
-
wrap: wrap$4
|
|
1241
|
-
};
|
|
1242
|
-
|
|
1243
1118
|
const isMessagePort = value => {
|
|
1244
1119
|
return value && value instanceof MessagePort;
|
|
1245
1120
|
};
|
|
@@ -1528,12 +1403,6 @@ class IpcChildWithModuleWorker extends Ipc {
|
|
|
1528
1403
|
const wrap$f = global => {
|
|
1529
1404
|
return new IpcChildWithModuleWorker(global);
|
|
1530
1405
|
};
|
|
1531
|
-
const IpcChildWithModuleWorker$1 = {
|
|
1532
|
-
__proto__: null,
|
|
1533
|
-
listen: listen$7,
|
|
1534
|
-
signal: signal$8,
|
|
1535
|
-
wrap: wrap$f
|
|
1536
|
-
};
|
|
1537
1406
|
const withResolvers = () => {
|
|
1538
1407
|
let _resolve;
|
|
1539
1408
|
const promise = new Promise(resolve => {
|
|
@@ -1545,7 +1414,7 @@ const withResolvers = () => {
|
|
|
1545
1414
|
promise
|
|
1546
1415
|
};
|
|
1547
1416
|
};
|
|
1548
|
-
const waitForFirstMessage
|
|
1417
|
+
const waitForFirstMessage = async port => {
|
|
1549
1418
|
const {
|
|
1550
1419
|
resolve,
|
|
1551
1420
|
promise
|
|
@@ -1561,7 +1430,7 @@ const listen$6 = async () => {
|
|
|
1561
1430
|
const parentIpcRaw = listen$7();
|
|
1562
1431
|
signal$8(parentIpcRaw);
|
|
1563
1432
|
const parentIpc = wrap$f(parentIpcRaw);
|
|
1564
|
-
const firstMessage = await waitForFirstMessage
|
|
1433
|
+
const firstMessage = await waitForFirstMessage(parentIpc);
|
|
1565
1434
|
if (firstMessage.method !== 'initialize') {
|
|
1566
1435
|
throw new IpcError('unexpected first message');
|
|
1567
1436
|
}
|
|
@@ -1651,6 +1520,61 @@ const getFirstEvent = (eventEmitter, eventMap) => {
|
|
|
1651
1520
|
}
|
|
1652
1521
|
return promise;
|
|
1653
1522
|
};
|
|
1523
|
+
const Message$1 = 3;
|
|
1524
|
+
const create$5$2 = async ({
|
|
1525
|
+
messagePort,
|
|
1526
|
+
isMessagePortOpen
|
|
1527
|
+
}) => {
|
|
1528
|
+
if (!isMessagePort(messagePort)) {
|
|
1529
|
+
throw new IpcError('port must be of type MessagePort');
|
|
1530
|
+
}
|
|
1531
|
+
if (isMessagePortOpen) {
|
|
1532
|
+
return messagePort;
|
|
1533
|
+
}
|
|
1534
|
+
const eventPromise = getFirstEvent(messagePort, {
|
|
1535
|
+
message: Message$1
|
|
1536
|
+
});
|
|
1537
|
+
messagePort.start();
|
|
1538
|
+
const {
|
|
1539
|
+
type,
|
|
1540
|
+
event
|
|
1541
|
+
} = await eventPromise;
|
|
1542
|
+
if (type !== Message$1) {
|
|
1543
|
+
throw new IpcError('Failed to wait for ipc message');
|
|
1544
|
+
}
|
|
1545
|
+
if (event.data !== readyMessage) {
|
|
1546
|
+
throw new IpcError('unexpected first message');
|
|
1547
|
+
}
|
|
1548
|
+
return messagePort;
|
|
1549
|
+
};
|
|
1550
|
+
const signal$1 = messagePort => {
|
|
1551
|
+
messagePort.start();
|
|
1552
|
+
};
|
|
1553
|
+
class IpcParentWithMessagePort extends Ipc {
|
|
1554
|
+
getData = getData$2;
|
|
1555
|
+
send(message) {
|
|
1556
|
+
this._rawIpc.postMessage(message);
|
|
1557
|
+
}
|
|
1558
|
+
sendAndTransfer(message) {
|
|
1559
|
+
throw new Error('not implemented');
|
|
1560
|
+
}
|
|
1561
|
+
dispose() {
|
|
1562
|
+
this._rawIpc.close();
|
|
1563
|
+
}
|
|
1564
|
+
onMessage(callback) {
|
|
1565
|
+
this._rawIpc.addEventListener('message', callback);
|
|
1566
|
+
}
|
|
1567
|
+
onClose(callback) {}
|
|
1568
|
+
}
|
|
1569
|
+
const wrap$5 = messagePort => {
|
|
1570
|
+
return new IpcParentWithMessagePort(messagePort);
|
|
1571
|
+
};
|
|
1572
|
+
const IpcParentWithMessagePort$1 = {
|
|
1573
|
+
__proto__: null,
|
|
1574
|
+
create: create$5$2,
|
|
1575
|
+
signal: signal$1,
|
|
1576
|
+
wrap: wrap$5
|
|
1577
|
+
};
|
|
1654
1578
|
const stringifyCompact = value => {
|
|
1655
1579
|
return JSON.stringify(value);
|
|
1656
1580
|
};
|
|
@@ -1703,139 +1627,17 @@ let IpcParentWithWebSocket$1 = class IpcParentWithWebSocket extends Ipc {
|
|
|
1703
1627
|
this._rawIpc.addEventListener('message', callback);
|
|
1704
1628
|
}
|
|
1705
1629
|
};
|
|
1706
|
-
const wrap$
|
|
1630
|
+
const wrap$1 = webSocket => {
|
|
1707
1631
|
return new IpcParentWithWebSocket$1(webSocket);
|
|
1708
1632
|
};
|
|
1709
1633
|
const IpcParentWithWebSocket$1$1 = {
|
|
1710
1634
|
__proto__: null,
|
|
1711
1635
|
create: create$9,
|
|
1712
|
-
wrap: wrap$3
|
|
1713
|
-
};
|
|
1714
|
-
|
|
1715
|
-
const getWebSocketProtocol = () => {
|
|
1716
|
-
return location.protocol === 'https:' ? 'wss:' : 'ws:';
|
|
1717
|
-
};
|
|
1718
|
-
|
|
1719
|
-
const getWebSocketUrl = type => {
|
|
1720
|
-
const wsProtocol = getWebSocketProtocol();
|
|
1721
|
-
return `${wsProtocol}//${location.host}/websocket/${type}`;
|
|
1722
|
-
};
|
|
1723
|
-
|
|
1724
|
-
const create$8 = async ({
|
|
1725
|
-
type
|
|
1726
|
-
}) => {
|
|
1727
|
-
string(type);
|
|
1728
|
-
const wsUrl = getWebSocketUrl(type);
|
|
1729
|
-
const webSocket = new WebSocket(wsUrl);
|
|
1730
|
-
return IpcParentWithWebSocket$1$1.create({
|
|
1731
|
-
webSocket
|
|
1732
|
-
});
|
|
1733
|
-
};
|
|
1734
|
-
const wrap$2 = webSocket => {
|
|
1735
|
-
return IpcParentWithWebSocket$1$1.wrap(webSocket);
|
|
1736
|
-
};
|
|
1737
|
-
|
|
1738
|
-
const IpcParentWithWebSocket = {
|
|
1739
|
-
__proto__: null,
|
|
1740
|
-
create: create$8,
|
|
1741
|
-
wrap: wrap$2
|
|
1742
|
-
};
|
|
1743
|
-
|
|
1744
|
-
const Electron = 'electron';
|
|
1745
|
-
const Remote = 'remote';
|
|
1746
|
-
const Web = 'web';
|
|
1747
|
-
const Test = 'test';
|
|
1748
|
-
|
|
1749
|
-
const getPlatform = () => {
|
|
1750
|
-
// @ts-ignore
|
|
1751
|
-
if (typeof PLATFORM !== 'undefined') {
|
|
1752
|
-
// @ts-ignore
|
|
1753
|
-
return PLATFORM;
|
|
1754
|
-
}
|
|
1755
|
-
if (typeof process !== 'undefined' && process.env.NODE_ENV === 'test') {
|
|
1756
|
-
return Test;
|
|
1757
|
-
}
|
|
1758
|
-
// TODO find a better way to pass runtime environment
|
|
1759
|
-
if (typeof name !== 'undefined' && name.endsWith('(Electron)')) {
|
|
1760
|
-
return Electron;
|
|
1761
|
-
}
|
|
1762
|
-
if (typeof name !== 'undefined' && name.endsWith('(Web)')) {
|
|
1763
|
-
return Web;
|
|
1764
|
-
}
|
|
1765
|
-
return Remote;
|
|
1766
|
-
};
|
|
1767
|
-
const platform = getPlatform(); // TODO tree-shake this out in production
|
|
1768
|
-
|
|
1769
|
-
const getModule$3 = () => {
|
|
1770
|
-
switch (platform) {
|
|
1771
|
-
case Remote:
|
|
1772
|
-
return IpcParentWithWebSocket;
|
|
1773
|
-
default:
|
|
1774
|
-
return IpcParentWithElectronMessagePort;
|
|
1775
|
-
}
|
|
1776
|
-
};
|
|
1777
|
-
const create$7 = async ({
|
|
1778
|
-
type,
|
|
1779
|
-
raw
|
|
1780
|
-
}) => {
|
|
1781
|
-
const module = getModule$3();
|
|
1782
|
-
const rawIpc = await module.create({
|
|
1783
|
-
type
|
|
1784
|
-
});
|
|
1785
|
-
if (raw) {
|
|
1786
|
-
return rawIpc;
|
|
1787
|
-
}
|
|
1788
|
-
return {
|
|
1789
|
-
module,
|
|
1790
|
-
rawIpc
|
|
1791
|
-
};
|
|
1792
|
-
};
|
|
1793
|
-
const wrap$1 = ({
|
|
1794
|
-
module,
|
|
1795
|
-
rawIpc
|
|
1796
|
-
}) => {
|
|
1797
|
-
return module.wrap(rawIpc);
|
|
1798
|
-
};
|
|
1799
|
-
|
|
1800
|
-
const IpcParentWithNode = {
|
|
1801
|
-
__proto__: null,
|
|
1802
|
-
create: create$7,
|
|
1803
1636
|
wrap: wrap$1
|
|
1804
1637
|
};
|
|
1805
1638
|
|
|
1806
|
-
const getModule$2 = method => {
|
|
1807
|
-
switch (method) {
|
|
1808
|
-
case WebSocket$1:
|
|
1809
|
-
return IpcParentWithWebSocket;
|
|
1810
|
-
case ElectronMessagePort:
|
|
1811
|
-
return IpcParentWithNode;
|
|
1812
|
-
case ModuleWorkerAndWorkaroundForChromeDevtoolsBug$1:
|
|
1813
|
-
return IpcParentWithModuleWorkerAndWorkaroundForChromeDevtoolsBug;
|
|
1814
|
-
default:
|
|
1815
|
-
throw new Error('unexpected ipc type');
|
|
1816
|
-
}
|
|
1817
|
-
};
|
|
1818
|
-
|
|
1819
|
-
const create$6 = async ({
|
|
1820
|
-
method,
|
|
1821
|
-
...options
|
|
1822
|
-
}) => {
|
|
1823
|
-
try {
|
|
1824
|
-
const module = getModule$2(method);
|
|
1825
|
-
// @ts-ignore
|
|
1826
|
-
const rawIpc = await module.create(options);
|
|
1827
|
-
// @ts-ignore
|
|
1828
|
-
const ipc = module.wrap(rawIpc);
|
|
1829
|
-
return ipc;
|
|
1830
|
-
} catch (error) {
|
|
1831
|
-
throw new VError(error, `Failed to create ipc`);
|
|
1832
|
-
}
|
|
1833
|
-
};
|
|
1834
|
-
|
|
1835
|
-
const JsonRpc = 1;
|
|
1836
|
-
|
|
1837
1639
|
const Two = '2.0';
|
|
1838
|
-
const create$4 = (method, params) => {
|
|
1640
|
+
const create$4$1 = (method, params) => {
|
|
1839
1641
|
return {
|
|
1840
1642
|
jsonrpc: Two,
|
|
1841
1643
|
method,
|
|
@@ -1846,7 +1648,7 @@ const callbacks = Object.create(null);
|
|
|
1846
1648
|
const set$3 = (id, fn) => {
|
|
1847
1649
|
callbacks[id] = fn;
|
|
1848
1650
|
};
|
|
1849
|
-
const get$
|
|
1651
|
+
const get$4 = id => {
|
|
1850
1652
|
return callbacks[id];
|
|
1851
1653
|
};
|
|
1852
1654
|
const remove = id => {
|
|
@@ -2019,7 +1821,7 @@ const warn = (...args) => {
|
|
|
2019
1821
|
console.warn(...args);
|
|
2020
1822
|
};
|
|
2021
1823
|
const resolve = (id, response) => {
|
|
2022
|
-
const fn = get$
|
|
1824
|
+
const fn = get$4(id);
|
|
2023
1825
|
if (!fn) {
|
|
2024
1826
|
console.log(response);
|
|
2025
1827
|
warn(`callback ${id} may already be disposed`);
|
|
@@ -2058,7 +1860,7 @@ const getErrorProperty = (error, prettyError) => {
|
|
|
2058
1860
|
}
|
|
2059
1861
|
};
|
|
2060
1862
|
};
|
|
2061
|
-
const create$1$
|
|
1863
|
+
const create$1$2 = (message, error) => {
|
|
2062
1864
|
return {
|
|
2063
1865
|
jsonrpc: Two,
|
|
2064
1866
|
id: message.id,
|
|
@@ -2069,9 +1871,9 @@ const getErrorResponse = (message, error, preparePrettyError, logError) => {
|
|
|
2069
1871
|
const prettyError = preparePrettyError(error);
|
|
2070
1872
|
logError(error, prettyError);
|
|
2071
1873
|
const errorProperty = getErrorProperty(error, prettyError);
|
|
2072
|
-
return create$1$
|
|
1874
|
+
return create$1$2(message, errorProperty);
|
|
2073
1875
|
};
|
|
2074
|
-
const create$
|
|
1876
|
+
const create$8 = (message, result) => {
|
|
2075
1877
|
return {
|
|
2076
1878
|
jsonrpc: Two,
|
|
2077
1879
|
id: message.id,
|
|
@@ -2080,7 +1882,7 @@ const create$5 = (message, result) => {
|
|
|
2080
1882
|
};
|
|
2081
1883
|
const getSuccessResponse = (message, result) => {
|
|
2082
1884
|
const resultProperty = result ?? null;
|
|
2083
|
-
return create$
|
|
1885
|
+
return create$8(message, resultProperty);
|
|
2084
1886
|
};
|
|
2085
1887
|
const getResponse = async (message, ipc, execute, preparePrettyError, logError, requiresSocket) => {
|
|
2086
1888
|
try {
|
|
@@ -2170,87 +1972,356 @@ const invokeHelper = async (ipc, method, params, useSendAndTransfer) => {
|
|
|
2170
1972
|
return unwrapJsonRpcResult(responseMessage);
|
|
2171
1973
|
};
|
|
2172
1974
|
const send = (transport, method, ...params) => {
|
|
2173
|
-
const message = create$4(method, params);
|
|
1975
|
+
const message = create$4$1(method, params);
|
|
2174
1976
|
transport.send(message);
|
|
2175
1977
|
};
|
|
2176
|
-
const invoke = (ipc, method, ...params) => {
|
|
1978
|
+
const invoke$1 = (ipc, method, ...params) => {
|
|
2177
1979
|
return invokeHelper(ipc, method, params, false);
|
|
2178
1980
|
};
|
|
2179
1981
|
const invokeAndTransfer = (ipc, method, ...params) => {
|
|
2180
1982
|
return invokeHelper(ipc, method, params, true);
|
|
2181
1983
|
};
|
|
2182
1984
|
|
|
2183
|
-
const
|
|
2184
|
-
|
|
1985
|
+
const commands = Object.create(null);
|
|
1986
|
+
const register$1 = commandMap => {
|
|
1987
|
+
Object.assign(commands, commandMap);
|
|
2185
1988
|
};
|
|
2186
|
-
const
|
|
2187
|
-
|
|
1989
|
+
const getCommand = key => {
|
|
1990
|
+
return commands[key];
|
|
2188
1991
|
};
|
|
2189
|
-
const
|
|
2190
|
-
|
|
1992
|
+
const execute = (command, ...args) => {
|
|
1993
|
+
const fn = getCommand(command);
|
|
1994
|
+
if (!fn) {
|
|
1995
|
+
throw new Error(`command not found ${command}`);
|
|
1996
|
+
}
|
|
1997
|
+
return fn(...args);
|
|
2191
1998
|
};
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
object(ipc);
|
|
2197
|
-
fn(execute);
|
|
2198
|
-
const handleMessage = async message => {
|
|
2199
|
-
return handleJsonRpcMessage(ipc, message, execute, resolve, preparePrettyError$2, logError$2, requiresSocket$2);
|
|
2200
|
-
};
|
|
2201
|
-
ipc.onmessage = handleMessage;
|
|
2202
|
-
return {
|
|
1999
|
+
|
|
2000
|
+
const createRpc$1 = ipc => {
|
|
2001
|
+
const rpc = {
|
|
2002
|
+
// @ts-ignore
|
|
2203
2003
|
ipc,
|
|
2004
|
+
/**
|
|
2005
|
+
* @deprecated
|
|
2006
|
+
*/
|
|
2007
|
+
send(method, ...params) {
|
|
2008
|
+
send(ipc, method, ...params);
|
|
2009
|
+
},
|
|
2204
2010
|
invoke(method, ...params) {
|
|
2205
|
-
return invoke(
|
|
2011
|
+
return invoke$1(ipc, method, ...params);
|
|
2012
|
+
},
|
|
2013
|
+
invokeAndTransfer(method, ...params) {
|
|
2014
|
+
return invokeAndTransfer(ipc, method, ...params);
|
|
2206
2015
|
}
|
|
2207
2016
|
};
|
|
2017
|
+
return rpc;
|
|
2208
2018
|
};
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
__proto__: null,
|
|
2212
|
-
create: create$3
|
|
2019
|
+
const requiresSocket = () => {
|
|
2020
|
+
return false;
|
|
2213
2021
|
};
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
switch (method) {
|
|
2217
|
-
case JsonRpc:
|
|
2218
|
-
return RpcParentWithJsonRpc;
|
|
2219
|
-
default:
|
|
2220
|
-
throw new Error('unexpected rpc type');
|
|
2221
|
-
}
|
|
2022
|
+
const preparePrettyError = error => {
|
|
2023
|
+
return error;
|
|
2222
2024
|
};
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2025
|
+
const logError = () => {
|
|
2026
|
+
// handled by renderer worker
|
|
2027
|
+
};
|
|
2028
|
+
const handleMessage = event => {
|
|
2029
|
+
const actualRequiresSocket = event?.target?.requiresSocket || requiresSocket;
|
|
2030
|
+
const actualExecute = event?.target?.execute || execute;
|
|
2031
|
+
return handleJsonRpcMessage(event.target, event.data, actualExecute, resolve, preparePrettyError, logError, actualRequiresSocket);
|
|
2032
|
+
};
|
|
2033
|
+
const handleIpc = ipc => {
|
|
2034
|
+
if ('addEventListener' in ipc) {
|
|
2035
|
+
ipc.addEventListener('message', handleMessage);
|
|
2036
|
+
} else if ('on' in ipc) {
|
|
2037
|
+
// deprecated
|
|
2038
|
+
ipc.on('message', handleMessage);
|
|
2039
|
+
}
|
|
2040
|
+
};
|
|
2041
|
+
const listen$1 = async (module, options) => {
|
|
2042
|
+
const rawIpc = await module.listen(options);
|
|
2043
|
+
if (module.signal) {
|
|
2044
|
+
module.signal(rawIpc);
|
|
2045
|
+
}
|
|
2046
|
+
const ipc = module.wrap(rawIpc);
|
|
2047
|
+
return ipc;
|
|
2048
|
+
};
|
|
2049
|
+
const create$6$1 = async ({
|
|
2050
|
+
commandMap,
|
|
2051
|
+
messagePort
|
|
2052
|
+
}) => {
|
|
2053
|
+
// TODO create a commandMap per rpc instance
|
|
2054
|
+
register$1(commandMap);
|
|
2055
|
+
const ipc = await listen$1(IpcChildWithMessagePort$1, {
|
|
2056
|
+
port: messagePort
|
|
2057
|
+
});
|
|
2058
|
+
handleIpc(ipc);
|
|
2059
|
+
const rpc = createRpc$1(ipc);
|
|
2060
|
+
return rpc;
|
|
2061
|
+
};
|
|
2062
|
+
const MessagePortRpcClient = {
|
|
2063
|
+
__proto__: null,
|
|
2064
|
+
create: create$6$1
|
|
2065
|
+
};
|
|
2066
|
+
const create$5$1 = async ({
|
|
2067
|
+
commandMap,
|
|
2068
|
+
messagePort,
|
|
2069
|
+
isMessagePortOpen
|
|
2070
|
+
}) => {
|
|
2071
|
+
// TODO create a commandMap per rpc instance
|
|
2072
|
+
register$1(commandMap);
|
|
2073
|
+
const rawIpc = await IpcParentWithMessagePort$1.create({
|
|
2074
|
+
messagePort,
|
|
2075
|
+
isMessagePortOpen
|
|
2076
|
+
});
|
|
2077
|
+
const ipc = IpcParentWithMessagePort$1.wrap(rawIpc);
|
|
2078
|
+
handleIpc(ipc);
|
|
2079
|
+
const rpc = createRpc$1(ipc);
|
|
2080
|
+
return rpc;
|
|
2081
|
+
};
|
|
2082
|
+
const MessagePortRpcParent = {
|
|
2083
|
+
__proto__: null,
|
|
2084
|
+
create: create$5$1
|
|
2085
|
+
};
|
|
2086
|
+
const create$1$1 = async ({
|
|
2087
|
+
commandMap,
|
|
2088
|
+
webSocket
|
|
2089
|
+
}) => {
|
|
2090
|
+
// TODO create a commandMap per rpc instance
|
|
2091
|
+
register$1(commandMap);
|
|
2092
|
+
const rawIpc = await IpcParentWithWebSocket$1$1.create({
|
|
2093
|
+
webSocket
|
|
2094
|
+
});
|
|
2095
|
+
const ipc = IpcParentWithWebSocket$1$1.wrap(rawIpc);
|
|
2096
|
+
handleIpc(ipc);
|
|
2097
|
+
const rpc = createRpc$1(ipc);
|
|
2098
|
+
return rpc;
|
|
2099
|
+
};
|
|
2100
|
+
const WebSocketRpcParent = {
|
|
2101
|
+
__proto__: null,
|
|
2102
|
+
create: create$1$1
|
|
2103
|
+
};
|
|
2104
|
+
const create$7 = async ({
|
|
2105
|
+
commandMap
|
|
2106
|
+
}) => {
|
|
2107
|
+
// TODO create a commandMap per rpc instance
|
|
2108
|
+
register$1(commandMap);
|
|
2109
|
+
const ipc = await listen$1(IpcChildWithModuleWorkerAndMessagePort$1);
|
|
2110
|
+
handleIpc(ipc);
|
|
2111
|
+
const rpc = createRpc$1(ipc);
|
|
2112
|
+
return rpc;
|
|
2113
|
+
};
|
|
2114
|
+
const WebWorkerRpcClient = {
|
|
2115
|
+
__proto__: null,
|
|
2116
|
+
create: create$7
|
|
2117
|
+
};
|
|
2118
|
+
|
|
2119
|
+
const getPortTuple = () => {
|
|
2120
|
+
const {
|
|
2121
|
+
port1,
|
|
2122
|
+
port2
|
|
2123
|
+
} = new MessageChannel();
|
|
2124
|
+
return {
|
|
2125
|
+
port1,
|
|
2126
|
+
port2
|
|
2127
|
+
};
|
|
2128
|
+
};
|
|
2129
|
+
|
|
2130
|
+
const ModuleWorkerAndWorkaroundForChromeDevtoolsBug = 6;
|
|
2131
|
+
|
|
2132
|
+
const sendPort = async ({
|
|
2133
|
+
url,
|
|
2134
|
+
name,
|
|
2135
|
+
port
|
|
2136
|
+
}) => {
|
|
2137
|
+
await invokeAndTransfer$1('IpcParent.create', {
|
|
2138
|
+
method: ModuleWorkerAndWorkaroundForChromeDevtoolsBug,
|
|
2139
|
+
url,
|
|
2140
|
+
name,
|
|
2141
|
+
raw: true,
|
|
2142
|
+
port
|
|
2143
|
+
});
|
|
2144
|
+
};
|
|
2145
|
+
const create$6 = async ({
|
|
2146
|
+
url,
|
|
2147
|
+
name,
|
|
2148
|
+
commandMap
|
|
2149
|
+
}) => {
|
|
2150
|
+
string(url);
|
|
2151
|
+
string(name);
|
|
2152
|
+
const {
|
|
2153
|
+
port1,
|
|
2154
|
+
port2
|
|
2155
|
+
} = getPortTuple();
|
|
2156
|
+
const rpcPromise = MessagePortRpcParent.create({
|
|
2157
|
+
messagePort: port2,
|
|
2158
|
+
isMessagePortOpen: true,
|
|
2159
|
+
commandMap
|
|
2160
|
+
});
|
|
2161
|
+
// TODO rpc module should start port
|
|
2162
|
+
port2.start();
|
|
2163
|
+
await sendPort({
|
|
2164
|
+
url,
|
|
2165
|
+
name,
|
|
2166
|
+
port: port1
|
|
2167
|
+
});
|
|
2168
|
+
const rpc = await rpcPromise;
|
|
2169
|
+
return rpc;
|
|
2170
|
+
};
|
|
2171
|
+
|
|
2172
|
+
const IpcParentWithModuleWorkerAndWorkaroundForChromeDevtoolsBug = {
|
|
2173
|
+
__proto__: null,
|
|
2174
|
+
create: create$6
|
|
2175
|
+
};
|
|
2176
|
+
|
|
2177
|
+
const sendMessagePortToElectron = async (port, initialCommand) => {
|
|
2178
|
+
await invokeAndTransfer$1('SendMessagePortToElectron.sendMessagePortToElectron', port, initialCommand);
|
|
2179
|
+
};
|
|
2180
|
+
|
|
2181
|
+
const getPort = async type => {
|
|
2182
|
+
const {
|
|
2183
|
+
port1,
|
|
2184
|
+
port2
|
|
2185
|
+
} = getPortTuple();
|
|
2186
|
+
await sendMessagePortToElectron(port1, 'HandleMessagePortForExtensionHostHelperProcess.handleMessagePortForExtensionHostHelperProcess');
|
|
2187
|
+
return port2;
|
|
2188
|
+
};
|
|
2189
|
+
const create$5 = async ({
|
|
2190
|
+
type
|
|
2227
2191
|
}) => {
|
|
2228
|
-
const
|
|
2192
|
+
const port = await getPort();
|
|
2193
|
+
const rpc = await MessagePortRpcParent.create({
|
|
2194
|
+
messagePort: port,
|
|
2195
|
+
isMessagePortOpen: true,
|
|
2196
|
+
commandMap: {}
|
|
2197
|
+
});
|
|
2198
|
+
return rpc;
|
|
2199
|
+
};
|
|
2200
|
+
|
|
2201
|
+
const IpcParentWithElectronMessagePort = {
|
|
2202
|
+
__proto__: null,
|
|
2203
|
+
create: create$5
|
|
2204
|
+
};
|
|
2205
|
+
|
|
2206
|
+
const getWebSocketProtocol = () => {
|
|
2207
|
+
return location.protocol === 'https:' ? 'wss:' : 'ws:';
|
|
2208
|
+
};
|
|
2209
|
+
|
|
2210
|
+
const getWebSocketUrl = type => {
|
|
2211
|
+
const wsProtocol = getWebSocketProtocol();
|
|
2212
|
+
return `${wsProtocol}//${location.host}/websocket/${type}`;
|
|
2213
|
+
};
|
|
2214
|
+
|
|
2215
|
+
const create$4 = async ({
|
|
2216
|
+
type
|
|
2217
|
+
}) => {
|
|
2218
|
+
string(type);
|
|
2219
|
+
const wsUrl = getWebSocketUrl(type);
|
|
2220
|
+
const webSocket = new WebSocket(wsUrl);
|
|
2221
|
+
const rpc = await WebSocketRpcParent.create({
|
|
2222
|
+
webSocket,
|
|
2223
|
+
commandMap: {}
|
|
2224
|
+
});
|
|
2225
|
+
return rpc;
|
|
2226
|
+
};
|
|
2227
|
+
|
|
2228
|
+
const IpcParentWithWebSocket = {
|
|
2229
|
+
__proto__: null,
|
|
2230
|
+
create: create$4
|
|
2231
|
+
};
|
|
2232
|
+
|
|
2233
|
+
const Electron = 'electron';
|
|
2234
|
+
const Remote = 'remote';
|
|
2235
|
+
const Web = 'web';
|
|
2236
|
+
const Test = 'test';
|
|
2237
|
+
|
|
2238
|
+
const getPlatform = () => {
|
|
2229
2239
|
// @ts-ignore
|
|
2230
|
-
|
|
2240
|
+
if (typeof PLATFORM !== 'undefined') {
|
|
2241
|
+
// @ts-ignore
|
|
2242
|
+
return PLATFORM;
|
|
2243
|
+
}
|
|
2244
|
+
if (typeof process !== 'undefined' && process.env.NODE_ENV === 'test') {
|
|
2245
|
+
return Test;
|
|
2246
|
+
}
|
|
2247
|
+
// TODO find a better way to pass runtime environment
|
|
2248
|
+
if (typeof name !== 'undefined' && name.endsWith('(Electron)')) {
|
|
2249
|
+
return Electron;
|
|
2250
|
+
}
|
|
2251
|
+
if (typeof name !== 'undefined' && name.endsWith('(Web)')) {
|
|
2252
|
+
return Web;
|
|
2253
|
+
}
|
|
2254
|
+
return Remote;
|
|
2255
|
+
};
|
|
2256
|
+
const platform = getPlatform(); // TODO tree-shake this out in production
|
|
2257
|
+
|
|
2258
|
+
const getModule$1 = platform => {
|
|
2259
|
+
switch (platform) {
|
|
2260
|
+
case Remote:
|
|
2261
|
+
return IpcParentWithWebSocket;
|
|
2262
|
+
default:
|
|
2263
|
+
return IpcParentWithElectronMessagePort;
|
|
2264
|
+
}
|
|
2265
|
+
};
|
|
2266
|
+
const create$3 = async ({
|
|
2267
|
+
type,
|
|
2268
|
+
raw
|
|
2269
|
+
}) => {
|
|
2270
|
+
const module = getModule$1(platform);
|
|
2271
|
+
const rpc = await module.create({
|
|
2272
|
+
type
|
|
2273
|
+
});
|
|
2231
2274
|
return rpc;
|
|
2232
2275
|
};
|
|
2233
2276
|
|
|
2234
|
-
const
|
|
2277
|
+
const IpcParentWithNode = {
|
|
2278
|
+
__proto__: null,
|
|
2279
|
+
create: create$3
|
|
2280
|
+
};
|
|
2281
|
+
|
|
2282
|
+
const getModule = method => {
|
|
2283
|
+
switch (method) {
|
|
2284
|
+
case WebSocket$1:
|
|
2285
|
+
return IpcParentWithWebSocket;
|
|
2286
|
+
case ElectronMessagePort:
|
|
2287
|
+
return IpcParentWithNode;
|
|
2288
|
+
case ModuleWorkerAndWorkaroundForChromeDevtoolsBug$1:
|
|
2289
|
+
return IpcParentWithModuleWorkerAndWorkaroundForChromeDevtoolsBug;
|
|
2290
|
+
default:
|
|
2291
|
+
throw new Error('unexpected ipc type');
|
|
2292
|
+
}
|
|
2293
|
+
};
|
|
2294
|
+
|
|
2295
|
+
const create$2 = async ({
|
|
2296
|
+
method,
|
|
2297
|
+
...options
|
|
2298
|
+
}) => {
|
|
2299
|
+
try {
|
|
2300
|
+
const module = getModule(method);
|
|
2301
|
+
// @ts-ignore
|
|
2302
|
+
const rpc = await module.create(options);
|
|
2303
|
+
return rpc;
|
|
2304
|
+
} catch (error) {
|
|
2305
|
+
throw new VError(error, `Failed to create rpc`);
|
|
2306
|
+
}
|
|
2307
|
+
};
|
|
2308
|
+
|
|
2309
|
+
const defaultExecute = () => {
|
|
2235
2310
|
throw new Error('not implemented');
|
|
2236
2311
|
};
|
|
2237
2312
|
const createNodeRpc = async ({
|
|
2238
2313
|
path,
|
|
2239
|
-
execute = defaultExecute
|
|
2314
|
+
execute = defaultExecute,
|
|
2240
2315
|
name = ''
|
|
2241
2316
|
}) => {
|
|
2242
2317
|
try {
|
|
2243
2318
|
string(path);
|
|
2244
2319
|
fn(execute);
|
|
2245
|
-
const
|
|
2320
|
+
const rpc = await create$2({
|
|
2246
2321
|
method: ElectronMessagePort,
|
|
2247
2322
|
type: 'extension-host-helper-process',
|
|
2248
|
-
name
|
|
2249
|
-
|
|
2250
|
-
const rpc = await create$2({
|
|
2251
|
-
ipc,
|
|
2252
|
-
method: JsonRpc,
|
|
2253
|
-
execute
|
|
2323
|
+
name,
|
|
2324
|
+
commandMap: {}
|
|
2254
2325
|
});
|
|
2255
2326
|
await rpc.invoke('LoadFile.loadFile', path);
|
|
2256
2327
|
return rpc;
|
|
@@ -2261,7 +2332,7 @@ const createNodeRpc = async ({
|
|
|
2261
2332
|
|
|
2262
2333
|
const confirm = message => {
|
|
2263
2334
|
string(message);
|
|
2264
|
-
const result = invoke$
|
|
2335
|
+
const result = invoke$2('ConfirmPrompt.prompt', message);
|
|
2265
2336
|
return result;
|
|
2266
2337
|
};
|
|
2267
2338
|
|
|
@@ -2273,7 +2344,7 @@ const showQuickPick = async ({
|
|
|
2273
2344
|
}) => {
|
|
2274
2345
|
const rawPicks = await getPicks();
|
|
2275
2346
|
const picks = rawPicks.map(toPick);
|
|
2276
|
-
return invoke$
|
|
2347
|
+
return invoke$2(ExtensionHostQuickPickShow, picks);
|
|
2277
2348
|
};
|
|
2278
2349
|
|
|
2279
2350
|
const {
|
|
@@ -2281,7 +2352,7 @@ const {
|
|
|
2281
2352
|
executeReferenceProvider,
|
|
2282
2353
|
executefileReferenceProvider,
|
|
2283
2354
|
reset: reset$4
|
|
2284
|
-
} = create$
|
|
2355
|
+
} = create$a({
|
|
2285
2356
|
name: 'Reference',
|
|
2286
2357
|
resultShape: {
|
|
2287
2358
|
type: Array$1,
|
|
@@ -2308,7 +2379,7 @@ const {
|
|
|
2308
2379
|
executeRenameProvider,
|
|
2309
2380
|
executeprepareRenameProvider,
|
|
2310
2381
|
reset: reset$3
|
|
2311
|
-
} = create$
|
|
2382
|
+
} = create$a({
|
|
2312
2383
|
name: 'Rename',
|
|
2313
2384
|
resultShape: {
|
|
2314
2385
|
type: Object$1,
|
|
@@ -2333,11 +2404,7 @@ const extensionHostSubWorkerUrl = getExtensionHostSubWorkerUrl();
|
|
|
2333
2404
|
|
|
2334
2405
|
const set$2 = async (url, contentSecurityPolicy) => {
|
|
2335
2406
|
const pathName = new URL(url).pathname;
|
|
2336
|
-
await invoke$
|
|
2337
|
-
};
|
|
2338
|
-
|
|
2339
|
-
const defaultExecute$1 = () => {
|
|
2340
|
-
throw new Error('not implemented');
|
|
2407
|
+
await invoke$2('ExtensionHostWorkerContentSecurityPolicy.set', pathName, contentSecurityPolicy);
|
|
2341
2408
|
};
|
|
2342
2409
|
|
|
2343
2410
|
/**
|
|
@@ -2347,25 +2414,27 @@ const defaultExecute$1 = () => {
|
|
|
2347
2414
|
const createLegacyRpc = async ({
|
|
2348
2415
|
url,
|
|
2349
2416
|
name,
|
|
2350
|
-
execute
|
|
2417
|
+
execute,
|
|
2418
|
+
commandMap = {},
|
|
2351
2419
|
contentSecurityPolicy
|
|
2352
2420
|
}) => {
|
|
2353
2421
|
string(url);
|
|
2354
2422
|
string(name);
|
|
2355
|
-
|
|
2423
|
+
object(commandMap);
|
|
2356
2424
|
if (contentSecurityPolicy) {
|
|
2357
2425
|
await set$2(url, contentSecurityPolicy);
|
|
2358
2426
|
}
|
|
2359
|
-
const
|
|
2427
|
+
const rpc = await create$2({
|
|
2360
2428
|
method: ModuleWorkerAndWorkaroundForChromeDevtoolsBug$1,
|
|
2361
2429
|
url: extensionHostSubWorkerUrl,
|
|
2362
|
-
name
|
|
2363
|
-
|
|
2364
|
-
const rpc = await create$2({
|
|
2365
|
-
ipc,
|
|
2366
|
-
method: JsonRpc,
|
|
2367
|
-
execute
|
|
2430
|
+
name,
|
|
2431
|
+
commandMap
|
|
2368
2432
|
});
|
|
2433
|
+
if (execute) {
|
|
2434
|
+
// deprecated
|
|
2435
|
+
// @ts-ignore
|
|
2436
|
+
rpc.ipc.execute = execute;
|
|
2437
|
+
}
|
|
2369
2438
|
await rpc.invoke('LoadFile.loadFile', url);
|
|
2370
2439
|
return rpc;
|
|
2371
2440
|
};
|
|
@@ -2374,92 +2443,92 @@ const rpcs$1 = Object.create(null);
|
|
|
2374
2443
|
const add$1 = (id, rpc) => {
|
|
2375
2444
|
rpcs$1[id] = rpc;
|
|
2376
2445
|
};
|
|
2377
|
-
const get$
|
|
2446
|
+
const get$3 = id => {
|
|
2378
2447
|
return rpcs$1[id];
|
|
2379
2448
|
};
|
|
2380
2449
|
|
|
2381
2450
|
const registry = Object.create(null);
|
|
2382
2451
|
const rpcs = Object.create(null);
|
|
2383
|
-
const register
|
|
2452
|
+
const register = (id, execute) => {
|
|
2384
2453
|
registry[id] = execute;
|
|
2385
2454
|
};
|
|
2386
|
-
const
|
|
2387
|
-
const fn = registry[id];
|
|
2388
|
-
delete registry[id];
|
|
2389
|
-
return fn;
|
|
2390
|
-
};
|
|
2391
|
-
const get$1 = id => {
|
|
2455
|
+
const get$2 = id => {
|
|
2392
2456
|
return rpcs[id];
|
|
2393
2457
|
};
|
|
2394
2458
|
const set$1 = (id, rpc) => {
|
|
2395
2459
|
rpcs[id] = rpc;
|
|
2396
2460
|
};
|
|
2397
2461
|
|
|
2398
|
-
const createRpcWithId$1 = async id => {
|
|
2399
|
-
const
|
|
2400
|
-
const info = get$2(id);
|
|
2462
|
+
const createRpcWithId$1 = async (id, commandMap, execute) => {
|
|
2463
|
+
const info = get$3(id);
|
|
2401
2464
|
if (!info) {
|
|
2402
2465
|
throw new Error(`rpc with id ${id} not found`);
|
|
2403
2466
|
}
|
|
2404
|
-
const
|
|
2467
|
+
const rpc = await create$2({
|
|
2405
2468
|
method: ModuleWorkerAndWorkaroundForChromeDevtoolsBug$1,
|
|
2406
2469
|
url: extensionHostSubWorkerUrl,
|
|
2407
|
-
name: info.name
|
|
2470
|
+
name: info.name,
|
|
2471
|
+
commandMap,
|
|
2472
|
+
isMessagePortOpen: true
|
|
2408
2473
|
});
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
return newRpc;
|
|
2474
|
+
if (execute) {
|
|
2475
|
+
// @ts-ignore
|
|
2476
|
+
rpc.ipc.execute = execute;
|
|
2477
|
+
}
|
|
2478
|
+
await rpc.invoke('LoadFile.loadFile', info.url);
|
|
2479
|
+
set$1(id, rpc);
|
|
2480
|
+
return rpc;
|
|
2417
2481
|
};
|
|
2418
2482
|
|
|
2419
|
-
const getOrCreateRpc = async id => {
|
|
2420
|
-
const rpc = get$
|
|
2483
|
+
const getOrCreateRpc = async (id, commandMap, execute) => {
|
|
2484
|
+
const rpc = get$2(id);
|
|
2421
2485
|
if (!rpc) {
|
|
2422
|
-
set$1(id, createRpcWithId$1(id));
|
|
2486
|
+
set$1(id, createRpcWithId$1(id, commandMap, execute));
|
|
2423
2487
|
}
|
|
2424
|
-
return get$
|
|
2488
|
+
return get$2(id);
|
|
2425
2489
|
};
|
|
2426
2490
|
const createRpcWithId = ({
|
|
2427
2491
|
id,
|
|
2492
|
+
commandMap,
|
|
2428
2493
|
execute
|
|
2429
2494
|
}) => {
|
|
2430
2495
|
string(id);
|
|
2431
|
-
register
|
|
2496
|
+
register(id, commandMap);
|
|
2432
2497
|
const lazyRpc = {
|
|
2433
2498
|
async invoke(method, ...params) {
|
|
2434
|
-
const rpc = await getOrCreateRpc(id);
|
|
2499
|
+
const rpc = await getOrCreateRpc(id, commandMap, execute);
|
|
2435
2500
|
return rpc.invoke(method, ...params);
|
|
2436
2501
|
}
|
|
2437
2502
|
};
|
|
2438
2503
|
return lazyRpc;
|
|
2439
2504
|
};
|
|
2440
2505
|
|
|
2441
|
-
const
|
|
2442
|
-
throw new Error('not implemented');
|
|
2443
|
-
};
|
|
2444
|
-
const createRpc$1 = ({
|
|
2506
|
+
const createRpc = ({
|
|
2445
2507
|
id,
|
|
2446
2508
|
url,
|
|
2447
2509
|
name,
|
|
2448
|
-
|
|
2449
|
-
contentSecurityPolicy
|
|
2510
|
+
commandMap,
|
|
2511
|
+
contentSecurityPolicy,
|
|
2512
|
+
execute
|
|
2450
2513
|
}) => {
|
|
2451
2514
|
try {
|
|
2515
|
+
if (execute && !commandMap) {
|
|
2516
|
+
console.info(`[extension-host-worker] The rpc execute function is deprecated. Use the commandMap property instead.`);
|
|
2517
|
+
}
|
|
2518
|
+
commandMap ||= {};
|
|
2452
2519
|
if (id) {
|
|
2453
2520
|
string(id);
|
|
2454
2521
|
return createRpcWithId({
|
|
2455
2522
|
id,
|
|
2456
|
-
execute
|
|
2523
|
+
execute,
|
|
2524
|
+
commandMap
|
|
2457
2525
|
});
|
|
2458
2526
|
}
|
|
2459
2527
|
return createLegacyRpc({
|
|
2460
2528
|
url,
|
|
2461
2529
|
name,
|
|
2462
2530
|
execute,
|
|
2531
|
+
commandMap,
|
|
2463
2532
|
contentSecurityPolicy
|
|
2464
2533
|
});
|
|
2465
2534
|
} catch (error) {
|
|
@@ -2471,7 +2540,7 @@ const {
|
|
|
2471
2540
|
registerSelectionProvider,
|
|
2472
2541
|
executeSelectionProvider,
|
|
2473
2542
|
reset: reset$2
|
|
2474
|
-
} = create$
|
|
2543
|
+
} = create$a({
|
|
2475
2544
|
name: 'Selection',
|
|
2476
2545
|
resultShape: {
|
|
2477
2546
|
allowUndefined: true,
|
|
@@ -2482,17 +2551,17 @@ const {
|
|
|
2482
2551
|
}
|
|
2483
2552
|
});
|
|
2484
2553
|
|
|
2485
|
-
const state$
|
|
2554
|
+
const state$6 = {
|
|
2486
2555
|
providers: Object.create(null)
|
|
2487
2556
|
};
|
|
2488
2557
|
const registerSourceControlProvider = provider => {
|
|
2489
|
-
state$
|
|
2558
|
+
state$6.providers[provider.id] = provider;
|
|
2490
2559
|
};
|
|
2491
2560
|
const getFilesFromProvider = provider => {
|
|
2492
2561
|
return provider.getChangedFiles();
|
|
2493
2562
|
};
|
|
2494
2563
|
const getChangedFiles = async providerId => {
|
|
2495
|
-
const provider = state$
|
|
2564
|
+
const provider = state$6.providers[providerId];
|
|
2496
2565
|
if (!provider) {
|
|
2497
2566
|
throw new Error('no source control provider found');
|
|
2498
2567
|
}
|
|
@@ -2503,7 +2572,7 @@ const getChangedFiles = async providerId => {
|
|
|
2503
2572
|
const getFileBefore = async (providerId, uri) => {
|
|
2504
2573
|
string(providerId);
|
|
2505
2574
|
string(uri);
|
|
2506
|
-
const provider = state$
|
|
2575
|
+
const provider = state$6.providers[providerId];
|
|
2507
2576
|
if (!provider) {
|
|
2508
2577
|
throw new Error('no source control provider found');
|
|
2509
2578
|
}
|
|
@@ -2525,7 +2594,7 @@ const getGroupsFromProvider = async (provider, cwd) => {
|
|
|
2525
2594
|
throw new Error('source control provider is missing required function getGroups');
|
|
2526
2595
|
};
|
|
2527
2596
|
const getGroups = async (providerId, cwd) => {
|
|
2528
|
-
const provider = state$
|
|
2597
|
+
const provider = state$6.providers[providerId];
|
|
2529
2598
|
if (!provider) {
|
|
2530
2599
|
throw new Error('no source control provider found');
|
|
2531
2600
|
}
|
|
@@ -2533,14 +2602,14 @@ const getGroups = async (providerId, cwd) => {
|
|
|
2533
2602
|
return groups;
|
|
2534
2603
|
};
|
|
2535
2604
|
const acceptInput = async (providerId, value) => {
|
|
2536
|
-
const provider = state$
|
|
2605
|
+
const provider = state$6.providers[providerId];
|
|
2537
2606
|
if (!provider) {
|
|
2538
2607
|
throw new Error('no source control provider found');
|
|
2539
2608
|
}
|
|
2540
2609
|
await provider.acceptInput(value);
|
|
2541
2610
|
};
|
|
2542
2611
|
const add = async path => {
|
|
2543
|
-
const provider = Object.values(state$
|
|
2612
|
+
const provider = Object.values(state$6.providers)[0];
|
|
2544
2613
|
if (!provider) {
|
|
2545
2614
|
return;
|
|
2546
2615
|
}
|
|
@@ -2548,7 +2617,7 @@ const add = async path => {
|
|
|
2548
2617
|
await provider.add(path);
|
|
2549
2618
|
};
|
|
2550
2619
|
const discard = async path => {
|
|
2551
|
-
const provider = Object.values(state$
|
|
2620
|
+
const provider = Object.values(state$6.providers)[0];
|
|
2552
2621
|
if (!provider) {
|
|
2553
2622
|
return;
|
|
2554
2623
|
}
|
|
@@ -2558,7 +2627,7 @@ const discard = async path => {
|
|
|
2558
2627
|
const getEnabledProviderIds = async (scheme, root) => {
|
|
2559
2628
|
string(scheme);
|
|
2560
2629
|
string(root);
|
|
2561
|
-
const providers = Object.values(state$
|
|
2630
|
+
const providers = Object.values(state$6.providers);
|
|
2562
2631
|
const enabledIds = [];
|
|
2563
2632
|
for (const provider of providers) {
|
|
2564
2633
|
// @ts-ignore
|
|
@@ -2579,7 +2648,7 @@ const {
|
|
|
2579
2648
|
registerTabCompletionProvider,
|
|
2580
2649
|
executeTabCompletionProvider,
|
|
2581
2650
|
reset: reset$1
|
|
2582
|
-
} = create$
|
|
2651
|
+
} = create$a({
|
|
2583
2652
|
name: 'TabCompletion',
|
|
2584
2653
|
resultShape: {
|
|
2585
2654
|
type: Object$1,
|
|
@@ -2587,7 +2656,7 @@ const {
|
|
|
2587
2656
|
}
|
|
2588
2657
|
});
|
|
2589
2658
|
|
|
2590
|
-
const state$
|
|
2659
|
+
const state$5 = {
|
|
2591
2660
|
textSearchProviders: Object.create(null)
|
|
2592
2661
|
};
|
|
2593
2662
|
const registerTextSearchProvider = textSearchProvider => {
|
|
@@ -2598,14 +2667,14 @@ const registerTextSearchProvider = textSearchProvider => {
|
|
|
2598
2667
|
if (!textSearchProvider.scheme) {
|
|
2599
2668
|
throw new Error('textSearchProvider is missing scheme');
|
|
2600
2669
|
}
|
|
2601
|
-
state$
|
|
2670
|
+
state$5.textSearchProviders[textSearchProvider.scheme] = textSearchProvider;
|
|
2602
2671
|
} catch (error) {
|
|
2603
2672
|
throw new VError(error, 'Failed to register text search provider');
|
|
2604
2673
|
}
|
|
2605
2674
|
};
|
|
2606
2675
|
const executeTextSearchProvider = async (scheme, query) => {
|
|
2607
2676
|
try {
|
|
2608
|
-
const textSearchProvider = state$
|
|
2677
|
+
const textSearchProvider = state$5.textSearchProviders[scheme];
|
|
2609
2678
|
if (!textSearchProvider) {
|
|
2610
2679
|
throw new Error(`No text search provider for ${scheme} found`);
|
|
2611
2680
|
}
|
|
@@ -2620,7 +2689,7 @@ const {
|
|
|
2620
2689
|
registerTypeDefinitionProvider,
|
|
2621
2690
|
executeTypeDefinitionProvider,
|
|
2622
2691
|
reset
|
|
2623
|
-
} = create$
|
|
2692
|
+
} = create$a({
|
|
2624
2693
|
name: 'TypeDefinition',
|
|
2625
2694
|
resultShape: {
|
|
2626
2695
|
allowUndefined: true,
|
|
@@ -2648,38 +2717,6 @@ const getProtocol = uri => {
|
|
|
2648
2717
|
return '';
|
|
2649
2718
|
};
|
|
2650
2719
|
|
|
2651
|
-
const commands = Object.create(null);
|
|
2652
|
-
const register = commandMap => {
|
|
2653
|
-
Object.assign(commands, commandMap);
|
|
2654
|
-
};
|
|
2655
|
-
const getCommand = key => {
|
|
2656
|
-
return commands[key];
|
|
2657
|
-
};
|
|
2658
|
-
const execute = (command, ...args) => {
|
|
2659
|
-
const fn = getCommand(command);
|
|
2660
|
-
if (!fn) {
|
|
2661
|
-
throw new Error(`command not found ${command}`);
|
|
2662
|
-
}
|
|
2663
|
-
return fn(...args);
|
|
2664
|
-
};
|
|
2665
|
-
|
|
2666
|
-
const requiresSocket$1 = () => {
|
|
2667
|
-
return false;
|
|
2668
|
-
};
|
|
2669
|
-
const preparePrettyError$1 = error => {
|
|
2670
|
-
return error;
|
|
2671
|
-
};
|
|
2672
|
-
const logError$1 = error => {
|
|
2673
|
-
// handled by renderer worker
|
|
2674
|
-
};
|
|
2675
|
-
const handleMessage$1 = event => {
|
|
2676
|
-
return handleJsonRpcMessage(event.target, event.data, execute, resolve, preparePrettyError$1, logError$1, requiresSocket$1);
|
|
2677
|
-
};
|
|
2678
|
-
|
|
2679
|
-
const handleIpc$1 = ipc => {
|
|
2680
|
-
ipc.addEventListener('message', handleMessage$1);
|
|
2681
|
-
};
|
|
2682
|
-
|
|
2683
2720
|
const createWebViewIpc = async webView => {
|
|
2684
2721
|
const {
|
|
2685
2722
|
uid,
|
|
@@ -2689,39 +2726,17 @@ const createWebViewIpc = async webView => {
|
|
|
2689
2726
|
port1,
|
|
2690
2727
|
port2
|
|
2691
2728
|
} = getPortTuple();
|
|
2692
|
-
const {
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2729
|
+
const rpcPromise = MessagePortRpcParent.create({
|
|
2730
|
+
messagePort: port2,
|
|
2731
|
+
isMessagePortOpen: false,
|
|
2732
|
+
commandMap: {}
|
|
2733
|
+
});
|
|
2697
2734
|
const portType = 'test';
|
|
2698
2735
|
await invokeAndTransfer$1('WebView.setPort', uid, port1, origin, portType);
|
|
2699
|
-
const event = await promise;
|
|
2700
|
-
// @ts-ignore
|
|
2701
|
-
if (event.data !== 'ready') {
|
|
2702
|
-
throw new Error('unexpected first message');
|
|
2703
|
-
}
|
|
2704
|
-
const ipc = {
|
|
2705
|
-
addEventListener(type, listener) {
|
|
2706
|
-
const that = this;
|
|
2707
|
-
const wrapped = event => {
|
|
2708
|
-
const actualEvent = {
|
|
2709
|
-
target: that,
|
|
2710
|
-
data: event.data
|
|
2711
|
-
};
|
|
2712
|
-
listener(actualEvent);
|
|
2713
|
-
};
|
|
2714
|
-
port2.addEventListener(type, wrapped);
|
|
2715
|
-
},
|
|
2716
|
-
dispose() {},
|
|
2717
|
-
send(message) {
|
|
2718
|
-
port2.postMessage(message);
|
|
2719
|
-
}
|
|
2720
|
-
};
|
|
2721
2736
|
// TODO maybe don't send a message port only to get object url?
|
|
2722
|
-
// TODO dispose
|
|
2723
|
-
|
|
2724
|
-
return
|
|
2737
|
+
// TODO dispose rpc to avoid memory leak
|
|
2738
|
+
const rpc = await rpcPromise;
|
|
2739
|
+
return rpc;
|
|
2725
2740
|
};
|
|
2726
2741
|
|
|
2727
2742
|
const webViews = Object.create(null);
|
|
@@ -2754,8 +2769,8 @@ const getRemoteUrlForWebView = async (uri, options = {}) => {
|
|
|
2754
2769
|
if (!webView) {
|
|
2755
2770
|
throw new Error(`webview ${options.webViewId} not found`);
|
|
2756
2771
|
}
|
|
2757
|
-
const [
|
|
2758
|
-
const objectUrl = await invoke(
|
|
2772
|
+
const [rpc, blob] = await Promise.all([createWebViewIpc(webView), invoke$2('FileSystem.getBlob', uri)]);
|
|
2773
|
+
const objectUrl = await rpc.invoke('createObjectUrl', blob);
|
|
2759
2774
|
return objectUrl;
|
|
2760
2775
|
};
|
|
2761
2776
|
|
|
@@ -2779,22 +2794,12 @@ const getRemoteUrl = async (uri, options = {}) => {
|
|
|
2779
2794
|
return getRemoteUrlForWebView(uri, options);
|
|
2780
2795
|
}
|
|
2781
2796
|
if (uri.startsWith('html://')) {
|
|
2782
|
-
const url = await invoke$
|
|
2797
|
+
const url = await invoke$2('Blob.getSrc', uri);
|
|
2783
2798
|
return url;
|
|
2784
2799
|
}
|
|
2785
2800
|
throw new Error(`unsupported platform for remote url`);
|
|
2786
2801
|
};
|
|
2787
2802
|
|
|
2788
|
-
const waitForFirstMessage = async port => {
|
|
2789
|
-
const {
|
|
2790
|
-
resolve,
|
|
2791
|
-
promise
|
|
2792
|
-
} = Promise.withResolvers();
|
|
2793
|
-
port.onmessage = resolve;
|
|
2794
|
-
const firstMessage = await promise;
|
|
2795
|
-
return firstMessage;
|
|
2796
|
-
};
|
|
2797
|
-
|
|
2798
2803
|
// TODO pass uuid to allow having multiple webviews open at the same time
|
|
2799
2804
|
const createWebView = async (providerId, port, uri, uid, origin, webView) => {
|
|
2800
2805
|
const provider = getProvider(providerId);
|
|
@@ -2804,63 +2809,24 @@ const createWebView = async (providerId, port, uri, uid, origin, webView) => {
|
|
|
2804
2809
|
|
|
2805
2810
|
// TODO cancel promise when webview is disposed before sending message
|
|
2806
2811
|
// TODO handle case when webview doesn't send ready message
|
|
2807
|
-
// TODO handle error
|
|
2808
|
-
await waitForFirstMessage(port);
|
|
2809
2812
|
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
const {
|
|
2817
|
-
method,
|
|
2818
|
-
params,
|
|
2819
|
-
id
|
|
2820
|
-
} = data;
|
|
2821
|
-
if (id && !method) {
|
|
2822
|
-
resolve(id, data);
|
|
2823
|
-
return;
|
|
2824
|
-
}
|
|
2825
|
-
if (provider && provider.commands && provider.commands[method]) {
|
|
2826
|
-
const fn = provider.commands[method];
|
|
2827
|
-
const result = await fn(...params);
|
|
2828
|
-
if (id && method) {
|
|
2829
|
-
target.postMessage({
|
|
2830
|
-
jsonrpc: '2.0',
|
|
2831
|
-
id,
|
|
2832
|
-
result
|
|
2833
|
-
});
|
|
2834
|
-
}
|
|
2835
|
-
}
|
|
2836
|
-
};
|
|
2837
|
-
port.onmessage = handlePortMessage;
|
|
2838
|
-
const rpc = {
|
|
2813
|
+
const rpc = await MessagePortRpcParent.create({
|
|
2814
|
+
messagePort: port,
|
|
2815
|
+
isMessagePortOpen: false,
|
|
2816
|
+
commandMap: provider.commands || {}
|
|
2817
|
+
});
|
|
2818
|
+
const outer = {
|
|
2839
2819
|
uri,
|
|
2840
2820
|
provider,
|
|
2841
2821
|
uid,
|
|
2842
2822
|
origin,
|
|
2843
2823
|
webView,
|
|
2844
2824
|
async invoke(method, ...params) {
|
|
2845
|
-
|
|
2846
|
-
id,
|
|
2847
|
-
promise
|
|
2848
|
-
} = registerPromise();
|
|
2849
|
-
port.postMessage({
|
|
2850
|
-
jsonrpc: '2.0',
|
|
2851
|
-
id,
|
|
2852
|
-
method,
|
|
2853
|
-
params
|
|
2854
|
-
});
|
|
2855
|
-
const result = await promise;
|
|
2856
|
-
if (result.error) {
|
|
2857
|
-
throw new Error(`Error: ${result.error.message}`);
|
|
2858
|
-
}
|
|
2859
|
-
return result.result;
|
|
2825
|
+
return rpc.invoke(method, ...params);
|
|
2860
2826
|
}
|
|
2861
2827
|
};
|
|
2862
2828
|
// TODO allow creating multiple webviews per provider
|
|
2863
|
-
setWebView(providerId,
|
|
2829
|
+
setWebView(providerId, outer);
|
|
2864
2830
|
};
|
|
2865
2831
|
const disposeWebView = id => {
|
|
2866
2832
|
// TODO race condition
|
|
@@ -2886,22 +2852,22 @@ const createWorker = async ({
|
|
|
2886
2852
|
string(method);
|
|
2887
2853
|
string(url);
|
|
2888
2854
|
string(name);
|
|
2889
|
-
const
|
|
2855
|
+
const rpc = create$2({
|
|
2890
2856
|
method: ModuleWorkerAndWorkaroundForChromeDevtoolsBug$1,
|
|
2891
2857
|
url,
|
|
2892
2858
|
name
|
|
2893
2859
|
});
|
|
2894
|
-
return
|
|
2860
|
+
return rpc;
|
|
2895
2861
|
};
|
|
2896
2862
|
|
|
2897
|
-
const state$
|
|
2863
|
+
const state$4 = {
|
|
2898
2864
|
workspacePath: ''
|
|
2899
2865
|
};
|
|
2900
2866
|
const setWorkspacePath = path => {
|
|
2901
|
-
state$
|
|
2867
|
+
state$4.workspacePath = path;
|
|
2902
2868
|
};
|
|
2903
2869
|
const getWorkspaceFolder = path => {
|
|
2904
|
-
return state$
|
|
2870
|
+
return state$4.workspacePath;
|
|
2905
2871
|
};
|
|
2906
2872
|
|
|
2907
2873
|
class FormattingError extends Error {
|
|
@@ -2974,7 +2940,7 @@ const api = {
|
|
|
2974
2940
|
registerHoverProvider: registerHoverProvider,
|
|
2975
2941
|
executeHoverProvider: executeHoverProvider,
|
|
2976
2942
|
// Rpc
|
|
2977
|
-
createRpc: createRpc
|
|
2943
|
+
createRpc: createRpc,
|
|
2978
2944
|
createNodeRpc: createNodeRpc,
|
|
2979
2945
|
// Implementation
|
|
2980
2946
|
registerImplementationProvider: registerImplementationProvider,
|
|
@@ -3054,7 +3020,7 @@ const handleUnhandledRejection = event => {
|
|
|
3054
3020
|
console.error(output);
|
|
3055
3021
|
};
|
|
3056
3022
|
|
|
3057
|
-
const state$
|
|
3023
|
+
const state$3 = {
|
|
3058
3024
|
/**
|
|
3059
3025
|
* @type {any[]}
|
|
3060
3026
|
*/
|
|
@@ -3062,10 +3028,10 @@ const state$2 = {
|
|
|
3062
3028
|
};
|
|
3063
3029
|
const addError = error => {
|
|
3064
3030
|
// @ts-ignore
|
|
3065
|
-
state$
|
|
3031
|
+
state$3.errors.push(error);
|
|
3066
3032
|
};
|
|
3067
3033
|
const hasRecentErrors = () => {
|
|
3068
|
-
return state$
|
|
3034
|
+
return state$3.errors.length > 0;
|
|
3069
3035
|
};
|
|
3070
3036
|
const getRecentError = () => {
|
|
3071
3037
|
};
|
|
@@ -3105,65 +3071,95 @@ const setup = ({
|
|
|
3105
3071
|
global.vscode = api;
|
|
3106
3072
|
};
|
|
3107
3073
|
|
|
3108
|
-
const
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
},
|
|
3119
|
-
invokeAndTransfer(method, ...params) {
|
|
3120
|
-
return invokeAndTransfer(ipc, method, ...params);
|
|
3121
|
-
}
|
|
3122
|
-
};
|
|
3123
|
-
return rpc;
|
|
3124
|
-
};
|
|
3125
|
-
const requiresSocket = () => {
|
|
3126
|
-
return false;
|
|
3074
|
+
const getAssetDir = () => {
|
|
3075
|
+
// @ts-ignore
|
|
3076
|
+
if (typeof ASSET_DIR !== 'undefined') {
|
|
3077
|
+
// @ts-ignore
|
|
3078
|
+
return ASSET_DIR;
|
|
3079
|
+
}
|
|
3080
|
+
if (platform === Electron) {
|
|
3081
|
+
return '../../../../..';
|
|
3082
|
+
}
|
|
3083
|
+
return '';
|
|
3127
3084
|
};
|
|
3128
|
-
const
|
|
3129
|
-
|
|
3085
|
+
const assetDir = getAssetDir();
|
|
3086
|
+
|
|
3087
|
+
const iframeWorkerUrl = `${assetDir}/packages/renderer-worker/node_modules/@lvce-editor/iframe-worker/dist/iframeWorkerMain.js`;
|
|
3088
|
+
|
|
3089
|
+
const get$1 = key => {
|
|
3090
|
+
return invoke$2('Preferences.get', key);
|
|
3130
3091
|
};
|
|
3131
|
-
|
|
3132
|
-
|
|
3092
|
+
|
|
3093
|
+
const getConfiguredIframeWorkerUrl = async () => {
|
|
3094
|
+
let configuredWorkerUrl = (await get$1('develop.iframeWorkerPath')) || '';
|
|
3095
|
+
if (configuredWorkerUrl) {
|
|
3096
|
+
configuredWorkerUrl = '/remote' + configuredWorkerUrl;
|
|
3097
|
+
}
|
|
3098
|
+
configuredWorkerUrl = configuredWorkerUrl || iframeWorkerUrl;
|
|
3099
|
+
return configuredWorkerUrl;
|
|
3133
3100
|
};
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3101
|
+
|
|
3102
|
+
const state$2 = {
|
|
3103
|
+
id: 0
|
|
3104
|
+
};
|
|
3105
|
+
const create$1 = () => {
|
|
3106
|
+
return ++state$2.id;
|
|
3107
|
+
};
|
|
3108
|
+
|
|
3109
|
+
const commandMap$1 = {
|
|
3110
|
+
'WebView.compatExtensionHostWorkerInvoke': (...args) => invoke$2('WebView.compatExtensionHostWorkerInvoke', ...args),
|
|
3111
|
+
'WebView.compatExtensionHostWorkerInvokeAndTransfer': (...args) => invokeAndTransfer$1('WebView.compatExtensionHostWorkerInvokeAndTransfer', ...args),
|
|
3112
|
+
'WebView.compatRendererProcessInvoke': (...args) => invoke$2('WebView.compatRendererProcessInvoke', ...args),
|
|
3113
|
+
'WebView.compatRendererProcessInvokeAndTransfer': (...args) => invokeAndTransfer$1('WebView.compatRendererProcessInvokeAndTransfer', ...args),
|
|
3114
|
+
'WebView.compatSharedProcessInvoke': (...args) => invoke$2('WebView.compatSharedProcessInvoke', ...args),
|
|
3115
|
+
'WebView.getSavedState': (...args) => invoke$2('WebView.getSavedState', ...args),
|
|
3116
|
+
'WebView.getWebViewInfo': (...args) => invoke$2('WebView.getWebViewInfo', ...args),
|
|
3117
|
+
'WebView.getWebViews': (...args) => invoke$2('WebView.getWebViews', ...args),
|
|
3118
|
+
'WebView.setPort': (...args) => invoke$2('WebView.setPort', ...args),
|
|
3119
|
+
'ExtensionHostManagement.activateByEvent': (...args) => invoke$2('ExtensionHostManagement.activateByEvent', ...args)
|
|
3120
|
+
};
|
|
3121
|
+
const launchIframeWorker = async () => {
|
|
3122
|
+
const configuredWorkerUrl = await getConfiguredIframeWorkerUrl();
|
|
3123
|
+
const name = 'Iframe Worker';
|
|
3124
|
+
const id = create$1();
|
|
3125
|
+
const rpc = await create$2({
|
|
3126
|
+
method: ModuleWorkerAndWorkaroundForChromeDevtoolsBug$1,
|
|
3127
|
+
name,
|
|
3128
|
+
url: configuredWorkerUrl,
|
|
3129
|
+
id,
|
|
3130
|
+
commandMap: commandMap$1
|
|
3131
|
+
});
|
|
3132
|
+
return rpc;
|
|
3137
3133
|
};
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
ipc.on('message', handleMessage);
|
|
3134
|
+
|
|
3135
|
+
let workerPromise;
|
|
3136
|
+
const ensureWorker = () => {
|
|
3137
|
+
if (!workerPromise) {
|
|
3138
|
+
workerPromise = launchIframeWorker();
|
|
3144
3139
|
}
|
|
3140
|
+
return workerPromise;
|
|
3145
3141
|
};
|
|
3146
|
-
const
|
|
3147
|
-
const
|
|
3148
|
-
|
|
3149
|
-
module.signal(rawIpc);
|
|
3150
|
-
}
|
|
3151
|
-
const ipc = module.wrap(rawIpc);
|
|
3152
|
-
return ipc;
|
|
3142
|
+
const invoke = async (method, ...params) => {
|
|
3143
|
+
const rpc = await ensureWorker();
|
|
3144
|
+
return rpc.invoke(method, ...params);
|
|
3153
3145
|
};
|
|
3154
|
-
|
|
3155
|
-
|
|
3146
|
+
|
|
3147
|
+
const createWebView3 = async ({
|
|
3148
|
+
id,
|
|
3149
|
+
uri,
|
|
3150
|
+
isGitpod,
|
|
3151
|
+
platform,
|
|
3152
|
+
assetDir,
|
|
3153
|
+
webViewScheme
|
|
3156
3154
|
}) => {
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
__proto__: null,
|
|
3166
|
-
create: create$1
|
|
3155
|
+
await invoke('WebView.create3', {
|
|
3156
|
+
id,
|
|
3157
|
+
uri,
|
|
3158
|
+
isGitpod,
|
|
3159
|
+
platform,
|
|
3160
|
+
assetDir,
|
|
3161
|
+
webViewScheme
|
|
3162
|
+
});
|
|
3167
3163
|
};
|
|
3168
3164
|
|
|
3169
3165
|
const BraceCompletionExecuteBraceCompletionProvider = 'ExtensionHostBraceCompletion.executeBraceCompletionProvider';
|
|
@@ -3231,7 +3227,7 @@ const getExtensionId = extension => {
|
|
|
3231
3227
|
return '<unknown>';
|
|
3232
3228
|
};
|
|
3233
3229
|
|
|
3234
|
-
const getUrlPrefix = extensionPath => {
|
|
3230
|
+
const getUrlPrefix = (platform, extensionPath) => {
|
|
3235
3231
|
if (extensionPath.startsWith('http://') || extensionPath.startsWith('https://')) {
|
|
3236
3232
|
return extensionPath;
|
|
3237
3233
|
}
|
|
@@ -3250,7 +3246,7 @@ const handleRpcInfos = extension => {
|
|
|
3250
3246
|
return;
|
|
3251
3247
|
}
|
|
3252
3248
|
const rpcs = extension.rpc;
|
|
3253
|
-
const urlPrefix = getUrlPrefix(extension.path);
|
|
3249
|
+
const urlPrefix = getUrlPrefix(platform, extension.path);
|
|
3254
3250
|
if (!rpcs) {
|
|
3255
3251
|
return;
|
|
3256
3252
|
}
|
|
@@ -3327,19 +3323,6 @@ class BabelParseError extends SyntaxError {
|
|
|
3327
3323
|
}
|
|
3328
3324
|
}
|
|
3329
3325
|
|
|
3330
|
-
const getAssetDir = () => {
|
|
3331
|
-
// @ts-ignore
|
|
3332
|
-
if (typeof ASSET_DIR !== 'undefined') {
|
|
3333
|
-
// @ts-ignore
|
|
3334
|
-
return ASSET_DIR;
|
|
3335
|
-
}
|
|
3336
|
-
if (platform === Electron) {
|
|
3337
|
-
return '../../../../..';
|
|
3338
|
-
}
|
|
3339
|
-
return '';
|
|
3340
|
-
};
|
|
3341
|
-
const assetDir = getAssetDir();
|
|
3342
|
-
|
|
3343
3326
|
const loadBabelParser = () => {
|
|
3344
3327
|
const url = `${assetDir}/js/babel-parser.js`;
|
|
3345
3328
|
return import(url);
|
|
@@ -3666,7 +3649,7 @@ const mockExec = () => {
|
|
|
3666
3649
|
try {
|
|
3667
3650
|
// @ts-ignore
|
|
3668
3651
|
api.exec = async (command, args, options) => {
|
|
3669
|
-
const result = await invoke$
|
|
3652
|
+
const result = await invoke$2('Test.executeMockExecFunction', command, args, options);
|
|
3670
3653
|
const {
|
|
3671
3654
|
stdout,
|
|
3672
3655
|
stderr,
|
|
@@ -3692,7 +3675,7 @@ const mockRpc = () => {
|
|
|
3692
3675
|
try {
|
|
3693
3676
|
return {
|
|
3694
3677
|
async invoke(method, ...params) {
|
|
3695
|
-
const result = await invoke$
|
|
3678
|
+
const result = await invoke$2('Test.executeMockRpcFunction', options.name, method, ...params);
|
|
3696
3679
|
return result;
|
|
3697
3680
|
}
|
|
3698
3681
|
};
|
|
@@ -3703,7 +3686,7 @@ const mockRpc = () => {
|
|
|
3703
3686
|
};
|
|
3704
3687
|
|
|
3705
3688
|
const getStatusBarItems = async () => {
|
|
3706
|
-
const providers = Object.values(state$
|
|
3689
|
+
const providers = Object.values(state$6.providers);
|
|
3707
3690
|
const statusBarItems = [];
|
|
3708
3691
|
for (const provider of providers) {
|
|
3709
3692
|
// @ts-ignore
|
|
@@ -3724,29 +3707,11 @@ const handleBeforeUnload = () => {
|
|
|
3724
3707
|
console.log('before unload');
|
|
3725
3708
|
};
|
|
3726
3709
|
|
|
3727
|
-
const
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
switch (method) {
|
|
3733
|
-
case ModuleWorker:
|
|
3734
|
-
return IpcChildWithModuleWorker$1;
|
|
3735
|
-
case ModuleWorkerWithMessagePort:
|
|
3736
|
-
return IpcChildWithModuleWorkerAndMessagePort$1;
|
|
3737
|
-
case MessagePort$1:
|
|
3738
|
-
return IpcChildWithMessagePort$1;
|
|
3739
|
-
default:
|
|
3740
|
-
throw new Error('unexpected ipc type');
|
|
3741
|
-
}
|
|
3742
|
-
};
|
|
3743
|
-
|
|
3744
|
-
const handleMessagePort = port => {
|
|
3745
|
-
const module = getModule(MessagePort$1);
|
|
3746
|
-
// @ts-ignore
|
|
3747
|
-
const ipc = module.wrap(port);
|
|
3748
|
-
handleIpc$1(ipc);
|
|
3749
|
-
ipc.send('ready');
|
|
3710
|
+
const handleMessagePort = async port => {
|
|
3711
|
+
await MessagePortRpcClient.create({
|
|
3712
|
+
messagePort: port,
|
|
3713
|
+
commandMap: {}
|
|
3714
|
+
});
|
|
3750
3715
|
};
|
|
3751
3716
|
|
|
3752
3717
|
const instanceOfAny = (object, constructors) => constructors.some(c => object instanceof c);
|
|
@@ -4457,6 +4422,8 @@ const textSearch = async (scheme, root, query) => {
|
|
|
4457
4422
|
};
|
|
4458
4423
|
|
|
4459
4424
|
const commandMap = {
|
|
4425
|
+
'WebView.create3': createWebView3,
|
|
4426
|
+
'ExtensionHost.launchIframeWorker': launchIframeWorker,
|
|
4460
4427
|
'ExtensionHostRename.executeprepareRenameProvider': executeprepareRenameProvider,
|
|
4461
4428
|
'ExtensionHostRename.executeRenameProvider': executeRenameProvider,
|
|
4462
4429
|
'IndexedDb.addHandle': addHandle,
|