@lvce-editor/hover-worker 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hoverWorkerMain.js +40 -7
- package/package.json +1 -1
package/dist/hoverWorkerMain.js
CHANGED
|
@@ -1054,7 +1054,7 @@ const getLines = async editorUid => {
|
|
|
1054
1054
|
const lines = await invoke$2('Editor.getLines2', editorUid);
|
|
1055
1055
|
return lines;
|
|
1056
1056
|
};
|
|
1057
|
-
const getPositionAtCursor = async parentUid => {
|
|
1057
|
+
const getPositionAtCursor$1 = async parentUid => {
|
|
1058
1058
|
const position = await invoke$2('Editor.getPositionAtCursor', parentUid);
|
|
1059
1059
|
return position;
|
|
1060
1060
|
};
|
|
@@ -1066,7 +1066,7 @@ const getSelections = async editorUid => {
|
|
|
1066
1066
|
const selections = await invoke$2('Editor.getSelections2', editorUid);
|
|
1067
1067
|
return selections;
|
|
1068
1068
|
};
|
|
1069
|
-
const getWordAtOffset2 = async editorUid => {
|
|
1069
|
+
const getWordAtOffset2$1 = async editorUid => {
|
|
1070
1070
|
return invoke$2('Editor.getWordAtOffset2', editorUid);
|
|
1071
1071
|
};
|
|
1072
1072
|
const getWordBefore = async (editorUid, rowIndex, columnIndex) => {
|
|
@@ -1105,12 +1105,12 @@ const EditorWorker = {
|
|
|
1105
1105
|
getLanguageId,
|
|
1106
1106
|
getLines,
|
|
1107
1107
|
getOffsetAtCursor,
|
|
1108
|
-
getPositionAtCursor,
|
|
1108
|
+
getPositionAtCursor: getPositionAtCursor$1,
|
|
1109
1109
|
getProblems,
|
|
1110
1110
|
getSelections,
|
|
1111
1111
|
getUri,
|
|
1112
1112
|
getWordAt,
|
|
1113
|
-
getWordAtOffset2,
|
|
1113
|
+
getWordAtOffset2: getWordAtOffset2$1,
|
|
1114
1114
|
getWordBefore,
|
|
1115
1115
|
invoke: invoke$2,
|
|
1116
1116
|
invokeAndTransfer: invokeAndTransfer$2,
|
|
@@ -1161,7 +1161,8 @@ const ExtensionHost = {
|
|
|
1161
1161
|
const {
|
|
1162
1162
|
invoke,
|
|
1163
1163
|
set: set$2,
|
|
1164
|
-
invokeAndTransfer
|
|
1164
|
+
invokeAndTransfer,
|
|
1165
|
+
getWordAtOffset2
|
|
1165
1166
|
} = EditorWorker;
|
|
1166
1167
|
|
|
1167
1168
|
const FocusEditorHovers = 9;
|
|
@@ -1305,7 +1306,7 @@ const isEqual$2 = (oldState, newState) => {
|
|
|
1305
1306
|
};
|
|
1306
1307
|
|
|
1307
1308
|
const isEqual$1 = (oldState, newState) => {
|
|
1308
|
-
return oldState.leadingWord === newState.leadingWord;
|
|
1309
|
+
return oldState.leadingWord === newState.leadingWord && oldState.x === newState.x && oldState.y === newState.y;
|
|
1309
1310
|
};
|
|
1310
1311
|
|
|
1311
1312
|
const isEqual = (oldState, newState) => {
|
|
@@ -1400,6 +1401,18 @@ const getKeyBindings = () => {
|
|
|
1400
1401
|
}];
|
|
1401
1402
|
};
|
|
1402
1403
|
|
|
1404
|
+
const handleSashPointerDown = (state, eventX, eventY) => {
|
|
1405
|
+
return state;
|
|
1406
|
+
};
|
|
1407
|
+
|
|
1408
|
+
const handleSashPointerMove = (state, eventX, eventY) => {
|
|
1409
|
+
return state;
|
|
1410
|
+
};
|
|
1411
|
+
|
|
1412
|
+
const handleSashPointerUp = (state, eventX, eventY) => {
|
|
1413
|
+
return state;
|
|
1414
|
+
};
|
|
1415
|
+
|
|
1403
1416
|
const getPortTuple = () => {
|
|
1404
1417
|
const {
|
|
1405
1418
|
port1,
|
|
@@ -1446,10 +1459,27 @@ const initialize = async () => {
|
|
|
1446
1459
|
set(rpc);
|
|
1447
1460
|
};
|
|
1448
1461
|
|
|
1462
|
+
const getPositionAtCursor = async editorUid => {
|
|
1463
|
+
const position = await invoke('Editor.getPositionAtCursor', editorUid);
|
|
1464
|
+
return position;
|
|
1465
|
+
};
|
|
1466
|
+
|
|
1467
|
+
const getWordAtOffset = getWordAtOffset2;
|
|
1468
|
+
|
|
1449
1469
|
const loadContent = async state => {
|
|
1470
|
+
const {
|
|
1471
|
+
editorUid
|
|
1472
|
+
} = state;
|
|
1473
|
+
const wordAtOffset = await getWordAtOffset(editorUid);
|
|
1474
|
+
const {
|
|
1475
|
+
x,
|
|
1476
|
+
y
|
|
1477
|
+
} = await getPositionAtCursor(editorUid);
|
|
1450
1478
|
return {
|
|
1451
1479
|
...state,
|
|
1452
|
-
leadingWord:
|
|
1480
|
+
leadingWord: wordAtOffset,
|
|
1481
|
+
x,
|
|
1482
|
+
y
|
|
1453
1483
|
};
|
|
1454
1484
|
};
|
|
1455
1485
|
|
|
@@ -1663,6 +1693,9 @@ const commandMap = {
|
|
|
1663
1693
|
'Hover.initialize': initialize,
|
|
1664
1694
|
'Hover.loadContent': wrapCommand(loadContent),
|
|
1665
1695
|
'Hover.render2': render2,
|
|
1696
|
+
'Hover.handleSashPointerUp': wrapCommand(handleSashPointerUp),
|
|
1697
|
+
'Hover.handleSashPointerDown': wrapCommand(handleSashPointerDown),
|
|
1698
|
+
'Hover.handleSashPointerMove': wrapCommand(handleSashPointerMove),
|
|
1666
1699
|
'Hover.terminate': terminate
|
|
1667
1700
|
};
|
|
1668
1701
|
|