@lvce-editor/editor-worker 5.8.0 → 5.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/editorWorkerMain.js +59 -8
- package/package.json +1 -1
package/dist/editorWorkerMain.js
CHANGED
|
@@ -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 => {
|
|
@@ -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;
|
|
@@ -3446,12 +3453,16 @@ const i18nString = (key, placeholders = emptyObject) => {
|
|
|
3446
3453
|
};
|
|
3447
3454
|
|
|
3448
3455
|
const UiStrings$1 = {
|
|
3456
|
+
GoToDefinition: 'Go to Definition',
|
|
3449
3457
|
NoDefinitionFound: 'No definition found',
|
|
3450
3458
|
NoDefinitionFoundFor: "No definition found for '{PH1}'",
|
|
3451
3459
|
NoTypeDefinitionFound: 'No type definition found',
|
|
3452
3460
|
NoTypeDefinitionFoundFor: "No type definition found for '{PH1}'",
|
|
3453
3461
|
NoResults: 'No Results',
|
|
3462
|
+
Replace: 'Replace',
|
|
3454
3463
|
SourceAction: 'Source Action',
|
|
3464
|
+
OrganizeImports: 'Organize Imports',
|
|
3465
|
+
SortImports: 'Sort Imports',
|
|
3455
3466
|
NoCodeActionsAvailable: 'No code actions available',
|
|
3456
3467
|
EscapeToClose: 'Escape to close',
|
|
3457
3468
|
EnterCode: 'Enter Code'
|
|
@@ -4093,6 +4104,9 @@ const handleScrollBarHorizontalPointerDown = (state, eventX) => {
|
|
|
4093
4104
|
x,
|
|
4094
4105
|
deltaX,
|
|
4095
4106
|
width,
|
|
4107
|
+
finalDeltaY,
|
|
4108
|
+
height,
|
|
4109
|
+
scrollBarHeight,
|
|
4096
4110
|
longestLineWidth
|
|
4097
4111
|
} = state;
|
|
4098
4112
|
const relativeX = eventX - x;
|
|
@@ -4245,7 +4259,9 @@ const setDelta = (editor, deltaMode, eventDeltaX, eventDeltaY) => {
|
|
|
4245
4259
|
number(eventDeltaY);
|
|
4246
4260
|
// @ts-ignore
|
|
4247
4261
|
const {
|
|
4248
|
-
deltaX
|
|
4262
|
+
deltaX,
|
|
4263
|
+
deltaY
|
|
4264
|
+
} = editor;
|
|
4249
4265
|
if (eventDeltaX === 0) {
|
|
4250
4266
|
return setDeltaY$1(editor, eventDeltaY);
|
|
4251
4267
|
}
|
|
@@ -4699,6 +4715,9 @@ const create$5 = () => {
|
|
|
4699
4715
|
return completionWidget;
|
|
4700
4716
|
};
|
|
4701
4717
|
|
|
4718
|
+
const combineResults$2 = results => {
|
|
4719
|
+
return results[0] ?? [];
|
|
4720
|
+
};
|
|
4702
4721
|
const executeCompletionProvider = async (editor, offset) => {
|
|
4703
4722
|
return execute({
|
|
4704
4723
|
editor,
|
|
@@ -4706,7 +4725,12 @@ const executeCompletionProvider = async (editor, offset) => {
|
|
|
4706
4725
|
method: CompletionExecute,
|
|
4707
4726
|
args: [offset],
|
|
4708
4727
|
noProviderFoundMessage: 'no completion provider found',
|
|
4709
|
-
noProviderFoundResult: []
|
|
4728
|
+
noProviderFoundResult: [],
|
|
4729
|
+
combineResults: combineResults$2
|
|
4730
|
+
});
|
|
4731
|
+
};
|
|
4732
|
+
const combineResultsResolve = items => {
|
|
4733
|
+
return items[0] ?? undefined;
|
|
4710
4734
|
};
|
|
4711
4735
|
const executeResolveCompletionItem = async (editor, offset, name, completionItem) => {
|
|
4712
4736
|
return execute({
|
|
@@ -4715,7 +4739,9 @@ const executeResolveCompletionItem = async (editor, offset, name, completionItem
|
|
|
4715
4739
|
method: CompletionResolveExecute,
|
|
4716
4740
|
args: [offset, name, completionItem],
|
|
4717
4741
|
noProviderFoundMessage: 'no completion provider found',
|
|
4718
|
-
noProviderFoundResult: []
|
|
4742
|
+
noProviderFoundResult: [],
|
|
4743
|
+
combineResults: combineResultsResolve
|
|
4744
|
+
});
|
|
4719
4745
|
};
|
|
4720
4746
|
|
|
4721
4747
|
const getOffsetAtCursor = editor => {
|
|
@@ -6390,7 +6416,14 @@ const TokenizePlainText = {
|
|
|
6390
6416
|
|
|
6391
6417
|
const state$1 = {
|
|
6392
6418
|
tokenizers: Object.create(null),
|
|
6393
|
-
|
|
6419
|
+
tokenizePaths: Object.create(null),
|
|
6420
|
+
listeners: [],
|
|
6421
|
+
pending: Object.create(null),
|
|
6422
|
+
/**
|
|
6423
|
+
* @type {number[]}
|
|
6424
|
+
*/
|
|
6425
|
+
connectedEditors: []
|
|
6426
|
+
};
|
|
6394
6427
|
const has = languageId => {
|
|
6395
6428
|
return languageId in state$1.tokenizers;
|
|
6396
6429
|
};
|
|
@@ -6960,6 +6993,9 @@ const sortLinesAscending = editor => {
|
|
|
6960
6993
|
return scheduleDocumentAndCursorsSelections(editor, changes);
|
|
6961
6994
|
};
|
|
6962
6995
|
|
|
6996
|
+
const combineResults$1 = results => {
|
|
6997
|
+
return results[0];
|
|
6998
|
+
};
|
|
6963
6999
|
const executeTabCompletionProvider = async (editor, offset) => {
|
|
6964
7000
|
return execute({
|
|
6965
7001
|
editor,
|
|
@@ -6967,6 +7003,7 @@ const executeTabCompletionProvider = async (editor, offset) => {
|
|
|
6967
7003
|
method: TabCompletionExecuteTabCompletionProvider,
|
|
6968
7004
|
args: [offset],
|
|
6969
7005
|
noProviderFoundMessage: 'No tab completion provider found',
|
|
7006
|
+
combineResults: combineResults$1,
|
|
6970
7007
|
noProviderFoundResult: undefined
|
|
6971
7008
|
});
|
|
6972
7009
|
};
|
|
@@ -7828,7 +7865,9 @@ const getEdits = async (editor, completionItem) => {
|
|
|
7828
7865
|
const child = getCompletionState(editor);
|
|
7829
7866
|
// @ts-ignore
|
|
7830
7867
|
const {
|
|
7831
|
-
leadingWord
|
|
7868
|
+
leadingWord,
|
|
7869
|
+
uid
|
|
7870
|
+
} = child;
|
|
7832
7871
|
const word = completionItem.label;
|
|
7833
7872
|
const resolvedItem = await resolveCompletion(editor, word, completionItem);
|
|
7834
7873
|
const inserted = resolvedItem ? resolvedItem.snippet : word;
|
|
@@ -7934,7 +7973,9 @@ const handleSashPointerDown = (state, eventX, eventY) => {
|
|
|
7934
7973
|
const handleSashPointerMove = (state, eventX, eventY) => {
|
|
7935
7974
|
// @ts-ignore
|
|
7936
7975
|
const {
|
|
7937
|
-
x
|
|
7976
|
+
x,
|
|
7977
|
+
y
|
|
7978
|
+
} = state;
|
|
7938
7979
|
const minWidth = 100;
|
|
7939
7980
|
const newWidth = Math.max(eventX - x, minWidth);
|
|
7940
7981
|
return {
|
|
@@ -8154,6 +8195,9 @@ const renderHover = (oldState, newState) => {
|
|
|
8154
8195
|
return commands;
|
|
8155
8196
|
};
|
|
8156
8197
|
|
|
8198
|
+
const combineResults = results => {
|
|
8199
|
+
return results[0] ?? [];
|
|
8200
|
+
};
|
|
8157
8201
|
const executeRenameProvider = async (editor, offset, newName) => {
|
|
8158
8202
|
return execute({
|
|
8159
8203
|
editor,
|
|
@@ -8161,7 +8205,9 @@ const executeRenameProvider = async (editor, offset, newName) => {
|
|
|
8161
8205
|
method: RenameExecuteRename,
|
|
8162
8206
|
args: [offset, newName],
|
|
8163
8207
|
noProviderFoundMessage: 'no rename provider found',
|
|
8164
|
-
noProviderFoundResult: []
|
|
8208
|
+
noProviderFoundResult: [],
|
|
8209
|
+
combineResults
|
|
8210
|
+
});
|
|
8165
8211
|
};
|
|
8166
8212
|
|
|
8167
8213
|
const getRenameState = editor => {
|
|
@@ -8925,6 +8971,10 @@ const getVisible = async (editor, syncIncremental) => {
|
|
|
8925
8971
|
lines,
|
|
8926
8972
|
width,
|
|
8927
8973
|
deltaX,
|
|
8974
|
+
fontWeight,
|
|
8975
|
+
fontSize,
|
|
8976
|
+
fontFamily,
|
|
8977
|
+
letterSpacing,
|
|
8928
8978
|
charWidth
|
|
8929
8979
|
} = editor;
|
|
8930
8980
|
const maxLineY = Math.min(minLineY + numberOfVisibleLines, lines.length);
|
|
@@ -10756,6 +10806,7 @@ const EditorCompletionWidget = {
|
|
|
10756
10806
|
* @enum {string}
|
|
10757
10807
|
*/
|
|
10758
10808
|
const UiStrings = {
|
|
10809
|
+
MatchesFoundFor: '{PH1} of {PH2} found for {PH3}',
|
|
10759
10810
|
MatchOf: '{PH1} of {PH2}',
|
|
10760
10811
|
NoResults: 'No Results',
|
|
10761
10812
|
Close: 'Close',
|