@lvce-editor/editor-worker 19.29.0 → 19.29.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.
@@ -1151,7 +1151,7 @@ const createMockRpc = ({
1151
1151
  };
1152
1152
 
1153
1153
  const rpcs = Object.create(null);
1154
- const set$i = (id, rpc) => {
1154
+ const set$g = (id, rpc) => {
1155
1155
  rpcs[id] = rpc;
1156
1156
  };
1157
1157
  const get$9 = id => {
@@ -1184,7 +1184,7 @@ const create$a = rpcId => {
1184
1184
  const mockRpc = createMockRpc({
1185
1185
  commandMap
1186
1186
  });
1187
- set$i(rpcId, mockRpc);
1187
+ set$g(rpcId, mockRpc);
1188
1188
  // @ts-ignore
1189
1189
  mockRpc[Symbol.dispose] = () => {
1190
1190
  remove$8(rpcId);
@@ -1193,7 +1193,7 @@ const create$a = rpcId => {
1193
1193
  return mockRpc;
1194
1194
  },
1195
1195
  set(rpc) {
1196
- set$i(rpcId, rpc);
1196
+ set$g(rpcId, rpc);
1197
1197
  }
1198
1198
  };
1199
1199
  };
@@ -1436,7 +1436,6 @@ const DebugWorker = 55;
1436
1436
  const DialogWorker = 7014;
1437
1437
  const EditorWorker = 99;
1438
1438
  const ErrorWorker = 3308;
1439
- const ExtensionHostWorker = 44;
1440
1439
  const ExtensionManagementWorker = 9006;
1441
1440
  const IconThemeWorker = 7009;
1442
1441
  const MarkdownWorker = 300;
@@ -1451,32 +1450,21 @@ const SetPatches = 'Viewlet.setPatches';
1451
1450
  const FocusEditorText$1 = 12;
1452
1451
 
1453
1452
  const {
1454
- invoke: invoke$h,
1455
- set: set$h
1456
- } = create$a(DialogWorker);
1457
-
1458
- const {
1459
- invoke: invoke$g,
1460
- set: set$g
1461
- } = create$a(ErrorWorker);
1462
-
1463
- const {
1464
- invoke: invoke$f,
1465
- set: set$f
1466
- } = create$a(ExtensionHostWorker);
1467
-
1468
- const ExtensionHost = {
1469
- __proto__: null,
1470
1453
  invoke: invoke$f,
1471
1454
  set: set$f
1472
- };
1455
+ } = create$a(DialogWorker);
1473
1456
 
1474
1457
  const {
1475
1458
  invoke: invoke$e,
1476
1459
  set: set$e
1460
+ } = create$a(ErrorWorker);
1461
+
1462
+ const {
1463
+ invoke: invoke$d,
1464
+ set: set$d
1477
1465
  } = create$a(ExtensionManagementWorker);
1478
1466
  const getLanguages$1 = (platform, assetDir) => {
1479
- return invoke$e('Extensions.getLanguages', platform, assetDir);
1467
+ return invoke$d('Extensions.getLanguages', platform, assetDir);
1480
1468
  };
1481
1469
 
1482
1470
  const createLazyRpc = rpcId => {
@@ -1492,7 +1480,7 @@ const createLazyRpc = rpcId => {
1492
1480
  throw new Error('Lazy RPC launch was superseded');
1493
1481
  }
1494
1482
  activeRpc = rpc;
1495
- set$i(rpcId, rpc);
1483
+ set$g(rpcId, rpc);
1496
1484
  return rpc;
1497
1485
  };
1498
1486
  const ensureRpc = async () => {
@@ -1553,29 +1541,29 @@ const createLazyRpc = rpcId => {
1553
1541
  };
1554
1542
 
1555
1543
  const {
1556
- invoke: invoke$d,
1557
- set: set$d
1544
+ invoke: invoke$c,
1545
+ set: set$c
1558
1546
  } = create$a(OpenerWorker);
1559
1547
  const openUrl = async (url, platform) => {
1560
- return invoke$d('Open.openUrl', url, platform);
1548
+ return invoke$c('Open.openUrl', url, platform);
1561
1549
  };
1562
1550
 
1563
1551
  const {
1564
- invoke: invoke$c,
1565
- set: set$c
1552
+ invoke: invoke$b,
1553
+ set: set$b
1566
1554
  } = create$a(IconThemeWorker);
1567
1555
 
1568
1556
  const {
1569
- invoke: invoke$b,
1557
+ invoke: invoke$a,
1570
1558
  invokeAndTransfer,
1571
- set: set$b
1559
+ set: set$a
1572
1560
  } = create$a(RendererWorker$1);
1573
1561
  const showContextMenu2 = async (uid, menuId, x, y, args) => {
1574
1562
  number(uid);
1575
1563
  number(menuId);
1576
1564
  number(x);
1577
1565
  number(y);
1578
- await invoke$b('ContextMenu.show2', uid, menuId, x, y, args);
1566
+ await invoke$a('ContextMenu.show2', uid, menuId, x, y, args);
1579
1567
  };
1580
1568
  const sendMessagePortToOpenerWorker = async (port, rpcId) => {
1581
1569
  const command = 'HandleMessagePort.handleMessagePort';
@@ -1590,23 +1578,16 @@ const sendMessagePortToErrorWorker = async (port, rpcId) => {
1590
1578
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToErrorWorker', port, command, rpcId);
1591
1579
  };
1592
1580
  const readFile$1 = async uri => {
1593
- return invoke$b('FileSystem.readFile', uri);
1581
+ return invoke$a('FileSystem.readFile', uri);
1594
1582
  };
1595
1583
  const handleWorkspaceRefresh = async () => {
1596
- return invoke$b('Layout.handleWorkspaceRefresh');
1597
- };
1598
- const sendMessagePortToExtensionHostWorker = async (port, rpcId = 0) => {
1599
- const command = 'HandleMessagePort.handleMessagePort2';
1600
- await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, rpcId);
1584
+ return invoke$a('Layout.handleWorkspaceRefresh');
1601
1585
  };
1602
1586
  const writeClipBoardText = async text => {
1603
- await invoke$b('ClipBoard.writeText', /* text */text);
1587
+ await invoke$a('ClipBoard.writeText', /* text */text);
1604
1588
  };
1605
1589
  const readClipBoardText = async () => {
1606
- return invoke$b('ClipBoard.readText');
1607
- };
1608
- const activateByEvent$1 = (event, assetDir, platform) => {
1609
- return invoke$b('ExtensionHostManagement.activateByEvent', event, assetDir, platform);
1590
+ return invoke$a('ClipBoard.readText');
1610
1591
  };
1611
1592
  const sendMessagePortToTextMeasurementWorker = async port => {
1612
1593
  const command = 'TextMeasurement.handleMessagePort';
@@ -1617,10 +1598,10 @@ const sendMessagePortToExtensionManagementWorker$1 = async (port, rpcId) => {
1617
1598
  await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionManagementWorker', port, command, rpcId);
1618
1599
  };
1619
1600
  const getPreference = async key => {
1620
- return await invoke$b('Preferences.get', key);
1601
+ return await invoke$a('Preferences.get', key);
1621
1602
  };
1622
1603
  const openUri = async (uri, focus, options) => {
1623
- await invoke$b('Main.openUri', {
1604
+ await invoke$a('Main.openUri', {
1624
1605
  ...options,
1625
1606
  focus,
1626
1607
  uri
@@ -1632,35 +1613,33 @@ const sendMessagePortToSyntaxHighlightingWorker$1 = async port => {
1632
1613
 
1633
1614
  const RendererWorker = {
1634
1615
  __proto__: null,
1635
- activateByEvent: activateByEvent$1,
1636
1616
  getPreference,
1637
1617
  handleWorkspaceRefresh,
1638
- invoke: invoke$b,
1618
+ invoke: invoke$a,
1639
1619
  invokeAndTransfer,
1640
1620
  openUri,
1641
1621
  readClipBoardText,
1642
1622
  readFile: readFile$1,
1643
1623
  sendMessagePortToDialogWorker,
1644
1624
  sendMessagePortToErrorWorker,
1645
- sendMessagePortToExtensionHostWorker,
1646
1625
  sendMessagePortToExtensionManagementWorker: sendMessagePortToExtensionManagementWorker$1,
1647
1626
  sendMessagePortToOpenerWorker,
1648
1627
  sendMessagePortToSyntaxHighlightingWorker: sendMessagePortToSyntaxHighlightingWorker$1,
1649
1628
  sendMessagePortToTextMeasurementWorker,
1650
- set: set$b,
1629
+ set: set$a,
1651
1630
  showContextMenu2,
1652
1631
  writeClipBoardText
1653
1632
  };
1654
1633
 
1655
1634
  const {
1656
- invoke: invoke$a,
1657
- set: set$a
1635
+ invoke: invoke$9,
1636
+ set: set$9
1658
1637
  } = create$a(MarkdownWorker);
1659
1638
 
1660
1639
  const SyntaxHighlightingWorker = {
1661
1640
  __proto__: null,
1662
- invoke: invoke$a,
1663
- set: set$a
1641
+ invoke: invoke$9,
1642
+ set: set$9
1664
1643
  };
1665
1644
 
1666
1645
  const toCommandId = key => {
@@ -1914,7 +1893,7 @@ const activateByEvent = async (event, assetDir, platform) => {
1914
1893
  string(event);
1915
1894
  // Assert.string(assetDir)
1916
1895
  // Assert.number(platform)
1917
- await activateByEvent$1(event, assetDir, platform);
1896
+ await invoke$d('Extensions.activateByEvent', event);
1918
1897
  };
1919
1898
 
1920
1899
  const codeGeneratorAccept = state => {
@@ -1957,7 +1936,7 @@ const getOrCreate$3 = () => {
1957
1936
  }
1958
1937
  return state$c.workerPromise;
1959
1938
  };
1960
- const invoke$9 = async (method, ...params) => {
1939
+ const invoke$8 = async (method, ...params) => {
1961
1940
  const worker = await getOrCreate$3();
1962
1941
  return await worker.invoke(method, ...params);
1963
1942
  };
@@ -1970,10 +1949,10 @@ const loadContent$3 = async (state, parentUid) => {
1970
1949
  x,
1971
1950
  y
1972
1951
  } = state;
1973
- await invoke$9('ColorPicker.create', uid, x, y, width, height, parentUid);
1974
- await invoke$9('ColorPicker.loadContent', uid);
1975
- const diff = await invoke$9('ColorPicker.diff2', uid);
1976
- const commands = await invoke$9('ColorPicker.render2', uid, diff);
1952
+ await invoke$8('ColorPicker.create', uid, x, y, width, height, parentUid);
1953
+ await invoke$8('ColorPicker.loadContent', uid);
1954
+ const diff = await invoke$8('ColorPicker.diff2', uid);
1955
+ const commands = await invoke$8('ColorPicker.render2', uid, diff);
1977
1956
  return {
1978
1957
  ...state,
1979
1958
  commands
@@ -1994,7 +1973,7 @@ const getKeys$2 = () => {
1994
1973
  const keys = editorStates.getKeys();
1995
1974
  return keys.map(String);
1996
1975
  };
1997
- const set$9 = (id, oldEditor, newEditor) => {
1976
+ const set$8 = (id, oldEditor, newEditor) => {
1998
1977
  editorStates.set(id, oldEditor, newEditor);
1999
1978
  };
2000
1979
 
@@ -2100,7 +2079,7 @@ const createEditor2 = (id, uri, x, y, width, height, platform, assetDir) => {
2100
2079
  x,
2101
2080
  y
2102
2081
  };
2103
- set$9(id, editor, editor);
2082
+ set$8(id, editor, editor);
2104
2083
  };
2105
2084
 
2106
2085
  // TODO use numeric enum
@@ -2123,7 +2102,7 @@ const Rename = 'rename';
2123
2102
  const ToggleBlockComment$1 = 'toggleBlockComment';
2124
2103
 
2125
2104
  const map$1 = Object.create(null);
2126
- const set$8 = (id, widget) => {
2105
+ const set$7 = (id, widget) => {
2127
2106
  map$1[id] = widget;
2128
2107
  };
2129
2108
  const get$7 = id => {
@@ -2596,8 +2575,8 @@ const getEnabled$1 = () => {
2596
2575
  };
2597
2576
 
2598
2577
  const {
2599
- invoke: invoke$8,
2600
- set: set$7
2578
+ invoke: invoke$7,
2579
+ set: set$6
2601
2580
  } = SyntaxHighlightingWorker;
2602
2581
 
2603
2582
  const state$9 = {
@@ -2608,7 +2587,7 @@ const state$9 = {
2608
2587
  const has = languageId => {
2609
2588
  return Object.hasOwn(state$9.tokenizers, languageId);
2610
2589
  };
2611
- const set$6 = (languageId, tokenizer) => {
2590
+ const set$5 = (languageId, tokenizer) => {
2612
2591
  state$9.tokenizers[languageId] = tokenizer;
2613
2592
  };
2614
2593
  const get$6 = languageId => {
@@ -2632,7 +2611,7 @@ const isPending = languageId => {
2632
2611
  };
2633
2612
 
2634
2613
  const tokenMaps = Object.create(null);
2635
- const set$5 = (languageId, tokenMap) => {
2614
+ const set$4 = (languageId, tokenMap) => {
2636
2615
  tokenMaps[languageId] = tokenMap;
2637
2616
  };
2638
2617
  const get$5 = languageId => {
@@ -2647,8 +2626,8 @@ const loadTokenizer = async (languageId, tokenizePath) => {
2647
2626
  setTokenizePath(languageId, tokenizePath);
2648
2627
  if (getEnabled$1()) {
2649
2628
  // @ts-ignore
2650
- const tokenMap = await invoke$8('Tokenizer.load', languageId, tokenizePath);
2651
- set$5(languageId, tokenMap);
2629
+ const tokenMap = await invoke$7('Tokenizer.load', languageId, tokenizePath);
2630
+ set$4(languageId, tokenMap);
2652
2631
  return;
2653
2632
  }
2654
2633
  try {
@@ -2664,8 +2643,8 @@ const loadTokenizer = async (languageId, tokenizePath) => {
2664
2643
  console.warn(`tokenizer.TokenMap should be an object in "${tokenizePath}"`);
2665
2644
  return;
2666
2645
  }
2667
- set$5(languageId, tokenizer.TokenMap);
2668
- set$6(languageId, tokenizer);
2646
+ set$4(languageId, tokenizer.TokenMap);
2647
+ set$5(languageId, tokenizer);
2669
2648
  } catch (error) {
2670
2649
  // TODO better error handling
2671
2650
  console.error(error);
@@ -2682,7 +2661,7 @@ const getTokenizer = languageId => {
2682
2661
  };
2683
2662
 
2684
2663
  const tokenizers = Object.create(null);
2685
- const set$4 = (id, value) => {
2664
+ const set$3 = (id, value) => {
2686
2665
  tokenizers[id] = value;
2687
2666
  };
2688
2667
  const get$4 = id => {
@@ -2835,13 +2814,13 @@ const getTokensViewport2 = async (editor, startLineIndex, endLineIndex, syncIncr
2835
2814
  invalidStartIndex,
2836
2815
  languageId
2837
2816
  };
2838
- return invoke$8('GetTokensViewport.getTokensViewport', slimEditor,
2817
+ return invoke$7('GetTokensViewport.getTokensViewport', slimEditor,
2839
2818
  // @ts-ignore
2840
2819
  startLineIndex, endLineIndex, hasLinesToSend, id, linesToSend);
2841
2820
  }
2842
2821
  // TODO only send needed lines of text
2843
2822
  // @ts-ignore
2844
- return invoke$8('GetTokensViewport.getTokensViewport', editor, startLineIndex, endLineIndex, true, editor.id, editor.lines);
2823
+ return invoke$7('GetTokensViewport.getTokensViewport', editor, startLineIndex, endLineIndex, true, editor.id, editor.lines);
2845
2824
  }
2846
2825
  return getTokensViewport(editor, startLineIndex, endLineIndex);
2847
2826
  };
@@ -3500,7 +3479,7 @@ const getIncrementalEdits = async (oldState, newState) => {
3500
3479
  const oldLine = oldState.lines[rowIndex];
3501
3480
  const newLine = lines[rowIndex];
3502
3481
  // @ts-ignore
3503
- const incrementalEdits = await invoke$8(
3482
+ const incrementalEdits = await invoke$7(
3504
3483
  // @ts-ignore
3505
3484
  'TokenizeIncremental.tokenizeIncremental', newState.uid,
3506
3485
  // @ts-ignore
@@ -3780,12 +3759,12 @@ const splitLines = lines => {
3780
3759
  };
3781
3760
 
3782
3761
  const {
3783
- invoke: invoke$7,
3762
+ invoke: invoke$6,
3784
3763
  readFile} = RendererWorker;
3785
3764
 
3786
3765
  const notifyTabModifiedStatusChange = async (uri, modified) => {
3787
3766
  try {
3788
- await invoke$7('Main.handleModifiedStatusChange', uri, modified);
3767
+ await invoke$6('Main.handleModifiedStatusChange', uri, modified);
3789
3768
  } catch {
3790
3769
  // ignore
3791
3770
  }
@@ -3822,7 +3801,7 @@ const measureTextWidthFast = async (text, charWidth) => {
3822
3801
  };
3823
3802
 
3824
3803
  const measureTextWidthSlow = async (text, fontWeight, fontSize, fontFamily, letterSpacing, isMonoSpaceFont, charWidth) => {
3825
- const width = await invoke$c('TextMeasurement.measureTextWidth', text, fontWeight, fontSize, fontFamily, letterSpacing, isMonoSpaceFont, charWidth);
3804
+ const width = await invoke$b('TextMeasurement.measureTextWidth', text, fontWeight, fontSize, fontFamily, letterSpacing, isMonoSpaceFont, charWidth);
3826
3805
  return width;
3827
3806
  };
3828
3807
 
@@ -4259,7 +4238,7 @@ const scheduleDocumentAndCursorsSelections = async (editor, changes, selectionCh
4259
4238
  ...newEditor,
4260
4239
  decorations: linkDecorations
4261
4240
  };
4262
- set$9(editor.uid, editor, newEditorWithDecorations);
4241
+ set$8(editor.uid, editor, newEditorWithDecorations);
4263
4242
 
4264
4243
  // Notify main-area-worker about modified status change
4265
4244
  if (!editor.modified) {
@@ -4453,15 +4432,6 @@ const emptyEditor = {
4453
4432
  y: 0
4454
4433
  };
4455
4434
 
4456
- const HoverExecute = 'ExtensionHostHover.execute';
4457
- const TabCompletionExecuteTabCompletionProvider = 'ExtensionHost.executeTabCompletionProvider';
4458
- const TextDocumentSyncFull = 'ExtensionHostTextDocument.syncFull';
4459
-
4460
- const {
4461
- invoke: invoke$6,
4462
- set: set$3
4463
- } = ExtensionHost;
4464
-
4465
4435
  const getFileExtensionIndex = file => {
4466
4436
  string(file);
4467
4437
  return file.lastIndexOf(Dot);
@@ -4687,15 +4657,10 @@ const createEditor = async ({
4687
4657
  focused: true,
4688
4658
  textInfos
4689
4659
  };
4690
- set$9(id, emptyEditor, newEditor4);
4691
-
4692
- // TODO only sync when needed
4693
- // e.g. it might not always be necessary to send text to extension host worker
4694
- // @ts-ignore
4695
- await invoke$6(TextDocumentSyncFull, uri, id, languageId, content);
4660
+ set$8(id, emptyEditor, newEditor4);
4696
4661
  const completionsOnTypeRaw = await get$3('editor.completionsOnType');
4697
4662
  const completionsOnType = Boolean(completionsOnTypeRaw);
4698
- set$9(id, emptyEditor, {
4663
+ set$8(id, emptyEditor, {
4699
4664
  ...newEditor4,
4700
4665
  completionsOnType
4701
4666
  });
@@ -4726,7 +4691,7 @@ const createStandaloneEditor = async ({
4726
4691
  const createdEditor = get$8(id).newState;
4727
4692
  await loadTokenizer(languageId, tokenizePath);
4728
4693
  const tokenizerId = createdEditor.tokenizerId + 1;
4729
- set$4(tokenizerId, getTokenizer(languageId));
4694
+ set$3(tokenizerId, getTokenizer(languageId));
4730
4695
  const configuredEditor = {
4731
4696
  ...createdEditor,
4732
4697
  charWidth,
@@ -4768,7 +4733,7 @@ const createStandaloneEditor = async ({
4768
4733
  cursorInfos,
4769
4734
  selectionInfos
4770
4735
  };
4771
- set$9(id, createdEditor, finalEditor);
4736
+ set$8(id, createdEditor, finalEditor);
4772
4737
  };
4773
4738
 
4774
4739
  const isEqual$4 = (oldState, newState) => {
@@ -4913,7 +4878,7 @@ const disposeEditor = async editorUid => {
4913
4878
  }
4914
4879
  for (const widget of editor.widgets) {
4915
4880
  if (widget.id === ColorPicker$1) {
4916
- await invoke$9('ColorPicker.dispose', widget.newState.uid);
4881
+ await invoke$8('ColorPicker.dispose', widget.newState.uid);
4917
4882
  }
4918
4883
  }
4919
4884
  const commands = renderWidgets$1(editor, {
@@ -5104,7 +5069,7 @@ const applyWorkspaceEdit = async (editor, changes) => {
5104
5069
  }
5105
5070
  const text = await readFile(uri);
5106
5071
  const newText = applyEditsToText(text, edits);
5107
- await invoke$7('FileSystem.writeFile', uri, newText);
5072
+ await invoke$6('FileSystem.writeFile', uri, newText);
5108
5073
  }
5109
5074
  return currentEditor;
5110
5075
  };
@@ -5129,8 +5094,8 @@ const closeWidgetsMaybe = widgets => {
5129
5094
  };
5130
5095
 
5131
5096
  const logError = async (error, prefix) => {
5132
- const prettyError = await invoke$g('Errors.prepare', error);
5133
- await invoke$g('Errors.print', prettyError, prefix);
5097
+ const prettyError = await invoke$e('Errors.prepare', error);
5098
+ await invoke$e('Errors.print', prettyError, prefix);
5134
5099
  };
5135
5100
  const logFallback = (error, prefix) => {
5136
5101
  if (prefix) {
@@ -5155,7 +5120,7 @@ const getFormattingEdits = async editor => {
5155
5120
  text: getText$1(editor),
5156
5121
  uri: editor.uri
5157
5122
  };
5158
- return invoke$e('Extensions.executeFormattingProvider', textDocument);
5123
+ return invoke$d('Extensions.executeFormattingProvider', textDocument);
5159
5124
  };
5160
5125
 
5161
5126
  const expectedErrorMessage$1 = 'Failed to execute formatting provider: FormattingError:';
@@ -5416,7 +5381,7 @@ const isUntitledFile = uri => {
5416
5381
  };
5417
5382
 
5418
5383
  const saveNormalFile = async (uri, content) => {
5419
- await invoke$b('FileSystem.writeFile', uri, content);
5384
+ await invoke$a('FileSystem.writeFile', uri, content);
5420
5385
  };
5421
5386
 
5422
5387
  const showFilePicker = async platform => {
@@ -5424,7 +5389,7 @@ const showFilePicker = async platform => {
5424
5389
  const {
5425
5390
  canceled,
5426
5391
  filePath
5427
- } = await invoke$d('Open.showSaveDialog', dialogTitle, [], platform);
5392
+ } = await invoke$c('Open.showSaveDialog', dialogTitle, [], platform);
5428
5393
  if (canceled) {
5429
5394
  return '';
5430
5395
  }
@@ -5436,9 +5401,9 @@ const saveUntitledFile = async (uri, content, platform) => {
5436
5401
  if (!filePath) {
5437
5402
  return;
5438
5403
  }
5439
- await invoke$b('FileSystem.writeFile', filePath, content);
5404
+ await invoke$a('FileSystem.writeFile', filePath, content);
5440
5405
  await handleWorkspaceRefresh();
5441
- await invoke$b('Main.handleUriChange', uri, filePath);
5406
+ await invoke$a('Main.handleUriChange', uri, filePath);
5442
5407
  return filePath;
5443
5408
  };
5444
5409
 
@@ -5448,7 +5413,7 @@ const isPermissionDeniedError = error => {
5448
5413
  };
5449
5414
  const showSaveErrorDialog = async error => {
5450
5415
  if (isPermissionDeniedError(error)) {
5451
- await invoke$h('ElectronDialog.showMessageBox', {
5416
+ await invoke$f('ElectronDialog.showMessageBox', {
5452
5417
  buttons: ['OK'],
5453
5418
  defaultId: 0,
5454
5419
  message: "You don't have permission to save changes to this file.",
@@ -5457,7 +5422,7 @@ const showSaveErrorDialog = async error => {
5457
5422
  });
5458
5423
  return;
5459
5424
  }
5460
- await invoke$h('ElectronDialog.showMessageBox', {
5425
+ await invoke$f('ElectronDialog.showMessageBox', {
5461
5426
  buttons: ['OK'],
5462
5427
  defaultId: 0,
5463
5428
  detail: error.message,
@@ -5534,6 +5499,27 @@ const handleBlur$1 = async editor => {
5534
5499
  return save(newEditor);
5535
5500
  };
5536
5501
 
5502
+ const getTextDocument$3 = editor => ({
5503
+ documentId: editor.id || editor.uid,
5504
+ languageId: editor.languageId,
5505
+ text: getText$1(editor),
5506
+ uri: editor.uri
5507
+ });
5508
+ const execute = async ({
5509
+ args,
5510
+ editor,
5511
+ kind,
5512
+ method,
5513
+ noProviderFoundResult = undefined
5514
+ }) => {
5515
+ const textDocument = getTextDocument$3(editor);
5516
+ const result = await invoke$d('Extensions.executeLanguageProvider', kind, method, textDocument, ...args);
5517
+ if (!result.found) {
5518
+ return noProviderFoundResult;
5519
+ }
5520
+ return result.result;
5521
+ };
5522
+
5537
5523
  const replaceRange = (editor, ranges, replacement, origin) => {
5538
5524
  const changes = [];
5539
5525
  const columnDeltas = new Map();
@@ -5604,8 +5590,12 @@ const getMatchingClosingBrace$1 = brace => {
5604
5590
  const braceCompletion = async (editor, text) => {
5605
5591
  try {
5606
5592
  const offset = getCursorOffset(editor);
5607
- // @ts-ignore
5608
- const result = await invoke$b('ExtensionHostBraceCompletion.executeBraceCompletionProvider', editor, offset, text);
5593
+ const result = await execute({
5594
+ args: [offset, text],
5595
+ editor,
5596
+ kind: 'brace completion',
5597
+ method: 'provideBraceCompletion'
5598
+ });
5609
5599
  if (result) {
5610
5600
  const closingBrace = getMatchingClosingBrace$1(text);
5611
5601
  const insertText = text + closingBrace;
@@ -6758,7 +6748,7 @@ const deleteWordRight = editor => {
6758
6748
 
6759
6749
  const findAllReferences$1 = async editor => {
6760
6750
  // @ts-ignore
6761
- await invoke$b('SideBar.show', 'References', /* focus */true);
6751
+ await invoke$a('SideBar.show', 'References', /* focus */true);
6762
6752
  return editor;
6763
6753
  };
6764
6754
 
@@ -6840,9 +6830,12 @@ const getWordBefore = (editor, rowIndex, columnIndex) => {
6840
6830
 
6841
6831
  // @ts-ignore
6842
6832
  const getDefinition = async (editor, offset) => {
6843
- // @ts-ignore
6844
- const definition = await invoke$b('ExtensionHostDefinition.executeDefinitionProvider', editor, offset);
6845
- return definition;
6833
+ return execute({
6834
+ args: [offset],
6835
+ editor,
6836
+ kind: 'definition',
6837
+ method: 'provideDefinition'
6838
+ });
6846
6839
  };
6847
6840
 
6848
6841
  const emptyObject = {};
@@ -7130,9 +7123,12 @@ const getNoLocationFoundMessage = info => {
7130
7123
  };
7131
7124
 
7132
7125
  const getTypeDefinition = async (editor, offset) => {
7133
- // @ts-ignore
7134
- const definition = await invoke$b('ExtensionHostTypeDefinition.executeTypeDefinitionProvider', editor, offset);
7135
- return definition;
7126
+ return execute({
7127
+ args: [offset],
7128
+ editor,
7129
+ kind: 'type definition',
7130
+ method: 'provideTypeDefinition'
7131
+ });
7136
7132
  };
7137
7133
 
7138
7134
  const getLocation = async (editor, rowIndex, columnIndex) => {
@@ -7582,26 +7578,6 @@ const create$5 = () => {
7582
7578
  return widget;
7583
7579
  };
7584
7580
 
7585
- const OnDiagnostic = 'onDiagnostic';
7586
- const OnHover = 'onHover';
7587
- const OnTabCompletion = 'onTabCompletion';
7588
-
7589
- const execute = async ({
7590
- args,
7591
- assetDir,
7592
- editor,
7593
- event,
7594
- method,
7595
- noProviderFoundMessage,
7596
- noProviderFoundResult = undefined,
7597
- platform
7598
- }) => {
7599
- const fullEvent = `${event}:${editor.languageId}`;
7600
- await activateByEvent(fullEvent, assetDir, platform);
7601
- const result = await invoke$6(method, editor.uid, ...args);
7602
- return result;
7603
- };
7604
-
7605
7581
  const getTextDocument$2 = editor => {
7606
7582
  return {
7607
7583
  documentId: editor.id || editor.uid,
@@ -7612,22 +7588,12 @@ const getTextDocument$2 = editor => {
7612
7588
  };
7613
7589
  const executeIsolatedHoverProvider = async (editor, offset) => {
7614
7590
  const textDocument = getTextDocument$2(editor);
7615
- return invoke$e('Extensions.executeHoverProvider', textDocument, offset);
7591
+ return invoke$d('Extensions.executeHoverProvider', textDocument, offset);
7616
7592
  };
7617
7593
  const executeHoverProvider = async (editor, offset) => {
7618
7594
  object(editor);
7619
7595
  number(offset);
7620
- const isolatedHover = await executeIsolatedHoverProvider(editor, offset);
7621
- if (isolatedHover) {
7622
- return isolatedHover;
7623
- }
7624
- return execute({
7625
- args: [offset],
7626
- editor,
7627
- event: OnHover,
7628
- method: HoverExecute,
7629
- noProviderFoundMessage: 'No hover provider found'
7630
- });
7596
+ return executeIsolatedHoverProvider(editor, offset);
7631
7597
  };
7632
7598
 
7633
7599
  const getHover = async (editor, offset) => {
@@ -7787,26 +7753,26 @@ const loadHoverContent = async (state, position) => {
7787
7753
  };
7788
7754
  };
7789
7755
 
7790
- const showHover2 = async (editor, position) => {
7756
+ const showHover$1 = async (editor, position) => {
7791
7757
  const newStateGenerator = async state => {
7792
7758
  return loadHoverContent(state, position);
7793
7759
  };
7794
7760
  return addWidgetToEditor(Hover, FocusEditorHover, editor, create$5, newStateGenerator);
7795
7761
  };
7796
7762
 
7797
- const showHover$1 = async (editor, position, token) => {
7763
+ const showHover = async (editor, position, token) => {
7798
7764
  const instance = get$8(editor.uid);
7799
7765
  if (!instance) {
7800
7766
  return;
7801
7767
  }
7802
7768
  const latestEditor = instance.newState;
7803
- const newEditor = await showHover2(latestEditor, position);
7769
+ const newEditor = await showHover$1(latestEditor, position);
7804
7770
  const latestInstance = get$8(editor.uid);
7805
7771
  if (latestEditor === newEditor || !latestInstance || latestInstance.newState !== latestEditor || get$1().token !== token) {
7806
7772
  return;
7807
7773
  }
7808
- set$9(editor.uid, latestInstance.oldState, newEditor);
7809
- await invoke$b('Editor.renderPending', editor.uid);
7774
+ set$8(editor.uid, latestInstance.oldState, newEditor);
7775
+ await invoke$a('Editor.renderPending', editor.uid);
7810
7776
  };
7811
7777
 
7812
7778
  // TODO several things can happen:
@@ -7829,7 +7795,7 @@ const onHoverIdle = async token => {
7829
7795
  return;
7830
7796
  }
7831
7797
  const position = await at(editor, x, y);
7832
- await showHover$1(editor, position, token);
7798
+ await showHover(editor, position, token);
7833
7799
  } catch {
7834
7800
  // Hover providers are optional and should not surface errors from an idle mouse event.
7835
7801
  }
@@ -8108,7 +8074,7 @@ const continueScrollingAndMovingSelection = async editorUid => {
8108
8074
  }
8109
8075
  };
8110
8076
  const newEditorWithDerivedState = await updateDerivedState(editor, nextEditor);
8111
- set$9(editor.uid, editor, newEditorWithDerivedState);
8077
+ set$8(editor.uid, editor, newEditorWithDerivedState);
8112
8078
  requestAnimationFrame(() => continueScrollingAndMovingSelection(editorUid));
8113
8079
  };
8114
8080
 
@@ -8381,8 +8347,6 @@ const handleTouchMove = (editor, touchEvent) => {
8381
8347
  };
8382
8348
 
8383
8349
  const handleUriChange = async (editor, newUri) => {
8384
- const content = getText$1(editor);
8385
- await invoke$6(TextDocumentSyncFull, newUri, editor.id, editor.languageId, content);
8386
8350
  return {
8387
8351
  ...editor,
8388
8352
  uri: newUri
@@ -8468,7 +8432,7 @@ const indentMore = editor => {
8468
8432
 
8469
8433
  const getLanguageConfiguration = async editor => {
8470
8434
  // @ts-ignore
8471
- return invoke$b('Languages.getLanguageConfiguration', {
8435
+ return invoke$a('Languages.getLanguageConfiguration', {
8472
8436
  languageId: editor.languageId,
8473
8437
  uri: editor.uri
8474
8438
  });
@@ -8720,7 +8684,7 @@ const launch = async () => {
8720
8684
  return;
8721
8685
  }
8722
8686
  const rpc = await launchFindWidgetWorker();
8723
- set$i(rpcId, rpc);
8687
+ set$g(rpcId, rpc);
8724
8688
  };
8725
8689
  const invoke$3 = async (method, ...params) => {
8726
8690
  const rpc = get$9(rpcId);
@@ -8781,7 +8745,7 @@ const invoke$1 = async (method, ...params) => {
8781
8745
  const getWidgetInvoke = widgetId => {
8782
8746
  switch (widgetId) {
8783
8747
  case ColorPicker$1:
8784
- return invoke$9;
8748
+ return invoke$8;
8785
8749
  case Completion:
8786
8750
  return invoke$4;
8787
8751
  case Find:
@@ -8886,7 +8850,7 @@ const createFn = (key, name, widgetId) => {
8886
8850
  widgetRevision,
8887
8851
  widgets: removeEditorWidget(latest.widgets, widgetId)
8888
8852
  };
8889
- set$9(editor.uid, latest, newEditor);
8853
+ set$8(editor.uid, latest, newEditor);
8890
8854
  return newEditor;
8891
8855
  }
8892
8856
  const newState = {
@@ -8894,7 +8858,7 @@ const createFn = (key, name, widgetId) => {
8894
8858
  commands
8895
8859
  };
8896
8860
  const newEditor = updateWidget(latest, widgetId, newState);
8897
- set$9(editor.uid, latest, newEditor);
8861
+ set$8(editor.uid, latest, newEditor);
8898
8862
  return newEditor;
8899
8863
  };
8900
8864
  return fn;
@@ -9200,13 +9164,14 @@ const openRename = async editor => {
9200
9164
  };
9201
9165
 
9202
9166
  const getOrganizeImportEdits = async editor => {
9203
- const edits = await execute({
9204
- args: [],
9205
- editor,
9206
- event: 'onLanguage',
9207
- method: 'ExtensionHostOrganizeImports.execute'
9208
- });
9209
- return edits;
9167
+ const textDocument = {
9168
+ documentId: editor.id || editor.uid,
9169
+ languageId: editor.languageId,
9170
+ text: getText$1(editor),
9171
+ uri: editor.uri
9172
+ };
9173
+ const result = await invoke$d('Extensions.executeOrganizeImportsProvider', textDocument);
9174
+ return result.found ? result.result ?? [] : [];
9210
9175
  };
9211
9176
 
9212
9177
  const organizeImports = async editor => {
@@ -9497,11 +9462,14 @@ const selectInsideString = editor => {
9497
9462
  return scheduleSelections(editor, newSelections);
9498
9463
  };
9499
9464
 
9500
- // import * as ExtensionHostSelection from '../ExtensionHost/ExtensionHostSelection.ts'
9501
-
9502
9465
  const getNewSelections = async (editor, selections) => {
9503
- // @ts-ignore
9504
- const newSelections = await invoke$b('ExtensionHostSelection.executeGrowSelection', editor, selections);
9466
+ const newSelections = await execute({
9467
+ args: [selections],
9468
+ editor,
9469
+ kind: 'selection',
9470
+ method: 'provideSelections',
9471
+ noProviderFoundResult: []
9472
+ });
9505
9473
  if (newSelections.length === 0) {
9506
9474
  return selections;
9507
9475
  }
@@ -9754,7 +9722,7 @@ const setLanguageId = async (editor, languageId, tokenizePath) => {
9754
9722
  await loadTokenizer(languageId, tokenizePath);
9755
9723
  const tokenizer = getTokenizer(languageId);
9756
9724
  const newTokenizerId = tokenizerId + 1;
9757
- set$4(newTokenizerId, tokenizer);
9725
+ set$3(newTokenizerId, tokenizer);
9758
9726
  return {
9759
9727
  ...editor,
9760
9728
  focused: true,
@@ -9793,12 +9761,6 @@ const setText = (editor, text) => {
9793
9761
  return scheduleDocumentAndCursorsSelections(editor, changes);
9794
9762
  };
9795
9763
 
9796
- const EditorHover = 'EditorHover';
9797
- const showHover = async state => {
9798
- await invoke$b('Viewlet.openWidget', EditorHover);
9799
- return state;
9800
- };
9801
-
9802
9764
  const clampIndex = (index, length) => {
9803
9765
  return Math.max(0, Math.min(index, length - 1));
9804
9766
  };
@@ -9871,7 +9833,7 @@ const executeSignatureHelpProvider = async (editor, offset) => {
9871
9833
  object(editor);
9872
9834
  number(offset);
9873
9835
  const textDocument = getTextDocument$1(editor);
9874
- return invoke$e('Extensions.executeSignatureHelpProvider', textDocument, offset);
9836
+ return invoke$d('Extensions.executeSignatureHelpProvider', textDocument, offset);
9875
9837
  };
9876
9838
 
9877
9839
  const getSignatureHelp = async (editor, offset) => {
@@ -10072,9 +10034,8 @@ const executeTabCompletionProvider = async (editor, offset) => {
10072
10034
  return execute({
10073
10035
  args: [offset],
10074
10036
  editor,
10075
- event: OnTabCompletion,
10076
- method: TabCompletionExecuteTabCompletionProvider,
10077
- noProviderFoundMessage: 'No tab completion provider found',
10037
+ kind: 'tab completion',
10038
+ method: 'provideTabCompletion',
10078
10039
  noProviderFoundResult: undefined
10079
10040
  });
10080
10041
  };
@@ -10201,18 +10162,13 @@ const tabCompletion = async editor => {
10201
10162
  };
10202
10163
 
10203
10164
  const getBlockComment = async (editor, offset) => {
10204
- const {
10205
- assetDir,
10206
- platform
10207
- } = editor;
10208
- // TODO ask extension host worker,
10209
- // execute block comment provider with
10210
- // URI, language id, offset
10211
- // and the extension returns a matching block comment or undefined
10212
10165
  try {
10213
- await activateByEvent(`onLanguage:${editor.languageId}`, assetDir, platform);
10214
- // @ts-ignore
10215
- const blockComment = await invoke$6(`ExtensionHostCommment.execute`, editor.uid, offset);
10166
+ const blockComment = await execute({
10167
+ args: [offset],
10168
+ editor,
10169
+ kind: 'comment',
10170
+ method: 'provideComment'
10171
+ });
10216
10172
  if (blockComment) {
10217
10173
  return blockComment;
10218
10174
  }
@@ -10572,8 +10528,12 @@ const typeWithAutoClosingQuote = (editor, text) => {
10572
10528
 
10573
10529
  const typeWithAutoClosingTag = async (editor, text) => {
10574
10530
  const offset = offsetAt(editor, editor.selections[0], editor.selections[1]);
10575
- // @ts-ignore
10576
- const result = await invoke$b('ExtensionHostClosingTagCompletion.executeClosingTagProvider', editor, offset, text);
10531
+ const result = await execute({
10532
+ args: [offset, text],
10533
+ editor,
10534
+ kind: 'closing tag',
10535
+ method: 'provideClosingTag'
10536
+ });
10577
10537
  if (!result) {
10578
10538
  const changes = editorReplaceSelections(editor, [text], EditorType);
10579
10539
  return scheduleDocumentAndCursorsSelections(editor, changes);
@@ -11252,13 +11212,8 @@ const getEditorSourceActions = async editorId => {
11252
11212
  const {
11253
11213
  newState
11254
11214
  } = get$8(editorId);
11255
- const offset = getOffsetAtCursor$1(newState);
11256
- return execute({
11257
- args: [offset],
11258
- editor: newState,
11259
- event: 'onLanguage',
11260
- method: 'ExtensionHostCodeActions.getSourceActions'
11261
- });
11215
+ const extensions = await invoke$d('Extensions.getAllExtensions', newState.assetDir, newState.platform);
11216
+ return extensions.flatMap(extension => extension.codeActions || []).filter(action => action.languageId === newState.languageId);
11262
11217
  };
11263
11218
 
11264
11219
  /* eslint-disable sonarjs/super-linear-regex */
@@ -11281,14 +11236,14 @@ const getWordAtOffset = editor => {
11281
11236
  };
11282
11237
 
11283
11238
  const setFocus = async focusKey => {
11284
- await invoke$b('Focus.setFocus', focusKey);
11239
+ await invoke$a('Focus.setFocus', focusKey);
11285
11240
  };
11286
11241
  const unsetAdditionalFocus = async focusKey => {
11287
11242
  if (!focusKey) {
11288
11243
  return;
11289
11244
  }
11290
11245
  // @ts-ignore
11291
- await invoke$b('Focus.removeAdditionalFocus', focusKey);
11246
+ await invoke$a('Focus.removeAdditionalFocus', focusKey);
11292
11247
  };
11293
11248
 
11294
11249
  const FocusEditor = 12;
@@ -11360,7 +11315,7 @@ const setSelections2 = async (editorUid, selections) => {
11360
11315
  selections
11361
11316
  };
11362
11317
  const newEditorWithDerivedState = await updateDerivedState(editor, newEditor);
11363
- set$9(editorUid, editor, newEditorWithDerivedState);
11318
+ set$8(editorUid, editor, newEditorWithDerivedState);
11364
11319
  };
11365
11320
  const closeWidget2 = async (editorUid, widgetId, widgetName, unsetAdditionalFocus$1) => {
11366
11321
  const editor = getEditor(editorUid);
@@ -11383,7 +11338,7 @@ const closeWidget2 = async (editorUid, widgetId, widgetName, unsetAdditionalFocu
11383
11338
  widgets: newWidgets
11384
11339
  };
11385
11340
  const newEditorWithDerivedState = await updateDerivedState(editor, newEditor);
11386
- set$9(editorUid, editor, newEditorWithDerivedState);
11341
+ set$8(editorUid, editor, newEditorWithDerivedState);
11387
11342
  await setFocus(FocusEditorText);
11388
11343
  if (unsetAdditionalFocus$1) {
11389
11344
  await unsetAdditionalFocus(unsetAdditionalFocus$1);
@@ -11396,7 +11351,7 @@ const applyEdits2 = async (editorUid, edits) => {
11396
11351
  const editor = getEditor(editorUid);
11397
11352
  const newEditor = await applyEdit(editor, edits);
11398
11353
  const newEditorWithDerivedState = await updateDerivedState(editor, newEditor);
11399
- set$9(editorUid, editor, newEditorWithDerivedState);
11354
+ set$8(editorUid, editor, newEditorWithDerivedState);
11400
11355
  };
11401
11356
  const getSourceActions = async editorUid => {
11402
11357
  const actions = await getEditorSourceActions(editorUid);
@@ -11411,7 +11366,7 @@ const getDiagnostics$1 = async editorUid => {
11411
11366
  };
11412
11367
 
11413
11368
  const ensure = async (fontName, fontUrl) => {
11414
- await invoke$c('TextMeasurement.ensureFont', fontName, fontUrl);
11369
+ await invoke$b('TextMeasurement.ensureFont', fontName, fontUrl);
11415
11370
  };
11416
11371
 
11417
11372
  const getKeyBindings = () => {
@@ -11768,7 +11723,7 @@ const getKeyBindings = () => {
11768
11723
  key: CtrlCmd | KeyA,
11769
11724
  when: FocusEditorText
11770
11725
  }, {
11771
- command: 'Editor.showHover2',
11726
+ command: 'Editor.showHover',
11772
11727
  key: CtrlCmd | KeyH,
11773
11728
  when: FocusEditorText
11774
11729
  }, {
@@ -12029,7 +11984,7 @@ const handleMessagePort = async (port, rpcId) => {
12029
11984
  messagePort: port
12030
11985
  });
12031
11986
  if (rpcId) {
12032
- set$i(rpcId, rpc);
11987
+ set$g(rpcId, rpc);
12033
11988
  }
12034
11989
  };
12035
11990
 
@@ -12283,12 +12238,12 @@ const hotReload = async () => {
12283
12238
  await relaunchWorkers();
12284
12239
  const newEditors = await restoreWidgetState(keys, savedStates);
12285
12240
  for (const editor of newEditors) {
12286
- set$9(editor.newState.uid, editor.oldState, editor.newState);
12241
+ set$8(editor.newState.uid, editor.oldState, editor.newState);
12287
12242
  }
12288
12243
 
12289
12244
  // TODO ask renderer worker to rerender all editors
12290
12245
  // @ts-ignore
12291
- await invoke$b(`Editor.rerender`);
12246
+ await invoke$a(`Editor.rerender`);
12292
12247
  } finally {
12293
12248
  state.isReloading = false;
12294
12249
  }
@@ -12321,7 +12276,7 @@ const initializeSyntaxHighlighting = async (syntaxHighlightingEnabled, syncIncre
12321
12276
  if (syntaxHighlightingEnabled) {
12322
12277
  setEnabled$1(true);
12323
12278
  const syntaxRpc = await createSyntaxHighlightingWorkerRpc();
12324
- set$7(syntaxRpc);
12279
+ set$6(syntaxRpc);
12325
12280
  }
12326
12281
  if (syncIncremental) {
12327
12282
  setEnabled(true);
@@ -12391,7 +12346,7 @@ const loadContent = async (state, savedState) => {
12391
12346
  await loadTokenizer(computedLanguageId, tokenizePath);
12392
12347
  const tokenizer = getTokenizer(computedLanguageId);
12393
12348
  const newTokenizerId = state.tokenizerId + 1;
12394
- set$4(newTokenizerId, tokenizer);
12349
+ set$3(newTokenizerId, tokenizer);
12395
12350
  const newEditor0 = {
12396
12351
  ...state,
12397
12352
  charWidth,
@@ -12462,11 +12417,6 @@ const loadContent = async (state, savedState) => {
12462
12417
  focused: true,
12463
12418
  textInfos
12464
12419
  };
12465
-
12466
- // TODO only sync when needed
12467
- // e.g. it might not always be necessary to send text to extension host worker
12468
- // @ts-ignore
12469
- await invoke$6(TextDocumentSyncFull, uri, id, computedLanguageId, content);
12470
12420
  const completionsOnTypeRaw = await get$3('editor.completionsOnType');
12471
12421
  const completionsOnType = Boolean(completionsOnTypeRaw);
12472
12422
  const newEditor5 = {
@@ -13292,7 +13242,7 @@ const render2 = (uid, diffResult) => {
13292
13242
  newState,
13293
13243
  oldState
13294
13244
  } = get$8(uid);
13295
- set$9(uid, newState, newState);
13245
+ set$8(uid, newState, newState);
13296
13246
  const commands = applyRender(oldState, newState, diffResult);
13297
13247
  return commands;
13298
13248
  };
@@ -13389,7 +13339,7 @@ const renderEditor = async id => {
13389
13339
  oldState
13390
13340
  } = instance;
13391
13341
  const commands = [];
13392
- set$9(id, newState, newState);
13342
+ set$8(id, newState, newState);
13393
13343
  for (const item of render$7) {
13394
13344
  if (item.isEqual(oldState, newState)) {
13395
13345
  continue;
@@ -13493,13 +13443,12 @@ const saveState = (state, savedState) => {
13493
13443
  };
13494
13444
  };
13495
13445
 
13496
- const sendMessagePortToExtensionHostWorker2 = async (port, initialCommand, rpcId) => {
13497
- await sendMessagePortToExtensionHostWorker(port, rpcId);
13498
- };
13499
-
13500
13446
  const sendMessagePortToExtensionManagementWorker = async (port, rpcId) => {
13501
13447
  await sendMessagePortToExtensionManagementWorker$1(port, rpcId);
13502
13448
  };
13449
+ const sendDeprecatedExtensionHostPortToExtensionManagementWorker = async (port, _initialCommand, rpcId) => {
13450
+ await sendMessagePortToExtensionManagementWorker$1(port, rpcId);
13451
+ };
13503
13452
 
13504
13453
  const setDebugEnabled = (state, enabled) => {
13505
13454
  return state;
@@ -13545,9 +13494,9 @@ const updateDebugInfo = async debugId => {
13545
13494
  ...newState,
13546
13495
  highlightedLine: newInfo.rowIndex
13547
13496
  };
13548
- set$9(key, oldState, newEditor);
13497
+ set$8(key, oldState, newEditor);
13549
13498
  // @ts-ignore
13550
- await invoke$b('Editor.rerender', key);
13499
+ await invoke$a('Editor.rerender', key);
13551
13500
  };
13552
13501
 
13553
13502
  const getTextDocument = editor => {
@@ -13560,26 +13509,10 @@ const getTextDocument = editor => {
13560
13509
  };
13561
13510
  const executeIsolatedDiagnosticProvider = async editor => {
13562
13511
  const textDocument = getTextDocument(editor);
13563
- return invoke$e('Extensions.executeDiagnosticProvider', textDocument);
13512
+ return invoke$d('Extensions.executeDiagnosticProvider', textDocument);
13564
13513
  };
13565
13514
  const executeDiagnosticProvider = async editor => {
13566
- const isolatedDiagnostics = await executeIsolatedDiagnosticProvider(editor);
13567
- if (isolatedDiagnostics.length > 0) {
13568
- return isolatedDiagnostics;
13569
- }
13570
- const {
13571
- assetDir,
13572
- platform
13573
- } = editor;
13574
- return execute({
13575
- args: [],
13576
- assetDir,
13577
- editor,
13578
- event: OnDiagnostic,
13579
- method: 'ExtensionHost.executeDiagnosticProvider',
13580
- noProviderFoundMessage: 'no diagnostic provider found',
13581
- platform
13582
- });
13515
+ return executeIsolatedDiagnosticProvider(editor);
13583
13516
  };
13584
13517
 
13585
13518
  const getDiagnosticType = diagnostic => {
@@ -13660,9 +13593,6 @@ const mergeLinksWithDiagnosticDecorations = (editor, diagnosticDecorations) => {
13660
13593
  };
13661
13594
 
13662
13595
  const getDiagnostics = async editor => {
13663
- const content = getText$1(editor);
13664
- // @ts-ignore
13665
- await invoke$6(TextDocumentSyncFull, editor.uri, editor.id, editor.languageId, content);
13666
13596
  return executeDiagnosticProvider(editor);
13667
13597
  };
13668
13598
  const addDiagnostics = async (editor, diagnostics) => {
@@ -13694,7 +13624,7 @@ const updateDiagnostics = async editor => {
13694
13624
  return editor;
13695
13625
  }
13696
13626
  const newEditor = await addDiagnostics(latest.newState, diagnostics);
13697
- set$9(editor.id, latest.oldState, newEditor);
13627
+ set$8(editor.id, latest.oldState, newEditor);
13698
13628
  return newEditor;
13699
13629
  } catch (error) {
13700
13630
  return handleError(error, editor);
@@ -13735,14 +13665,14 @@ const wrapCommand = fn => async (uid, ...args) => {
13735
13665
  return newEditor;
13736
13666
  }
13737
13667
  const newEditorWithDerivedState = await updateDerivedState(state, newEditor);
13738
- set$9(uid, state, newEditorWithDerivedState);
13668
+ set$8(uid, state, newEditorWithDerivedState);
13739
13669
  let finalEditor = newEditorWithDerivedState;
13740
13670
  if (editorDiagnosticEffect.isActive(state, newEditorWithDerivedState)) {
13741
13671
  finalEditor = await editorDiagnosticEffect.apply(newEditorWithDerivedState);
13742
13672
  if (!get$8(uid)) {
13743
13673
  return finalEditor;
13744
13674
  }
13745
- set$9(uid, state, finalEditor);
13675
+ set$8(uid, state, finalEditor);
13746
13676
  }
13747
13677
  const {
13748
13678
  initial,
@@ -13772,7 +13702,7 @@ const wrapCommand = fn => async (uid, ...args) => {
13772
13702
  undoStack: finalEditor.undoStack,
13773
13703
  visualDecorations: finalEditor.visualDecorations
13774
13704
  });
13775
- set$9(otherUid, instance.oldState, synchronizedEditor);
13705
+ set$8(otherUid, instance.oldState, synchronizedEditor);
13776
13706
  }
13777
13707
  }
13778
13708
  return finalEditor;
@@ -13963,8 +13893,8 @@ const commandMap = {
13963
13893
  'Editor.setSelections': wrapCommand(setSelections),
13964
13894
  'Editor.setSelections2': setSelections2,
13965
13895
  'Editor.setText': wrapCommand(setText),
13966
- 'Editor.showHover': showHover,
13967
- 'Editor.showHover2': wrapCommand(showHover2),
13896
+ 'Editor.showHover': wrapCommand(showHover$1),
13897
+ 'Editor.showHover2': wrapCommand(showHover$1),
13968
13898
  'Editor.showSignatureHelp': wrapCommand(showSignatureHelp),
13969
13899
  'Editor.showSourceActions': wrapCommand(showSourceActions),
13970
13900
  'Editor.showSourceActions2': wrapCommand(showSourceActions),
@@ -14014,7 +13944,6 @@ const commandMap = {
14014
13944
  'EditorSourceAction.selectItem': selectItem,
14015
13945
  'EditorSourceAction.toggleDetails': toggleDetails,
14016
13946
  'EditorSourceActions.focusNext': focusNext$1,
14017
- 'ExtensionHostManagement.activateByEvent': activateByEvent,
14018
13947
  'FindWidget.close': close$4,
14019
13948
  'FindWidget.focusCloseButton': focusCloseButton,
14020
13949
  'FindWidget.focusFind': focusFind,
@@ -14055,7 +13984,7 @@ const commandMap = {
14055
13984
  'Listener.register': registerListener,
14056
13985
  'Listener.registerListener': registerListener$1,
14057
13986
  'Listener.unregister': unregisterListener,
14058
- 'SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker': sendMessagePortToExtensionHostWorker2,
13987
+ 'SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker': sendDeprecatedExtensionHostPortToExtensionManagementWorker,
14059
13988
  'SendMessagePortToExtensionManagementWorker.sendMessagePortToExtensionManagementWorker': sendMessagePortToExtensionManagementWorker
14060
13989
  };
14061
13990
  for (const [key, value] of Object.entries(commandMap)) {
@@ -14072,23 +14001,7 @@ const initializeErrorWorker = async () => {
14072
14001
  return sendMessagePortToErrorWorker(port, EditorWorker);
14073
14002
  }
14074
14003
  });
14075
- set$g(rpc);
14076
- };
14077
-
14078
- const createExtensionHostRpc = async () => {
14079
- const initialCommand = 'HandleMessagePort.handleMessagePort2';
14080
- const rpc = await create$d({
14081
- commandMap: {},
14082
- async send(port) {
14083
- await sendMessagePortToExtensionHostWorker2(port, initialCommand, EditorWorker);
14084
- }
14085
- });
14086
- return rpc;
14087
- };
14088
-
14089
- const initializeExtensionHost = async () => {
14090
- const extensionHostRpc = await createExtensionHostRpc();
14091
- set$3(extensionHostRpc);
14004
+ set$e(rpc);
14092
14005
  };
14093
14006
 
14094
14007
  const createExtensionManagementWorkerRpc = async () => {
@@ -14104,7 +14017,7 @@ const createExtensionManagementWorkerRpc = async () => {
14104
14017
  const initializeExtensionManagementWorker = async () => {
14105
14018
  try {
14106
14019
  const rpc = await createExtensionManagementWorkerRpc();
14107
- set$e(rpc);
14020
+ set$d(rpc);
14108
14021
  } catch {
14109
14022
  // ignore
14110
14023
  }
@@ -14119,14 +14032,14 @@ const initializeOpenerWorker = async () => {
14119
14032
  commandMap: {},
14120
14033
  send: send$1
14121
14034
  });
14122
- set$d(rpc);
14035
+ set$c(rpc);
14123
14036
  };
14124
14037
 
14125
14038
  const initializeRendererWorker = async () => {
14126
14039
  const rpc = await create$b({
14127
14040
  commandMap: commandMap
14128
14041
  });
14129
- set$b(rpc);
14042
+ set$a(rpc);
14130
14043
  };
14131
14044
 
14132
14045
  const send = port => {
@@ -14137,17 +14050,17 @@ const initializeTextMeasurementWorker = async () => {
14137
14050
  commandMap: {},
14138
14051
  send
14139
14052
  });
14140
- set$c(rpc);
14053
+ set$b(rpc);
14141
14054
  };
14142
14055
 
14143
14056
  const listen = async () => {
14144
14057
  registerCommands(commandMap);
14145
- await Promise.all([initializeRendererWorker(), initializeErrorWorker(), initializeExtensionHost(), initializeExtensionManagementWorker(), initializeTextMeasurementWorker(), initializeOpenerWorker()]);
14058
+ await Promise.all([initializeRendererWorker(), initializeErrorWorker(), initializeExtensionManagementWorker(), initializeTextMeasurementWorker(), initializeOpenerWorker()]);
14146
14059
  const dialogRpc = await create$d({
14147
14060
  commandMap: {},
14148
14061
  send: sendMessagePortToDialogWorker
14149
14062
  });
14150
- set$h(dialogRpc);
14063
+ set$f(dialogRpc);
14151
14064
  };
14152
14065
 
14153
14066
  const CodeGeneratorInput = 'CodeGeneratorInput';
@@ -14467,15 +14380,15 @@ const EditorMessageWidget = {
14467
14380
  };
14468
14381
 
14469
14382
  const registerWidgets = () => {
14470
- set$8(ColorPicker$1, EditorColorPickerWidget);
14471
- set$8(Completion, EditorCompletionWidget);
14472
- set$8(CompletionDetail, EditorCompletionDetailWidget);
14473
- set$8(Find, EditorFindWidget);
14474
- set$8(Hover, EditorHoverWidget);
14475
- set$8(Message, EditorMessageWidget);
14476
- set$8(Rename$1, EditorRenameWidget);
14477
- set$8(SourceAction$1, EditorSourceActionWidget);
14478
- set$8(CodeGenerator, EditorCodeGeneratorWidget);
14383
+ set$7(ColorPicker$1, EditorColorPickerWidget);
14384
+ set$7(Completion, EditorCompletionWidget);
14385
+ set$7(CompletionDetail, EditorCompletionDetailWidget);
14386
+ set$7(Find, EditorFindWidget);
14387
+ set$7(Hover, EditorHoverWidget);
14388
+ set$7(Message, EditorMessageWidget);
14389
+ set$7(Rename$1, EditorRenameWidget);
14390
+ set$7(SourceAction$1, EditorSourceActionWidget);
14391
+ set$7(CodeGenerator, EditorCodeGeneratorWidget);
14479
14392
  };
14480
14393
 
14481
14394
  const handleUnhandledRejection = event => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/editor-worker",
3
- "version": "19.29.0",
3
+ "version": "19.29.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git@github.com:lvce-editor/editor-worker.git"