@lvce-editor/editor-worker 19.66.3 → 19.66.4
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 +199 -134
- package/package.json +1 -1
package/dist/editorWorkerMain.js
CHANGED
|
@@ -733,6 +733,23 @@ const restoreMessageError = (error, _currentStack) => {
|
|
|
733
733
|
}
|
|
734
734
|
return restoredError;
|
|
735
735
|
};
|
|
736
|
+
const getFallbackMessage = error => {
|
|
737
|
+
if (error && typeof error.message === 'string' && error.message) {
|
|
738
|
+
return error.message;
|
|
739
|
+
}
|
|
740
|
+
if (error && error.data) {
|
|
741
|
+
return getFallbackMessage(error.data);
|
|
742
|
+
}
|
|
743
|
+
const stringified = String(error);
|
|
744
|
+
if (stringified !== '[object Object]') {
|
|
745
|
+
return stringified;
|
|
746
|
+
}
|
|
747
|
+
try {
|
|
748
|
+
return JSON.stringify(error);
|
|
749
|
+
} catch {
|
|
750
|
+
return stringified;
|
|
751
|
+
}
|
|
752
|
+
};
|
|
736
753
|
const restoreJsonRpcError = error => {
|
|
737
754
|
const currentStack = getCurrentStack();
|
|
738
755
|
if (error && error instanceof Error) {
|
|
@@ -741,13 +758,13 @@ const restoreJsonRpcError = error => {
|
|
|
741
758
|
if (error && error.code && error.code === MethodNotFound) {
|
|
742
759
|
return restoreMethodNotFoundError(error, currentStack);
|
|
743
760
|
}
|
|
761
|
+
if (error && error.error) {
|
|
762
|
+
return restoreJsonRpcError(error.error);
|
|
763
|
+
}
|
|
744
764
|
if (error && error.message) {
|
|
745
765
|
return restoreMessageError(error);
|
|
746
766
|
}
|
|
747
|
-
|
|
748
|
-
return new Error(`JsonRpc Error: ${error}`);
|
|
749
|
-
}
|
|
750
|
-
return new Error(`JsonRpc Error: ${error}`);
|
|
767
|
+
return new Error(`JsonRpc Error: ${getFallbackMessage(error)}`);
|
|
751
768
|
};
|
|
752
769
|
const unwrapJsonRpcResult = responseMessage => {
|
|
753
770
|
if ('error' in responseMessage) {
|
|
@@ -826,7 +843,7 @@ const getErrorResponse = (id, error, preparePrettyError, logError) => {
|
|
|
826
843
|
const errorProperty = getErrorProperty(error, prettyError);
|
|
827
844
|
return create$1$1(id, errorProperty);
|
|
828
845
|
};
|
|
829
|
-
const create$
|
|
846
|
+
const create$l = (message, result) => {
|
|
830
847
|
return {
|
|
831
848
|
id: message.id,
|
|
832
849
|
jsonrpc: Two$1,
|
|
@@ -835,7 +852,7 @@ const create$j = (message, result) => {
|
|
|
835
852
|
};
|
|
836
853
|
const getSuccessResponse = (message, result) => {
|
|
837
854
|
const resultProperty = result ?? null;
|
|
838
|
-
return create$
|
|
855
|
+
return create$l(message, resultProperty);
|
|
839
856
|
};
|
|
840
857
|
const getErrorResponseSimple = (id, error) => {
|
|
841
858
|
return {
|
|
@@ -934,7 +951,7 @@ const handleJsonRpcMessage = async (...args) => {
|
|
|
934
951
|
|
|
935
952
|
const Two = '2.0';
|
|
936
953
|
|
|
937
|
-
const create$
|
|
954
|
+
const create$k = (method, params) => {
|
|
938
955
|
return {
|
|
939
956
|
jsonrpc: Two,
|
|
940
957
|
method,
|
|
@@ -942,7 +959,7 @@ const create$i = (method, params) => {
|
|
|
942
959
|
};
|
|
943
960
|
};
|
|
944
961
|
|
|
945
|
-
const create$
|
|
962
|
+
const create$j = (id, method, params) => {
|
|
946
963
|
const message = {
|
|
947
964
|
id,
|
|
948
965
|
jsonrpc: Two,
|
|
@@ -953,12 +970,12 @@ const create$h = (id, method, params) => {
|
|
|
953
970
|
};
|
|
954
971
|
|
|
955
972
|
let id = 0;
|
|
956
|
-
const create$
|
|
973
|
+
const create$i = () => {
|
|
957
974
|
return ++id;
|
|
958
975
|
};
|
|
959
976
|
|
|
960
977
|
const registerPromise = map => {
|
|
961
|
-
const id = create$
|
|
978
|
+
const id = create$i();
|
|
962
979
|
const {
|
|
963
980
|
promise,
|
|
964
981
|
resolve
|
|
@@ -975,7 +992,7 @@ const invokeHelper = async (callbacks, ipc, method, params, useSendAndTransfer)
|
|
|
975
992
|
id,
|
|
976
993
|
promise
|
|
977
994
|
} = registerPromise(callbacks);
|
|
978
|
-
const message = create$
|
|
995
|
+
const message = create$j(id, method, params);
|
|
979
996
|
if (useSendAndTransfer && ipc.sendAndTransfer) {
|
|
980
997
|
ipc.sendAndTransfer(message);
|
|
981
998
|
} else {
|
|
@@ -1011,7 +1028,7 @@ const createRpc = ipc => {
|
|
|
1011
1028
|
* @deprecated
|
|
1012
1029
|
*/
|
|
1013
1030
|
send(method, ...params) {
|
|
1014
|
-
const message = create$
|
|
1031
|
+
const message = create$k(method, params);
|
|
1015
1032
|
ipc.send(message);
|
|
1016
1033
|
}
|
|
1017
1034
|
};
|
|
@@ -1079,7 +1096,7 @@ const createSharedLazyRpc = factory => {
|
|
|
1079
1096
|
};
|
|
1080
1097
|
};
|
|
1081
1098
|
|
|
1082
|
-
const create$
|
|
1099
|
+
const create$h = async ({
|
|
1083
1100
|
commandMap,
|
|
1084
1101
|
isMessagePortOpen = true,
|
|
1085
1102
|
messagePort
|
|
@@ -1097,7 +1114,7 @@ const create$f = async ({
|
|
|
1097
1114
|
return rpc;
|
|
1098
1115
|
};
|
|
1099
1116
|
|
|
1100
|
-
const create$
|
|
1117
|
+
const create$g = async ({
|
|
1101
1118
|
commandMap,
|
|
1102
1119
|
isMessagePortOpen,
|
|
1103
1120
|
send
|
|
@@ -1107,20 +1124,20 @@ const create$e = async ({
|
|
|
1107
1124
|
port2
|
|
1108
1125
|
} = new MessageChannel();
|
|
1109
1126
|
await send(port1);
|
|
1110
|
-
return create$
|
|
1127
|
+
return create$h({
|
|
1111
1128
|
commandMap,
|
|
1112
1129
|
isMessagePortOpen,
|
|
1113
1130
|
messagePort: port2
|
|
1114
1131
|
});
|
|
1115
1132
|
};
|
|
1116
1133
|
|
|
1117
|
-
const create$
|
|
1134
|
+
const create$f = async ({
|
|
1118
1135
|
commandMap,
|
|
1119
1136
|
isMessagePortOpen,
|
|
1120
1137
|
send
|
|
1121
1138
|
}) => {
|
|
1122
1139
|
return createSharedLazyRpc(() => {
|
|
1123
|
-
return create$
|
|
1140
|
+
return create$g({
|
|
1124
1141
|
commandMap,
|
|
1125
1142
|
isMessagePortOpen,
|
|
1126
1143
|
send
|
|
@@ -1128,17 +1145,17 @@ const create$d = async ({
|
|
|
1128
1145
|
});
|
|
1129
1146
|
};
|
|
1130
1147
|
|
|
1131
|
-
const create$
|
|
1148
|
+
const create$e = async ({
|
|
1132
1149
|
commandMap,
|
|
1133
1150
|
messagePort
|
|
1134
1151
|
}) => {
|
|
1135
|
-
return create$
|
|
1152
|
+
return create$h({
|
|
1136
1153
|
commandMap,
|
|
1137
1154
|
messagePort
|
|
1138
1155
|
});
|
|
1139
1156
|
};
|
|
1140
1157
|
|
|
1141
|
-
const create$
|
|
1158
|
+
const create$d = async ({
|
|
1142
1159
|
commandMap
|
|
1143
1160
|
}) => {
|
|
1144
1161
|
// TODO create a commandMap per rpc instance
|
|
@@ -1181,7 +1198,7 @@ const remove$8 = id => {
|
|
|
1181
1198
|
};
|
|
1182
1199
|
|
|
1183
1200
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
1184
|
-
const create$
|
|
1201
|
+
const create$c = rpcId => {
|
|
1185
1202
|
return {
|
|
1186
1203
|
async dispose() {
|
|
1187
1204
|
const rpc = get$9(rpcId);
|
|
@@ -1310,26 +1327,26 @@ const SetPatches = 'Viewlet.setPatches';
|
|
|
1310
1327
|
const FocusEditorText$1 = 12;
|
|
1311
1328
|
|
|
1312
1329
|
const {
|
|
1313
|
-
invoke: invoke$
|
|
1330
|
+
invoke: invoke$j,
|
|
1314
1331
|
set: set$g
|
|
1315
|
-
} = create$
|
|
1332
|
+
} = create$c(DialogWorker);
|
|
1316
1333
|
|
|
1317
1334
|
const {
|
|
1318
|
-
invoke: invoke$
|
|
1335
|
+
invoke: invoke$i,
|
|
1319
1336
|
set: set$f
|
|
1320
|
-
} = create$
|
|
1337
|
+
} = create$c(DragAndDropWorker);
|
|
1321
1338
|
|
|
1322
1339
|
const {
|
|
1323
|
-
invoke: invoke$
|
|
1340
|
+
invoke: invoke$h,
|
|
1324
1341
|
set: set$e
|
|
1325
|
-
} = create$
|
|
1342
|
+
} = create$c(ErrorWorker);
|
|
1326
1343
|
|
|
1327
1344
|
const {
|
|
1328
|
-
invoke: invoke$
|
|
1345
|
+
invoke: invoke$g,
|
|
1329
1346
|
set: set$d
|
|
1330
|
-
} = create$
|
|
1347
|
+
} = create$c(ExtensionManagementWorker);
|
|
1331
1348
|
const getLanguages$1 = (platform, assetDir) => {
|
|
1332
|
-
return invoke$
|
|
1349
|
+
return invoke$g('Extensions.getLanguages', platform, assetDir);
|
|
1333
1350
|
};
|
|
1334
1351
|
|
|
1335
1352
|
const createLazyRpc = rpcId => {
|
|
@@ -1406,29 +1423,29 @@ const createLazyRpc = rpcId => {
|
|
|
1406
1423
|
};
|
|
1407
1424
|
|
|
1408
1425
|
const {
|
|
1409
|
-
invoke: invoke$
|
|
1426
|
+
invoke: invoke$f,
|
|
1410
1427
|
set: set$c
|
|
1411
|
-
} = create$
|
|
1428
|
+
} = create$c(OpenerWorker);
|
|
1412
1429
|
const openUrl = async (url, platform) => {
|
|
1413
|
-
return invoke$
|
|
1430
|
+
return invoke$f('Open.openUrl', url, platform);
|
|
1414
1431
|
};
|
|
1415
1432
|
|
|
1416
1433
|
const {
|
|
1417
|
-
invoke: invoke$
|
|
1434
|
+
invoke: invoke$e,
|
|
1418
1435
|
set: set$b
|
|
1419
|
-
} = create$
|
|
1436
|
+
} = create$c(TextMeasurementWorker);
|
|
1420
1437
|
|
|
1421
1438
|
const {
|
|
1422
|
-
invoke: invoke$
|
|
1439
|
+
invoke: invoke$d,
|
|
1423
1440
|
invokeAndTransfer,
|
|
1424
1441
|
set: set$a
|
|
1425
|
-
} = create$
|
|
1442
|
+
} = create$c(RendererWorker);
|
|
1426
1443
|
const showContextMenu2 = async (uid, menuId, x, y, args) => {
|
|
1427
1444
|
number(uid);
|
|
1428
1445
|
number(menuId);
|
|
1429
1446
|
number(x);
|
|
1430
1447
|
number(y);
|
|
1431
|
-
await invoke$
|
|
1448
|
+
await invoke$d('ContextMenu.show2', uid, menuId, x, y, args);
|
|
1432
1449
|
};
|
|
1433
1450
|
const sendMessagePortToDragAndDropWorker = async port => {
|
|
1434
1451
|
const command = 'DragAndDrop.handleMessagePort';
|
|
@@ -1446,14 +1463,11 @@ const sendMessagePortToErrorWorker = async (port, rpcId) => {
|
|
|
1446
1463
|
const command = 'Errors.handleMessagePort';
|
|
1447
1464
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToErrorWorker', port, command, rpcId);
|
|
1448
1465
|
};
|
|
1449
|
-
const readFile$1 = async uri => {
|
|
1450
|
-
return invoke$c('FileSystem.readFile', uri);
|
|
1451
|
-
};
|
|
1452
1466
|
const writeClipBoardText = async text => {
|
|
1453
|
-
await invoke$
|
|
1467
|
+
await invoke$d('ClipBoard.writeText', /* text */text);
|
|
1454
1468
|
};
|
|
1455
1469
|
const readClipBoardText = async () => {
|
|
1456
|
-
return invoke$
|
|
1470
|
+
return invoke$d('ClipBoard.readText');
|
|
1457
1471
|
};
|
|
1458
1472
|
const sendMessagePortToTextMeasurementWorker = async port => {
|
|
1459
1473
|
const command = 'TextMeasurement.handleMessagePort';
|
|
@@ -1464,10 +1478,10 @@ const sendMessagePortToExtensionManagementWorker$1 = async (port, rpcId) => {
|
|
|
1464
1478
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionManagementWorker', port, command, rpcId);
|
|
1465
1479
|
};
|
|
1466
1480
|
const getPreference = async key => {
|
|
1467
|
-
return await invoke$
|
|
1481
|
+
return await invoke$d('Preferences.get', key);
|
|
1468
1482
|
};
|
|
1469
1483
|
const openUri = async (uri, focus, options) => {
|
|
1470
|
-
await invoke$
|
|
1484
|
+
await invoke$d('Main.openUri', {
|
|
1471
1485
|
...options,
|
|
1472
1486
|
focus,
|
|
1473
1487
|
uri
|
|
@@ -1478,13 +1492,13 @@ const sendMessagePortToSyntaxHighlightingWorker$1 = async port => {
|
|
|
1478
1492
|
};
|
|
1479
1493
|
|
|
1480
1494
|
const {
|
|
1481
|
-
invoke: invoke$
|
|
1495
|
+
invoke: invoke$c,
|
|
1482
1496
|
set: set$9
|
|
1483
|
-
} = create$
|
|
1497
|
+
} = create$c(MarkdownWorker);
|
|
1484
1498
|
|
|
1485
1499
|
const SyntaxHighlightingWorker = {
|
|
1486
1500
|
__proto__: null,
|
|
1487
|
-
invoke: invoke$
|
|
1501
|
+
invoke: invoke$c,
|
|
1488
1502
|
set: set$9
|
|
1489
1503
|
};
|
|
1490
1504
|
|
|
@@ -1492,7 +1506,7 @@ const toCommandId = key => {
|
|
|
1492
1506
|
const dotIndex = key.indexOf('.');
|
|
1493
1507
|
return key.slice(dotIndex + 1);
|
|
1494
1508
|
};
|
|
1495
|
-
const create$
|
|
1509
|
+
const create$b = () => {
|
|
1496
1510
|
const commandQueues = new Map();
|
|
1497
1511
|
const generations = Object.create(null);
|
|
1498
1512
|
const states = Object.create(null);
|
|
@@ -1755,7 +1769,7 @@ const activateByEvent = async (event, assetDir, platform) => {
|
|
|
1755
1769
|
string(event);
|
|
1756
1770
|
// Assert.string(assetDir)
|
|
1757
1771
|
// Assert.number(platform)
|
|
1758
|
-
await invoke$
|
|
1772
|
+
await invoke$g('Extensions.activateByEvent', event);
|
|
1759
1773
|
};
|
|
1760
1774
|
|
|
1761
1775
|
const codeGeneratorAccept = state => {
|
|
@@ -1782,7 +1796,7 @@ const toEditorValue = (value, originalValue) => {
|
|
|
1782
1796
|
return `0x${match[1]}`;
|
|
1783
1797
|
};
|
|
1784
1798
|
|
|
1785
|
-
const editorStates = create$
|
|
1799
|
+
const editorStates = create$b();
|
|
1786
1800
|
const {
|
|
1787
1801
|
dispose: dispose$5,
|
|
1788
1802
|
getCommandIds,
|
|
@@ -2403,7 +2417,7 @@ const getInitialLineState = initialLineState => {
|
|
|
2403
2417
|
return deepCopy(initialLineState);
|
|
2404
2418
|
};
|
|
2405
2419
|
|
|
2406
|
-
const state$
|
|
2420
|
+
const state$e = {
|
|
2407
2421
|
warned: []
|
|
2408
2422
|
};
|
|
2409
2423
|
const flattenTokensArray = tokens => {
|
|
@@ -2415,10 +2429,10 @@ const flattenTokensArray = tokens => {
|
|
|
2415
2429
|
return flattened;
|
|
2416
2430
|
};
|
|
2417
2431
|
const warnDeprecatedArrayReturn = (languageId, fn) => {
|
|
2418
|
-
if (state$
|
|
2432
|
+
if (state$e.warned.includes(fn)) {
|
|
2419
2433
|
return;
|
|
2420
2434
|
}
|
|
2421
|
-
state$
|
|
2435
|
+
state$e.warned.push(fn);
|
|
2422
2436
|
console.warn(`tokenizers without hasArrayReturn=false are deprecated (language ${languageId})`);
|
|
2423
2437
|
};
|
|
2424
2438
|
const safeTokenizeLine = (languageId, tokenizeLine, line, lineStateAtStart, hasArrayReturn) => {
|
|
@@ -2479,40 +2493,40 @@ const TokenizePlainText = {
|
|
|
2479
2493
|
tokenizeLine
|
|
2480
2494
|
};
|
|
2481
2495
|
|
|
2482
|
-
const state$
|
|
2496
|
+
const state$d = {
|
|
2483
2497
|
enabled: false
|
|
2484
2498
|
};
|
|
2485
2499
|
const setEnabled$1 = value => {
|
|
2486
|
-
state$
|
|
2500
|
+
state$d.enabled = value;
|
|
2487
2501
|
};
|
|
2488
2502
|
const getEnabled$1 = () => {
|
|
2489
|
-
return state$
|
|
2503
|
+
return state$d.enabled;
|
|
2490
2504
|
};
|
|
2491
2505
|
|
|
2492
2506
|
const {
|
|
2493
|
-
invoke: invoke$
|
|
2507
|
+
invoke: invoke$b,
|
|
2494
2508
|
set: set$6
|
|
2495
2509
|
} = SyntaxHighlightingWorker;
|
|
2496
2510
|
|
|
2497
|
-
const state$
|
|
2511
|
+
const state$c = {
|
|
2498
2512
|
pending: Object.create(null),
|
|
2499
2513
|
tokenizePaths: Object.create(null),
|
|
2500
2514
|
tokenizers: Object.create(null)
|
|
2501
2515
|
};
|
|
2502
2516
|
const has = languageId => {
|
|
2503
|
-
return Object.hasOwn(state$
|
|
2517
|
+
return Object.hasOwn(state$c.tokenizers, languageId);
|
|
2504
2518
|
};
|
|
2505
2519
|
const set$5 = (languageId, tokenizer) => {
|
|
2506
|
-
state$
|
|
2520
|
+
state$c.tokenizers[languageId] = tokenizer;
|
|
2507
2521
|
};
|
|
2508
2522
|
const get$6 = languageId => {
|
|
2509
|
-
return state$
|
|
2523
|
+
return state$c.tokenizers[languageId];
|
|
2510
2524
|
};
|
|
2511
2525
|
const setTokenizePath = (languageId, tokenizePath) => {
|
|
2512
|
-
state$
|
|
2526
|
+
state$c.tokenizePaths[languageId] = tokenizePath;
|
|
2513
2527
|
};
|
|
2514
2528
|
const getTokenizePath$1 = languageId => {
|
|
2515
|
-
return state$
|
|
2529
|
+
return state$c.tokenizePaths[languageId] || '';
|
|
2516
2530
|
};
|
|
2517
2531
|
const setTokenizePaths = languages => {
|
|
2518
2532
|
for (const language of languages) {
|
|
@@ -2522,7 +2536,7 @@ const setTokenizePaths = languages => {
|
|
|
2522
2536
|
}
|
|
2523
2537
|
};
|
|
2524
2538
|
const isPending = languageId => {
|
|
2525
|
-
return Object.hasOwn(state$
|
|
2539
|
+
return Object.hasOwn(state$c.pending, languageId);
|
|
2526
2540
|
};
|
|
2527
2541
|
|
|
2528
2542
|
const tokenMaps = Object.create(null);
|
|
@@ -2541,7 +2555,7 @@ const loadTokenizer = async (languageId, tokenizePath) => {
|
|
|
2541
2555
|
setTokenizePath(languageId, tokenizePath);
|
|
2542
2556
|
if (getEnabled$1()) {
|
|
2543
2557
|
// @ts-ignore
|
|
2544
|
-
const tokenMap = await invoke$
|
|
2558
|
+
const tokenMap = await invoke$b('Tokenizer.load', languageId, tokenizePath);
|
|
2545
2559
|
set$4(languageId, tokenMap);
|
|
2546
2560
|
return;
|
|
2547
2561
|
}
|
|
@@ -2705,10 +2719,18 @@ const getTokensViewport = (editor, startLineIndex, endLineIndex) => {
|
|
|
2705
2719
|
};
|
|
2706
2720
|
};
|
|
2707
2721
|
|
|
2708
|
-
const sentLines = Object.create(null);
|
|
2709
|
-
|
|
2710
2722
|
// TODO only send changed lines to renderer process instead of all lines in viewport
|
|
2711
2723
|
const getTokensViewport2 = async (editor, startLineIndex, endLineIndex, syncIncremental) => {
|
|
2724
|
+
const {
|
|
2725
|
+
lifecycle
|
|
2726
|
+
} = editor;
|
|
2727
|
+
if (lifecycle?.disposed) {
|
|
2728
|
+
return {
|
|
2729
|
+
embeddedResults: [],
|
|
2730
|
+
tokenizersToLoad: [],
|
|
2731
|
+
tokens: []
|
|
2732
|
+
};
|
|
2733
|
+
}
|
|
2712
2734
|
if (getEnabled$1()) {
|
|
2713
2735
|
if (syncIncremental) {
|
|
2714
2736
|
const {
|
|
@@ -2719,23 +2741,23 @@ const getTokensViewport2 = async (editor, startLineIndex, endLineIndex, syncIncr
|
|
|
2719
2741
|
} = editor;
|
|
2720
2742
|
let hasLinesToSend = true;
|
|
2721
2743
|
let linesToSend = lines;
|
|
2722
|
-
if (sentLines
|
|
2744
|
+
if (lifecycle?.sentLines === lines) {
|
|
2723
2745
|
hasLinesToSend = false;
|
|
2724
2746
|
linesToSend = [];
|
|
2725
|
-
} else {
|
|
2726
|
-
sentLines
|
|
2747
|
+
} else if (lifecycle) {
|
|
2748
|
+
lifecycle.sentLines = lines;
|
|
2727
2749
|
}
|
|
2728
2750
|
const slimEditor = {
|
|
2729
2751
|
invalidStartIndex,
|
|
2730
2752
|
languageId
|
|
2731
2753
|
};
|
|
2732
|
-
return invoke$
|
|
2754
|
+
return invoke$b('GetTokensViewport.getTokensViewport', slimEditor,
|
|
2733
2755
|
// @ts-ignore
|
|
2734
2756
|
startLineIndex, endLineIndex, hasLinesToSend, id, linesToSend);
|
|
2735
2757
|
}
|
|
2736
2758
|
// TODO only send needed lines of text
|
|
2737
2759
|
// @ts-ignore
|
|
2738
|
-
return invoke$
|
|
2760
|
+
return invoke$b('GetTokensViewport.getTokensViewport', editor, startLineIndex, endLineIndex, true, editor.id, editor.lines);
|
|
2739
2761
|
}
|
|
2740
2762
|
return getTokensViewport(editor, startLineIndex, endLineIndex);
|
|
2741
2763
|
};
|
|
@@ -3353,14 +3375,14 @@ const getVisible$1 = async (editor, syncIncremental) => {
|
|
|
3353
3375
|
};
|
|
3354
3376
|
};
|
|
3355
3377
|
|
|
3356
|
-
const state$
|
|
3378
|
+
const state$b = {
|
|
3357
3379
|
enabled: false
|
|
3358
3380
|
};
|
|
3359
3381
|
const setEnabled = value => {
|
|
3360
|
-
state$
|
|
3382
|
+
state$b.enabled = value;
|
|
3361
3383
|
};
|
|
3362
3384
|
const getEnabled = () => {
|
|
3363
|
-
return state$
|
|
3385
|
+
return state$b.enabled;
|
|
3364
3386
|
};
|
|
3365
3387
|
|
|
3366
3388
|
// TODO this should be in a separate scrolling module
|
|
@@ -3410,7 +3432,7 @@ const setDeltaY$1 = async (state, value) => {
|
|
|
3410
3432
|
const emptyIncrementalEdits = [];
|
|
3411
3433
|
|
|
3412
3434
|
const getIncrementalEdits = async (oldState, newState) => {
|
|
3413
|
-
if (!newState.undoStack) {
|
|
3435
|
+
if (newState.lifecycle?.disposed || !newState.undoStack) {
|
|
3414
3436
|
return emptyIncrementalEdits;
|
|
3415
3437
|
}
|
|
3416
3438
|
if (oldState.undoStack === newState.undoStack) {
|
|
@@ -3429,7 +3451,7 @@ const getIncrementalEdits = async (oldState, newState) => {
|
|
|
3429
3451
|
const oldLine = oldState.lines[rowIndex];
|
|
3430
3452
|
const newLine = lines[rowIndex];
|
|
3431
3453
|
// @ts-ignore
|
|
3432
|
-
const incrementalEdits = await invoke$
|
|
3454
|
+
const incrementalEdits = await invoke$b(
|
|
3433
3455
|
// @ts-ignore
|
|
3434
3456
|
'TokenizeIncremental.tokenizeIncremental', newState.uid,
|
|
3435
3457
|
// @ts-ignore
|
|
@@ -3677,7 +3699,7 @@ const send$2 = (rpcId, rpc, status) => {
|
|
|
3677
3699
|
return delivery.running || start(delivery);
|
|
3678
3700
|
};
|
|
3679
3701
|
|
|
3680
|
-
const state$
|
|
3702
|
+
const state$a = Object.create(null);
|
|
3681
3703
|
|
|
3682
3704
|
/**
|
|
3683
3705
|
* Register a listener for a specific event type
|
|
@@ -3687,13 +3709,13 @@ const state$9 = Object.create(null);
|
|
|
3687
3709
|
const registerListener$1 = (listenerType, rpcId) => {
|
|
3688
3710
|
number(listenerType);
|
|
3689
3711
|
number(rpcId);
|
|
3690
|
-
if (!Object.hasOwn(state$
|
|
3691
|
-
state$
|
|
3712
|
+
if (!Object.hasOwn(state$a, listenerType)) {
|
|
3713
|
+
state$a[listenerType] = [];
|
|
3692
3714
|
}
|
|
3693
3715
|
|
|
3694
3716
|
// Avoid duplicate registrations
|
|
3695
|
-
if (!state$
|
|
3696
|
-
state$
|
|
3717
|
+
if (!state$a[listenerType].includes(rpcId)) {
|
|
3718
|
+
state$a[listenerType].push(rpcId);
|
|
3697
3719
|
}
|
|
3698
3720
|
};
|
|
3699
3721
|
|
|
@@ -3708,10 +3730,10 @@ const unregisterListener$1 = (listenerType, rpcId) => {
|
|
|
3708
3730
|
if (listenerType === EditorSelection$1) {
|
|
3709
3731
|
dispose$4(rpcId);
|
|
3710
3732
|
}
|
|
3711
|
-
if (Object.hasOwn(state$
|
|
3712
|
-
const index = state$
|
|
3733
|
+
if (Object.hasOwn(state$a, listenerType)) {
|
|
3734
|
+
const index = state$a[listenerType].indexOf(rpcId);
|
|
3713
3735
|
if (index !== -1) {
|
|
3714
|
-
state$
|
|
3736
|
+
state$a[listenerType].splice(index, 1);
|
|
3715
3737
|
}
|
|
3716
3738
|
}
|
|
3717
3739
|
};
|
|
@@ -3723,7 +3745,7 @@ const unregisterListener$1 = (listenerType, rpcId) => {
|
|
|
3723
3745
|
*/
|
|
3724
3746
|
const getListeners = listenerType => {
|
|
3725
3747
|
number(listenerType);
|
|
3726
|
-
return state$
|
|
3748
|
+
return state$a[listenerType] || [];
|
|
3727
3749
|
};
|
|
3728
3750
|
|
|
3729
3751
|
/**
|
|
@@ -3822,11 +3844,31 @@ const splitLines = lines => {
|
|
|
3822
3844
|
return lines.split('\n');
|
|
3823
3845
|
};
|
|
3824
3846
|
|
|
3847
|
+
const state$9 = {};
|
|
3848
|
+
const create$a = () => create$g({
|
|
3849
|
+
commandMap: {},
|
|
3850
|
+
send: port => invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSystemWorker', port, 'FileSystem.connect')
|
|
3851
|
+
});
|
|
3852
|
+
const invoke$a = async (method, ...args) => {
|
|
3853
|
+
state$9.rpcPromise ||= create$a();
|
|
3854
|
+
let rpc;
|
|
3855
|
+
try {
|
|
3856
|
+
const {
|
|
3857
|
+
rpcPromise
|
|
3858
|
+
} = state$9;
|
|
3859
|
+
rpc = await rpcPromise;
|
|
3860
|
+
} catch (error) {
|
|
3861
|
+
delete state$9.rpcPromise;
|
|
3862
|
+
throw error;
|
|
3863
|
+
}
|
|
3864
|
+
return rpc.invoke(method, ...args);
|
|
3865
|
+
};
|
|
3866
|
+
|
|
3825
3867
|
const invoke$9 = async (applicationId, method, ...args) => {
|
|
3826
|
-
return applicationId === undefined ? invoke$
|
|
3868
|
+
return applicationId === undefined ? invoke$d(method, ...args) : invoke$d('Application.execute', applicationId, method, ...args);
|
|
3827
3869
|
};
|
|
3828
3870
|
const readFile = async (applicationId, uri) => {
|
|
3829
|
-
return applicationId === undefined ?
|
|
3871
|
+
return applicationId === undefined ? invoke$a('FileSystem.readFile', uri) : invoke$a('ApplicationFileSystem.execute', applicationId, 'readFile', uri);
|
|
3830
3872
|
};
|
|
3831
3873
|
|
|
3832
3874
|
const notifyTabModifiedStatusChange = async (uri, modified, applicationId) => {
|
|
@@ -3868,7 +3910,7 @@ const measureTextWidthFast = async (text, charWidth) => {
|
|
|
3868
3910
|
};
|
|
3869
3911
|
|
|
3870
3912
|
const measureTextWidthSlow = async (text, fontWeight, fontSize, fontFamily, letterSpacing, isMonoSpaceFont, charWidth) => {
|
|
3871
|
-
const width = await invoke$
|
|
3913
|
+
const width = await invoke$e('TextMeasurement.measureTextWidth', text, fontWeight, fontSize, fontFamily, letterSpacing, isMonoSpaceFont, charWidth);
|
|
3872
3914
|
return width;
|
|
3873
3915
|
};
|
|
3874
3916
|
|
|
@@ -4574,7 +4616,7 @@ const updateColorPickerValue$1 = async (editor, value) => {
|
|
|
4574
4616
|
};
|
|
4575
4617
|
|
|
4576
4618
|
const invoke$8 = async (applicationId, method, ...args) => {
|
|
4577
|
-
return applicationId === undefined ? invoke$
|
|
4619
|
+
return applicationId === undefined ? invoke$g(method, ...args) : invoke$g('Extensions.invokeForApplication', applicationId, method, ...args);
|
|
4578
4620
|
};
|
|
4579
4621
|
|
|
4580
4622
|
const validTypes = new Set(['added', 'deleted', 'modified']);
|
|
@@ -5174,7 +5216,7 @@ const getColorPickerWorkerCommandMap = () => ({
|
|
|
5174
5216
|
const ModuleWorkerAndWorkaroundForChromeDevtoolsBug = 6;
|
|
5175
5217
|
|
|
5176
5218
|
const launchWorker = async (name, url, intializeCommand, commandMap = {}) => {
|
|
5177
|
-
const rpc = await create$
|
|
5219
|
+
const rpc = await create$g({
|
|
5178
5220
|
commandMap,
|
|
5179
5221
|
isMessagePortOpen: true,
|
|
5180
5222
|
async send(port) {
|
|
@@ -5230,6 +5272,10 @@ const loadContent$3 = async (state, parentUid) => {
|
|
|
5230
5272
|
};
|
|
5231
5273
|
};
|
|
5232
5274
|
|
|
5275
|
+
const create$9 = () => ({
|
|
5276
|
+
disposed: false
|
|
5277
|
+
});
|
|
5278
|
+
|
|
5233
5279
|
const ColorPicker = 41;
|
|
5234
5280
|
const EditorCompletion = 9;
|
|
5235
5281
|
const Empty = 0;
|
|
@@ -5310,6 +5356,7 @@ const createEditor2 = (id, uri, x, y, width, height, platform, assetDir, _langua
|
|
|
5310
5356
|
itemHeight: 20,
|
|
5311
5357
|
languageId: '',
|
|
5312
5358
|
letterSpacing: 0,
|
|
5359
|
+
lifecycle: create$9(),
|
|
5313
5360
|
lightBulbRowIndex: -1,
|
|
5314
5361
|
lineCache: [],
|
|
5315
5362
|
lineNumbers: false,
|
|
@@ -5530,7 +5577,7 @@ const get$3 = async key => {
|
|
|
5530
5577
|
return value;
|
|
5531
5578
|
};
|
|
5532
5579
|
const update = async settings => {
|
|
5533
|
-
await invoke$
|
|
5580
|
+
await invoke$d('Preferences.update', settings);
|
|
5534
5581
|
};
|
|
5535
5582
|
|
|
5536
5583
|
const createEditor = async ({
|
|
@@ -5629,6 +5676,7 @@ const createEditor = async ({
|
|
|
5629
5676
|
itemHeight: 20,
|
|
5630
5677
|
languageId: computedlanguageId,
|
|
5631
5678
|
letterSpacing,
|
|
5679
|
+
lifecycle: create$9(),
|
|
5632
5680
|
lineCache: [],
|
|
5633
5681
|
lineNumbers,
|
|
5634
5682
|
lines: [],
|
|
@@ -5790,7 +5838,9 @@ const createStandaloneEditor = async ({
|
|
|
5790
5838
|
cursorInfos,
|
|
5791
5839
|
selectionInfos
|
|
5792
5840
|
};
|
|
5793
|
-
|
|
5841
|
+
if (!createdEditor.lifecycle?.disposed) {
|
|
5842
|
+
set$8(id, createdEditor, finalEditor);
|
|
5843
|
+
}
|
|
5794
5844
|
};
|
|
5795
5845
|
|
|
5796
5846
|
const isEqual$5 = (oldState, newState) => {
|
|
@@ -6017,7 +6067,7 @@ const invoke$6 = async (method, ...params) => {
|
|
|
6017
6067
|
return await worker.invoke(method, ...params);
|
|
6018
6068
|
};
|
|
6019
6069
|
const dispose$2 = async () => {
|
|
6020
|
-
if (getKeys$2().
|
|
6070
|
+
if (getKeys$2().some(uid => get$8(Number(uid))?.newState.widgets?.some(widget => widget.id === Rename$1))) {
|
|
6021
6071
|
return;
|
|
6022
6072
|
}
|
|
6023
6073
|
const promise = workerPromise;
|
|
@@ -6110,20 +6160,30 @@ const disposeEditor = async editorUid => {
|
|
|
6110
6160
|
if (!editor) {
|
|
6111
6161
|
return [];
|
|
6112
6162
|
}
|
|
6163
|
+
if (editor.lifecycle) {
|
|
6164
|
+
editor.lifecycle.disposed = true;
|
|
6165
|
+
delete editor.lifecycle.sentLines;
|
|
6166
|
+
}
|
|
6167
|
+
// Invalidate the registry before awaiting widget or worker cleanup.
|
|
6168
|
+
dispose$5(editorUid);
|
|
6169
|
+
dispose$3(editorUid);
|
|
6113
6170
|
clear$1(editorUid);
|
|
6171
|
+
dispose$1(editorUid);
|
|
6172
|
+
const pending = [];
|
|
6173
|
+
if (getEnabled$1()) {
|
|
6174
|
+
pending.push(invoke$b('TextDocument.dispose', editor.id));
|
|
6175
|
+
}
|
|
6114
6176
|
for (const widget of editor.widgets) {
|
|
6115
6177
|
if (widget.id === ColorPicker$2) {
|
|
6116
|
-
|
|
6178
|
+
pending.push(invoke$7('ColorPicker.dispose', widget.newState.uid));
|
|
6117
6179
|
}
|
|
6118
6180
|
}
|
|
6119
6181
|
const commands = renderWidgets$1(editor, {
|
|
6120
6182
|
...editor,
|
|
6121
6183
|
widgets: []
|
|
6122
6184
|
});
|
|
6123
|
-
dispose$
|
|
6124
|
-
|
|
6125
|
-
dispose$5(editorUid);
|
|
6126
|
-
await dispose$2();
|
|
6185
|
+
pending.push(dispose$2());
|
|
6186
|
+
await Promise.all(pending);
|
|
6127
6187
|
if (getKeys$2().length === 0) {
|
|
6128
6188
|
await notifyEditorStatusCleared();
|
|
6129
6189
|
}
|
|
@@ -6362,8 +6422,8 @@ const closeWidgetsMaybe = widgets => {
|
|
|
6362
6422
|
};
|
|
6363
6423
|
|
|
6364
6424
|
const logError = async (error, prefix) => {
|
|
6365
|
-
const prettyError = await invoke$
|
|
6366
|
-
await invoke$
|
|
6425
|
+
const prettyError = await invoke$h('Errors.prepare', error);
|
|
6426
|
+
await invoke$h('Errors.print', prettyError, prefix);
|
|
6367
6427
|
};
|
|
6368
6428
|
const logFallback = (error, prefix) => {
|
|
6369
6429
|
if (prefix) {
|
|
@@ -6700,7 +6760,7 @@ const showFilePicker = async platform => {
|
|
|
6700
6760
|
const {
|
|
6701
6761
|
canceled,
|
|
6702
6762
|
filePath
|
|
6703
|
-
} = await invoke$
|
|
6763
|
+
} = await invoke$f('Open.showSaveDialog', dialogTitle, [], platform);
|
|
6704
6764
|
if (canceled) {
|
|
6705
6765
|
return '';
|
|
6706
6766
|
}
|
|
@@ -6724,7 +6784,7 @@ const isPermissionDeniedError = error => {
|
|
|
6724
6784
|
};
|
|
6725
6785
|
const showSaveErrorDialog = async error => {
|
|
6726
6786
|
if (isPermissionDeniedError(error)) {
|
|
6727
|
-
await invoke$
|
|
6787
|
+
await invoke$j('ElectronDialog.showMessageBox', {
|
|
6728
6788
|
buttons: ['OK'],
|
|
6729
6789
|
defaultId: 0,
|
|
6730
6790
|
message: "You don't have permission to save changes to this file.",
|
|
@@ -6733,7 +6793,7 @@ const showSaveErrorDialog = async error => {
|
|
|
6733
6793
|
});
|
|
6734
6794
|
return;
|
|
6735
6795
|
}
|
|
6736
|
-
await invoke$
|
|
6796
|
+
await invoke$j('ElectronDialog.showMessageBox', {
|
|
6737
6797
|
buttons: ['OK'],
|
|
6738
6798
|
defaultId: 0,
|
|
6739
6799
|
detail: error.message,
|
|
@@ -8417,7 +8477,7 @@ const deleteWordRight = editor => {
|
|
|
8417
8477
|
|
|
8418
8478
|
const findAllReferences$1 = async editor => {
|
|
8419
8479
|
// @ts-ignore
|
|
8420
|
-
await invoke$
|
|
8480
|
+
await invoke$d('SideBar.show', 'References', /* focus */true);
|
|
8421
8481
|
return editor;
|
|
8422
8482
|
};
|
|
8423
8483
|
|
|
@@ -9216,10 +9276,10 @@ const startTextDrag = async (state, x, y) => {
|
|
|
9216
9276
|
}
|
|
9217
9277
|
try {
|
|
9218
9278
|
if (state.textDragId) {
|
|
9219
|
-
await invoke$
|
|
9279
|
+
await invoke$i('DragAndDrop.discardTextDrag', state.textDragId);
|
|
9220
9280
|
}
|
|
9221
9281
|
const text = getText$1(state).slice(startOffset, endOffset);
|
|
9222
|
-
const textDragId = await invoke$
|
|
9282
|
+
const textDragId = await invoke$i('DragAndDrop.createTextDrag', {
|
|
9223
9283
|
endOffset,
|
|
9224
9284
|
sourceUri: state.uri,
|
|
9225
9285
|
startOffset,
|
|
@@ -9354,7 +9414,7 @@ const getDiagnosticHoverDetail = ({
|
|
|
9354
9414
|
|
|
9355
9415
|
const measureTextBlockHeight = async (text, fontFamily, fontSize, lineHeight, width) => {
|
|
9356
9416
|
// @ts-ignore
|
|
9357
|
-
return invoke$
|
|
9417
|
+
return invoke$d('MeasureTextHeight.measureTextBlockHeight', text, fontFamily, fontSize, lineHeight, width);
|
|
9358
9418
|
};
|
|
9359
9419
|
|
|
9360
9420
|
const maximumWidth = 600;
|
|
@@ -9678,7 +9738,7 @@ const showHover = async (editor, position, token) => {
|
|
|
9678
9738
|
return;
|
|
9679
9739
|
}
|
|
9680
9740
|
set$8(editor.uid, latestInstance.oldState, newEditor);
|
|
9681
|
-
await invoke$
|
|
9741
|
+
await invoke$d('Editor.renderPending', editor.uid);
|
|
9682
9742
|
};
|
|
9683
9743
|
|
|
9684
9744
|
// TODO several things can happen:
|
|
@@ -9770,7 +9830,7 @@ const editorHandleNativeSelectionChange = (editor, range) => {
|
|
|
9770
9830
|
const handlePointerCaptureLost = async editor => {
|
|
9771
9831
|
if (editor.textDragId) {
|
|
9772
9832
|
try {
|
|
9773
|
-
await invoke$
|
|
9833
|
+
await invoke$i('DragAndDrop.discardTextDrag', editor.textDragId);
|
|
9774
9834
|
} catch {
|
|
9775
9835
|
// The pointer state still needs to be reset if the worker is unavailable.
|
|
9776
9836
|
}
|
|
@@ -10058,7 +10118,7 @@ const handlePointerUp = async editor => {
|
|
|
10058
10118
|
return resetEditor;
|
|
10059
10119
|
}
|
|
10060
10120
|
try {
|
|
10061
|
-
const data = await invoke$
|
|
10121
|
+
const data = await invoke$i('DragAndDrop.takeTextDrag', editor.textDragId);
|
|
10062
10122
|
if (!data) {
|
|
10063
10123
|
return resetEditor;
|
|
10064
10124
|
}
|
|
@@ -10385,7 +10445,7 @@ const indentMore = editor => {
|
|
|
10385
10445
|
|
|
10386
10446
|
const getLanguageConfiguration = async editor => {
|
|
10387
10447
|
// @ts-ignore
|
|
10388
|
-
return invoke$
|
|
10448
|
+
return invoke$d('Languages.getLanguageConfiguration', {
|
|
10389
10449
|
languageId: editor.languageId,
|
|
10390
10450
|
uri: editor.uri
|
|
10391
10451
|
});
|
|
@@ -10696,14 +10756,14 @@ const addWidget = (widget, id, render) => {
|
|
|
10696
10756
|
};
|
|
10697
10757
|
|
|
10698
10758
|
const setFocus = async focusKey => {
|
|
10699
|
-
await invoke$
|
|
10759
|
+
await invoke$d('Focus.setFocus', focusKey);
|
|
10700
10760
|
};
|
|
10701
10761
|
const unsetAdditionalFocus = async focusKey => {
|
|
10702
10762
|
if (!focusKey) {
|
|
10703
10763
|
return;
|
|
10704
10764
|
}
|
|
10705
10765
|
// @ts-ignore
|
|
10706
|
-
await invoke$
|
|
10766
|
+
await invoke$d('Focus.removeAdditionalFocus', focusKey);
|
|
10707
10767
|
};
|
|
10708
10768
|
|
|
10709
10769
|
const FocusEditor = 12;
|
|
@@ -13645,7 +13705,7 @@ const executeViewletCommand$1 = async (commandMap, uid, commandId, ...args) => {
|
|
|
13645
13705
|
throw new TypeError(`Viewlet command not found: ${commandId}`);
|
|
13646
13706
|
}
|
|
13647
13707
|
await fn(uid, ...args);
|
|
13648
|
-
await invoke$
|
|
13708
|
+
await invoke$d('Viewlet.executeViewletCommand', uid, '__renderPending', false);
|
|
13649
13709
|
};
|
|
13650
13710
|
|
|
13651
13711
|
const executeWidgetCommand = async (editor, name, method, _uid, widgetId, ...params) => {
|
|
@@ -13823,7 +13883,7 @@ const getDiagnostics$1 = async editorUid => {
|
|
|
13823
13883
|
};
|
|
13824
13884
|
|
|
13825
13885
|
const ensure = async (fontName, fontUrl) => {
|
|
13826
|
-
await invoke$
|
|
13886
|
+
await invoke$e('TextMeasurement.ensureFont', fontName, fontUrl);
|
|
13827
13887
|
};
|
|
13828
13888
|
|
|
13829
13889
|
const findWidgetFocusContexts = [FindWidget, FocusFindWidgetReplace$1, FocusFindWidgetOptions, FocusFindWidgetToggleReplace, FocusFindWidgetPreviousMatchButton, FocusFindWidgetNextMatchButton, FocusFindWidgetCloseButton, FocusFindWidgetReplaceButton, FocusFindWidgetReplaceAllButton];
|
|
@@ -14471,7 +14531,7 @@ const handleBeforeInput = (editor, inputType, data) => {
|
|
|
14471
14531
|
};
|
|
14472
14532
|
|
|
14473
14533
|
const handleMessagePort = async (port, rpcId) => {
|
|
14474
|
-
const rpc = await create$
|
|
14534
|
+
const rpc = await create$e({
|
|
14475
14535
|
commandMap: {},
|
|
14476
14536
|
messagePort: port
|
|
14477
14537
|
});
|
|
@@ -14847,7 +14907,7 @@ const hotReload = async () => {
|
|
|
14847
14907
|
|
|
14848
14908
|
// TODO ask renderer worker to rerender all editors
|
|
14849
14909
|
// @ts-ignore
|
|
14850
|
-
await invoke$
|
|
14910
|
+
await invoke$d(`Editor.rerender`);
|
|
14851
14911
|
} finally {
|
|
14852
14912
|
state.isReloading = false;
|
|
14853
14913
|
}
|
|
@@ -14866,7 +14926,7 @@ const sendMessagePortToSyntaxHighlightingWorker = async port => {
|
|
|
14866
14926
|
|
|
14867
14927
|
const createSyntaxHighlightingWorkerRpc = async () => {
|
|
14868
14928
|
try {
|
|
14869
|
-
const rpc = await create$
|
|
14929
|
+
const rpc = await create$g({
|
|
14870
14930
|
commandMap: {},
|
|
14871
14931
|
send: sendMessagePortToSyntaxHighlightingWorker
|
|
14872
14932
|
});
|
|
@@ -15043,6 +15103,9 @@ const loadContent = async (state, savedState, largeFile = false) => {
|
|
|
15043
15103
|
textInfos: []
|
|
15044
15104
|
};
|
|
15045
15105
|
}
|
|
15106
|
+
if (state.lifecycle?.disposed) {
|
|
15107
|
+
return state;
|
|
15108
|
+
}
|
|
15046
15109
|
const savedLargeFile = !!savedState && typeof savedState === 'object' && savedState.largeFile === true;
|
|
15047
15110
|
largeFile ||= state.largeFile === true || existingEditor?.largeFile === true || savedLargeFile || content.length > largeFileContentLength;
|
|
15048
15111
|
const effectiveEditor = {
|
|
@@ -15200,7 +15263,7 @@ const refreshGutterDecorationsAll = async () => {
|
|
|
15200
15263
|
...latest.newState,
|
|
15201
15264
|
gutterDecorations: refreshedEditor.gutterDecorations
|
|
15202
15265
|
});
|
|
15203
|
-
await invoke$
|
|
15266
|
+
await invoke$d('Editor.renderPending', editor.id);
|
|
15204
15267
|
}
|
|
15205
15268
|
}
|
|
15206
15269
|
};
|
|
@@ -16504,9 +16567,11 @@ const saveState = (state, savedState) => {
|
|
|
16504
16567
|
...(largeFile && {
|
|
16505
16568
|
largeFile: true
|
|
16506
16569
|
}),
|
|
16507
|
-
|
|
16508
|
-
|
|
16509
|
-
|
|
16570
|
+
...((redoStack.length > 0 || undoStack.length > 0) && {
|
|
16571
|
+
lines,
|
|
16572
|
+
redoStack,
|
|
16573
|
+
undoStack
|
|
16574
|
+
})
|
|
16510
16575
|
};
|
|
16511
16576
|
};
|
|
16512
16577
|
|
|
@@ -16570,7 +16635,7 @@ const updateDebugInfo = async debugId => {
|
|
|
16570
16635
|
};
|
|
16571
16636
|
set$8(key, oldState, newEditor);
|
|
16572
16637
|
// @ts-ignore
|
|
16573
|
-
await invoke$
|
|
16638
|
+
await invoke$d('Editor.rerender', key);
|
|
16574
16639
|
};
|
|
16575
16640
|
|
|
16576
16641
|
const queues = {};
|
|
@@ -16619,7 +16684,7 @@ const executeDiagnosticProvider = async editor => {
|
|
|
16619
16684
|
return executeIsolatedDiagnosticProvider(editor);
|
|
16620
16685
|
};
|
|
16621
16686
|
|
|
16622
|
-
const invoke = (...args) => invoke$
|
|
16687
|
+
const invoke = (...args) => invoke$d(...args);
|
|
16623
16688
|
|
|
16624
16689
|
/**
|
|
16625
16690
|
* Merges link decorations with diagnostic decorations
|
|
@@ -16797,7 +16862,7 @@ const saveAfterDelay = async (uid, token) => {
|
|
|
16797
16862
|
});
|
|
16798
16863
|
await save$1(uid);
|
|
16799
16864
|
if (didSave) {
|
|
16800
|
-
await invoke$
|
|
16865
|
+
await invoke$d('Editor.renderPending', uid);
|
|
16801
16866
|
}
|
|
16802
16867
|
};
|
|
16803
16868
|
|
|
@@ -17224,7 +17289,7 @@ for (const [key, value] of Object.entries(commandMap)) {
|
|
|
17224
17289
|
}
|
|
17225
17290
|
|
|
17226
17291
|
const initializeDragAndDropWorker = async () => {
|
|
17227
|
-
const rpc = await create$
|
|
17292
|
+
const rpc = await create$f({
|
|
17228
17293
|
commandMap: {},
|
|
17229
17294
|
send: sendMessagePortToDragAndDropWorker
|
|
17230
17295
|
});
|
|
@@ -17232,7 +17297,7 @@ const initializeDragAndDropWorker = async () => {
|
|
|
17232
17297
|
};
|
|
17233
17298
|
|
|
17234
17299
|
const initializeErrorWorker = async () => {
|
|
17235
|
-
const rpc = await create$
|
|
17300
|
+
const rpc = await create$f({
|
|
17236
17301
|
commandMap: {},
|
|
17237
17302
|
send(port) {
|
|
17238
17303
|
return sendMessagePortToErrorWorker(port, EditorWorker);
|
|
@@ -17242,7 +17307,7 @@ const initializeErrorWorker = async () => {
|
|
|
17242
17307
|
};
|
|
17243
17308
|
|
|
17244
17309
|
const createExtensionManagementWorkerRpc = async () => {
|
|
17245
|
-
const rpc = await create$
|
|
17310
|
+
const rpc = await create$f({
|
|
17246
17311
|
commandMap: {},
|
|
17247
17312
|
async send(port) {
|
|
17248
17313
|
await sendMessagePortToExtensionManagementWorker$1(port, EditorWorker);
|
|
@@ -17265,7 +17330,7 @@ const send$1 = port => {
|
|
|
17265
17330
|
return sendMessagePortToOpenerWorker(port);
|
|
17266
17331
|
};
|
|
17267
17332
|
const initializeOpenerWorker = async () => {
|
|
17268
|
-
const rpc = await create$
|
|
17333
|
+
const rpc = await create$f({
|
|
17269
17334
|
commandMap: {},
|
|
17270
17335
|
send: send$1
|
|
17271
17336
|
});
|
|
@@ -17273,7 +17338,7 @@ const initializeOpenerWorker = async () => {
|
|
|
17273
17338
|
};
|
|
17274
17339
|
|
|
17275
17340
|
const initializeRendererWorker = async () => {
|
|
17276
|
-
const rpc = await create$
|
|
17341
|
+
const rpc = await create$d({
|
|
17277
17342
|
commandMap: commandMap
|
|
17278
17343
|
});
|
|
17279
17344
|
set$a(rpc);
|
|
@@ -17283,7 +17348,7 @@ const send = port => {
|
|
|
17283
17348
|
return sendMessagePortToTextMeasurementWorker(port);
|
|
17284
17349
|
};
|
|
17285
17350
|
const initializeTextMeasurementWorker = async () => {
|
|
17286
|
-
const rpc = await create$
|
|
17351
|
+
const rpc = await create$f({
|
|
17287
17352
|
commandMap: {},
|
|
17288
17353
|
send
|
|
17289
17354
|
});
|
|
@@ -17293,7 +17358,7 @@ const initializeTextMeasurementWorker = async () => {
|
|
|
17293
17358
|
const listen = async () => {
|
|
17294
17359
|
registerCommands(commandMap);
|
|
17295
17360
|
await Promise.all([initializeRendererWorker(), initializeDragAndDropWorker(), initializeErrorWorker(), initializeExtensionManagementWorker(), initializeTextMeasurementWorker(), initializeOpenerWorker()]);
|
|
17296
|
-
const dialogRpc = await create$
|
|
17361
|
+
const dialogRpc = await create$f({
|
|
17297
17362
|
commandMap: {},
|
|
17298
17363
|
send: sendMessagePortToDialogWorker
|
|
17299
17364
|
});
|