@lvce-editor/editor-worker 19.69.0 → 19.69.2
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 +192 -73
- package/dist/settings.json +2 -1
- package/package.json +1 -1
package/dist/editorWorkerMain.js
CHANGED
|
@@ -1187,7 +1187,7 @@ const createMockRpc = ({
|
|
|
1187
1187
|
};
|
|
1188
1188
|
|
|
1189
1189
|
const rpcs = Object.create(null);
|
|
1190
|
-
const set$
|
|
1190
|
+
const set$i = (id, rpc) => {
|
|
1191
1191
|
rpcs[id] = rpc;
|
|
1192
1192
|
};
|
|
1193
1193
|
const get$9 = id => {
|
|
@@ -1220,7 +1220,7 @@ const create$c = rpcId => {
|
|
|
1220
1220
|
const mockRpc = createMockRpc({
|
|
1221
1221
|
commandMap
|
|
1222
1222
|
});
|
|
1223
|
-
set$
|
|
1223
|
+
set$i(rpcId, mockRpc);
|
|
1224
1224
|
// @ts-ignore
|
|
1225
1225
|
mockRpc[Symbol.dispose] = () => {
|
|
1226
1226
|
remove$8(rpcId);
|
|
@@ -1229,7 +1229,7 @@ const create$c = rpcId => {
|
|
|
1229
1229
|
return mockRpc;
|
|
1230
1230
|
},
|
|
1231
1231
|
set(rpc) {
|
|
1232
|
-
set$
|
|
1232
|
+
set$i(rpcId, rpc);
|
|
1233
1233
|
}
|
|
1234
1234
|
};
|
|
1235
1235
|
};
|
|
@@ -1328,23 +1328,23 @@ const FocusEditorText$1 = 12;
|
|
|
1328
1328
|
|
|
1329
1329
|
const {
|
|
1330
1330
|
invoke: invoke$j,
|
|
1331
|
-
set: set$
|
|
1331
|
+
set: set$h
|
|
1332
1332
|
} = create$c(DialogWorker);
|
|
1333
1333
|
|
|
1334
1334
|
const {
|
|
1335
1335
|
invoke: invoke$i,
|
|
1336
|
-
set: set$
|
|
1336
|
+
set: set$g
|
|
1337
1337
|
} = create$c(DragAndDropWorker);
|
|
1338
1338
|
|
|
1339
1339
|
const {
|
|
1340
1340
|
invoke: invoke$h,
|
|
1341
|
-
set: set$
|
|
1341
|
+
set: set$f
|
|
1342
1342
|
} = create$c(ErrorWorker);
|
|
1343
1343
|
|
|
1344
1344
|
const {
|
|
1345
1345
|
invoke: invoke$g,
|
|
1346
1346
|
invokeAndTransfer: invokeAndTransfer$2,
|
|
1347
|
-
set: set$
|
|
1347
|
+
set: set$e
|
|
1348
1348
|
} = create$c(ExtensionManagementWorker);
|
|
1349
1349
|
const getLanguages$1 = (platform, assetDir) => {
|
|
1350
1350
|
return invoke$g('Extensions.getLanguages', platform, assetDir);
|
|
@@ -1363,7 +1363,7 @@ const createLazyRpc = rpcId => {
|
|
|
1363
1363
|
throw new Error('Lazy RPC launch was superseded');
|
|
1364
1364
|
}
|
|
1365
1365
|
activeRpc = rpc;
|
|
1366
|
-
set$
|
|
1366
|
+
set$i(rpcId, rpc);
|
|
1367
1367
|
return rpc;
|
|
1368
1368
|
};
|
|
1369
1369
|
const ensureRpc = async () => {
|
|
@@ -1425,7 +1425,7 @@ const createLazyRpc = rpcId => {
|
|
|
1425
1425
|
|
|
1426
1426
|
const {
|
|
1427
1427
|
invoke: invoke$f,
|
|
1428
|
-
set: set$
|
|
1428
|
+
set: set$d
|
|
1429
1429
|
} = create$c(OpenerWorker);
|
|
1430
1430
|
const openUrl = async (url, platform) => {
|
|
1431
1431
|
return invoke$f('Open.openUrl', url, platform);
|
|
@@ -1433,13 +1433,13 @@ const openUrl = async (url, platform) => {
|
|
|
1433
1433
|
|
|
1434
1434
|
const {
|
|
1435
1435
|
invoke: invoke$e,
|
|
1436
|
-
set: set$
|
|
1436
|
+
set: set$c
|
|
1437
1437
|
} = create$c(TextMeasurementWorker);
|
|
1438
1438
|
|
|
1439
1439
|
const {
|
|
1440
1440
|
invoke: invoke$d,
|
|
1441
1441
|
invokeAndTransfer: invokeAndTransfer$1,
|
|
1442
|
-
set: set$
|
|
1442
|
+
set: set$b
|
|
1443
1443
|
} = create$c(RendererWorker);
|
|
1444
1444
|
const showContextMenu2 = async (uid, menuId, x, y, args) => {
|
|
1445
1445
|
number(uid);
|
|
@@ -1494,13 +1494,13 @@ const sendMessagePortToSyntaxHighlightingWorker$1 = async port => {
|
|
|
1494
1494
|
|
|
1495
1495
|
const {
|
|
1496
1496
|
invoke: invoke$c,
|
|
1497
|
-
set: set$
|
|
1497
|
+
set: set$a
|
|
1498
1498
|
} = create$c(MarkdownWorker);
|
|
1499
1499
|
|
|
1500
1500
|
const SyntaxHighlightingWorker = {
|
|
1501
1501
|
__proto__: null,
|
|
1502
1502
|
invoke: invoke$c,
|
|
1503
|
-
set: set$
|
|
1503
|
+
set: set$a
|
|
1504
1504
|
};
|
|
1505
1505
|
|
|
1506
1506
|
const toCommandId = key => {
|
|
@@ -1811,7 +1811,7 @@ const getKeys$2 = () => {
|
|
|
1811
1811
|
const keys = editorStates.getKeys();
|
|
1812
1812
|
return keys.map(String);
|
|
1813
1813
|
};
|
|
1814
|
-
const set$
|
|
1814
|
+
const set$9 = (id, oldEditor, newEditor) => {
|
|
1815
1815
|
editorStates.set(id, oldEditor, newEditor);
|
|
1816
1816
|
};
|
|
1817
1817
|
|
|
@@ -1862,7 +1862,7 @@ const ToggleBlockComment$1 = 'toggleBlockComment';
|
|
|
1862
1862
|
const Unknown$2 = 'unknown';
|
|
1863
1863
|
|
|
1864
1864
|
const map$1 = Object.create(null);
|
|
1865
|
-
const set$
|
|
1865
|
+
const set$8 = (id, widget) => {
|
|
1866
1866
|
map$1[id] = widget;
|
|
1867
1867
|
};
|
|
1868
1868
|
const get$7 = id => {
|
|
@@ -2506,7 +2506,7 @@ const getEnabled$1 = () => {
|
|
|
2506
2506
|
|
|
2507
2507
|
const {
|
|
2508
2508
|
invoke: invoke$b,
|
|
2509
|
-
set: set$
|
|
2509
|
+
set: set$7
|
|
2510
2510
|
} = SyntaxHighlightingWorker;
|
|
2511
2511
|
|
|
2512
2512
|
const state$c = {
|
|
@@ -2517,7 +2517,7 @@ const state$c = {
|
|
|
2517
2517
|
const has = languageId => {
|
|
2518
2518
|
return Object.hasOwn(state$c.tokenizers, languageId);
|
|
2519
2519
|
};
|
|
2520
|
-
const set$
|
|
2520
|
+
const set$6 = (languageId, tokenizer) => {
|
|
2521
2521
|
state$c.tokenizers[languageId] = tokenizer;
|
|
2522
2522
|
};
|
|
2523
2523
|
const get$6 = languageId => {
|
|
@@ -2541,7 +2541,7 @@ const isPending = languageId => {
|
|
|
2541
2541
|
};
|
|
2542
2542
|
|
|
2543
2543
|
const tokenMaps = Object.create(null);
|
|
2544
|
-
const set$
|
|
2544
|
+
const set$5 = (languageId, tokenMap) => {
|
|
2545
2545
|
tokenMaps[languageId] = tokenMap;
|
|
2546
2546
|
};
|
|
2547
2547
|
const get$5 = languageId => {
|
|
@@ -2557,7 +2557,7 @@ const loadTokenizer = async (languageId, tokenizePath) => {
|
|
|
2557
2557
|
if (getEnabled$1()) {
|
|
2558
2558
|
// @ts-ignore
|
|
2559
2559
|
const tokenMap = await invoke$b('Tokenizer.load', languageId, tokenizePath);
|
|
2560
|
-
set$
|
|
2560
|
+
set$5(languageId, tokenMap);
|
|
2561
2561
|
return;
|
|
2562
2562
|
}
|
|
2563
2563
|
try {
|
|
@@ -2573,8 +2573,8 @@ const loadTokenizer = async (languageId, tokenizePath) => {
|
|
|
2573
2573
|
console.warn(`tokenizer.TokenMap should be an object in "${tokenizePath}"`);
|
|
2574
2574
|
return;
|
|
2575
2575
|
}
|
|
2576
|
-
set$
|
|
2577
|
-
set$
|
|
2576
|
+
set$5(languageId, tokenizer.TokenMap);
|
|
2577
|
+
set$6(languageId, tokenizer);
|
|
2578
2578
|
} catch (error) {
|
|
2579
2579
|
// TODO better error handling
|
|
2580
2580
|
console.error(error);
|
|
@@ -2591,7 +2591,7 @@ const getTokenizer = languageId => {
|
|
|
2591
2591
|
};
|
|
2592
2592
|
|
|
2593
2593
|
const tokenizers = Object.create(null);
|
|
2594
|
-
const set$
|
|
2594
|
+
const set$4 = (id, value) => {
|
|
2595
2595
|
tokenizers[id] = value;
|
|
2596
2596
|
};
|
|
2597
2597
|
const get$4 = id => {
|
|
@@ -4372,7 +4372,7 @@ const scheduleDocumentAndCursorsSelections = async (editor, changes, selectionCh
|
|
|
4372
4372
|
...newEditor,
|
|
4373
4373
|
decorations: linkDecorations
|
|
4374
4374
|
};
|
|
4375
|
-
set$
|
|
4375
|
+
set$9(editor.uid, editor, newEditorWithDecorations);
|
|
4376
4376
|
|
|
4377
4377
|
// Notify main-area-worker about modified status change
|
|
4378
4378
|
if (!editor.modified) {
|
|
@@ -5255,7 +5255,7 @@ const updateColorPickerValue = async (editorUid, value) => {
|
|
|
5255
5255
|
return;
|
|
5256
5256
|
}
|
|
5257
5257
|
const newEditorWithDerivedState = await updateDerivedState(editor, newEditor);
|
|
5258
|
-
set$
|
|
5258
|
+
set$9(editorUid, editor, newEditorWithDerivedState);
|
|
5259
5259
|
};
|
|
5260
5260
|
|
|
5261
5261
|
const getColorPickerWorkerCommandMap = () => ({
|
|
@@ -5466,7 +5466,7 @@ const createEditor2 = (id, uri, x, y, width, height, platform, assetDir, _langua
|
|
|
5466
5466
|
x,
|
|
5467
5467
|
y
|
|
5468
5468
|
};
|
|
5469
|
-
set$
|
|
5469
|
+
set$9(id, editor, editor);
|
|
5470
5470
|
};
|
|
5471
5471
|
|
|
5472
5472
|
const emptyEditor = {
|
|
@@ -5809,10 +5809,10 @@ const createEditor = async ({
|
|
|
5809
5809
|
focused: true,
|
|
5810
5810
|
textInfos
|
|
5811
5811
|
};
|
|
5812
|
-
set$
|
|
5812
|
+
set$9(id, emptyEditor, newEditor4);
|
|
5813
5813
|
const completionsOnTypeRaw = await get$3('editor.completionsOnType');
|
|
5814
5814
|
const completionsOnType = Boolean(completionsOnTypeRaw);
|
|
5815
|
-
set$
|
|
5815
|
+
set$9(id, emptyEditor, {
|
|
5816
5816
|
...newEditor4,
|
|
5817
5817
|
completionsOnType
|
|
5818
5818
|
});
|
|
@@ -5843,7 +5843,7 @@ const createStandaloneEditor = async ({
|
|
|
5843
5843
|
const createdEditor = get$8(id).newState;
|
|
5844
5844
|
await loadTokenizer(languageId, tokenizePath);
|
|
5845
5845
|
const tokenizerId = createdEditor.tokenizerId + 1;
|
|
5846
|
-
set$
|
|
5846
|
+
set$4(tokenizerId, getTokenizer(languageId));
|
|
5847
5847
|
const configuredEditor = {
|
|
5848
5848
|
...createdEditor,
|
|
5849
5849
|
charWidth,
|
|
@@ -5888,7 +5888,7 @@ const createStandaloneEditor = async ({
|
|
|
5888
5888
|
selectionInfos
|
|
5889
5889
|
};
|
|
5890
5890
|
if (!createdEditor.lifecycle?.disposed) {
|
|
5891
|
-
set$
|
|
5891
|
+
set$9(id, createdEditor, finalEditor);
|
|
5892
5892
|
}
|
|
5893
5893
|
};
|
|
5894
5894
|
|
|
@@ -6001,6 +6001,19 @@ const dispose$4 = uid => {
|
|
|
6001
6001
|
pendingSaves.delete(uid);
|
|
6002
6002
|
};
|
|
6003
6003
|
|
|
6004
|
+
const dismissals = new Map();
|
|
6005
|
+
const clear$2 = editorUid => {
|
|
6006
|
+
const dismissal = dismissals.get(editorUid);
|
|
6007
|
+
if (dismissal) {
|
|
6008
|
+
clearTimeout(dismissal.timeout);
|
|
6009
|
+
dismissals.delete(editorUid);
|
|
6010
|
+
}
|
|
6011
|
+
};
|
|
6012
|
+
const set$3 = (editorUid, dismissal) => {
|
|
6013
|
+
clear$2(editorUid);
|
|
6014
|
+
dismissals.set(editorUid, dismissal);
|
|
6015
|
+
};
|
|
6016
|
+
|
|
6004
6017
|
const state$6 = {
|
|
6005
6018
|
editor: undefined,
|
|
6006
6019
|
timeout: -1,
|
|
@@ -6391,7 +6404,7 @@ const commitDiagnostics = async (editor, generation, diagnostics) => {
|
|
|
6391
6404
|
return latest.newState;
|
|
6392
6405
|
}
|
|
6393
6406
|
const newEditor = mergeDiagnostics(latest.newState, editorWithDiagnostics);
|
|
6394
|
-
set$
|
|
6407
|
+
set$9(editor.id, latest.oldState, newEditor);
|
|
6395
6408
|
requestDiagnosticSnapshots.set(editor.id, diagnostics);
|
|
6396
6409
|
await invoke$5('Editor.renderPending', newEditor.id);
|
|
6397
6410
|
await notifyDiagnosticsChange(newEditor.uri, newEditor.applicationId);
|
|
@@ -6546,6 +6559,7 @@ const disposeEditor = async editorUid => {
|
|
|
6546
6559
|
dispose$2(editorUid);
|
|
6547
6560
|
dispose$4(editorUid);
|
|
6548
6561
|
clear$1(editorUid);
|
|
6562
|
+
clear$2(editorUid);
|
|
6549
6563
|
dispose$1(editorUid);
|
|
6550
6564
|
const pending = [];
|
|
6551
6565
|
if (getEnabled$1()) {
|
|
@@ -10013,6 +10027,53 @@ const handleMouseDown = async (state, button, altKey, ctrlKey, x, y, detail, shi
|
|
|
10013
10027
|
};
|
|
10014
10028
|
};
|
|
10015
10029
|
|
|
10030
|
+
const editorHoverDismissDelay = 500;
|
|
10031
|
+
const handleMouseLeave = (viewletUid, editorUidValue) => {
|
|
10032
|
+
const targetEditorUid = editorUidValue ?? viewletUid;
|
|
10033
|
+
const editorUid = Number(targetEditorUid);
|
|
10034
|
+
const instance = get$8(editorUid);
|
|
10035
|
+
if (!instance) {
|
|
10036
|
+
return;
|
|
10037
|
+
}
|
|
10038
|
+
const {
|
|
10039
|
+
widgets = []
|
|
10040
|
+
} = instance.newState;
|
|
10041
|
+
clear$1(editorUid);
|
|
10042
|
+
clear$2(editorUid);
|
|
10043
|
+
const hoverWidget = widgets.find(widget => widget.id === Hover);
|
|
10044
|
+
if (!hoverWidget) {
|
|
10045
|
+
return;
|
|
10046
|
+
}
|
|
10047
|
+
const timeout = setTimeout(async () => {
|
|
10048
|
+
clear$2(editorUid);
|
|
10049
|
+
const latestInstance = get$8(editorUid);
|
|
10050
|
+
if (!latestInstance) {
|
|
10051
|
+
return;
|
|
10052
|
+
}
|
|
10053
|
+
const latestEditor = latestInstance.newState;
|
|
10054
|
+
const latestHoverWidget = latestEditor.widgets?.find(widget => widget.id === Hover);
|
|
10055
|
+
if (latestHoverWidget !== hoverWidget) {
|
|
10056
|
+
return;
|
|
10057
|
+
}
|
|
10058
|
+
const newEditor = {
|
|
10059
|
+
...latestEditor,
|
|
10060
|
+
additionalFocus: 0,
|
|
10061
|
+
focused: true,
|
|
10062
|
+
widgetRevision: next(editorUid),
|
|
10063
|
+
widgets: removeEditorWidget(latestEditor.widgets, Hover)
|
|
10064
|
+
};
|
|
10065
|
+
set$9(editorUid, latestEditor, newEditor);
|
|
10066
|
+
await invoke$d('Editor.renderPending', editorUid);
|
|
10067
|
+
}, editorHoverDismissDelay);
|
|
10068
|
+
set$3(editorUid, {
|
|
10069
|
+
timeout
|
|
10070
|
+
});
|
|
10071
|
+
};
|
|
10072
|
+
const handleMouseEnter = (viewletUid, editorUidValue) => {
|
|
10073
|
+
const targetEditorUid = editorUidValue ?? viewletUid;
|
|
10074
|
+
clear$2(Number(targetEditorUid));
|
|
10075
|
+
};
|
|
10076
|
+
|
|
10016
10077
|
const RE_ALPHA_NUMERIC = /[a-zA-Z\d]/;
|
|
10017
10078
|
const isAlphaNumeric = char => {
|
|
10018
10079
|
return RE_ALPHA_NUMERIC.test(char);
|
|
@@ -10432,7 +10493,7 @@ const showHover = async (editor, position, token) => {
|
|
|
10432
10493
|
if (latestEditor === newEditor || !latestInstance || latestInstance.newState !== latestEditor || get$2().token !== token) {
|
|
10433
10494
|
return;
|
|
10434
10495
|
}
|
|
10435
|
-
set$
|
|
10496
|
+
set$9(editor.uid, latestInstance.oldState, newEditor);
|
|
10436
10497
|
await invoke$d('Editor.renderPending', editor.uid);
|
|
10437
10498
|
};
|
|
10438
10499
|
|
|
@@ -10694,7 +10755,7 @@ const continueScrollingAndMovingSelection = async editorUid => {
|
|
|
10694
10755
|
}
|
|
10695
10756
|
return;
|
|
10696
10757
|
}
|
|
10697
|
-
set$
|
|
10758
|
+
set$9(editor.uid, editor, derivedEditor);
|
|
10698
10759
|
if (derivedEditor.hasListener) {
|
|
10699
10760
|
requestAnimationFrame(() => continueScrollingAndMovingSelection(editorUid));
|
|
10700
10761
|
}
|
|
@@ -11483,7 +11544,7 @@ const updateEditor = async (editorUid, editor, newEditor) => {
|
|
|
11483
11544
|
return;
|
|
11484
11545
|
}
|
|
11485
11546
|
const newEditorWithDerivedState = await updateDerivedState(editor, newEditor);
|
|
11486
|
-
set$
|
|
11547
|
+
set$9(editorUid, editor, newEditorWithDerivedState);
|
|
11487
11548
|
};
|
|
11488
11549
|
const applyDocumentEdits = async (editorUid, edits) => {
|
|
11489
11550
|
const editor = getEditor$1(editorUid);
|
|
@@ -11533,7 +11594,7 @@ const launch = async () => {
|
|
|
11533
11594
|
return;
|
|
11534
11595
|
}
|
|
11535
11596
|
const rpc = await launchFindWidgetWorker();
|
|
11536
|
-
set$
|
|
11597
|
+
set$i(rpcId, rpc);
|
|
11537
11598
|
};
|
|
11538
11599
|
const invoke$3 = async (method, ...params) => {
|
|
11539
11600
|
const rpc = get$9(rpcId);
|
|
@@ -11664,7 +11725,7 @@ const createFn = (key, name, widgetId) => {
|
|
|
11664
11725
|
const latestAfterInvoke = get$8(editor.uid).newState;
|
|
11665
11726
|
const latestChildIndex = latestAfterInvoke.widgets.findIndex(isWidget);
|
|
11666
11727
|
if (latestChildIndex === -1) {
|
|
11667
|
-
set$
|
|
11728
|
+
set$9(editor.uid, editor, latestAfterInvoke);
|
|
11668
11729
|
await dispose$3();
|
|
11669
11730
|
return latestAfterInvoke;
|
|
11670
11731
|
}
|
|
@@ -11678,7 +11739,7 @@ const createFn = (key, name, widgetId) => {
|
|
|
11678
11739
|
widgetRevision,
|
|
11679
11740
|
widgets: removeEditorWidget(latest.widgets, widgetId)
|
|
11680
11741
|
};
|
|
11681
|
-
set$
|
|
11742
|
+
set$9(editor.uid, latest, newEditor);
|
|
11682
11743
|
return newEditor;
|
|
11683
11744
|
}
|
|
11684
11745
|
const newState = {
|
|
@@ -11686,7 +11747,7 @@ const createFn = (key, name, widgetId) => {
|
|
|
11686
11747
|
commands
|
|
11687
11748
|
};
|
|
11688
11749
|
const newEditor = updateWidget(latest, widgetId, newState);
|
|
11689
|
-
set$
|
|
11750
|
+
set$9(editor.uid, editor, newEditor);
|
|
11690
11751
|
return newEditor;
|
|
11691
11752
|
};
|
|
11692
11753
|
return fn;
|
|
@@ -12716,7 +12777,7 @@ const setLanguageId = async (editor, languageId, tokenizePath, isExplicit = fals
|
|
|
12716
12777
|
await loadTokenizer(languageId, tokenizePath);
|
|
12717
12778
|
const tokenizer = getTokenizer(languageId);
|
|
12718
12779
|
const newTokenizerId = tokenizerId + 1;
|
|
12719
|
-
set$
|
|
12780
|
+
set$4(newTokenizerId, tokenizer);
|
|
12720
12781
|
return {
|
|
12721
12782
|
...editor,
|
|
12722
12783
|
explicitLanguageId: isExplicit ? languageId : editor.explicitLanguageId,
|
|
@@ -14050,6 +14111,8 @@ const HandleKeyUp = 34;
|
|
|
14050
14111
|
const HandleLightBulbClick = 35;
|
|
14051
14112
|
const HandleMergeConflictActionClick = 36;
|
|
14052
14113
|
const HandleMergeConflictActionsMouseDown = 37;
|
|
14114
|
+
const HandleMouseOut = 38;
|
|
14115
|
+
const HandleMouseOver = 39;
|
|
14053
14116
|
|
|
14054
14117
|
const Button$1 = 1;
|
|
14055
14118
|
const Div = 4;
|
|
@@ -14383,11 +14446,14 @@ const getEditorHoverClassName = (lineInfos, documentationVirtualDom, diagnostics
|
|
|
14383
14446
|
const isDiagnosticOnly = diagnostics?.length === 1 && lineInfos.length === 0 && documentationVirtualDom.length === 0;
|
|
14384
14447
|
return mergeClassNames('Viewlet', 'EditorHover', isDiagnosticOnly ? EditorHoverDiagnosticOnly : '');
|
|
14385
14448
|
};
|
|
14386
|
-
const getHoverVirtualDom = (lineInfos, documentationVirtualDom, diagnostics) => {
|
|
14449
|
+
const getHoverVirtualDom = (lineInfos, documentationVirtualDom, diagnostics, editorUid = 0) => {
|
|
14387
14450
|
const dom = [];
|
|
14388
14451
|
dom.push({
|
|
14389
14452
|
childCount: getChildCount(lineInfos, documentationVirtualDom, diagnostics) + 1,
|
|
14390
14453
|
className: getEditorHoverClassName(lineInfos, documentationVirtualDom, diagnostics),
|
|
14454
|
+
'data-uid': editorUid,
|
|
14455
|
+
onMouseOut: HandleMouseOut,
|
|
14456
|
+
onMouseOver: HandleMouseOver,
|
|
14391
14457
|
type: Div
|
|
14392
14458
|
});
|
|
14393
14459
|
if (diagnostics && diagnostics.length > 0) {
|
|
@@ -14417,10 +14483,10 @@ const getHoverVirtualDom = (lineInfos, documentationVirtualDom, diagnostics) =>
|
|
|
14417
14483
|
|
|
14418
14484
|
const renderHoverDom = {
|
|
14419
14485
|
apply(oldState, newState) {
|
|
14420
|
-
const dom = getHoverVirtualDom(newState.lineInfos, newState.documentationVirtualDom, newState.diagnostics);
|
|
14486
|
+
const dom = getHoverVirtualDom(newState.lineInfos, newState.documentationVirtualDom, newState.diagnostics, newState.editorUid);
|
|
14421
14487
|
return [/* method */SetDom2, dom];
|
|
14422
14488
|
},
|
|
14423
|
-
isEqual: (oldState, newState) => oldState.lineInfos === newState.lineInfos && oldState.documentationVirtualDom === newState.documentationVirtualDom && oldState.diagnostics === newState.diagnostics
|
|
14489
|
+
isEqual: (oldState, newState) => oldState.lineInfos === newState.lineInfos && oldState.documentationVirtualDom === newState.documentationVirtualDom && oldState.diagnostics === newState.diagnostics && oldState.editorUid === newState.editorUid
|
|
14424
14490
|
};
|
|
14425
14491
|
const renderBounds$2 = {
|
|
14426
14492
|
apply(oldState, newState) {
|
|
@@ -14694,7 +14760,7 @@ const setSelections2 = async (editorUid, selections) => {
|
|
|
14694
14760
|
const editor = getEditor$1(editorUid);
|
|
14695
14761
|
const newEditor = setSelections$2(editor, selections);
|
|
14696
14762
|
const newEditorWithDerivedState = await updateDerivedState(editor, newEditor);
|
|
14697
|
-
set$
|
|
14763
|
+
set$9(editorUid, editor, newEditorWithDerivedState);
|
|
14698
14764
|
};
|
|
14699
14765
|
const closeWidget2 = async (editorUid, widgetId, widgetName, unsetAdditionalFocus$1) => {
|
|
14700
14766
|
const editor = getEditor$1(editorUid);
|
|
@@ -14718,7 +14784,7 @@ const closeWidget2 = async (editorUid, widgetId, widgetName, unsetAdditionalFocu
|
|
|
14718
14784
|
widgets: newWidgets
|
|
14719
14785
|
};
|
|
14720
14786
|
const newEditorWithDerivedState = await updateDerivedState(editor, newEditor);
|
|
14721
|
-
set$
|
|
14787
|
+
set$9(editorUid, editor, newEditorWithDerivedState);
|
|
14722
14788
|
await setFocus(FocusEditorText);
|
|
14723
14789
|
if (unsetAdditionalFocus$1) {
|
|
14724
14790
|
await unsetAdditionalFocus(unsetAdditionalFocus$1);
|
|
@@ -14731,7 +14797,7 @@ const applyEdits2 = async (editorUid, edits, selectionChanges) => {
|
|
|
14731
14797
|
const editor = getEditor$1(editorUid);
|
|
14732
14798
|
const newEditor = await applyEdit(editor, edits, selectionChanges);
|
|
14733
14799
|
const newEditorWithDerivedState = await updateDerivedState(editor, newEditor);
|
|
14734
|
-
set$
|
|
14800
|
+
set$9(editorUid, editor, newEditorWithDerivedState);
|
|
14735
14801
|
};
|
|
14736
14802
|
const getSourceActions = async editorUid => {
|
|
14737
14803
|
const actions = await getEditorSourceActions(editorUid);
|
|
@@ -15402,7 +15468,7 @@ const handleMessagePort = async (port, rpcId) => {
|
|
|
15402
15468
|
messagePort: port
|
|
15403
15469
|
});
|
|
15404
15470
|
if (rpcId) {
|
|
15405
|
-
set$
|
|
15471
|
+
set$i(rpcId, rpc);
|
|
15406
15472
|
await initializeListener(rpcId);
|
|
15407
15473
|
}
|
|
15408
15474
|
};
|
|
@@ -15431,6 +15497,17 @@ const kAutoClosingBrackets = 'editor.autoClosingBrackets';
|
|
|
15431
15497
|
const kFontWeight = 'editor.fontWeight';
|
|
15432
15498
|
const kMinimapEnabled = 'editor.minimap.enabled';
|
|
15433
15499
|
const kMergeConflictActions = 'editor.mergeConflictActions';
|
|
15500
|
+
const kMinFontSize = 10;
|
|
15501
|
+
const kMaxFontSize = 100;
|
|
15502
|
+
const kMaxLineHeight = 100;
|
|
15503
|
+
const lastWarnings = new Map();
|
|
15504
|
+
const warnIfChanged = (setting, value, bound, direction) => {
|
|
15505
|
+
if (Object.is(lastWarnings.get(setting), value)) {
|
|
15506
|
+
return;
|
|
15507
|
+
}
|
|
15508
|
+
lastWarnings.set(setting, value);
|
|
15509
|
+
warn(`[editor-worker] ${setting} value ${value} is too ${direction}; using ${bound}`);
|
|
15510
|
+
};
|
|
15434
15511
|
const isAutoClosingBracketsEnabled = async () => {
|
|
15435
15512
|
return Boolean(await get$3(kAutoClosingBrackets));
|
|
15436
15513
|
};
|
|
@@ -15445,13 +15522,37 @@ const isAutoClosingTagsEnabled = async () => {
|
|
|
15445
15522
|
};
|
|
15446
15523
|
const getRowHeight = async () => {
|
|
15447
15524
|
const [lineHeight, fontSize] = await Promise.all([get$3(kLineHeight), getFontSize()]);
|
|
15448
|
-
if (typeof lineHeight !== 'number' || !Number.isFinite(lineHeight) || lineHeight
|
|
15525
|
+
if (typeof lineHeight !== 'number' || !Number.isFinite(lineHeight) || lineHeight === 0) {
|
|
15526
|
+
lastWarnings.delete(kLineHeight);
|
|
15449
15527
|
return fontSize;
|
|
15450
15528
|
}
|
|
15529
|
+
if (lineHeight > kMaxLineHeight) {
|
|
15530
|
+
warnIfChanged(kLineHeight, lineHeight, kMaxLineHeight, 'large');
|
|
15531
|
+
return kMaxLineHeight;
|
|
15532
|
+
}
|
|
15533
|
+
if (lineHeight < fontSize) {
|
|
15534
|
+
warnIfChanged(kLineHeight, lineHeight, fontSize, 'small');
|
|
15535
|
+
return fontSize;
|
|
15536
|
+
}
|
|
15537
|
+
lastWarnings.delete(kLineHeight);
|
|
15451
15538
|
return lineHeight;
|
|
15452
15539
|
};
|
|
15453
15540
|
const getFontSize = async () => {
|
|
15454
|
-
|
|
15541
|
+
const fontSize = await get$3(kFontSize);
|
|
15542
|
+
if (typeof fontSize !== 'number' || !Number.isFinite(fontSize)) {
|
|
15543
|
+
lastWarnings.delete(kFontSize);
|
|
15544
|
+
return 15;
|
|
15545
|
+
}
|
|
15546
|
+
if (fontSize < kMinFontSize) {
|
|
15547
|
+
warnIfChanged(kFontSize, fontSize, kMinFontSize, 'small');
|
|
15548
|
+
return kMinFontSize;
|
|
15549
|
+
}
|
|
15550
|
+
if (fontSize > kMaxFontSize) {
|
|
15551
|
+
warnIfChanged(kFontSize, fontSize, kMaxFontSize, 'large');
|
|
15552
|
+
return kMaxFontSize;
|
|
15553
|
+
}
|
|
15554
|
+
lastWarnings.delete(kFontSize);
|
|
15555
|
+
return fontSize;
|
|
15455
15556
|
};
|
|
15456
15557
|
const getFontFamily = async () => {
|
|
15457
15558
|
return (await get$3(kFontFamily)) || 'Fira Code';
|
|
@@ -15774,7 +15875,7 @@ const hotReload = async () => {
|
|
|
15774
15875
|
await relaunchWorkers();
|
|
15775
15876
|
const newEditors = await restoreWidgetState(keys, savedStates);
|
|
15776
15877
|
for (const editor of newEditors) {
|
|
15777
|
-
set$
|
|
15878
|
+
set$9(editor.newState.uid, editor.oldState, editor.newState);
|
|
15778
15879
|
}
|
|
15779
15880
|
|
|
15780
15881
|
// TODO ask renderer worker to rerender all editors
|
|
@@ -15812,7 +15913,7 @@ const initializeSyntaxHighlighting = async (syntaxHighlightingEnabled, syncIncre
|
|
|
15812
15913
|
if (syntaxHighlightingEnabled) {
|
|
15813
15914
|
setEnabled$1(true);
|
|
15814
15915
|
const syntaxRpc = await createSyntaxHighlightingWorkerRpc();
|
|
15815
|
-
set$
|
|
15916
|
+
set$7(syntaxRpc);
|
|
15816
15917
|
}
|
|
15817
15918
|
if (syncIncremental) {
|
|
15818
15919
|
setEnabled(true);
|
|
@@ -16009,7 +16110,7 @@ const loadContent = async (state, savedState, largeFile = false) => {
|
|
|
16009
16110
|
await loadTokenizer(computedLanguageId, tokenizePath);
|
|
16010
16111
|
const tokenizer = getTokenizer(computedLanguageId);
|
|
16011
16112
|
const newTokenizerId = state.tokenizerId + 1;
|
|
16012
|
-
set$
|
|
16113
|
+
set$4(newTokenizerId, tokenizer);
|
|
16013
16114
|
effectiveEditor.tokenizerId = newTokenizerId;
|
|
16014
16115
|
}
|
|
16015
16116
|
const savedHistory = existingEditor ? undefined : getSavedHistory(savedState, content);
|
|
@@ -16153,7 +16254,7 @@ const refreshGutterDecorationsAll = async () => {
|
|
|
16153
16254
|
if (!latest) {
|
|
16154
16255
|
continue;
|
|
16155
16256
|
}
|
|
16156
|
-
set$
|
|
16257
|
+
set$9(editor.id, latest.oldState, {
|
|
16157
16258
|
...latest.newState,
|
|
16158
16259
|
gutterDecorations: refreshedEditor.gutterDecorations
|
|
16159
16260
|
});
|
|
@@ -17060,6 +17161,8 @@ const getEditorVirtualDom = ({
|
|
|
17060
17161
|
className: Editor,
|
|
17061
17162
|
'data-uid': uid,
|
|
17062
17163
|
onContextMenu: HandleContextMenu,
|
|
17164
|
+
onMouseOut: HandleMouseOut,
|
|
17165
|
+
onMouseOver: HandleMouseOver,
|
|
17063
17166
|
role: Code,
|
|
17064
17167
|
type: Div
|
|
17065
17168
|
}, ...breadcrumbsDom, ...gutterDom, ...getEditorContentVirtualDom({
|
|
@@ -17255,7 +17358,7 @@ const render2 = (uid, _diffResult) => {
|
|
|
17255
17358
|
} = editor;
|
|
17256
17359
|
// Diagnostics can change after the caller calculated its diff in a separate RPC.
|
|
17257
17360
|
const diffResult = diff(oldState, newState);
|
|
17258
|
-
set$
|
|
17361
|
+
set$9(uid, newState, newState);
|
|
17259
17362
|
const commands = applyRender(oldState, newState, diffResult);
|
|
17260
17363
|
return commands;
|
|
17261
17364
|
};
|
|
@@ -17364,7 +17467,7 @@ const renderEditor = async id => {
|
|
|
17364
17467
|
oldState
|
|
17365
17468
|
} = instance;
|
|
17366
17469
|
const commands = [];
|
|
17367
|
-
set$
|
|
17470
|
+
set$9(id, newState, newState);
|
|
17368
17471
|
for (const item of render$7) {
|
|
17369
17472
|
if (item.isEqual(oldState, newState)) {
|
|
17370
17473
|
continue;
|
|
@@ -17401,6 +17504,12 @@ const renderEventListeners = () => {
|
|
|
17401
17504
|
}, {
|
|
17402
17505
|
name: HandleMouseMove,
|
|
17403
17506
|
params: ['handleMouseMove', ClientX, ClientY, AltKey]
|
|
17507
|
+
}, {
|
|
17508
|
+
name: HandleMouseOut,
|
|
17509
|
+
params: ['handleMouseLeave', 'event.currentTarget.dataset.uid']
|
|
17510
|
+
}, {
|
|
17511
|
+
name: HandleMouseOver,
|
|
17512
|
+
params: ['handleMouseEnter', 'event.currentTarget.dataset.uid']
|
|
17404
17513
|
}, {
|
|
17405
17514
|
name: HandleKeyUp,
|
|
17406
17515
|
params: ['handleKeyUp', Key]
|
|
@@ -17569,7 +17678,7 @@ const updateDebugInfo = async debugId => {
|
|
|
17569
17678
|
...newState,
|
|
17570
17679
|
highlightedLine: newInfo.rowIndex
|
|
17571
17680
|
};
|
|
17572
|
-
set$
|
|
17681
|
+
set$9(key, oldState, newEditor);
|
|
17573
17682
|
// @ts-ignore
|
|
17574
17683
|
await invoke$d('Editor.rerender', key);
|
|
17575
17684
|
};
|
|
@@ -17666,7 +17775,7 @@ const wrapCommand$1 = (fn, preservesTypingCoalescing = false, returnState = true
|
|
|
17666
17775
|
return returnState ? newEditor : undefined;
|
|
17667
17776
|
}
|
|
17668
17777
|
const newEditorWithDerivedState = await updateDerivedState(state, newEditor);
|
|
17669
|
-
set$
|
|
17778
|
+
set$9(uid, state, newEditorWithDerivedState);
|
|
17670
17779
|
await dispose$3();
|
|
17671
17780
|
if (editorDiagnosticEffect.isActive(state, newEditorWithDerivedState)) {
|
|
17672
17781
|
void editorDiagnosticEffect.apply(newEditorWithDerivedState);
|
|
@@ -17695,7 +17804,7 @@ const wrapCommand$1 = (fn, preservesTypingCoalescing = false, returnState = true
|
|
|
17695
17804
|
undoStack: finalEditor.undoStack,
|
|
17696
17805
|
visualDecorations: finalEditor.visualDecorations
|
|
17697
17806
|
});
|
|
17698
|
-
set$
|
|
17807
|
+
set$9(otherUid, instance.oldState, synchronizedEditor);
|
|
17699
17808
|
if (editorDiagnosticEffect.isActive(editor, synchronizedEditor)) {
|
|
17700
17809
|
void editorDiagnosticEffect.apply(synchronizedEditor);
|
|
17701
17810
|
}
|
|
@@ -17846,6 +17955,8 @@ const commandMap = {
|
|
|
17846
17955
|
'Editor.handleKeyUp': wrapCommand(handleKeyUp, true),
|
|
17847
17956
|
'Editor.handleMergeConflictActionsMouseDown': wrapCommand(handleMergeConflictActionsMouseDown),
|
|
17848
17957
|
'Editor.handleMouseDown': wrapCommand(handleMouseDown),
|
|
17958
|
+
'Editor.handleMouseEnter': handleMouseEnter,
|
|
17959
|
+
'Editor.handleMouseLeave': handleMouseLeave,
|
|
17849
17960
|
'Editor.handleMouseMove': wrapCommand(handleMouseMove),
|
|
17850
17961
|
'Editor.handleMouseMoveWithAltKey': wrapCommand(handleMouseMoveWithAltKey),
|
|
17851
17962
|
'Editor.handleNativeSelectionChange': editorHandleNativeSelectionChange,
|
|
@@ -17973,6 +18084,8 @@ const commandMap = {
|
|
|
17973
18084
|
'EditorCompletion.handleEditorClick': handleEditorClick,
|
|
17974
18085
|
'EditorCompletion.handleEditorDeleteLeft': handleEditorDeleteLeft$1,
|
|
17975
18086
|
'EditorCompletion.handleEditorType': handleEditorType$1,
|
|
18087
|
+
'EditorCompletion.handleMouseEnter': handleMouseEnter,
|
|
18088
|
+
'EditorCompletion.handleMouseLeave': handleMouseLeave,
|
|
17976
18089
|
'EditorCompletion.handlePointerDown': handlePointerDown,
|
|
17977
18090
|
'EditorCompletion.handleWheel': handleWheel$1,
|
|
17978
18091
|
'EditorCompletion.openDetails': openDetails,
|
|
@@ -18025,6 +18138,8 @@ const commandMap = {
|
|
|
18025
18138
|
'Font.ensure': ensure,
|
|
18026
18139
|
'HandleMessagePort.handleMessagePort': handleMessagePort,
|
|
18027
18140
|
'Hover.getHoverInfo': getEditorHoverInfo,
|
|
18141
|
+
'Hover.handleMouseEnter': handleMouseEnter,
|
|
18142
|
+
'Hover.handleMouseLeave': handleMouseLeave,
|
|
18028
18143
|
'Hover.handleSashPointerDown': handleSashPointerDown,
|
|
18029
18144
|
'Hover.handleSashPointerMove': handleSashPointerMove,
|
|
18030
18145
|
'Hover.handleSashPointerUp': handleSashPointerUp,
|
|
@@ -18051,7 +18166,7 @@ const initializeDragAndDropWorker = async () => {
|
|
|
18051
18166
|
commandMap: {},
|
|
18052
18167
|
send: sendMessagePortToDragAndDropWorker
|
|
18053
18168
|
});
|
|
18054
|
-
set$
|
|
18169
|
+
set$g(rpc);
|
|
18055
18170
|
};
|
|
18056
18171
|
|
|
18057
18172
|
const initializeErrorWorker = async () => {
|
|
@@ -18061,7 +18176,7 @@ const initializeErrorWorker = async () => {
|
|
|
18061
18176
|
return sendMessagePortToErrorWorker(port, EditorWorker);
|
|
18062
18177
|
}
|
|
18063
18178
|
});
|
|
18064
|
-
set$
|
|
18179
|
+
set$f(rpc);
|
|
18065
18180
|
};
|
|
18066
18181
|
|
|
18067
18182
|
const createExtensionManagementWorkerRpc = async () => {
|
|
@@ -18077,7 +18192,7 @@ const createExtensionManagementWorkerRpc = async () => {
|
|
|
18077
18192
|
const initializeExtensionManagementWorker = async () => {
|
|
18078
18193
|
try {
|
|
18079
18194
|
const rpc = await createExtensionManagementWorkerRpc();
|
|
18080
|
-
set$
|
|
18195
|
+
set$e(rpc);
|
|
18081
18196
|
} catch {
|
|
18082
18197
|
// ignore
|
|
18083
18198
|
}
|
|
@@ -18092,14 +18207,14 @@ const initializeOpenerWorker = async () => {
|
|
|
18092
18207
|
commandMap: {},
|
|
18093
18208
|
send: send$1
|
|
18094
18209
|
});
|
|
18095
|
-
set$
|
|
18210
|
+
set$d(rpc);
|
|
18096
18211
|
};
|
|
18097
18212
|
|
|
18098
18213
|
const initializeRendererWorker = async () => {
|
|
18099
18214
|
const rpc = await create$d({
|
|
18100
18215
|
commandMap: commandMap
|
|
18101
18216
|
});
|
|
18102
|
-
set$
|
|
18217
|
+
set$b(rpc);
|
|
18103
18218
|
};
|
|
18104
18219
|
|
|
18105
18220
|
const send = port => {
|
|
@@ -18110,7 +18225,7 @@ const initializeTextMeasurementWorker = async () => {
|
|
|
18110
18225
|
commandMap: {},
|
|
18111
18226
|
send
|
|
18112
18227
|
});
|
|
18113
|
-
set$
|
|
18228
|
+
set$c(rpc);
|
|
18114
18229
|
};
|
|
18115
18230
|
|
|
18116
18231
|
const listen = async () => {
|
|
@@ -18120,7 +18235,7 @@ const listen = async () => {
|
|
|
18120
18235
|
commandMap: {},
|
|
18121
18236
|
send: sendMessagePortToDialogWorker
|
|
18122
18237
|
});
|
|
18123
|
-
set$
|
|
18238
|
+
set$h(dialogRpc);
|
|
18124
18239
|
};
|
|
18125
18240
|
|
|
18126
18241
|
const CodeGeneratorInput = 'CodeGeneratorInput';
|
|
@@ -18381,7 +18496,7 @@ const render$1 = widget => {
|
|
|
18381
18496
|
newState,
|
|
18382
18497
|
oldState
|
|
18383
18498
|
} = widget;
|
|
18384
|
-
const commands = newState.commands.length > 0 ? renderFull$3(oldState, newState) : [[SetDom2, newState.uid, getHoverVirtualDom(newState.lineInfos, newState.documentationVirtualDom, newState.diagnostics)], [SetBounds2, newState.uid, newState.x, newState.y, newState.width, newState.height]];
|
|
18499
|
+
const commands = newState.commands.length > 0 ? renderFull$3(oldState, newState) : [[SetDom2, newState.uid, getHoverVirtualDom(newState.lineInfos, newState.documentationVirtualDom, newState.diagnostics, newState.editorUid)], [SetBounds2, newState.uid, newState.x, newState.y, newState.width, newState.height]];
|
|
18385
18500
|
const wrappedCommands = [];
|
|
18386
18501
|
const {
|
|
18387
18502
|
uid
|
|
@@ -18393,6 +18508,10 @@ const render$1 = widget => {
|
|
|
18393
18508
|
wrappedCommands.push(['Viewlet.send', uid, ...command]);
|
|
18394
18509
|
}
|
|
18395
18510
|
}
|
|
18511
|
+
if (commands.every(([method]) => method !== RegisterEventListeners)) {
|
|
18512
|
+
wrappedCommands.unshift([RegisterEventListeners, uid, renderEventListeners()]);
|
|
18513
|
+
}
|
|
18514
|
+
wrappedCommands.push([SetUid, uid, newState.editorUid]);
|
|
18396
18515
|
return wrappedCommands;
|
|
18397
18516
|
};
|
|
18398
18517
|
const add$1 = widget => {
|
|
@@ -18440,15 +18559,15 @@ const EditorMessageWidget = {
|
|
|
18440
18559
|
};
|
|
18441
18560
|
|
|
18442
18561
|
const registerWidgets = () => {
|
|
18443
|
-
set$
|
|
18444
|
-
set$
|
|
18445
|
-
set$
|
|
18446
|
-
set$
|
|
18447
|
-
set$
|
|
18448
|
-
set$
|
|
18449
|
-
set$
|
|
18450
|
-
set$
|
|
18451
|
-
set$
|
|
18562
|
+
set$8(ColorPicker$2, EditorColorPickerWidget);
|
|
18563
|
+
set$8(Completion, EditorCompletionWidget);
|
|
18564
|
+
set$8(CompletionDetail, EditorCompletionDetailWidget);
|
|
18565
|
+
set$8(Find, EditorFindWidget);
|
|
18566
|
+
set$8(Hover, EditorHoverWidget);
|
|
18567
|
+
set$8(Message, EditorMessageWidget);
|
|
18568
|
+
set$8(Rename$1, EditorRenameWidget);
|
|
18569
|
+
set$8(SourceAction$1, EditorSourceActionWidget);
|
|
18570
|
+
set$8(CodeGenerator, EditorCodeGeneratorWidget);
|
|
18452
18571
|
};
|
|
18453
18572
|
|
|
18454
18573
|
const handleUnhandledRejection = event => {
|
package/dist/settings.json
CHANGED