@lvce-editor/editor-worker 5.8.0 → 5.10.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.
@@ -465,14 +465,14 @@ const getSelectionPairs = (selections, i) => {
465
465
 
466
466
  const EmptyString$1 = '';
467
467
  const NewLine$4 = '\n';
468
- const Space$1 = ' ';
469
- const Tab = '\t';
468
+ const Space$2 = ' ';
469
+ const Tab$1 = '\t';
470
470
  const DoubleQuote$1 = '"';
471
471
 
472
472
  const getTabCount = string => {
473
473
  let count = 0;
474
474
  for (const element of string) {
475
- if (element === Tab) {
475
+ if (element === Tab$1) {
476
476
  count++;
477
477
  }
478
478
  }
@@ -547,12 +547,12 @@ const measureTextWidth = (text, fontWeight, fontSize, fontFamily, letterSpacing,
547
547
 
548
548
  const normalizeText = (text, normalize, tabSize) => {
549
549
  if (normalize) {
550
- return text.replaceAll(Tab, Space$1.repeat(tabSize));
550
+ return text.replaceAll(Tab$1, Space$2.repeat(tabSize));
551
551
  }
552
552
  return text;
553
553
  };
554
554
  const shouldNormalizeText = text => {
555
- return text.includes(Tab);
555
+ return text.includes(Tab$1);
556
556
  };
557
557
 
558
558
  const getX = (line, column, fontWeight, fontSize, fontFamily, isMonospaceFont, letterSpacing, tabSize, halfCursorWidth, width, averageCharWidth, difference = 0) => {
@@ -1714,13 +1714,13 @@ const EditorCompletion = 9;
1714
1714
  const Empty = 0;
1715
1715
  const FindWidget = 16;
1716
1716
  const FocusEditorHover = 51;
1717
- const FocusEditorRename = 11;
1718
- const FocusFindWidgetCloseButton = 48;
1719
- const FocusFindWidgetNextMatchButton = 49;
1720
- const FocusFindWidgetPreviousMatchButton = 50;
1721
- const FocusFindWidgetReplace = 43;
1722
- const FocusFindWidgetReplaceAllButton = 47;
1723
- const FocusFindWidgetReplaceButton = 46;
1717
+ const FocusEditorRename$1 = 11;
1718
+ const FocusFindWidgetCloseButton$1 = 48;
1719
+ const FocusFindWidgetNextMatchButton$1 = 49;
1720
+ const FocusFindWidgetPreviousMatchButton$1 = 50;
1721
+ const FocusFindWidgetReplace$1 = 43;
1722
+ const FocusFindWidgetReplaceAllButton$1 = 47;
1723
+ const FocusFindWidgetReplaceButton$1 = 46;
1724
1724
  const FocusFindWidgetToggleReplace = 42;
1725
1725
  const SourceActions = 38;
1726
1726
  const FocusCodeGenerator = 52;
@@ -1754,13 +1754,19 @@ const execute = async ({
1754
1754
  return result;
1755
1755
  };
1756
1756
 
1757
+ const combineResults$3 = results => {
1758
+ return results[0];
1759
+ };
1757
1760
  const executeDiagnosticProvider = editor => {
1758
1761
  return execute({
1759
1762
  editor,
1760
1763
  event: OnDiagnostic,
1761
1764
  method: 'ExtensionHost.executeDiagnosticProvider',
1762
1765
  args: [],
1763
- noProviderFoundMessage: 'no diagnostic provider found'});
1766
+ noProviderFoundMessage: 'no diagnostic provider found',
1767
+ noProviderResult: [],
1768
+ combineResults: combineResults$3
1769
+ });
1764
1770
  };
1765
1771
 
1766
1772
  const getDiagnosticType = diagnostic => {
@@ -2159,7 +2165,7 @@ const guessOffset = (eventX, averageCharWidth) => {
2159
2165
  const normalizeGuess = (line, guess, tabSize) => {
2160
2166
  let normalizedGuess = guess;
2161
2167
  for (let i = 0; i < guess; i++) {
2162
- if (line[i] === Tab) {
2168
+ if (line[i] === Tab$1) {
2163
2169
  normalizedGuess -= tabSize - 1;
2164
2170
  }
2165
2171
  }
@@ -2208,6 +2214,7 @@ const at = (editor, eventX, eventY) => {
2208
2214
  letterSpacing,
2209
2215
  lines,
2210
2216
  tabSize,
2217
+ differences,
2211
2218
  isMonospaceFont,
2212
2219
  charWidth
2213
2220
  } = editor;
@@ -2756,6 +2763,409 @@ const copyLineDown = editor => {
2756
2763
  return scheduleDocumentAndCursorsSelections(editor, changes);
2757
2764
  };
2758
2765
 
2766
+ const Backspace = 1;
2767
+ const Tab = 2;
2768
+ const Enter = 3;
2769
+ const Escape = 8;
2770
+ const Space$1 = 9;
2771
+ const End = 255;
2772
+ const Home = 12;
2773
+ const LeftArrow = 13;
2774
+ const UpArrow = 14;
2775
+ const RightArrow = 15;
2776
+ const DownArrow = 16;
2777
+ const Delete = 18;
2778
+ const KeyA = 29;
2779
+ const KeyC = 31;
2780
+ const KeyD = 32;
2781
+ const KeyF = 34;
2782
+ const KeyH = 36;
2783
+ const KeyJ = 38;
2784
+ const KeyK = 39;
2785
+ const KeyL = 40;
2786
+ const KeyO = 43;
2787
+ const KeyV = 50;
2788
+ const KeyX = 52;
2789
+ const KeyZ = 54;
2790
+ const F2 = 58;
2791
+ const F3 = 59;
2792
+ const F4 = 60;
2793
+ const F12 = 68;
2794
+ const Period = 87;
2795
+ const Slash$1 = 88;
2796
+ const BracketLeft = 90;
2797
+ const BracketRight = 92;
2798
+
2799
+ const CtrlCmd = 1 << 11 >>> 0;
2800
+ const Shift = 1 << 10 >>> 0;
2801
+ const Alt$1 = 1 << 9 >>> 0;
2802
+
2803
+ const FocusEditor = 12;
2804
+ const FocusEditorCompletions = 9;
2805
+ const FocusEditorRename = 11;
2806
+ const FocusEditorText = 12;
2807
+ const FocusFindWidget = 16;
2808
+ const FocusSourceActions = 38;
2809
+ const FocusFindWidgetReplace = 43;
2810
+ const FocusFindWidgetReplaceButton = 46;
2811
+ const FocusFindWidgetReplaceAllButton = 47;
2812
+ const FocusFindWidgetCloseButton = 48;
2813
+ const FocusFindWidgetNextMatchButton = 49;
2814
+ const FocusFindWidgetPreviousMatchButton = 50;
2815
+ const FocusEditorCodeGenerator = 52;
2816
+
2817
+ const getKeyBindings = () => {
2818
+ return [{
2819
+ key: Escape,
2820
+ command: 'Editor.closeSourceAction',
2821
+ when: FocusSourceActions
2822
+ }, {
2823
+ key: DownArrow,
2824
+ command: 'EditorSourceActions.focusNext',
2825
+ when: FocusSourceActions
2826
+ }, {
2827
+ key: UpArrow,
2828
+ command: 'EditorSourceActions.focusPrevious',
2829
+ when: FocusSourceActions
2830
+ }, {
2831
+ key: Home,
2832
+ command: 'EditorSourceActions.focusFirst',
2833
+ when: FocusSourceActions
2834
+ }, {
2835
+ key: End,
2836
+ command: 'EditorSourceActions.focusLast',
2837
+ when: FocusSourceActions
2838
+ }, {
2839
+ key: Enter,
2840
+ command: 'EditorSourceActions.selectCurrent',
2841
+ when: FocusSourceActions
2842
+ }, {
2843
+ key: Enter,
2844
+ command: 'FindWidget.focusNext',
2845
+ when: FocusFindWidget
2846
+ }, {
2847
+ key: Shift | F4,
2848
+ command: 'FindWidget.focusPrevious',
2849
+ when: FocusFindWidget
2850
+ }, {
2851
+ key: F4,
2852
+ command: 'FindWidget.focusNext',
2853
+ when: FocusFindWidget
2854
+ }, {
2855
+ key: Shift | Tab,
2856
+ command: 'FindWidget.focusToggleReplace',
2857
+ when: FocusFindWidget
2858
+ }, {
2859
+ key: Tab,
2860
+ command: 'FindWidget.focusReplace',
2861
+ when: FocusFindWidget
2862
+ }, {
2863
+ key: Tab,
2864
+ command: 'FindWidget.focusPreviousMatchButton',
2865
+ when: FocusFindWidgetReplace
2866
+ }, {
2867
+ key: Alt$1 | CtrlCmd | Enter,
2868
+ command: 'FindWidget.replaceAll',
2869
+ when: FocusFindWidgetReplace
2870
+ }, {
2871
+ key: Tab,
2872
+ command: 'FindWidget.focusNextMatchButton',
2873
+ when: FocusFindWidgetPreviousMatchButton
2874
+ }, {
2875
+ key: Shift | Tab,
2876
+ command: 'FindWidget.focusReplace',
2877
+ when: FocusFindWidgetPreviousMatchButton
2878
+ }, {
2879
+ key: Shift | Tab,
2880
+ command: 'FindWidget.focusPreviousMatchButton',
2881
+ when: FocusFindWidgetNextMatchButton
2882
+ }, {
2883
+ key: Tab,
2884
+ command: 'FindWidget.focusCloseButton',
2885
+ when: FocusFindWidgetNextMatchButton
2886
+ }, {
2887
+ key: Shift | Tab,
2888
+ command: 'FindWidget.focusNextMatchButton',
2889
+ when: FocusFindWidgetCloseButton
2890
+ }, {
2891
+ key: Tab,
2892
+ command: 'FindWidget.focusReplaceButton',
2893
+ when: FocusFindWidgetCloseButton
2894
+ }, {
2895
+ key: Shift | Tab,
2896
+ command: 'FindWidget.focusFind',
2897
+ when: FocusFindWidgetReplace
2898
+ }, {
2899
+ key: Tab,
2900
+ command: 'FindWidget.focusReplaceAllButton',
2901
+ when: FocusFindWidgetReplaceButton
2902
+ }, {
2903
+ key: Shift | Tab,
2904
+ command: 'FindWidget.focusCloseButton',
2905
+ when: FocusFindWidgetReplaceButton
2906
+ }, {
2907
+ key: Shift | Tab,
2908
+ command: 'FindWidget.focusReplaceButton',
2909
+ when: FocusFindWidgetReplaceAllButton
2910
+ }, {
2911
+ key: DownArrow,
2912
+ command: 'EditorCompletion.focusNext',
2913
+ when: FocusEditorCompletions
2914
+ }, {
2915
+ key: UpArrow,
2916
+ command: 'EditorCompletion.focusPrevious',
2917
+ when: FocusEditorCompletions
2918
+ }, {
2919
+ key: Enter,
2920
+ command: 'EditorCompletion.selectCurrent',
2921
+ when: FocusEditorCompletions
2922
+ }, {
2923
+ key: Escape,
2924
+ command: 'Editor.closeCompletion',
2925
+ when: FocusEditorCompletions
2926
+ }, {
2927
+ key: End,
2928
+ command: 'EditorCompletion.focusLast',
2929
+ when: FocusEditorCompletions
2930
+ }, {
2931
+ key: Home,
2932
+ command: 'EditorCompletion.focusFirst',
2933
+ when: FocusEditorCompletions
2934
+ }, {
2935
+ key: CtrlCmd | Space$1,
2936
+ command: 'EditorCompletion.toggleDetails',
2937
+ when: FocusEditorCompletions
2938
+ }, {
2939
+ key: CtrlCmd | RightArrow,
2940
+ command: 'Editor.cursorWordRight',
2941
+ when: FocusEditorText
2942
+ }, {
2943
+ key: CtrlCmd | LeftArrow,
2944
+ command: 'Editor.cursorWordLeft',
2945
+ when: FocusEditorText
2946
+ }, {
2947
+ key: Alt$1 | Backspace,
2948
+ command: 'Editor.deleteWordPartLeft',
2949
+ when: FocusEditorText
2950
+ }, {
2951
+ key: Alt$1 | Delete,
2952
+ command: 'Editor.deleteWordPartRight',
2953
+ when: FocusEditorText
2954
+ }, {
2955
+ key: CtrlCmd | Backspace,
2956
+ command: 'Editor.deleteWordLeft',
2957
+ when: FocusEditorText
2958
+ }, {
2959
+ key: CtrlCmd | Delete,
2960
+ command: 'Editor.deleteWordRight',
2961
+ when: FocusEditorText
2962
+ }, {
2963
+ key: CtrlCmd | KeyD,
2964
+ command: 'Editor.selectNextOccurrence',
2965
+ when: FocusEditorText
2966
+ }, {
2967
+ key: CtrlCmd | KeyJ,
2968
+ command: 'Editor.openColorPicker',
2969
+ when: FocusEditorText
2970
+ }, {
2971
+ key: CtrlCmd | Period,
2972
+ command: 'Editor.showSourceActions2',
2973
+ when: FocusEditorText
2974
+ }, {
2975
+ key: Tab,
2976
+ command: 'Editor.handleTab',
2977
+ when: FocusEditorText
2978
+ }, {
2979
+ key: Shift | Tab,
2980
+ command: 'Editor.unindent',
2981
+ when: FocusEditorText
2982
+ }, {
2983
+ key: CtrlCmd | BracketLeft,
2984
+ command: 'Editor.indentLess',
2985
+ when: FocusEditorText
2986
+ }, {
2987
+ key: Escape,
2988
+ command: 'Editor.closeFind',
2989
+ when: FocusFindWidget
2990
+ }, {
2991
+ key: CtrlCmd | KeyF,
2992
+ command: 'Editor.openFind2',
2993
+ when: FocusEditorText
2994
+ }, {
2995
+ key: CtrlCmd | KeyK,
2996
+ command: 'Editor.openCodeGenerator',
2997
+ when: FocusEditorText
2998
+ }, {
2999
+ key: Escape,
3000
+ command: 'Editor.closeCodeGenerator',
3001
+ when: FocusEditorCodeGenerator
3002
+ }, {
3003
+ key: Enter,
3004
+ command: 'EditorCodeGenerator.accept',
3005
+ when: FocusEditorCodeGenerator
3006
+ }, {
3007
+ key: CtrlCmd | BracketRight,
3008
+ command: 'Editor.indentMore',
3009
+ when: FocusEditorText
3010
+ }, {
3011
+ key: Shift | LeftArrow,
3012
+ command: 'Editor.selectCharacterLeft',
3013
+ when: FocusEditorText
3014
+ }, {
3015
+ key: CtrlCmd | Shift | LeftArrow,
3016
+ command: 'Editor.selectWordLeft',
3017
+ when: FocusEditorText
3018
+ }, {
3019
+ key: Shift | RightArrow,
3020
+ command: 'Editor.selectCharacterRight',
3021
+ when: FocusEditorText
3022
+ }, {
3023
+ key: CtrlCmd | Shift | RightArrow,
3024
+ command: 'Editor.selectWordRight',
3025
+ when: FocusEditorText
3026
+ }, {
3027
+ key: CtrlCmd | KeyL,
3028
+ command: 'Editor.selectLine',
3029
+ when: FocusEditorText
3030
+ }, {
3031
+ key: CtrlCmd | Shift | Backspace,
3032
+ command: 'Editor.deleteAllLeft',
3033
+ when: FocusEditorText
3034
+ }, {
3035
+ key: CtrlCmd | Shift | Delete,
3036
+ command: 'Editor.deleteAllRight',
3037
+ when: FocusEditorText
3038
+ }, {
3039
+ key: Escape,
3040
+ command: 'Editor.cancelSelection',
3041
+ when: FocusEditorText
3042
+ }, {
3043
+ key: CtrlCmd | KeyZ,
3044
+ command: 'Editor.undo',
3045
+ when: FocusEditorText
3046
+ }, {
3047
+ key: LeftArrow,
3048
+ command: 'Editor.cursorLeft',
3049
+ when: FocusEditorText
3050
+ }, {
3051
+ key: RightArrow,
3052
+ command: 'Editor.cursorRight',
3053
+ when: FocusEditorText
3054
+ }, {
3055
+ key: UpArrow,
3056
+ command: 'Editor.cursorUp',
3057
+ when: FocusEditorText
3058
+ }, {
3059
+ key: DownArrow,
3060
+ command: 'Editor.cursorDown',
3061
+ when: FocusEditorText
3062
+ }, {
3063
+ key: Backspace,
3064
+ command: 'Editor.deleteLeft',
3065
+ when: FocusEditorText
3066
+ }, {
3067
+ key: Delete,
3068
+ command: 'Editor.deleteRight',
3069
+ when: FocusEditorText
3070
+ }, {
3071
+ key: Enter,
3072
+ command: 'Editor.insertLineBreak',
3073
+ when: FocusEditorText
3074
+ }, {
3075
+ key: CtrlCmd | Shift | KeyD,
3076
+ command: 'Editor.copyLineDown',
3077
+ when: FocusEditorText
3078
+ }, {
3079
+ key: CtrlCmd | Shift | DownArrow,
3080
+ command: 'Editor.moveLineDown',
3081
+ when: FocusEditorText
3082
+ }, {
3083
+ key: CtrlCmd | Shift | UpArrow,
3084
+ command: 'Editor.moveLineUp',
3085
+ when: FocusEditorText
3086
+ }, {
3087
+ key: CtrlCmd | Space$1,
3088
+ command: 'Editor.openCompletion',
3089
+ when: FocusEditorText
3090
+ }, {
3091
+ key: F2,
3092
+ command: 'Editor.openRename',
3093
+ when: FocusEditorText
3094
+ }, {
3095
+ key: Enter,
3096
+ command: 'EditorRename.accept',
3097
+ when: FocusEditorRename
3098
+ }, {
3099
+ key: Escape,
3100
+ command: 'Editor.closeRename',
3101
+ when: FocusEditorRename
3102
+ }, {
3103
+ key: Home,
3104
+ command: 'Editor.cursorHome',
3105
+ when: FocusEditorText
3106
+ }, {
3107
+ key: End,
3108
+ command: 'Editor.cursorEnd',
3109
+ when: FocusEditorText
3110
+ }, {
3111
+ key: CtrlCmd | Slash$1,
3112
+ command: 'Editor.toggleComment',
3113
+ when: FocusEditorText
3114
+ }, {
3115
+ key: CtrlCmd | KeyC,
3116
+ command: 'Editor.copy',
3117
+ when: FocusEditorText
3118
+ }, {
3119
+ key: CtrlCmd | KeyA,
3120
+ command: 'Editor.selectAll',
3121
+ when: FocusEditorText
3122
+ }, {
3123
+ key: CtrlCmd | KeyH,
3124
+ command: 'Editor.showHover2',
3125
+ when: FocusEditorText
3126
+ }, {
3127
+ key: CtrlCmd | KeyX,
3128
+ command: 'Editor.cut',
3129
+ when: FocusEditorText
3130
+ }, {
3131
+ key: CtrlCmd | KeyV,
3132
+ command: 'Editor.paste',
3133
+ when: FocusEditorText
3134
+ }, {
3135
+ key: Alt$1 | LeftArrow,
3136
+ command: 'Editor.cursorWordPartLeft',
3137
+ when: FocusEditorText
3138
+ }, {
3139
+ key: Alt$1 | RightArrow,
3140
+ command: 'Editor.cursorWordPartRight',
3141
+ when: FocusEditorText
3142
+ }, {
3143
+ key: Alt$1 | F3,
3144
+ command: 'Editor.selectAllOccurrences',
3145
+ when: FocusEditorText
3146
+ }, {
3147
+ key: Alt$1 | Shift | UpArrow,
3148
+ command: 'Editor.addCursorAbove',
3149
+ when: FocusEditorText
3150
+ }, {
3151
+ key: Alt$1 | Shift | DownArrow,
3152
+ command: 'Editor.addCursorBelow',
3153
+ when: FocusEditorText
3154
+ }, {
3155
+ key: Alt$1 | Shift | F12,
3156
+ command: 'Editor.findAllReferences',
3157
+ when: FocusEditorText
3158
+ }, {
3159
+ key: Alt$1 | Shift | KeyO,
3160
+ command: 'Editor.organizeImports',
3161
+ when: FocusEditorText
3162
+ }, {
3163
+ key: CtrlCmd | Shift | Space$1,
3164
+ command: 'Editor.selectionGrow',
3165
+ when: FocusEditor
3166
+ }];
3167
+ };
3168
+
2759
3169
  const copyLineUp = editor => {
2760
3170
  const {
2761
3171
  selections
@@ -2878,7 +3288,7 @@ const characterRight = (line, columnIndex) => {
2878
3288
  return next.segment.length;
2879
3289
  };
2880
3290
  const isWhitespace = char => {
2881
- return char === Space$1 || char === Tab;
3291
+ return char === Space$2 || char === Tab$1;
2882
3292
  };
2883
3293
  const lineCharacterStart = (line, columnIndex) => {
2884
3294
  if (line.length === 0) {
@@ -3446,12 +3856,16 @@ const i18nString = (key, placeholders = emptyObject) => {
3446
3856
  };
3447
3857
 
3448
3858
  const UiStrings$1 = {
3859
+ GoToDefinition: 'Go to Definition',
3449
3860
  NoDefinitionFound: 'No definition found',
3450
3861
  NoDefinitionFoundFor: "No definition found for '{PH1}'",
3451
3862
  NoTypeDefinitionFound: 'No type definition found',
3452
3863
  NoTypeDefinitionFoundFor: "No type definition found for '{PH1}'",
3453
3864
  NoResults: 'No Results',
3865
+ Replace: 'Replace',
3454
3866
  SourceAction: 'Source Action',
3867
+ OrganizeImports: 'Organize Imports',
3868
+ SortImports: 'Sort Imports',
3455
3869
  NoCodeActionsAvailable: 'No code actions available',
3456
3870
  EscapeToClose: 'Escape to close',
3457
3871
  EnterCode: 'Enter Code'
@@ -4093,6 +4507,9 @@ const handleScrollBarHorizontalPointerDown = (state, eventX) => {
4093
4507
  x,
4094
4508
  deltaX,
4095
4509
  width,
4510
+ finalDeltaY,
4511
+ height,
4512
+ scrollBarHeight,
4096
4513
  longestLineWidth
4097
4514
  } = state;
4098
4515
  const relativeX = eventX - x;
@@ -4245,7 +4662,9 @@ const setDelta = (editor, deltaMode, eventDeltaX, eventDeltaY) => {
4245
4662
  number(eventDeltaY);
4246
4663
  // @ts-ignore
4247
4664
  const {
4248
- deltaX} = editor;
4665
+ deltaX,
4666
+ deltaY
4667
+ } = editor;
4249
4668
  if (eventDeltaX === 0) {
4250
4669
  return setDeltaY$1(editor, eventDeltaY);
4251
4670
  }
@@ -4699,6 +5118,9 @@ const create$5 = () => {
4699
5118
  return completionWidget;
4700
5119
  };
4701
5120
 
5121
+ const combineResults$2 = results => {
5122
+ return results[0] ?? [];
5123
+ };
4702
5124
  const executeCompletionProvider = async (editor, offset) => {
4703
5125
  return execute({
4704
5126
  editor,
@@ -4706,7 +5128,12 @@ const executeCompletionProvider = async (editor, offset) => {
4706
5128
  method: CompletionExecute,
4707
5129
  args: [offset],
4708
5130
  noProviderFoundMessage: 'no completion provider found',
4709
- noProviderFoundResult: []});
5131
+ noProviderFoundResult: [],
5132
+ combineResults: combineResults$2
5133
+ });
5134
+ };
5135
+ const combineResultsResolve = items => {
5136
+ return items[0] ?? undefined;
4710
5137
  };
4711
5138
  const executeResolveCompletionItem = async (editor, offset, name, completionItem) => {
4712
5139
  return execute({
@@ -4715,7 +5142,9 @@ const executeResolveCompletionItem = async (editor, offset, name, completionItem
4715
5142
  method: CompletionResolveExecute,
4716
5143
  args: [offset, name, completionItem],
4717
5144
  noProviderFoundMessage: 'no completion provider found',
4718
- noProviderFoundResult: []});
5145
+ noProviderFoundResult: [],
5146
+ combineResults: combineResultsResolve
5147
+ });
4719
5148
  };
4720
5149
 
4721
5150
  const getOffsetAtCursor = editor => {
@@ -5273,7 +5702,7 @@ const setFindWidgetFocus = (state, focusKey) => {
5273
5702
  };
5274
5703
 
5275
5704
  const focusCloseButton = state => {
5276
- return setFindWidgetFocus(state, FocusFindWidgetCloseButton);
5705
+ return setFindWidgetFocus(state, FocusFindWidgetCloseButton$1);
5277
5706
  };
5278
5707
 
5279
5708
  const focusFind = state => {
@@ -5385,23 +5814,23 @@ const focusPrevious$1 = editor => {
5385
5814
  };
5386
5815
 
5387
5816
  const focusNextMatchButton = state => {
5388
- return setFindWidgetFocus(state, FocusFindWidgetNextMatchButton);
5817
+ return setFindWidgetFocus(state, FocusFindWidgetNextMatchButton$1);
5389
5818
  };
5390
5819
 
5391
5820
  const focusPreviousMatchButton = state => {
5392
- return setFindWidgetFocus(state, FocusFindWidgetPreviousMatchButton);
5821
+ return setFindWidgetFocus(state, FocusFindWidgetPreviousMatchButton$1);
5393
5822
  };
5394
5823
 
5395
5824
  const focusReplace = state => {
5396
- return setFindWidgetFocus(state, FocusFindWidgetReplace);
5825
+ return setFindWidgetFocus(state, FocusFindWidgetReplace$1);
5397
5826
  };
5398
5827
 
5399
5828
  const focusReplaceAllButton = state => {
5400
- return setFindWidgetFocus(state, FocusFindWidgetReplaceAllButton);
5829
+ return setFindWidgetFocus(state, FocusFindWidgetReplaceAllButton$1);
5401
5830
  };
5402
5831
 
5403
5832
  const focusReplaceButton = state => {
5404
- return setFindWidgetFocus(state, FocusFindWidgetReplaceButton);
5833
+ return setFindWidgetFocus(state, FocusFindWidgetReplaceButton$1);
5405
5834
  };
5406
5835
 
5407
5836
  const focusToggleReplaceButton = state => {
@@ -5454,11 +5883,11 @@ const handleFindWidgetFocus = (state, focusKey) => {
5454
5883
  };
5455
5884
 
5456
5885
  const handleReplaceAllFocus = state => {
5457
- return handleFindWidgetFocus(state, FocusFindWidgetReplaceAllButton);
5886
+ return handleFindWidgetFocus(state, FocusFindWidgetReplaceAllButton$1);
5458
5887
  };
5459
5888
 
5460
5889
  const handleReplaceFocus = state => {
5461
- return handleFindWidgetFocus(state, FocusFindWidgetReplace);
5890
+ return handleFindWidgetFocus(state, FocusFindWidgetReplace$1);
5462
5891
  };
5463
5892
 
5464
5893
  const getFindWidgetHeight = replaceExpanded => {
@@ -5653,7 +6082,7 @@ const openRename = async editor => {
5653
6082
  return latestState;
5654
6083
  };
5655
6084
  const fullFocus = true;
5656
- return addWidgetToEditor(Rename, FocusEditorRename, editor, create$3, newStateGenerator, fullFocus);
6085
+ return addWidgetToEditor(Rename, FocusEditorRename$1, editor, create$3, newStateGenerator, fullFocus);
5657
6086
  };
5658
6087
 
5659
6088
  const getOrganizeImportEdits = async editor => {
@@ -6390,7 +6819,14 @@ const TokenizePlainText = {
6390
6819
 
6391
6820
  const state$1 = {
6392
6821
  tokenizers: Object.create(null),
6393
- pending: Object.create(null)};
6822
+ tokenizePaths: Object.create(null),
6823
+ listeners: [],
6824
+ pending: Object.create(null),
6825
+ /**
6826
+ * @type {number[]}
6827
+ */
6828
+ connectedEditors: []
6829
+ };
6394
6830
  const has = languageId => {
6395
6831
  return languageId in state$1.tokenizers;
6396
6832
  };
@@ -6960,6 +7396,9 @@ const sortLinesAscending = editor => {
6960
7396
  return scheduleDocumentAndCursorsSelections(editor, changes);
6961
7397
  };
6962
7398
 
7399
+ const combineResults$1 = results => {
7400
+ return results[0];
7401
+ };
6963
7402
  const executeTabCompletionProvider = async (editor, offset) => {
6964
7403
  return execute({
6965
7404
  editor,
@@ -6967,6 +7406,7 @@ const executeTabCompletionProvider = async (editor, offset) => {
6967
7406
  method: TabCompletionExecuteTabCompletionProvider,
6968
7407
  args: [offset],
6969
7408
  noProviderFoundMessage: 'No tab completion provider found',
7409
+ combineResults: combineResults$1,
6970
7410
  noProviderFoundResult: undefined
6971
7411
  });
6972
7412
  };
@@ -7828,7 +8268,9 @@ const getEdits = async (editor, completionItem) => {
7828
8268
  const child = getCompletionState(editor);
7829
8269
  // @ts-ignore
7830
8270
  const {
7831
- leadingWord} = child;
8271
+ leadingWord,
8272
+ uid
8273
+ } = child;
7832
8274
  const word = completionItem.label;
7833
8275
  const resolvedItem = await resolveCompletion(editor, word, completionItem);
7834
8276
  const inserted = resolvedItem ? resolvedItem.snippet : word;
@@ -7934,7 +8376,9 @@ const handleSashPointerDown = (state, eventX, eventY) => {
7934
8376
  const handleSashPointerMove = (state, eventX, eventY) => {
7935
8377
  // @ts-ignore
7936
8378
  const {
7937
- x} = state;
8379
+ x,
8380
+ y
8381
+ } = state;
7938
8382
  const minWidth = 100;
7939
8383
  const newWidth = Math.max(eventX - x, minWidth);
7940
8384
  return {
@@ -8030,9 +8474,7 @@ const getLineInfoVirtualDom = lineInfo => {
8030
8474
  type: Span,
8031
8475
  className: tokenClass,
8032
8476
  childCount: 1
8033
- },
8034
- // @ts-ignore
8035
- text(tokenText));
8477
+ }, text(tokenText));
8036
8478
  }
8037
8479
  return dom;
8038
8480
  };
@@ -8154,6 +8596,9 @@ const renderHover = (oldState, newState) => {
8154
8596
  return commands;
8155
8597
  };
8156
8598
 
8599
+ const combineResults = results => {
8600
+ return results[0] ?? [];
8601
+ };
8157
8602
  const executeRenameProvider = async (editor, offset, newName) => {
8158
8603
  return execute({
8159
8604
  editor,
@@ -8161,7 +8606,9 @@ const executeRenameProvider = async (editor, offset, newName) => {
8161
8606
  method: RenameExecuteRename,
8162
8607
  args: [offset, newName],
8163
8608
  noProviderFoundMessage: 'no rename provider found',
8164
- noProviderFoundResult: []});
8609
+ noProviderFoundResult: [],
8610
+ combineResults
8611
+ });
8165
8612
  };
8166
8613
 
8167
8614
  const getRenameState = editor => {
@@ -8925,6 +9372,10 @@ const getVisible = async (editor, syncIncremental) => {
8925
9372
  lines,
8926
9373
  width,
8927
9374
  deltaX,
9375
+ fontWeight,
9376
+ fontSize,
9377
+ fontFamily,
9378
+ letterSpacing,
8928
9379
  charWidth
8929
9380
  } = editor;
8930
9381
  const maxLineY = Math.min(minLineY + numberOfVisibleLines, lines.length);
@@ -9426,6 +9877,7 @@ const commandMap = {
9426
9877
  'Editor.deleteWordRight': deleteWordRight,
9427
9878
  'Editor.findAllReferences': findAllReferences,
9428
9879
  'Editor.format': format,
9880
+ 'Editor.getKeyBindings': getKeyBindings,
9429
9881
  'Editor.getSelections': getSelections,
9430
9882
  'Editor.getText': getText,
9431
9883
  'Editor.getWordAt': getWordAt,
@@ -10756,6 +11208,7 @@ const EditorCompletionWidget = {
10756
11208
  * @enum {string}
10757
11209
  */
10758
11210
  const UiStrings = {
11211
+ MatchesFoundFor: '{PH1} of {PH2} found for {PH3}',
10759
11212
  MatchOf: '{PH1} of {PH2}',
10760
11213
  NoResults: 'No Results',
10761
11214
  Close: 'Close',
@@ -10863,15 +11316,15 @@ const getFindWidgetFocusSelector = focus => {
10863
11316
  {
10864
11317
  return `[name="${SearchValue}"]`;
10865
11318
  }
10866
- case FocusFindWidgetReplace:
11319
+ case FocusFindWidgetReplace$1:
10867
11320
  {
10868
11321
  return `[name="${ReplaceValue}"]`;
10869
11322
  }
10870
- case FocusFindWidgetReplaceAllButton:
11323
+ case FocusFindWidgetReplaceAllButton$1:
10871
11324
  {
10872
11325
  return `[name="${ReplaceAll}"]`;
10873
11326
  }
10874
- case FocusFindWidgetCloseButton:
11327
+ case FocusFindWidgetCloseButton$1:
10875
11328
  {
10876
11329
  return `[name="${Close}"]`;
10877
11330
  }
@@ -10879,15 +11332,15 @@ const getFindWidgetFocusSelector = focus => {
10879
11332
  {
10880
11333
  return `[name="${ToggleReplace}"]`;
10881
11334
  }
10882
- case FocusFindWidgetNextMatchButton:
11335
+ case FocusFindWidgetNextMatchButton$1:
10883
11336
  {
10884
11337
  return `[name="${FocusNext}"]`;
10885
11338
  }
10886
- case FocusFindWidgetPreviousMatchButton:
11339
+ case FocusFindWidgetPreviousMatchButton$1:
10887
11340
  {
10888
11341
  return `[name="${FocusPrevious}"]`;
10889
11342
  }
10890
- case FocusFindWidgetReplaceButton:
11343
+ case FocusFindWidgetReplaceButton$1:
10891
11344
  {
10892
11345
  return `[name="${Replace}"]`;
10893
11346
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/editor-worker",
3
- "version": "5.8.0",
3
+ "version": "5.10.0",
4
4
  "description": "",
5
5
  "main": "dist/editorWorkerMain.js",
6
6
  "type": "module",