@lvce-editor/editor-worker 16.3.0 → 16.5.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/editorWorkerMain.js +101 -69
- package/package.json +1 -1
package/dist/editorWorkerMain.js
CHANGED
|
@@ -474,7 +474,7 @@ const getFirstEvent = (eventEmitter, eventMap) => {
|
|
|
474
474
|
return promise;
|
|
475
475
|
};
|
|
476
476
|
const Message$1 = 3;
|
|
477
|
-
const create$5$
|
|
477
|
+
const create$5$2 = async ({
|
|
478
478
|
isMessagePortOpen,
|
|
479
479
|
messagePort
|
|
480
480
|
}) => {
|
|
@@ -525,7 +525,7 @@ const wrap$5 = messagePort => {
|
|
|
525
525
|
};
|
|
526
526
|
const IpcParentWithMessagePort$1 = {
|
|
527
527
|
__proto__: null,
|
|
528
|
-
create: create$5$
|
|
528
|
+
create: create$5$2,
|
|
529
529
|
signal: signal$1,
|
|
530
530
|
wrap: wrap$5
|
|
531
531
|
};
|
|
@@ -731,7 +731,7 @@ const getErrorProperty = (error, prettyError) => {
|
|
|
731
731
|
}
|
|
732
732
|
};
|
|
733
733
|
};
|
|
734
|
-
const create$1$
|
|
734
|
+
const create$1$1 = (id, error) => {
|
|
735
735
|
return {
|
|
736
736
|
jsonrpc: Two$1,
|
|
737
737
|
id,
|
|
@@ -742,7 +742,7 @@ const getErrorResponse = (id, error, preparePrettyError, logError) => {
|
|
|
742
742
|
const prettyError = preparePrettyError(error);
|
|
743
743
|
logError(error, prettyError);
|
|
744
744
|
const errorProperty = getErrorProperty(error, prettyError);
|
|
745
|
-
return create$1$
|
|
745
|
+
return create$1$1(id, errorProperty);
|
|
746
746
|
};
|
|
747
747
|
const create$a = (message, result) => {
|
|
748
748
|
return {
|
|
@@ -867,14 +867,14 @@ const execute$1 = (command, ...args) => {
|
|
|
867
867
|
};
|
|
868
868
|
|
|
869
869
|
const Two = '2.0';
|
|
870
|
-
const create$
|
|
870
|
+
const create$t = (method, params) => {
|
|
871
871
|
return {
|
|
872
872
|
jsonrpc: Two,
|
|
873
873
|
method,
|
|
874
874
|
params
|
|
875
875
|
};
|
|
876
876
|
};
|
|
877
|
-
const create$
|
|
877
|
+
const create$s = (id, method, params) => {
|
|
878
878
|
const message = {
|
|
879
879
|
id,
|
|
880
880
|
jsonrpc: Two,
|
|
@@ -884,14 +884,14 @@ const create$r = (id, method, params) => {
|
|
|
884
884
|
return message;
|
|
885
885
|
};
|
|
886
886
|
let id = 0;
|
|
887
|
-
const create$
|
|
887
|
+
const create$r = () => {
|
|
888
888
|
return ++id;
|
|
889
889
|
};
|
|
890
890
|
|
|
891
891
|
/* eslint-disable n/no-unsupported-features/es-syntax */
|
|
892
892
|
|
|
893
893
|
const registerPromise = map => {
|
|
894
|
-
const id = create$
|
|
894
|
+
const id = create$r();
|
|
895
895
|
const {
|
|
896
896
|
promise,
|
|
897
897
|
resolve
|
|
@@ -909,7 +909,7 @@ const invokeHelper = async (callbacks, ipc, method, params, useSendAndTransfer)
|
|
|
909
909
|
id,
|
|
910
910
|
promise
|
|
911
911
|
} = registerPromise(callbacks);
|
|
912
|
-
const message = create$
|
|
912
|
+
const message = create$s(id, method, params);
|
|
913
913
|
if (useSendAndTransfer && ipc.sendAndTransfer) {
|
|
914
914
|
ipc.sendAndTransfer(message);
|
|
915
915
|
} else {
|
|
@@ -945,7 +945,7 @@ const createRpc = ipc => {
|
|
|
945
945
|
* @deprecated
|
|
946
946
|
*/
|
|
947
947
|
send(method, ...params) {
|
|
948
|
-
const message = create$
|
|
948
|
+
const message = create$t(method, params);
|
|
949
949
|
ipc.send(message);
|
|
950
950
|
}
|
|
951
951
|
};
|
|
@@ -1011,13 +1011,13 @@ const createSharedLazyRpc = factory => {
|
|
|
1011
1011
|
}
|
|
1012
1012
|
};
|
|
1013
1013
|
};
|
|
1014
|
-
const create$
|
|
1014
|
+
const create$j = async ({
|
|
1015
1015
|
commandMap,
|
|
1016
1016
|
isMessagePortOpen,
|
|
1017
1017
|
send
|
|
1018
1018
|
}) => {
|
|
1019
1019
|
return createSharedLazyRpc(() => {
|
|
1020
|
-
return create$
|
|
1020
|
+
return create$3$1({
|
|
1021
1021
|
commandMap,
|
|
1022
1022
|
isMessagePortOpen,
|
|
1023
1023
|
send
|
|
@@ -1026,9 +1026,9 @@ const create$i = async ({
|
|
|
1026
1026
|
};
|
|
1027
1027
|
const LazyTransferMessagePortRpcParent = {
|
|
1028
1028
|
__proto__: null,
|
|
1029
|
-
create: create$
|
|
1029
|
+
create: create$j
|
|
1030
1030
|
};
|
|
1031
|
-
const create$
|
|
1031
|
+
const create$5$1 = async ({
|
|
1032
1032
|
commandMap,
|
|
1033
1033
|
isMessagePortOpen = true,
|
|
1034
1034
|
messagePort
|
|
@@ -1045,20 +1045,20 @@ const create$4$1 = async ({
|
|
|
1045
1045
|
messagePort.start();
|
|
1046
1046
|
return rpc;
|
|
1047
1047
|
};
|
|
1048
|
-
const create$
|
|
1048
|
+
const create$4$1 = async ({
|
|
1049
1049
|
commandMap,
|
|
1050
1050
|
messagePort
|
|
1051
1051
|
}) => {
|
|
1052
|
-
return create$
|
|
1052
|
+
return create$5$1({
|
|
1053
1053
|
commandMap,
|
|
1054
1054
|
messagePort
|
|
1055
1055
|
});
|
|
1056
1056
|
};
|
|
1057
1057
|
const PlainMessagePortRpcParent = {
|
|
1058
1058
|
__proto__: null,
|
|
1059
|
-
create: create$
|
|
1059
|
+
create: create$4$1
|
|
1060
1060
|
};
|
|
1061
|
-
const create$
|
|
1061
|
+
const create$3$1 = async ({
|
|
1062
1062
|
commandMap,
|
|
1063
1063
|
isMessagePortOpen,
|
|
1064
1064
|
send
|
|
@@ -1068,7 +1068,7 @@ const create$2$1 = async ({
|
|
|
1068
1068
|
port2
|
|
1069
1069
|
} = new MessageChannel();
|
|
1070
1070
|
await send(port1);
|
|
1071
|
-
return create$
|
|
1071
|
+
return create$5$1({
|
|
1072
1072
|
commandMap,
|
|
1073
1073
|
isMessagePortOpen,
|
|
1074
1074
|
messagePort: port2
|
|
@@ -1076,9 +1076,9 @@ const create$2$1 = async ({
|
|
|
1076
1076
|
};
|
|
1077
1077
|
const TransferMessagePortRpcParent = {
|
|
1078
1078
|
__proto__: null,
|
|
1079
|
-
create: create$
|
|
1079
|
+
create: create$3$1
|
|
1080
1080
|
};
|
|
1081
|
-
const create$
|
|
1081
|
+
const create$2$1 = async ({
|
|
1082
1082
|
commandMap
|
|
1083
1083
|
}) => {
|
|
1084
1084
|
// TODO create a commandMap per rpc instance
|
|
@@ -1090,7 +1090,7 @@ const create$1$1 = async ({
|
|
|
1090
1090
|
};
|
|
1091
1091
|
const WebWorkerRpcClient = {
|
|
1092
1092
|
__proto__: null,
|
|
1093
|
-
create: create$
|
|
1093
|
+
create: create$2$1
|
|
1094
1094
|
};
|
|
1095
1095
|
const createMockRpc = ({
|
|
1096
1096
|
commandMap
|
|
@@ -1177,7 +1177,7 @@ const TextMeasurementWorker = 7011;
|
|
|
1177
1177
|
const FocusEditorText$1 = 12;
|
|
1178
1178
|
|
|
1179
1179
|
const rpcs = Object.create(null);
|
|
1180
|
-
const set$
|
|
1180
|
+
const set$e = (id, rpc) => {
|
|
1181
1181
|
rpcs[id] = rpc;
|
|
1182
1182
|
};
|
|
1183
1183
|
const get$7 = id => {
|
|
@@ -1210,7 +1210,7 @@ const create$9 = rpcId => {
|
|
|
1210
1210
|
const mockRpc = createMockRpc({
|
|
1211
1211
|
commandMap
|
|
1212
1212
|
});
|
|
1213
|
-
set$
|
|
1213
|
+
set$e(rpcId, mockRpc);
|
|
1214
1214
|
// @ts-ignore
|
|
1215
1215
|
mockRpc[Symbol.dispose] = () => {
|
|
1216
1216
|
remove$8(rpcId);
|
|
@@ -1219,32 +1219,32 @@ const create$9 = rpcId => {
|
|
|
1219
1219
|
return mockRpc;
|
|
1220
1220
|
},
|
|
1221
1221
|
set(rpc) {
|
|
1222
|
-
set$
|
|
1222
|
+
set$e(rpcId, rpc);
|
|
1223
1223
|
}
|
|
1224
1224
|
};
|
|
1225
1225
|
};
|
|
1226
1226
|
|
|
1227
1227
|
const {
|
|
1228
1228
|
dispose: dispose$2,
|
|
1229
|
-
invoke: invoke$
|
|
1229
|
+
invoke: invoke$e,
|
|
1230
1230
|
invokeAndTransfer: invokeAndTransfer$2,
|
|
1231
1231
|
registerMockRpc,
|
|
1232
|
-
set: set$
|
|
1232
|
+
set: set$d
|
|
1233
1233
|
} = create$9(ExtensionHostWorker);
|
|
1234
1234
|
const executeReferenceProvider = async (id, offset) => {
|
|
1235
1235
|
// @ts-ignore
|
|
1236
|
-
return invoke$
|
|
1236
|
+
return invoke$e('ExtensionHostReference.executeReferenceProvider', id, offset);
|
|
1237
1237
|
};
|
|
1238
1238
|
const executeFileReferenceProvider = async id => {
|
|
1239
1239
|
// @ts-ignore
|
|
1240
|
-
return invoke$
|
|
1240
|
+
return invoke$e('ExtensionHostReference.executeFileReferenceProvider', id);
|
|
1241
1241
|
};
|
|
1242
1242
|
const getRuntimeStatus = async extensionId => {
|
|
1243
1243
|
// @ts-ignore
|
|
1244
|
-
return invoke$
|
|
1244
|
+
return invoke$e('ExtensionHost.getRuntimeStatus', extensionId);
|
|
1245
1245
|
};
|
|
1246
1246
|
const getEnabledOutputProviderIds = async () => {
|
|
1247
|
-
const channels = await invoke$
|
|
1247
|
+
const channels = await invoke$e('Output.getEnabledProviders');
|
|
1248
1248
|
return channels;
|
|
1249
1249
|
};
|
|
1250
1250
|
|
|
@@ -1255,21 +1255,21 @@ const ExtensionHost = {
|
|
|
1255
1255
|
executeReferenceProvider,
|
|
1256
1256
|
getEnabledOutputProviderIds,
|
|
1257
1257
|
getRuntimeStatus,
|
|
1258
|
-
invoke: invoke$
|
|
1258
|
+
invoke: invoke$e,
|
|
1259
1259
|
invokeAndTransfer: invokeAndTransfer$2,
|
|
1260
1260
|
registerMockRpc,
|
|
1261
|
-
set: set$
|
|
1261
|
+
set: set$d
|
|
1262
1262
|
};
|
|
1263
1263
|
|
|
1264
1264
|
const {
|
|
1265
|
-
invoke: invoke$
|
|
1266
|
-
set: set$
|
|
1265
|
+
invoke: invoke$d,
|
|
1266
|
+
set: set$c
|
|
1267
1267
|
} = create$9(ExtensionManagementWorker);
|
|
1268
1268
|
|
|
1269
1269
|
const {
|
|
1270
|
-
invoke: invoke$
|
|
1270
|
+
invoke: invoke$c,
|
|
1271
1271
|
invokeAndTransfer: invokeAndTransfer$1,
|
|
1272
|
-
set: set$
|
|
1272
|
+
set: set$b
|
|
1273
1273
|
} = create$9(RendererWorker$1);
|
|
1274
1274
|
const showContextMenu2 = async (uid, menuId, x, y, args) => {
|
|
1275
1275
|
number(uid);
|
|
@@ -1277,7 +1277,12 @@ const showContextMenu2 = async (uid, menuId, x, y, args) => {
|
|
|
1277
1277
|
number(x);
|
|
1278
1278
|
number(y);
|
|
1279
1279
|
// @ts-ignore
|
|
1280
|
-
await invoke$
|
|
1280
|
+
await invoke$c('ContextMenu.show2', uid, menuId, x, y, args);
|
|
1281
|
+
};
|
|
1282
|
+
const sendMessagePortToOpenerWorker = async (port, rpcId) => {
|
|
1283
|
+
const command = 'HandleMessagePort.handleMessagePort';
|
|
1284
|
+
// @ts-ignore
|
|
1285
|
+
await invokeAndTransfer$1('SendMessagePortToExtensionHostWorker.sendMessagePortToOpenerWorker', port, command, rpcId);
|
|
1281
1286
|
};
|
|
1282
1287
|
const sendMessagePortToTextMeasurementWorker = async port => {
|
|
1283
1288
|
const command = 'TextMeasurement.handleMessagePort';
|
|
@@ -1289,6 +1294,15 @@ const sendMessagePortToExtensionManagementWorker = async (port, rpcId) => {
|
|
|
1289
1294
|
await invokeAndTransfer$1('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionManagementWorker', port, command, rpcId);
|
|
1290
1295
|
};
|
|
1291
1296
|
|
|
1297
|
+
const rpcId$1 = 4561;
|
|
1298
|
+
const {
|
|
1299
|
+
invoke: invoke$b,
|
|
1300
|
+
set: set$a
|
|
1301
|
+
} = create$9(rpcId$1);
|
|
1302
|
+
const openUrl = async url => {
|
|
1303
|
+
return invoke$b('Open.openUrl', url);
|
|
1304
|
+
};
|
|
1305
|
+
|
|
1292
1306
|
const {
|
|
1293
1307
|
set: set$9
|
|
1294
1308
|
} = create$9(IconThemeWorker);
|
|
@@ -1313,7 +1327,7 @@ const createLazyRpc = rpcId => {
|
|
|
1313
1327
|
let factory;
|
|
1314
1328
|
const createRpc = async () => {
|
|
1315
1329
|
const rpc = await factory();
|
|
1316
|
-
set$
|
|
1330
|
+
set$e(rpcId, rpc);
|
|
1317
1331
|
};
|
|
1318
1332
|
const ensureRpc = async () => {
|
|
1319
1333
|
if (!rpcPromise) {
|
|
@@ -1343,7 +1357,7 @@ const activateByEvent = async (event, assetDir, platform) => {
|
|
|
1343
1357
|
string(event);
|
|
1344
1358
|
// Assert.string(assetDir)
|
|
1345
1359
|
// Assert.number(platform)
|
|
1346
|
-
await invoke$
|
|
1360
|
+
await invoke$c('ExtensionHostManagement.activateByEvent', event, assetDir, platform);
|
|
1347
1361
|
};
|
|
1348
1362
|
|
|
1349
1363
|
const codeGeneratorAccept = state => {
|
|
@@ -2632,7 +2646,8 @@ const getRegexMatches = (text, regex) => {
|
|
|
2632
2646
|
// URL matching regex pattern - matches common URL schemes
|
|
2633
2647
|
// Supports: http://, https://, ftp://, ftps://, file://
|
|
2634
2648
|
// Also matches URLs without explicit scheme (www.example.com)
|
|
2635
|
-
|
|
2649
|
+
// Excludes trailing quotes which are commonly used in JSON strings
|
|
2650
|
+
const URL_PATTERN = /(?:(?:https?|ftp|ftps|file):\/\/)?(?:www\.)?(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?(?:\/[^\s"']*)?/g;
|
|
2636
2651
|
|
|
2637
2652
|
// Regex to check if URL has a scheme (http://, https://, ftp://, etc.)
|
|
2638
2653
|
const HAS_SCHEME_PATTERN = /^(?:https?|ftp|ftps|file):\/\//;
|
|
@@ -3412,7 +3427,7 @@ const getLanguageId$1 = (uri, languages) => {
|
|
|
3412
3427
|
const getLanguages = async (platform, assetDir) => {
|
|
3413
3428
|
number(platform);
|
|
3414
3429
|
string(assetDir);
|
|
3415
|
-
const languages = await invoke$
|
|
3430
|
+
const languages = await invoke$d('Extensions.getLanguages', platform, assetDir);
|
|
3416
3431
|
return languages;
|
|
3417
3432
|
};
|
|
3418
3433
|
|
|
@@ -3421,7 +3436,7 @@ const measureCharacterWidth = async (fontWeight, fontSize, fontFamily, letterSpa
|
|
|
3421
3436
|
};
|
|
3422
3437
|
|
|
3423
3438
|
const get$1 = async key => {
|
|
3424
|
-
const value = await invoke$
|
|
3439
|
+
const value = await invoke$c('Preferences.get', key);
|
|
3425
3440
|
return value;
|
|
3426
3441
|
};
|
|
3427
3442
|
|
|
@@ -3567,7 +3582,7 @@ const updateDiagnostics = async newState => {
|
|
|
3567
3582
|
};
|
|
3568
3583
|
set$6(newState.id, latest.oldState, newEditor);
|
|
3569
3584
|
// @ts-ignore
|
|
3570
|
-
await invoke$
|
|
3585
|
+
await invoke$c('Editor.rerender', newState.id);
|
|
3571
3586
|
return newEditor;
|
|
3572
3587
|
} catch (error) {
|
|
3573
3588
|
// @ts-ignore
|
|
@@ -4109,7 +4124,7 @@ const editorShowMessage = async (editor, rowIndex, columnIndex, message, isError
|
|
|
4109
4124
|
const y$1 = y(editor, rowIndex);
|
|
4110
4125
|
const displayErrorMessage = message;
|
|
4111
4126
|
// @ts-ignore
|
|
4112
|
-
await invoke$
|
|
4127
|
+
await invoke$c('Editor.showOverlayMessage', editor, 'Viewlet.send', editor.uid, 'showOverlayMessage', x$1, y$1, displayErrorMessage);
|
|
4113
4128
|
if (!isError) {
|
|
4114
4129
|
const handleTimeout = () => {
|
|
4115
4130
|
editorHideMessage(editor);
|
|
@@ -4166,7 +4181,7 @@ const braceCompletion = async (editor, text) => {
|
|
|
4166
4181
|
// @ts-ignore
|
|
4167
4182
|
const offset = offsetAt(editor, editor.cursor);
|
|
4168
4183
|
// @ts-ignore
|
|
4169
|
-
const result = await invoke$
|
|
4184
|
+
const result = await invoke$c('ExtensionHostBraceCompletion.executeBraceCompletionProvider', editor, offset, text);
|
|
4170
4185
|
if (result) {
|
|
4171
4186
|
const closingBrace = getMatchingClosingBrace$1(text);
|
|
4172
4187
|
const insertText = text + closingBrace;
|
|
@@ -4434,7 +4449,7 @@ const compositionEnd = (editor, data) => {
|
|
|
4434
4449
|
const writeText = async text => {
|
|
4435
4450
|
try {
|
|
4436
4451
|
string(text);
|
|
4437
|
-
await invoke$
|
|
4452
|
+
await invoke$c('ClipBoard.writeText', /* text */text);
|
|
4438
4453
|
} catch (error) {
|
|
4439
4454
|
throw new VError(error, 'Failed to write text to clipboard');
|
|
4440
4455
|
}
|
|
@@ -5072,7 +5087,7 @@ const deleteWordRight = editor => {
|
|
|
5072
5087
|
|
|
5073
5088
|
const findAllReferences$1 = async editor => {
|
|
5074
5089
|
// @ts-ignore
|
|
5075
|
-
await invoke$
|
|
5090
|
+
await invoke$c('SideBar.show', 'References', /* focus */true);
|
|
5076
5091
|
return editor;
|
|
5077
5092
|
};
|
|
5078
5093
|
|
|
@@ -5160,7 +5175,7 @@ const getWordBefore = (editor, rowIndex, columnIndex) => {
|
|
|
5160
5175
|
// @ts-ignore
|
|
5161
5176
|
const getDefinition = async (editor, offset) => {
|
|
5162
5177
|
// @ts-ignore
|
|
5163
|
-
const definition = await invoke$
|
|
5178
|
+
const definition = await invoke$c('ExtensionHostDefinition.executeDefinitionProvider', editor, offset);
|
|
5164
5179
|
return definition;
|
|
5165
5180
|
};
|
|
5166
5181
|
|
|
@@ -5367,7 +5382,7 @@ const goTo = async ({
|
|
|
5367
5382
|
startColumnIndex: definition.startColumnIndex,
|
|
5368
5383
|
startRowIndex: definition.startRowIndex
|
|
5369
5384
|
};
|
|
5370
|
-
await invoke$
|
|
5385
|
+
await invoke$c(/* Main.openUri */'Main.openUri', /* uri */uri, /* focus */true, context);
|
|
5371
5386
|
return editor;
|
|
5372
5387
|
} catch (error) {
|
|
5373
5388
|
// TODO if editor is already disposed at this point, do nothing
|
|
@@ -5445,7 +5460,7 @@ const getNoLocationFoundMessage = info => {
|
|
|
5445
5460
|
|
|
5446
5461
|
const getTypeDefinition = async (editor, offset) => {
|
|
5447
5462
|
// @ts-ignore
|
|
5448
|
-
const definition = await invoke$
|
|
5463
|
+
const definition = await invoke$c('ExtensionHostTypeDefinition.executeTypeDefinitionProvider', editor, offset);
|
|
5449
5464
|
return definition;
|
|
5450
5465
|
};
|
|
5451
5466
|
|
|
@@ -5516,8 +5531,9 @@ const setPosition$1 = position => {
|
|
|
5516
5531
|
state$3.position = position;
|
|
5517
5532
|
};
|
|
5518
5533
|
|
|
5519
|
-
const openExternal = async url => {
|
|
5520
|
-
|
|
5534
|
+
const openExternal = async (url, platform) => {
|
|
5535
|
+
// @ts-ignore
|
|
5536
|
+
await openUrl(url);
|
|
5521
5537
|
};
|
|
5522
5538
|
|
|
5523
5539
|
// TODO first change cursor position, then run go to definition
|
|
@@ -6223,7 +6239,7 @@ const indentMore = editor => {
|
|
|
6223
6239
|
|
|
6224
6240
|
const getLanguageConfiguration = async editor => {
|
|
6225
6241
|
// @ts-ignore
|
|
6226
|
-
return invoke$
|
|
6242
|
+
return invoke$c('Languages.getLanguageConfiguration', {
|
|
6227
6243
|
languageId: editor.languageId,
|
|
6228
6244
|
uri: editor.uri
|
|
6229
6245
|
});
|
|
@@ -6637,7 +6653,7 @@ const launch = async () => {
|
|
|
6637
6653
|
return;
|
|
6638
6654
|
}
|
|
6639
6655
|
const rpc = await launchFindWidgetWorker();
|
|
6640
|
-
set$
|
|
6656
|
+
set$e(rpcId, rpc);
|
|
6641
6657
|
};
|
|
6642
6658
|
const invoke$3 = async (method, ...params) => {
|
|
6643
6659
|
const rpc = get$7(rpcId);
|
|
@@ -6804,7 +6820,7 @@ const pasteText = (editor, text) => {
|
|
|
6804
6820
|
|
|
6805
6821
|
const paste = async editor => {
|
|
6806
6822
|
// @ts-ignore
|
|
6807
|
-
const text = await invoke$
|
|
6823
|
+
const text = await invoke$c('ClipBoard.readText');
|
|
6808
6824
|
string(text);
|
|
6809
6825
|
return pasteText(editor, text);
|
|
6810
6826
|
};
|
|
@@ -6950,7 +6966,7 @@ const save = async editor => {
|
|
|
6950
6966
|
} = editor;
|
|
6951
6967
|
const newEditor = await getNewEditor(editor);
|
|
6952
6968
|
const content = getText$1(newEditor);
|
|
6953
|
-
await invoke$
|
|
6969
|
+
await invoke$c('FileSystem.writeFile', uri, content);
|
|
6954
6970
|
return newEditor;
|
|
6955
6971
|
} catch (error) {
|
|
6956
6972
|
// @ts-ignore
|
|
@@ -7260,7 +7276,7 @@ const selectInsideString = editor => {
|
|
|
7260
7276
|
|
|
7261
7277
|
const getNewSelections = async (editor, selections) => {
|
|
7262
7278
|
// @ts-ignore
|
|
7263
|
-
const newSelections = await invoke$
|
|
7279
|
+
const newSelections = await invoke$c('ExtensionHostSelection.executeGrowSelection', editor, selections);
|
|
7264
7280
|
if (newSelections.length === 0) {
|
|
7265
7281
|
return selections;
|
|
7266
7282
|
}
|
|
@@ -7668,7 +7684,7 @@ const showHover3 = async editor => {
|
|
|
7668
7684
|
|
|
7669
7685
|
const EditorHover = 'EditorHover';
|
|
7670
7686
|
const showHover = async state => {
|
|
7671
|
-
await invoke$
|
|
7687
|
+
await invoke$c('Viewlet.openWidget', EditorHover);
|
|
7672
7688
|
return state;
|
|
7673
7689
|
};
|
|
7674
7690
|
|
|
@@ -8349,7 +8365,7 @@ const typeWithAutoClosingQuote = (editor, text) => {
|
|
|
8349
8365
|
const typeWithAutoClosingTag = async (editor, text) => {
|
|
8350
8366
|
const offset = offsetAt(editor, editor.selections[0], editor.selections[1]);
|
|
8351
8367
|
// @ts-ignore
|
|
8352
|
-
const result = await invoke$
|
|
8368
|
+
const result = await invoke$c('ExtensionHostClosingTagCompletion.executeClosingTagProvider', editor, offset, text);
|
|
8353
8369
|
if (!result) {
|
|
8354
8370
|
const changes = editorReplaceSelections(editor, [text], EditorType);
|
|
8355
8371
|
return scheduleDocumentAndCursorsSelections(editor, changes);
|
|
@@ -9373,7 +9389,7 @@ const getEditorSourceActions = async editorId => {
|
|
|
9373
9389
|
languageId
|
|
9374
9390
|
} = newState;
|
|
9375
9391
|
// @ts-ignore
|
|
9376
|
-
const allActions = await invoke$
|
|
9392
|
+
const allActions = await invoke$c('GetEditorSourceActions.getEditorSourceActions');
|
|
9377
9393
|
const filtered = filterActions(allActions, languageId);
|
|
9378
9394
|
return filtered;
|
|
9379
9395
|
};
|
|
@@ -9396,14 +9412,14 @@ const getWordAtOffset = editor => {
|
|
|
9396
9412
|
};
|
|
9397
9413
|
|
|
9398
9414
|
const setFocus = async focusKey => {
|
|
9399
|
-
await invoke$
|
|
9415
|
+
await invoke$c('Focus.setFocus', focusKey);
|
|
9400
9416
|
};
|
|
9401
9417
|
const unsetAdditionalFocus = async focusKey => {
|
|
9402
9418
|
if (!focusKey) {
|
|
9403
9419
|
return;
|
|
9404
9420
|
}
|
|
9405
9421
|
// @ts-ignore
|
|
9406
|
-
await invoke$
|
|
9422
|
+
await invoke$c('Focus.removeAdditionalFocus', focusKey);
|
|
9407
9423
|
};
|
|
9408
9424
|
|
|
9409
9425
|
const FocusEditor = 12;
|
|
@@ -10135,7 +10151,7 @@ const handleMessagePort = async (port, rpcId) => {
|
|
|
10135
10151
|
messagePort: port
|
|
10136
10152
|
});
|
|
10137
10153
|
if (rpcId) {
|
|
10138
|
-
set$
|
|
10154
|
+
set$e(rpcId, rpc);
|
|
10139
10155
|
}
|
|
10140
10156
|
};
|
|
10141
10157
|
|
|
@@ -10239,7 +10255,7 @@ const hotReload = async () => {
|
|
|
10239
10255
|
|
|
10240
10256
|
// TODO ask renderer worker to rerender all editors
|
|
10241
10257
|
// @ts-ignore
|
|
10242
|
-
await invoke$
|
|
10258
|
+
await invoke$c(`Editor.rerender`);
|
|
10243
10259
|
isReloading = false;
|
|
10244
10260
|
};
|
|
10245
10261
|
|
|
@@ -10284,7 +10300,23 @@ const createExtensionManagementWorkerRpc = async () => {
|
|
|
10284
10300
|
const initializeExtensionManagementWorker = async () => {
|
|
10285
10301
|
try {
|
|
10286
10302
|
const rpc = await createExtensionManagementWorkerRpc();
|
|
10287
|
-
set$
|
|
10303
|
+
set$c(rpc);
|
|
10304
|
+
} catch {
|
|
10305
|
+
// ignore
|
|
10306
|
+
}
|
|
10307
|
+
};
|
|
10308
|
+
|
|
10309
|
+
const send$2 = port => {
|
|
10310
|
+
// @ts-ignore
|
|
10311
|
+
return sendMessagePortToOpenerWorker(port);
|
|
10312
|
+
};
|
|
10313
|
+
const initializeOpenerWorker = async () => {
|
|
10314
|
+
try {
|
|
10315
|
+
const rpc = await LazyTransferMessagePortRpcParent.create({
|
|
10316
|
+
commandMap: {},
|
|
10317
|
+
send: send$2
|
|
10318
|
+
});
|
|
10319
|
+
set$a(rpc);
|
|
10288
10320
|
} catch {
|
|
10289
10321
|
// ignore
|
|
10290
10322
|
}
|
|
@@ -10351,7 +10383,7 @@ const launchCompletionWorker = async () => {
|
|
|
10351
10383
|
|
|
10352
10384
|
const intialize = async (syntaxHighlightingEnabled, syncIncremental) => {
|
|
10353
10385
|
setFactory(launchCompletionWorker);
|
|
10354
|
-
await Promise.all([initializeSyntaxHighlighting(syntaxHighlightingEnabled, syncIncremental), initializeExtensionHost(), initializeExtensionManagementWorker(), initializeTextMeasurementWorker()]);
|
|
10386
|
+
await Promise.all([initializeSyntaxHighlighting(syntaxHighlightingEnabled, syncIncremental), initializeExtensionHost(), initializeExtensionManagementWorker(), initializeTextMeasurementWorker(), initializeOpenerWorker()]);
|
|
10355
10387
|
};
|
|
10356
10388
|
|
|
10357
10389
|
// TODO move cursor
|
|
@@ -10817,7 +10849,7 @@ const updateDebugInfo = async debugId => {
|
|
|
10817
10849
|
};
|
|
10818
10850
|
set$6(key, oldState, newEditor);
|
|
10819
10851
|
// @ts-ignore
|
|
10820
|
-
await invoke$
|
|
10852
|
+
await invoke$c('Editor.rerender', key);
|
|
10821
10853
|
};
|
|
10822
10854
|
|
|
10823
10855
|
const keep = ['ActivateByEvent.activateByEvent', 'ExtensionHostManagement.activateByEvent', 'Editor.applyEdit2', 'Editor.applyEdits2', 'Editor.closeFind2', 'Editor.closeWidget2', 'Editor.create', 'Editor.getKeyBindings', 'Editor.getSourceActions', 'Editor.getLines2', 'Editor.getPositionAtCursor', 'Editor.getOffsetAtCursor', 'Editor.getQuickPickMenuEntries', 'Editor.getSelections', 'Editor.hotReload', 'Editor.getSelections2', 'Editor.getDiagnostics', 'Editor.getText', 'Editor.getWordAt', 'Editor.getWordAt2', 'Editor.getWordAtOffset2', 'Editor.getUri', 'Editor.getWordBefore', 'Editor.getWordBefore2', 'Editor.offsetAt', 'Editor.render', 'Editor.setSelections2', 'Editor.updateDebugInfo', 'Editor.getLanguageId', 'Editor.getProblems', 'Editor.getKeys', 'Editor.getMenuIds', 'Editor.getMenuEntries', 'Editor.getMenuEntries2', 'Font.ensure', 'HandleMessagePort.handleMessagePort', 'Hover.getHoverInfo', 'Hover.handleSashPointerDown', 'Hover.handleSashPointerMove', 'Hover.handleSashPointerUp', 'Hover.loadContent', 'Hover.render', 'Initialize.initialize', 'SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker'
|
|
@@ -11142,7 +11174,7 @@ const listen = async () => {
|
|
|
11142
11174
|
const rpc = await WebWorkerRpcClient.create({
|
|
11143
11175
|
commandMap: commandMap
|
|
11144
11176
|
});
|
|
11145
|
-
set$
|
|
11177
|
+
set$b(rpc);
|
|
11146
11178
|
};
|
|
11147
11179
|
|
|
11148
11180
|
const CodeGeneratorInput = 'CodeGeneratorInput';
|