@lvce-editor/completion-worker 1.25.0 → 1.26.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.
@@ -1179,6 +1179,10 @@ const getPositionAtCursor$2 = async parentUid => {
1179
1179
  const position = await invoke$c('Editor.getPositionAtCursor', parentUid);
1180
1180
  return position;
1181
1181
  };
1182
+ const getOffsetAtCursor$2 = async editorId => {
1183
+ // @ts-ignore
1184
+ return await invoke$c('Editor.getOffsetAtCursor', editorId);
1185
+ };
1182
1186
  const getSelections$2 = async editorUid => {
1183
1187
  const selections = await invoke$c('Editor.getSelections2', editorUid);
1184
1188
  return selections;
@@ -1196,6 +1200,7 @@ const EditorWorker$2 = {
1196
1200
  closeWidget: closeWidget$1,
1197
1201
  dispose: dispose$c,
1198
1202
  getLines: getLines$2,
1203
+ getOffsetAtCursor: getOffsetAtCursor$2,
1199
1204
  getPositionAtCursor: getPositionAtCursor$2,
1200
1205
  getSelections: getSelections$2,
1201
1206
  getWordAt: getWordAt$1,
@@ -1226,6 +1231,7 @@ const {
1226
1231
  getPositionAtCursor: getPositionAtCursor$1,
1227
1232
  getSelections: getSelections$1,
1228
1233
  getWordAt,
1234
+ getOffsetAtCursor: getOffsetAtCursor$1,
1229
1235
  getWordAtOffset2,
1230
1236
  getWordBefore: getWordBefore$1,
1231
1237
  invokeAndTransfer
@@ -1238,6 +1244,7 @@ const EditorWorker = {
1238
1244
  closeWidget,
1239
1245
  dispose: dispose$2,
1240
1246
  getLines: getLines$1,
1247
+ getOffsetAtCursor: getOffsetAtCursor$1,
1241
1248
  getPositionAtCursor: getPositionAtCursor$1,
1242
1249
  getSelections: getSelections$1,
1243
1250
  getWordAt,
@@ -1383,8 +1390,7 @@ const openDetails = async state => {
1383
1390
  };
1384
1391
 
1385
1392
  const applyEdit = async (editorUid, changes) => {
1386
- // @ts-ignore
1387
- await invoke$1('Editor.applyEdit2', editorUid, changes);
1393
+ await applyEdit$1(editorUid, changes);
1388
1394
  };
1389
1395
 
1390
1396
  const {
@@ -1464,9 +1470,7 @@ const execute = async ({
1464
1470
  editorUid,
1465
1471
  args,
1466
1472
  event,
1467
- method,
1468
- noProviderFoundMessage,
1469
- noProviderFoundResult = undefined
1473
+ method
1470
1474
  }) => {
1471
1475
  const fullEvent = `${event}:${editorLanguageId}`;
1472
1476
  await activateByEvent(fullEvent);
@@ -1480,24 +1484,18 @@ const executeCompletionProvider = async (editorUid, editorLanguageId, offset) =>
1480
1484
  editorLanguageId,
1481
1485
  event: OnCompletion,
1482
1486
  method: CompletionExecute,
1483
- args: [offset],
1484
- noProviderFoundMessage: 'no completion provider found',
1485
- noProviderFoundResult: []});
1487
+ args: [offset]});
1486
1488
  };
1487
1489
  const executeResolveCompletionItem = async (editorUid, offset, name, completionItem) => {
1488
1490
  return execute({
1489
1491
  editorUid,
1490
1492
  event: OnCompletion,
1491
1493
  method: CompletionResolveExecute,
1492
- args: [offset, name, completionItem],
1493
- noProviderFoundMessage: 'no completion provider found',
1494
- noProviderFoundResult: []});
1494
+ args: [offset, name, completionItem]});
1495
1495
  };
1496
1496
 
1497
1497
  const getOffsetAtCursor = async editorUid => {
1498
- // TODO ask editor worker
1499
- // @ts-ignore
1500
- return invoke$1('Editor.getOffsetAtCursor', editorUid);
1498
+ return getOffsetAtCursor$1(editorUid);
1501
1499
  };
1502
1500
 
1503
1501
  // TODO don't send unnecessary parts of completion item like matches
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/completion-worker",
3
- "version": "1.25.0",
3
+ "version": "1.26.0",
4
4
  "description": "Web Worker for the find widget in Lvce Editor",
5
5
  "repository": {
6
6
  "type": "git",