@lvce-editor/editor-worker 19.29.2 → 19.29.4

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.
@@ -1440,7 +1440,7 @@ const ExtensionManagementWorker = 9006;
1440
1440
  const IconThemeWorker = 7009;
1441
1441
  const MarkdownWorker = 300;
1442
1442
  const OpenerWorker = 4561;
1443
- const RendererWorker$1 = 1;
1443
+ const RendererWorker = 1;
1444
1444
 
1445
1445
  const FocusSelector$1 = 'Viewlet.focusSelector';
1446
1446
  const SetCss$1 = 'Viewlet.setCss';
@@ -1557,7 +1557,7 @@ const {
1557
1557
  invoke: invoke$a,
1558
1558
  invokeAndTransfer,
1559
1559
  set: set$a
1560
- } = create$a(RendererWorker$1);
1560
+ } = create$a(RendererWorker);
1561
1561
  const showContextMenu2 = async (uid, menuId, x, y, args) => {
1562
1562
  number(uid);
1563
1563
  number(menuId);
@@ -1611,26 +1611,6 @@ const sendMessagePortToSyntaxHighlightingWorker$1 = async port => {
1611
1611
  await invokeAndTransfer('SendMessagePortToSyntaxHighlightingWorker.sendMessagePortToSyntaxHighlightingWorker', port, 'HandleMessagePort.handleMessagePort2');
1612
1612
  };
1613
1613
 
1614
- const RendererWorker = {
1615
- __proto__: null,
1616
- getPreference,
1617
- handleWorkspaceRefresh,
1618
- invoke: invoke$a,
1619
- invokeAndTransfer,
1620
- openUri,
1621
- readClipBoardText,
1622
- readFile: readFile$1,
1623
- sendMessagePortToDialogWorker,
1624
- sendMessagePortToErrorWorker,
1625
- sendMessagePortToExtensionManagementWorker: sendMessagePortToExtensionManagementWorker$1,
1626
- sendMessagePortToOpenerWorker,
1627
- sendMessagePortToSyntaxHighlightingWorker: sendMessagePortToSyntaxHighlightingWorker$1,
1628
- sendMessagePortToTextMeasurementWorker,
1629
- set: set$a,
1630
- showContextMenu2,
1631
- writeClipBoardText
1632
- };
1633
-
1634
1614
  const {
1635
1615
  invoke: invoke$9,
1636
1616
  set: set$9
@@ -1903,9 +1883,9 @@ const codeGeneratorAccept = state => {
1903
1883
 
1904
1884
  const ModuleWorkerAndWorkaroundForChromeDevtoolsBug = 6;
1905
1885
 
1906
- const launchWorker = async (name, url, intializeCommand) => {
1886
+ const launchWorker = async (name, url, intializeCommand, commandMap = {}) => {
1907
1887
  const rpc = await create$e({
1908
- commandMap: {},
1888
+ commandMap,
1909
1889
  isMessagePortOpen: true,
1910
1890
  async send(port) {
1911
1891
  await invokeAndTransfer('IpcParent.create', {
@@ -1985,6 +1965,14 @@ const Empty = 0;
1985
1965
  const FindWidget = 16;
1986
1966
  const FocusEditorHover = 51;
1987
1967
  const FocusEditorRename$1 = 11;
1968
+ const FocusFindWidgetCloseButton = 48;
1969
+ const FocusFindWidgetNextMatchButton = 49;
1970
+ const FocusFindWidgetOptions = 44;
1971
+ const FocusFindWidgetPreviousMatchButton = 50;
1972
+ const FocusFindWidgetReplace$1 = 43;
1973
+ const FocusFindWidgetReplaceAllButton = 47;
1974
+ const FocusFindWidgetReplaceButton = 46;
1975
+ const FocusFindWidgetToggleReplace = 42;
1988
1976
  const SourceActions = 38;
1989
1977
  const FocusCodeGenerator = 52;
1990
1978
 
@@ -3758,9 +3746,8 @@ const splitLines = lines => {
3758
3746
  return lines.split('\n');
3759
3747
  };
3760
3748
 
3761
- const {
3762
- invoke: invoke$6,
3763
- readFile} = RendererWorker;
3749
+ const invoke$6 = (...args) => invoke$a(...args);
3750
+ const readFile = (...args) => readFile$1(...args);
3764
3751
 
3765
3752
  const notifyTabModifiedStatusChange = async (uri, modified) => {
3766
3753
  try {
@@ -4069,7 +4056,7 @@ const getSelectionFromChange = change => {
4069
4056
  start: newPosition
4070
4057
  };
4071
4058
  };
4072
- const setSelections$1 = (editor, selections) => {
4059
+ const setSelections$2 = (editor, selections) => {
4073
4060
  object(editor);
4074
4061
  const {
4075
4062
  foldingRanges = []
@@ -4187,7 +4174,7 @@ const applyAutoClosingRangesEdit = (editor, changes) => {
4187
4174
  return newAutoClosingRanges;
4188
4175
  };
4189
4176
  const scheduleSelections = (editor, selectionEdits) => {
4190
- return setSelections$1(editor, selectionEdits);
4177
+ return setSelections$2(editor, selectionEdits);
4191
4178
  };
4192
4179
  const updateLines = (editor, lines) => {
4193
4180
  const newEditor = {
@@ -4868,7 +4855,7 @@ const renderWidgets$1 = (oldState, newState) => {
4868
4855
  record(newState.uid, declaredRevision);
4869
4856
  const widgetUids = newWidgets.map(widget => widget.newState.uid);
4870
4857
  const allCommands = [...addCommands, ...changeCommands, ['Viewlet.setWidgets', newState.uid, declaredRevision, widgetUids]];
4871
- return allCommands.filter(item => item[0] !== 'Viewlet.setFocusContext' && item[0] !== 'Viewlet.appendToBody');
4858
+ return allCommands.filter(item => item[0] !== 'Viewlet.appendToBody' && (item[0] !== 'Viewlet.setFocusContext' || item.length >= 3));
4872
4859
  };
4873
4860
 
4874
4861
  const disposeEditor = async editorUid => {
@@ -4978,7 +4965,7 @@ const error = (...args) => {
4978
4965
  console.error(...args);
4979
4966
  };
4980
4967
 
4981
- const applyDocumentEdits = (editor, edits) => {
4968
+ const applyDocumentEdits$1 = (editor, edits) => {
4982
4969
  if (!Array.isArray(edits)) {
4983
4970
  warn('something is wrong with format on save', edits);
4984
4971
  return editor;
@@ -5354,7 +5341,7 @@ const expectedErrorMessage = 'Failed to execute formatting provider: FormattingE
5354
5341
  const format = async editor => {
5355
5342
  try {
5356
5343
  const edits = await getFormattingEdits(editor);
5357
- return applyDocumentEdits(editor, edits);
5344
+ return applyDocumentEdits$1(editor, edits);
5358
5345
  } catch (error) {
5359
5346
  if (isFormattingError(error)) {
5360
5347
  console.error('Formatting Error:',
@@ -5683,7 +5670,7 @@ const closeCompletion = editor => {
5683
5670
  const isMatchingWidget$1 = widget => {
5684
5671
  return widget.id === Find;
5685
5672
  };
5686
- const closeFind = editor => {
5673
+ const closeFind$1 = editor => {
5687
5674
  const {
5688
5675
  widgets
5689
5676
  } = editor;
@@ -8671,10 +8658,83 @@ const addWidget = (widget, id, render) => {
8671
8658
  return allCommands;
8672
8659
  };
8673
8660
 
8661
+ const getEditor$1 = editorUid => {
8662
+ const instance = get$8(editorUid);
8663
+ if (!instance) {
8664
+ throw new Error(`editor ${editorUid} not found`);
8665
+ }
8666
+ const {
8667
+ newState
8668
+ } = instance;
8669
+ return newState;
8670
+ };
8671
+
8672
+ const setFocus = async focusKey => {
8673
+ await invoke$a('Focus.setFocus', focusKey);
8674
+ };
8675
+ const unsetAdditionalFocus = async focusKey => {
8676
+ if (!focusKey) {
8677
+ return;
8678
+ }
8679
+ // @ts-ignore
8680
+ await invoke$a('Focus.removeAdditionalFocus', focusKey);
8681
+ };
8682
+
8683
+ const FocusEditor = 12;
8684
+ const FocusEditorCompletions = 9;
8685
+ const FocusEditorRename = 11;
8686
+ const FocusEditorText = 12;
8687
+ const FocusFindWidget = 16;
8688
+ const FocusSourceActions = 38;
8689
+ const FocusFindWidgetReplace = 43;
8690
+ const FocusEditorCodeGenerator = 52;
8691
+ const FocusColorPicker = 41;
8692
+
8693
+ const updateEditor = async (editorUid, editor, newEditor) => {
8694
+ if (newEditor === editor) {
8695
+ return;
8696
+ }
8697
+ const newEditorWithDerivedState = await updateDerivedState(editor, newEditor);
8698
+ set$8(editorUid, editor, newEditorWithDerivedState);
8699
+ };
8700
+ const applyDocumentEdits = async (editorUid, edits) => {
8701
+ const editor = getEditor$1(editorUid);
8702
+ const newEditor = await applyDocumentEdits$1(editor, edits);
8703
+ await updateEditor(editorUid, editor, newEditor);
8704
+ };
8705
+ const closeFind = async editorUid => {
8706
+ const editor = getEditor$1(editorUid);
8707
+ const newEditor = closeFind$1(editor);
8708
+ await updateEditor(editorUid, editor, newEditor);
8709
+ await setFocus(FocusEditorText);
8710
+ };
8711
+ const getLines = editorUid => {
8712
+ return getEditor$1(editorUid).lines;
8713
+ };
8714
+ const getSelections$1 = editorUid => {
8715
+ return getEditor$1(editorUid).selections;
8716
+ };
8717
+ const setSelections$1 = async (editorUid, selections) => {
8718
+ const editor = getEditor$1(editorUid);
8719
+ const newEditor = {
8720
+ ...editor,
8721
+ selections
8722
+ };
8723
+ await updateEditor(editorUid, editor, newEditor);
8724
+ };
8725
+
8726
+ const getFindWidgetWorkerCommandMap = () => ({
8727
+ 'Editor.applyDocumentEdits': applyDocumentEdits,
8728
+ 'Editor.closeFind2': closeFind,
8729
+ 'Editor.getLines2': getLines,
8730
+ 'Editor.getSelections2': getSelections$1,
8731
+ 'Editor.setSelections2': setSelections$1
8732
+ });
8733
+
8674
8734
  const launchFindWidgetWorker = async () => {
8675
8735
  const name = 'Find Widget Worker';
8676
8736
  const url = 'findWidgetWorkerMain.js';
8677
- return launchWorker(name, url);
8737
+ return launchWorker(name, url, undefined, getFindWidgetWorkerCommandMap());
8678
8738
  };
8679
8739
 
8680
8740
  const rpcId = 9002;
@@ -8799,7 +8859,7 @@ const getEditorByWidgetUid = (widgetUid, widgetId) => {
8799
8859
  }
8800
8860
  return undefined;
8801
8861
  };
8802
- const getEditor$1 = (editorOrUid, widgetId) => {
8862
+ const getEditor = (editorOrUid, widgetId) => {
8803
8863
  if (editorOrUid && editorOrUid.widgets) {
8804
8864
  return editorOrUid;
8805
8865
  }
@@ -8817,7 +8877,7 @@ const createFn = (key, name, widgetId) => {
8817
8877
  return key === 'close' || key === 'handleClickButton' && args.includes(Close);
8818
8878
  };
8819
8879
  const fn = async (editorOrUid, ...args) => {
8820
- const editor = getEditor$1(editorOrUid, widgetId);
8880
+ const editor = getEditor(editorOrUid, widgetId);
8821
8881
  if (!editor) {
8822
8882
  return editorOrUid;
8823
8883
  }
@@ -8858,7 +8918,7 @@ const createFn = (key, name, widgetId) => {
8858
8918
  commands
8859
8919
  };
8860
8920
  const newEditor = updateWidget(latest, widgetId, newState);
8861
- set$8(editor.uid, latest, newEditor);
8921
+ set$8(editor.uid, editor, newEditor);
8862
8922
  return newEditor;
8863
8923
  };
8864
8924
  return fn;
@@ -8895,10 +8955,13 @@ const render$c = widget => {
8895
8955
  const commands = renderFull$4(widget.oldState, widget.newState);
8896
8956
  const wrappedCommands = [];
8897
8957
  const {
8958
+ editorUid,
8898
8959
  uid
8899
8960
  } = widget.newState;
8900
8961
  for (const command of commands) {
8901
- if (commandsToForward$5.includes(command[0])) {
8962
+ if (command[0] === SetFocusContext) {
8963
+ wrappedCommands.push([command[0], editorUid, ...command.slice(1)]);
8964
+ } else if (commandsToForward$5.includes(command[0])) {
8902
8965
  wrappedCommands.push(command);
8903
8966
  } else {
8904
8967
  wrappedCommands.push(['Viewlet.send', uid, ...command]);
@@ -9017,22 +9080,11 @@ const create$2 = () => {
9017
9080
  return widget;
9018
9081
  };
9019
9082
 
9020
- const getEditor = editorUid => {
9021
- const instance = get$8(editorUid);
9022
- if (!instance) {
9023
- throw new Error(`editor ${editorUid} not found`);
9024
- }
9025
- const {
9026
- newState
9027
- } = instance;
9028
- return newState;
9029
- };
9030
-
9031
9083
  const loadContent$2 = async (state, parentUid) => {
9032
9084
  const {
9033
9085
  uid
9034
9086
  } = state;
9035
- const editor = getEditor(parentUid);
9087
+ const editor = getEditor$1(parentUid);
9036
9088
  const {
9037
9089
  height,
9038
9090
  width,
@@ -9176,7 +9228,7 @@ const getOrganizeImportEdits = async editor => {
9176
9228
 
9177
9229
  const organizeImports = async editor => {
9178
9230
  const edits = await getOrganizeImportEdits(editor);
9179
- return applyDocumentEdits(editor, edits);
9231
+ return applyDocumentEdits$1(editor, edits);
9180
9232
  };
9181
9233
 
9182
9234
  // @ts-ignore
@@ -11185,7 +11237,7 @@ const executeWidgetCommand = async (editor, name, method, _uid, widgetId, ...par
11185
11237
  const isWidget = widget => {
11186
11238
  return widget.id === widgetId;
11187
11239
  };
11188
- const latestEditor = getEditor(editor.uid);
11240
+ const latestEditor = getEditor$1(editor.uid);
11189
11241
  const childIndex1 = latestEditor.widgets.findIndex(isWidget);
11190
11242
  if (childIndex1 === -1) {
11191
11243
  return latestEditor;
@@ -11235,81 +11287,55 @@ const getWordAtOffset = editor => {
11235
11287
  return '';
11236
11288
  };
11237
11289
 
11238
- const setFocus = async focusKey => {
11239
- await invoke$a('Focus.setFocus', focusKey);
11240
- };
11241
- const unsetAdditionalFocus = async focusKey => {
11242
- if (!focusKey) {
11243
- return;
11244
- }
11245
- // @ts-ignore
11246
- await invoke$a('Focus.removeAdditionalFocus', focusKey);
11247
- };
11248
-
11249
- const FocusEditor = 12;
11250
- const FocusEditorCompletions = 9;
11251
- const FocusEditorRename = 11;
11252
- const FocusEditorText = 12;
11253
- const FocusFindWidget = 16;
11254
- const FocusSourceActions = 38;
11255
- const FocusFindWidgetReplace = 43;
11256
- const FocusFindWidgetReplaceButton = 46;
11257
- const FocusFindWidgetReplaceAllButton = 47;
11258
- const FocusFindWidgetCloseButton = 48;
11259
- const FocusFindWidgetNextMatchButton = 49;
11260
- const FocusFindWidgetPreviousMatchButton = 50;
11261
- const FocusEditorCodeGenerator = 52;
11262
- const FocusColorPicker = 41;
11263
-
11264
11290
  const getPositionAtCursor = editorUid => {
11265
- const editor = getEditor(editorUid);
11291
+ const editor = getEditor$1(editorUid);
11266
11292
  return getPositionAtCursor$1(editor);
11267
11293
  };
11268
11294
  const getUri = editorUid => {
11269
- const editor = getEditor(editorUid);
11295
+ const editor = getEditor$1(editorUid);
11270
11296
  return editor.uri;
11271
11297
  };
11272
11298
  const getLanguageId = editorUid => {
11273
- const editor = getEditor(editorUid);
11299
+ const editor = getEditor$1(editorUid);
11274
11300
  return editor.languageId;
11275
11301
  };
11276
11302
  const getOffsetAtCursor = editorUid => {
11277
- const editor = getEditor(editorUid);
11303
+ const editor = getEditor$1(editorUid);
11278
11304
  return getOffsetAtCursor$1(editor);
11279
11305
  };
11280
11306
  const getWordAt = (editorUid, rowIndex, columnIndex) => {
11281
- const editor = getEditor(editorUid);
11307
+ const editor = getEditor$1(editorUid);
11282
11308
  const {
11283
11309
  word
11284
11310
  } = getWordAt$1(editor, rowIndex, columnIndex);
11285
11311
  return word;
11286
11312
  };
11287
11313
  const getWordAtOffset2 = editorUid => {
11288
- const editor = getEditor(editorUid);
11314
+ const editor = getEditor$1(editorUid);
11289
11315
  const word = getWordAtOffset(editor);
11290
11316
  return word;
11291
11317
  };
11292
11318
  const getWordBefore2 = (editorUid, rowIndex, columnIndex) => {
11293
- const editor = getEditor(editorUid);
11319
+ const editor = getEditor$1(editorUid);
11294
11320
  const word = getWordBefore(editor, rowIndex, columnIndex);
11295
11321
  return word;
11296
11322
  };
11297
11323
  const getLines2 = editorUid => {
11298
- const editor = getEditor(editorUid);
11324
+ const editor = getEditor$1(editorUid);
11299
11325
  const {
11300
11326
  lines
11301
11327
  } = editor;
11302
11328
  return lines;
11303
11329
  };
11304
11330
  const getSelections2 = editorUid => {
11305
- const editor = getEditor(editorUid);
11331
+ const editor = getEditor$1(editorUid);
11306
11332
  const {
11307
11333
  selections
11308
11334
  } = editor;
11309
11335
  return selections;
11310
11336
  };
11311
11337
  const setSelections2 = async (editorUid, selections) => {
11312
- const editor = getEditor(editorUid);
11338
+ const editor = getEditor$1(editorUid);
11313
11339
  const newEditor = {
11314
11340
  ...editor,
11315
11341
  selections
@@ -11318,7 +11344,7 @@ const setSelections2 = async (editorUid, selections) => {
11318
11344
  set$8(editorUid, editor, newEditorWithDerivedState);
11319
11345
  };
11320
11346
  const closeWidget2 = async (editorUid, widgetId, widgetName, unsetAdditionalFocus$1) => {
11321
- const editor = getEditor(editorUid);
11347
+ const editor = getEditor$1(editorUid);
11322
11348
  const widgetRevision = next(editorUid);
11323
11349
  const invoke = getWidgetInvoke(widgetId);
11324
11350
  const {
@@ -11348,7 +11374,7 @@ const closeFind2 = async editorUid => {
11348
11374
  await closeWidget2(editorUid, Find, 'FindWidget', 0);
11349
11375
  };
11350
11376
  const applyEdits2 = async (editorUid, edits) => {
11351
- const editor = getEditor(editorUid);
11377
+ const editor = getEditor$1(editorUid);
11352
11378
  const newEditor = await applyEdit(editor, edits);
11353
11379
  const newEditorWithDerivedState = await updateDerivedState(editor, newEditor);
11354
11380
  set$8(editorUid, editor, newEditorWithDerivedState);
@@ -11358,7 +11384,7 @@ const getSourceActions = async editorUid => {
11358
11384
  return actions;
11359
11385
  };
11360
11386
  const getDiagnostics$1 = async editorUid => {
11361
- const editor = getEditor(editorUid);
11387
+ const editor = getEditor$1(editorUid);
11362
11388
  const {
11363
11389
  diagnostics
11364
11390
  } = editor;
@@ -11369,6 +11395,18 @@ const ensure = async (fontName, fontUrl) => {
11369
11395
  await invoke$b('TextMeasurement.ensureFont', fontName, fontUrl);
11370
11396
  };
11371
11397
 
11398
+ const findWidgetFocusContexts = [FindWidget, FocusFindWidgetReplace$1, FocusFindWidgetOptions, FocusFindWidgetToggleReplace, FocusFindWidgetPreviousMatchButton, FocusFindWidgetNextMatchButton, FocusFindWidgetCloseButton, FocusFindWidgetReplaceButton, FocusFindWidgetReplaceAllButton];
11399
+ const getFindWidgetFocusKeyBindings = () => {
11400
+ return findWidgetFocusContexts.flatMap(focusContext => [{
11401
+ command: 'FindWidget.focusNextElement',
11402
+ key: Tab$1,
11403
+ when: focusContext
11404
+ }, {
11405
+ command: 'FindWidget.focusPreviousElement',
11406
+ key: Shift | Tab$1,
11407
+ when: focusContext
11408
+ }]);
11409
+ };
11372
11410
  const getKeyBindings = () => {
11373
11411
  return [{
11374
11412
  command: 'Editor.closeColorPicker',
@@ -11398,6 +11436,10 @@ const getKeyBindings = () => {
11398
11436
  command: 'EditorSourceActions.selectCurrent',
11399
11437
  key: Enter,
11400
11438
  when: FocusSourceActions
11439
+ }, {
11440
+ command: 'FindWidget.replace',
11441
+ key: Enter,
11442
+ when: FocusFindWidgetReplace
11401
11443
  }, {
11402
11444
  command: 'FindWidget.focusNext',
11403
11445
  key: Enter,
@@ -11418,62 +11460,10 @@ const getKeyBindings = () => {
11418
11460
  command: 'FindWidget.focusNext',
11419
11461
  key: F4,
11420
11462
  when: FocusFindWidget
11421
- }, {
11422
- command: 'FindWidget.focusToggleReplace',
11423
- key: Shift | Tab$1,
11424
- when: FocusFindWidget
11425
- }, {
11426
- command: 'FindWidget.focusReplace',
11427
- key: Tab$1,
11428
- when: FocusFindWidget
11429
- }, {
11430
- command: 'FindWidget.focusPreviousMatchButton',
11431
- key: Tab$1,
11432
- when: FocusFindWidgetReplace
11433
- }, {
11463
+ }, ...getFindWidgetFocusKeyBindings(), {
11434
11464
  command: 'FindWidget.replaceAll',
11435
11465
  key: Alt$1 | CtrlCmd | Enter,
11436
11466
  when: FocusFindWidgetReplace
11437
- }, {
11438
- command: 'FindWidget.focusNextMatchButton',
11439
- key: Tab$1,
11440
- when: FocusFindWidgetPreviousMatchButton
11441
- }, {
11442
- command: 'FindWidget.focusReplace',
11443
- key: Shift | Tab$1,
11444
- when: FocusFindWidgetPreviousMatchButton
11445
- }, {
11446
- command: 'FindWidget.focusPreviousMatchButton',
11447
- key: Shift | Tab$1,
11448
- when: FocusFindWidgetNextMatchButton
11449
- }, {
11450
- command: 'FindWidget.focusCloseButton',
11451
- key: Tab$1,
11452
- when: FocusFindWidgetNextMatchButton
11453
- }, {
11454
- command: 'FindWidget.focusNextMatchButton',
11455
- key: Shift | Tab$1,
11456
- when: FocusFindWidgetCloseButton
11457
- }, {
11458
- command: 'FindWidget.focusReplaceButton',
11459
- key: Tab$1,
11460
- when: FocusFindWidgetCloseButton
11461
- }, {
11462
- command: 'FindWidget.focusFind',
11463
- key: Shift | Tab$1,
11464
- when: FocusFindWidgetReplace
11465
- }, {
11466
- command: 'FindWidget.focusReplaceAllButton',
11467
- key: Tab$1,
11468
- when: FocusFindWidgetReplaceButton
11469
- }, {
11470
- command: 'FindWidget.focusCloseButton',
11471
- key: Shift | Tab$1,
11472
- when: FocusFindWidgetReplaceButton
11473
- }, {
11474
- command: 'FindWidget.focusReplaceButton',
11475
- key: Shift | Tab$1,
11476
- when: FocusFindWidgetReplaceAllButton
11477
11467
  }, {
11478
11468
  command: 'EditorCompletion.focusNext',
11479
11469
  key: DownArrow,
@@ -11951,7 +11941,7 @@ const getQuickPickMenuEntries = () => {
11951
11941
  };
11952
11942
 
11953
11943
  const getSelections = editorUid => {
11954
- const editor = getEditor(editorUid);
11944
+ const editor = getEditor$1(editorUid);
11955
11945
  const {
11956
11946
  selections
11957
11947
  } = editor;
@@ -11960,7 +11950,7 @@ const getSelections = editorUid => {
11960
11950
 
11961
11951
  const getText = editorUid => {
11962
11952
  number(editorUid);
11963
- const editor = getEditor(editorUid);
11953
+ const editor = getEditor$1(editorUid);
11964
11954
  const {
11965
11955
  lines
11966
11956
  } = editor;
@@ -13613,6 +13603,13 @@ const handleError = async (error, editor) => {
13613
13603
  await handleError$1(error, 'Failed to update diagnostics: ');
13614
13604
  return editor;
13615
13605
  };
13606
+ const notifyDiagnosticsChange = async uri => {
13607
+ try {
13608
+ await invoke$6('Layout.handleDiagnosticsChange', uri);
13609
+ } catch {
13610
+ // Older renderer workers do not support diagnostics change listeners.
13611
+ }
13612
+ };
13616
13613
  const updateDiagnostics = async editor => {
13617
13614
  if (!editor.diagnosticsEnabled) {
13618
13615
  return editor;
@@ -13625,6 +13622,7 @@ const updateDiagnostics = async editor => {
13625
13622
  }
13626
13623
  const newEditor = await addDiagnostics(latest.newState, diagnostics);
13627
13624
  set$8(editor.id, latest.oldState, newEditor);
13625
+ await notifyDiagnosticsChange(newEditor.uri);
13628
13626
  return newEditor;
13629
13627
  } catch (error) {
13630
13628
  return handleError(error, editor);
@@ -13720,7 +13718,7 @@ const commandMap = {
13720
13718
  'ColorPicker.loadContent': loadContent$3,
13721
13719
  'Editor.addCursorAbove': wrapCommand(addCursorAbove),
13722
13720
  'Editor.addCursorBelow': wrapCommand(addCursorBelow),
13723
- 'Editor.applyDocumentEdits': wrapCommand(applyDocumentEdits),
13721
+ 'Editor.applyDocumentEdits': wrapCommand(applyDocumentEdits$1),
13724
13722
  'Editor.applyEdit': wrapCommand(applyEdit),
13725
13723
  'Editor.applyEdit2': applyEdits2,
13726
13724
  'Editor.applyWorkspaceEdit': wrapCommand(applyWorkspaceEdit),
@@ -13729,7 +13727,7 @@ const commandMap = {
13729
13727
  'Editor.closeCodeGenerator': wrapCommand(closeCodeGenerator),
13730
13728
  'Editor.closeColorPicker': wrapCommand(closeColorPicker),
13731
13729
  'Editor.closeCompletion': wrapCommand(closeCompletion),
13732
- 'Editor.closeFind': wrapCommand(closeFind),
13730
+ 'Editor.closeFind': wrapCommand(closeFind$1),
13733
13731
  'Editor.closeFind2': closeFind2,
13734
13732
  'Editor.closeRename': wrapCommand(closeRename),
13735
13733
  'Editor.closeSourceAction': wrapCommand(closeSourceAction),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/editor-worker",
3
- "version": "19.29.2",
3
+ "version": "19.29.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git@github.com:lvce-editor/editor-worker.git"