@lvce-editor/editor-worker 19.68.5 → 19.68.6
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 +59 -42
- package/package.json +1 -1
package/dist/editorWorkerMain.js
CHANGED
|
@@ -9825,6 +9825,7 @@ const getDiagnosticHoverInfo = async (editor, diagnostic) => {
|
|
|
9825
9825
|
return {
|
|
9826
9826
|
diagnostics: [diagnostic],
|
|
9827
9827
|
documentation: '',
|
|
9828
|
+
documentationVirtualDom: [],
|
|
9828
9829
|
height,
|
|
9829
9830
|
lineInfos: [],
|
|
9830
9831
|
width,
|
|
@@ -9842,6 +9843,7 @@ const create$5 = () => {
|
|
|
9842
9843
|
content: '',
|
|
9843
9844
|
diagnostics: [],
|
|
9844
9845
|
documentation: '',
|
|
9846
|
+
documentationVirtualDom: [],
|
|
9845
9847
|
editorUid: 0,
|
|
9846
9848
|
height: 0,
|
|
9847
9849
|
lineInfos: [],
|
|
@@ -9855,6 +9857,7 @@ const create$5 = () => {
|
|
|
9855
9857
|
content: '',
|
|
9856
9858
|
diagnostics: [],
|
|
9857
9859
|
documentation: '',
|
|
9860
|
+
documentationVirtualDom: [],
|
|
9858
9861
|
editorUid: 0,
|
|
9859
9862
|
height: 0,
|
|
9860
9863
|
lineInfos: [],
|
|
@@ -9893,6 +9896,15 @@ const getHover = async (editor, offset) => {
|
|
|
9893
9896
|
return hover;
|
|
9894
9897
|
};
|
|
9895
9898
|
|
|
9899
|
+
const invoke$5 = (...args) => invoke$d(...args);
|
|
9900
|
+
|
|
9901
|
+
const getVirtualDomFromMarkdown = async markdown => {
|
|
9902
|
+
const html = await invoke$5('Markdown.renderMarkdown', markdown, {
|
|
9903
|
+
linksExternal: true
|
|
9904
|
+
});
|
|
9905
|
+
return invoke$5('Markdown.getVirtualDom', html);
|
|
9906
|
+
};
|
|
9907
|
+
|
|
9896
9908
|
const getLineInfo = (line, tokens, TokenMap) => {
|
|
9897
9909
|
const tokensLength = tokens.length;
|
|
9898
9910
|
let end = 0;
|
|
@@ -9990,6 +10002,7 @@ const getEditorHoverInfo = async (editorUid, position) => {
|
|
|
9990
10002
|
}
|
|
9991
10003
|
const tokenizerPath = '';
|
|
9992
10004
|
const lineInfos = displayString ? await tokenizeCodeBlock(displayString, displayStringLanguageId || fallbackDisplayStringLanguageId, tokenizerPath) : [];
|
|
10005
|
+
const documentationVirtualDom = documentation ? await getVirtualDomFromMarkdown(documentation) : [];
|
|
9993
10006
|
const wordPart = getWordBefore(editor, rowIndex, columnIndex);
|
|
9994
10007
|
const wordStart = columnIndex - wordPart.length;
|
|
9995
10008
|
const documentationHeight = documentation ? await measureTextBlockHeight(documentation, hoverDocumentationFontFamily, hoverDocumentationFontSize, hoverDocumentationLineHeight, hoverDocumentationWidth) : 0;
|
|
@@ -10004,6 +10017,7 @@ const getEditorHoverInfo = async (editorUid, position) => {
|
|
|
10004
10017
|
const y$1 = rowBottom + height <= editor.y + editor.height ? rowBottom : Math.max(editor.y, rowBottom - editor.rowHeight - height);
|
|
10005
10018
|
return {
|
|
10006
10019
|
documentation,
|
|
10020
|
+
documentationVirtualDom,
|
|
10007
10021
|
height,
|
|
10008
10022
|
lineInfos,
|
|
10009
10023
|
matchingDiagnostics,
|
|
@@ -10019,6 +10033,7 @@ const loadHoverContent = async (state, position) => {
|
|
|
10019
10033
|
}
|
|
10020
10034
|
const {
|
|
10021
10035
|
documentation,
|
|
10036
|
+
documentationVirtualDom,
|
|
10022
10037
|
height,
|
|
10023
10038
|
lineInfos,
|
|
10024
10039
|
matchingDiagnostics,
|
|
@@ -10029,6 +10044,7 @@ const loadHoverContent = async (state, position) => {
|
|
|
10029
10044
|
...state,
|
|
10030
10045
|
diagnostics: matchingDiagnostics,
|
|
10031
10046
|
documentation,
|
|
10047
|
+
documentationVirtualDom,
|
|
10032
10048
|
height,
|
|
10033
10049
|
lineInfos,
|
|
10034
10050
|
width: 600,
|
|
@@ -11073,7 +11089,7 @@ const create$3 = () => {
|
|
|
11073
11089
|
};
|
|
11074
11090
|
|
|
11075
11091
|
const {
|
|
11076
|
-
invoke: invoke$
|
|
11092
|
+
invoke: invoke$4,
|
|
11077
11093
|
setFactory
|
|
11078
11094
|
} = createLazyRpc(CompletionWorker);
|
|
11079
11095
|
|
|
@@ -11092,10 +11108,10 @@ const newStateGenerator$3 = async (state, parentUid) => {
|
|
|
11092
11108
|
applicationId,
|
|
11093
11109
|
languageId
|
|
11094
11110
|
} = newState;
|
|
11095
|
-
await invoke$
|
|
11096
|
-
await invoke$
|
|
11097
|
-
const diff = await invoke$
|
|
11098
|
-
const commands = await invoke$
|
|
11111
|
+
await invoke$4('Completions.create', uid, x, y, width, height, parentUid, languageId, applicationId);
|
|
11112
|
+
await invoke$4('Completions.loadContent', uid);
|
|
11113
|
+
const diff = await invoke$4('Completions.diff2', uid);
|
|
11114
|
+
const commands = await invoke$4('Completions.render2', uid, diff);
|
|
11099
11115
|
return {
|
|
11100
11116
|
...state,
|
|
11101
11117
|
commands
|
|
@@ -11225,7 +11241,7 @@ const launch = async () => {
|
|
|
11225
11241
|
const rpc = await launchFindWidgetWorker();
|
|
11226
11242
|
set$h(rpcId, rpc);
|
|
11227
11243
|
};
|
|
11228
|
-
const invoke$
|
|
11244
|
+
const invoke$3 = async (method, ...params) => {
|
|
11229
11245
|
const rpc = get$9(rpcId);
|
|
11230
11246
|
return await rpc.invoke(method, ...params);
|
|
11231
11247
|
};
|
|
@@ -11256,7 +11272,7 @@ const getOrCreate$1 = () => {
|
|
|
11256
11272
|
}
|
|
11257
11273
|
return state$2.workerPromise;
|
|
11258
11274
|
};
|
|
11259
|
-
const invoke$
|
|
11275
|
+
const invoke$2 = async (method, ...params) => {
|
|
11260
11276
|
const worker = await getOrCreate$1();
|
|
11261
11277
|
return await worker.invoke(method, ...params);
|
|
11262
11278
|
};
|
|
@@ -11276,7 +11292,7 @@ const getOrCreate = () => {
|
|
|
11276
11292
|
}
|
|
11277
11293
|
return state$1.workerPromise;
|
|
11278
11294
|
};
|
|
11279
|
-
const invoke$
|
|
11295
|
+
const invoke$1 = async (method, ...params) => {
|
|
11280
11296
|
const worker = await getOrCreate();
|
|
11281
11297
|
return await worker.invoke(method, ...params);
|
|
11282
11298
|
};
|
|
@@ -11286,15 +11302,15 @@ const getWidgetInvoke = widgetId => {
|
|
|
11286
11302
|
case ColorPicker$2:
|
|
11287
11303
|
return invoke$7;
|
|
11288
11304
|
case Completion:
|
|
11289
|
-
return invoke$5;
|
|
11290
|
-
case Find:
|
|
11291
11305
|
return invoke$4;
|
|
11292
|
-
case
|
|
11306
|
+
case Find:
|
|
11293
11307
|
return invoke$3;
|
|
11308
|
+
case Hover:
|
|
11309
|
+
return invoke$2;
|
|
11294
11310
|
case Rename$1:
|
|
11295
11311
|
return invoke$6;
|
|
11296
11312
|
case SourceAction$1:
|
|
11297
|
-
return invoke$
|
|
11313
|
+
return invoke$1;
|
|
11298
11314
|
default:
|
|
11299
11315
|
return undefined;
|
|
11300
11316
|
}
|
|
@@ -11554,10 +11570,10 @@ const loadContent$2 = async (state, parentUid) => {
|
|
|
11554
11570
|
y
|
|
11555
11571
|
} = editor;
|
|
11556
11572
|
await launch();
|
|
11557
|
-
await invoke$
|
|
11558
|
-
await invoke$
|
|
11559
|
-
const diff = await invoke$
|
|
11560
|
-
const commands = await invoke$
|
|
11573
|
+
await invoke$3('FindWidget.create', uid, x, y, width, height, parentUid);
|
|
11574
|
+
await invoke$3('FindWidget.loadContent', uid);
|
|
11575
|
+
const diff = await invoke$3('FindWidget.diff2', uid);
|
|
11576
|
+
const commands = await invoke$3('FindWidget.render2', uid, diff);
|
|
11561
11577
|
return {
|
|
11562
11578
|
...state,
|
|
11563
11579
|
commands
|
|
@@ -12654,10 +12670,10 @@ const newStateGenerator = async (state, parentUid) => {
|
|
|
12654
12670
|
const {
|
|
12655
12671
|
languageId
|
|
12656
12672
|
} = newState;
|
|
12657
|
-
await invoke$
|
|
12658
|
-
await invoke$
|
|
12659
|
-
const diff = await invoke$
|
|
12660
|
-
const commands = await invoke$
|
|
12673
|
+
await invoke$1('SourceActions.create', uid, x, y, width, height, parentUid, languageId);
|
|
12674
|
+
await invoke$1('SourceActions.loadContent', uid);
|
|
12675
|
+
const diff = await invoke$1('SourceActions.diff2', uid);
|
|
12676
|
+
const commands = await invoke$1('SourceActions.render2', uid, diff);
|
|
12661
12677
|
return {
|
|
12662
12678
|
...state,
|
|
12663
12679
|
commands
|
|
@@ -13647,6 +13663,7 @@ const loadContent$1 = async (editorUid, state, position) => {
|
|
|
13647
13663
|
}
|
|
13648
13664
|
const {
|
|
13649
13665
|
documentation,
|
|
13666
|
+
documentationVirtualDom,
|
|
13650
13667
|
height,
|
|
13651
13668
|
lineInfos,
|
|
13652
13669
|
matchingDiagnostics,
|
|
@@ -13657,6 +13674,7 @@ const loadContent$1 = async (editorUid, state, position) => {
|
|
|
13657
13674
|
...state,
|
|
13658
13675
|
diagnostics: matchingDiagnostics,
|
|
13659
13676
|
documentation,
|
|
13677
|
+
documentationVirtualDom,
|
|
13660
13678
|
height,
|
|
13661
13679
|
lineInfos,
|
|
13662
13680
|
x,
|
|
@@ -14062,20 +14080,20 @@ const hoverSashNode = {
|
|
|
14062
14080
|
onPointerDown: HandleSashPointerDown,
|
|
14063
14081
|
type: Div
|
|
14064
14082
|
};
|
|
14065
|
-
const getChildCount = (lineInfos,
|
|
14066
|
-
const documentationCount =
|
|
14083
|
+
const getChildCount = (lineInfos, documentationVirtualDom, diagnostics) => {
|
|
14084
|
+
const documentationCount = documentationVirtualDom.length > 0 ? 1 : 0;
|
|
14067
14085
|
const diagnosticsCount = diagnostics && diagnostics.length > 0 ? 1 : 0;
|
|
14068
|
-
return lineInfos.length + documentationCount + diagnosticsCount;
|
|
14086
|
+
return (lineInfos.length > 0 ? 1 : 0) + documentationCount + diagnosticsCount;
|
|
14069
14087
|
};
|
|
14070
|
-
const getEditorHoverClassName = (lineInfos,
|
|
14071
|
-
const isDiagnosticOnly = diagnostics?.length === 1 && lineInfos.length === 0 &&
|
|
14088
|
+
const getEditorHoverClassName = (lineInfos, documentationVirtualDom, diagnostics) => {
|
|
14089
|
+
const isDiagnosticOnly = diagnostics?.length === 1 && lineInfos.length === 0 && documentationVirtualDom.length === 0;
|
|
14072
14090
|
return mergeClassNames('Viewlet', 'EditorHover', isDiagnosticOnly ? EditorHoverDiagnosticOnly : '');
|
|
14073
14091
|
};
|
|
14074
|
-
const getHoverVirtualDom = (lineInfos,
|
|
14092
|
+
const getHoverVirtualDom = (lineInfos, documentationVirtualDom, diagnostics) => {
|
|
14075
14093
|
const dom = [];
|
|
14076
14094
|
dom.push({
|
|
14077
|
-
childCount: getChildCount(lineInfos,
|
|
14078
|
-
className: getEditorHoverClassName(lineInfos,
|
|
14095
|
+
childCount: getChildCount(lineInfos, documentationVirtualDom, diagnostics) + 1,
|
|
14096
|
+
className: getEditorHoverClassName(lineInfos, documentationVirtualDom, diagnostics),
|
|
14079
14097
|
type: Div
|
|
14080
14098
|
});
|
|
14081
14099
|
if (diagnostics && diagnostics.length > 0) {
|
|
@@ -14096,8 +14114,8 @@ const getHoverVirtualDom = (lineInfos, documentation, diagnostics) => {
|
|
|
14096
14114
|
type: Div
|
|
14097
14115
|
}, ...lineInfosDom);
|
|
14098
14116
|
}
|
|
14099
|
-
if (
|
|
14100
|
-
dom.push(hoverDocumentationNode,
|
|
14117
|
+
if (documentationVirtualDom.length > 0) {
|
|
14118
|
+
dom.push(hoverDocumentationNode, ...documentationVirtualDom);
|
|
14101
14119
|
}
|
|
14102
14120
|
dom.push(hoverSashNode);
|
|
14103
14121
|
return dom;
|
|
@@ -14105,10 +14123,10 @@ const getHoverVirtualDom = (lineInfos, documentation, diagnostics) => {
|
|
|
14105
14123
|
|
|
14106
14124
|
const renderHoverDom = {
|
|
14107
14125
|
apply(oldState, newState) {
|
|
14108
|
-
const dom = getHoverVirtualDom(newState.lineInfos, newState.
|
|
14126
|
+
const dom = getHoverVirtualDom(newState.lineInfos, newState.documentationVirtualDom, newState.diagnostics);
|
|
14109
14127
|
return [/* method */SetDom2, dom];
|
|
14110
14128
|
},
|
|
14111
|
-
isEqual: (oldState, newState) => oldState.lineInfos === newState.lineInfos && oldState.
|
|
14129
|
+
isEqual: (oldState, newState) => oldState.lineInfos === newState.lineInfos && oldState.documentationVirtualDom === newState.documentationVirtualDom && oldState.diagnostics === newState.diagnostics
|
|
14112
14130
|
};
|
|
14113
14131
|
const renderBounds$2 = {
|
|
14114
14132
|
apply(oldState, newState) {
|
|
@@ -15240,9 +15258,9 @@ const updateFindWidget = async state => {
|
|
|
15240
15258
|
const {
|
|
15241
15259
|
uid
|
|
15242
15260
|
} = widget.newState;
|
|
15243
|
-
await invoke$
|
|
15244
|
-
const diff = await invoke$
|
|
15245
|
-
const commands = await invoke$
|
|
15261
|
+
await invoke$3('FindWidget.handleSettingsChanged', uid);
|
|
15262
|
+
const diff = await invoke$3('FindWidget.diff2', uid);
|
|
15263
|
+
const commands = await invoke$3('FindWidget.render2', uid, diff);
|
|
15246
15264
|
return updateWidget(state, Find, {
|
|
15247
15265
|
...widget.newState,
|
|
15248
15266
|
commands
|
|
@@ -15337,7 +15355,7 @@ const getWidgetHotReloadDescriptor = widgetId => {
|
|
|
15337
15355
|
switch (widgetId) {
|
|
15338
15356
|
case Find:
|
|
15339
15357
|
return {
|
|
15340
|
-
invoke: invoke$
|
|
15358
|
+
invoke: invoke$3,
|
|
15341
15359
|
name: 'FindWidget'
|
|
15342
15360
|
};
|
|
15343
15361
|
default:
|
|
@@ -17228,13 +17246,13 @@ const unregisterListener = (listenerType, rpcId) => {
|
|
|
17228
17246
|
unregisterListener$1(listenerType, rpcId);
|
|
17229
17247
|
};
|
|
17230
17248
|
|
|
17231
|
-
const invoke
|
|
17249
|
+
const invoke = async (method, ...params) => {
|
|
17232
17250
|
const worker = get$9(DebugWorker);
|
|
17233
17251
|
return worker.invoke(method, ...params);
|
|
17234
17252
|
};
|
|
17235
17253
|
|
|
17236
17254
|
const getDebugHighlight = async debugId => {
|
|
17237
|
-
const newInfo = await invoke
|
|
17255
|
+
const newInfo = await invoke('RunAndDebug.getHighlight', debugId);
|
|
17238
17256
|
return newInfo;
|
|
17239
17257
|
};
|
|
17240
17258
|
|
|
@@ -17308,8 +17326,6 @@ const executeDiagnosticProvider = async editor => {
|
|
|
17308
17326
|
return executeIsolatedDiagnosticProvider(editor);
|
|
17309
17327
|
};
|
|
17310
17328
|
|
|
17311
|
-
const invoke = (...args) => invoke$d(...args);
|
|
17312
|
-
|
|
17313
17329
|
/**
|
|
17314
17330
|
* Merges link decorations with diagnostic decorations
|
|
17315
17331
|
* Links should always be present, but we also need to include any diagnostic decorations
|
|
@@ -17421,7 +17437,7 @@ const updateDiagnostics = async editor => {
|
|
|
17421
17437
|
}
|
|
17422
17438
|
const newEditor = mergeDiagnostics(latest.newState, editorWithDiagnostics);
|
|
17423
17439
|
set$8(editor.id, latest.oldState, newEditor);
|
|
17424
|
-
await invoke('Editor.renderPending', newEditor.id);
|
|
17440
|
+
await invoke$5('Editor.renderPending', newEditor.id);
|
|
17425
17441
|
await notifyDiagnosticsChange(newEditor.uri, newEditor.applicationId);
|
|
17426
17442
|
return newEditor;
|
|
17427
17443
|
})) ?? editor;
|
|
@@ -17903,6 +17919,7 @@ const commandMap = {
|
|
|
17903
17919
|
'Listener.register': registerListener,
|
|
17904
17920
|
'Listener.registerListener': registerListener,
|
|
17905
17921
|
'Listener.unregister': unregisterListener,
|
|
17922
|
+
'Markdown.getVirtualDomFromMarkdown': getVirtualDomFromMarkdown,
|
|
17906
17923
|
'SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker': sendDeprecatedExtensionHostPortToExtensionManagementWorker,
|
|
17907
17924
|
'SendMessagePortToExtensionManagementWorker.sendMessagePortToExtensionManagementWorker': sendMessagePortToExtensionManagementWorker
|
|
17908
17925
|
};
|
|
@@ -18248,7 +18265,7 @@ const render$1 = widget => {
|
|
|
18248
18265
|
newState,
|
|
18249
18266
|
oldState
|
|
18250
18267
|
} = widget;
|
|
18251
|
-
const commands = newState.commands.length > 0 ? renderFull$3(oldState, newState) : [[SetDom2, newState.uid, getHoverVirtualDom(newState.lineInfos, newState.
|
|
18268
|
+
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]];
|
|
18252
18269
|
const wrappedCommands = [];
|
|
18253
18270
|
const {
|
|
18254
18271
|
uid
|