@lvce-editor/editor-worker 18.25.0 → 18.27.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 +333 -289
- package/dist/editorWorkerMain.min.js +1 -0
- package/package.json +1 -1
package/dist/editorWorkerMain.js
CHANGED
|
@@ -1537,12 +1537,12 @@ const launchColorPickerWorker = async () => {
|
|
|
1537
1537
|
return launchWorker(name, url);
|
|
1538
1538
|
};
|
|
1539
1539
|
|
|
1540
|
-
|
|
1540
|
+
const state$f = {};
|
|
1541
1541
|
const getOrCreate$3 = () => {
|
|
1542
|
-
if (!workerPromise
|
|
1543
|
-
workerPromise
|
|
1542
|
+
if (!state$f.workerPromise) {
|
|
1543
|
+
state$f.workerPromise = launchColorPickerWorker();
|
|
1544
1544
|
}
|
|
1545
|
-
return workerPromise
|
|
1545
|
+
return state$f.workerPromise;
|
|
1546
1546
|
};
|
|
1547
1547
|
const invoke$9 = async (method, ...params) => {
|
|
1548
1548
|
const worker = await getOrCreate$3();
|
|
@@ -1651,6 +1651,7 @@ const createEditor2 = (id, uri, x, y, width, height, platform, assetDir) => {
|
|
|
1651
1651
|
numberOfVisibleLines: 0,
|
|
1652
1652
|
platform,
|
|
1653
1653
|
primarySelectionIndex: 0,
|
|
1654
|
+
redoStack: [],
|
|
1654
1655
|
rowHeight: 0,
|
|
1655
1656
|
savedSelections: [],
|
|
1656
1657
|
scrollBarHeight: 0,
|
|
@@ -1845,7 +1846,7 @@ const getInitialLineState = initialLineState => {
|
|
|
1845
1846
|
return deepCopy(initialLineState);
|
|
1846
1847
|
};
|
|
1847
1848
|
|
|
1848
|
-
const state$
|
|
1849
|
+
const state$e = {
|
|
1849
1850
|
warned: []
|
|
1850
1851
|
};
|
|
1851
1852
|
const flattenTokensArray = tokens => {
|
|
@@ -1857,10 +1858,10 @@ const flattenTokensArray = tokens => {
|
|
|
1857
1858
|
return flattened;
|
|
1858
1859
|
};
|
|
1859
1860
|
const warnDeprecatedArrayReturn = (languageId, fn) => {
|
|
1860
|
-
if (state$
|
|
1861
|
+
if (state$e.warned.includes(fn)) {
|
|
1861
1862
|
return;
|
|
1862
1863
|
}
|
|
1863
|
-
state$
|
|
1864
|
+
state$e.warned.push(fn);
|
|
1864
1865
|
console.warn(`tokenizers without hasArrayReturn=false are deprecated (language ${languageId})`);
|
|
1865
1866
|
};
|
|
1866
1867
|
const safeTokenizeLine = (languageId, tokenizeLine, line, lineStateAtStart, hasArrayReturn) => {
|
|
@@ -1921,12 +1922,14 @@ const TokenizePlainText = {
|
|
|
1921
1922
|
tokenizeLine
|
|
1922
1923
|
};
|
|
1923
1924
|
|
|
1924
|
-
|
|
1925
|
+
const state$d = {
|
|
1926
|
+
enabled: false
|
|
1927
|
+
};
|
|
1925
1928
|
const setEnabled$1 = value => {
|
|
1926
|
-
enabled
|
|
1929
|
+
state$d.enabled = value;
|
|
1927
1930
|
};
|
|
1928
1931
|
const getEnabled$1 = () => {
|
|
1929
|
-
return enabled
|
|
1932
|
+
return state$d.enabled;
|
|
1930
1933
|
};
|
|
1931
1934
|
|
|
1932
1935
|
const {
|
|
@@ -1934,25 +1937,25 @@ const {
|
|
|
1934
1937
|
set: set$5
|
|
1935
1938
|
} = SyntaxHighlightingWorker;
|
|
1936
1939
|
|
|
1937
|
-
const state$
|
|
1940
|
+
const state$c = {
|
|
1938
1941
|
pending: Object.create(null),
|
|
1939
1942
|
tokenizePaths: Object.create(null),
|
|
1940
1943
|
tokenizers: Object.create(null)
|
|
1941
1944
|
};
|
|
1942
1945
|
const has = languageId => {
|
|
1943
|
-
return Object.hasOwn(state$
|
|
1946
|
+
return Object.hasOwn(state$c.tokenizers, languageId);
|
|
1944
1947
|
};
|
|
1945
1948
|
const set$4 = (languageId, tokenizer) => {
|
|
1946
|
-
state$
|
|
1949
|
+
state$c.tokenizers[languageId] = tokenizer;
|
|
1947
1950
|
};
|
|
1948
1951
|
const get$4 = languageId => {
|
|
1949
|
-
return state$
|
|
1952
|
+
return state$c.tokenizers[languageId];
|
|
1950
1953
|
};
|
|
1951
1954
|
const setTokenizePath = (languageId, tokenizePath) => {
|
|
1952
|
-
state$
|
|
1955
|
+
state$c.tokenizePaths[languageId] = tokenizePath;
|
|
1953
1956
|
};
|
|
1954
1957
|
const getTokenizePath$1 = languageId => {
|
|
1955
|
-
return state$
|
|
1958
|
+
return state$c.tokenizePaths[languageId] || '';
|
|
1956
1959
|
};
|
|
1957
1960
|
const setTokenizePaths = languages => {
|
|
1958
1961
|
for (const language of languages) {
|
|
@@ -1962,7 +1965,7 @@ const setTokenizePaths = languages => {
|
|
|
1962
1965
|
}
|
|
1963
1966
|
};
|
|
1964
1967
|
const isPending = languageId => {
|
|
1965
|
-
return Object.hasOwn(state$
|
|
1968
|
+
return Object.hasOwn(state$c.pending, languageId);
|
|
1966
1969
|
};
|
|
1967
1970
|
|
|
1968
1971
|
const tokenMaps = Object.create(null);
|
|
@@ -2269,13 +2272,12 @@ const applyEdits = (textDocument, changes) => {
|
|
|
2269
2272
|
array(inserted);
|
|
2270
2273
|
array(deleted);
|
|
2271
2274
|
if (startRowIndex === endRowIndex) {
|
|
2275
|
+
const line = newLines[startRowIndex];
|
|
2272
2276
|
if (inserted.length === 0) {
|
|
2273
|
-
const line = newLines[startRowIndex];
|
|
2274
2277
|
const before = line.slice(0, startColumnIndex);
|
|
2275
2278
|
const after = line.slice(endColumnIndex);
|
|
2276
2279
|
newLines[startRowIndex] = before + after;
|
|
2277
2280
|
} else if (inserted.length === 1) {
|
|
2278
|
-
const line = newLines[startRowIndex];
|
|
2279
2281
|
let before = line.slice(0, startColumnIndex);
|
|
2280
2282
|
if (startColumnIndex > line.length) {
|
|
2281
2283
|
before += ' '.repeat(startColumnIndex - line.length);
|
|
@@ -2284,7 +2286,6 @@ const applyEdits = (textDocument, changes) => {
|
|
|
2284
2286
|
const text = inserted[0];
|
|
2285
2287
|
newLines[startRowIndex] = before + text + after;
|
|
2286
2288
|
} else {
|
|
2287
|
-
const line = newLines[startRowIndex];
|
|
2288
2289
|
const before = line.slice(0, startColumnIndex) + inserted[0];
|
|
2289
2290
|
const after = inserted.at(-1) + line.slice(endColumnIndex);
|
|
2290
2291
|
spliceLargeArray(newLines, startRowIndex, deleted.length, [before, ...inserted.slice(1, -1), after]);
|
|
@@ -2292,12 +2293,11 @@ const applyEdits = (textDocument, changes) => {
|
|
|
2292
2293
|
textDocument.maxLineY = Math.min(textDocument.numberOfVisibleLines, newLines.length);
|
|
2293
2294
|
}
|
|
2294
2295
|
} else {
|
|
2296
|
+
const before = newLines[startRowIndex].slice(0, startColumnIndex) + inserted[0];
|
|
2295
2297
|
if (inserted.length === 1) {
|
|
2296
|
-
const before = newLines[startRowIndex].slice(0, startColumnIndex) + inserted[0];
|
|
2297
2298
|
const after = endRowIndex >= newLines.length ? '' : newLines[endRowIndex].slice(endColumnIndex);
|
|
2298
2299
|
spliceLargeArray(newLines, startRowIndex, deleted.length, [before + after]);
|
|
2299
2300
|
} else {
|
|
2300
|
-
const before = newLines[startRowIndex].slice(0, startColumnIndex) + inserted[0];
|
|
2301
2301
|
const middle = inserted.slice(1, -1);
|
|
2302
2302
|
const after = inserted.at(-1) + (endRowIndex >= newLines.length ? '' : newLines[endRowIndex].slice(endColumnIndex));
|
|
2303
2303
|
spliceLargeArray(newLines, startRowIndex, deleted.length, [before, ...middle, after]);
|
|
@@ -2507,15 +2507,15 @@ const getLineInfoEmbeddedFull = (embeddedResults, tokenResults, line, decoration
|
|
|
2507
2507
|
while (currentPos < tokenEnd) {
|
|
2508
2508
|
// Find if current position is inside a decoration
|
|
2509
2509
|
const activeDecoration = getActiveDecoration(decorationMap, currentPos);
|
|
2510
|
+
let partEnd;
|
|
2511
|
+
let text;
|
|
2512
|
+
let className;
|
|
2510
2513
|
if (activeDecoration) {
|
|
2511
2514
|
// Render decorated part
|
|
2512
|
-
|
|
2513
|
-
|
|
2515
|
+
partEnd = Math.min(tokenEnd, activeDecoration.end);
|
|
2516
|
+
text = line.slice(currentPos, partEnd);
|
|
2514
2517
|
const baseTokenClass = embeddedTokenMap[tokenType] || 'Unknown';
|
|
2515
|
-
|
|
2516
|
-
const normalizedText = normalizeText(text, normalize, tabSize);
|
|
2517
|
-
lineInfo.push(normalizedText, className);
|
|
2518
|
-
currentPos = partEnd;
|
|
2518
|
+
className = `Token ${baseTokenClass} ${activeDecoration.className}`;
|
|
2519
2519
|
} else {
|
|
2520
2520
|
// Find next decoration start or token end
|
|
2521
2521
|
let nextDecorationStart = tokenEnd;
|
|
@@ -2526,13 +2526,13 @@ const getLineInfoEmbeddedFull = (embeddedResults, tokenResults, line, decoration
|
|
|
2526
2526
|
}
|
|
2527
2527
|
|
|
2528
2528
|
// Render non-decorated part
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
const normalizedText = normalizeText(text, normalize, tabSize);
|
|
2533
|
-
lineInfo.push(normalizedText, className);
|
|
2534
|
-
currentPos = partEnd;
|
|
2529
|
+
partEnd = nextDecorationStart;
|
|
2530
|
+
text = line.slice(currentPos, partEnd);
|
|
2531
|
+
className = `Token ${embeddedTokenMap[tokenType] || 'Unknown'}`;
|
|
2535
2532
|
}
|
|
2533
|
+
const normalizedText = normalizeText(text, normalize, tabSize);
|
|
2534
|
+
lineInfo.push(normalizedText, className);
|
|
2535
|
+
currentPos = partEnd;
|
|
2536
2536
|
}
|
|
2537
2537
|
} else {
|
|
2538
2538
|
// No decoration overlap - render token normally
|
|
@@ -2617,15 +2617,15 @@ const getLineInfoDefault = (line, tokenResults, embeddedResults, decorations, To
|
|
|
2617
2617
|
while (currentPos < tokenEnd) {
|
|
2618
2618
|
// Find if current position is inside a decoration
|
|
2619
2619
|
const activeDecoration = getActiveDecoration(decorationMap, currentPos);
|
|
2620
|
+
let partEnd;
|
|
2621
|
+
let text;
|
|
2622
|
+
let className;
|
|
2620
2623
|
if (activeDecoration) {
|
|
2621
2624
|
// Render decorated part
|
|
2622
|
-
|
|
2623
|
-
|
|
2625
|
+
partEnd = Math.min(tokenEnd, activeDecoration.end);
|
|
2626
|
+
text = line.slice(currentPos, partEnd);
|
|
2624
2627
|
const baseTokenClass = TokenMap[tokenType] || 'Unknown';
|
|
2625
|
-
|
|
2626
|
-
const normalizedText = normalizeText(text, normalize, tabSize);
|
|
2627
|
-
lineInfo.push(normalizedText, className);
|
|
2628
|
-
currentPos = partEnd;
|
|
2628
|
+
className = `Token ${baseTokenClass} ${activeDecoration.className}`;
|
|
2629
2629
|
} else {
|
|
2630
2630
|
// Find next decoration start or token end
|
|
2631
2631
|
let nextDecorationStart = tokenEnd;
|
|
@@ -2636,13 +2636,13 @@ const getLineInfoDefault = (line, tokenResults, embeddedResults, decorations, To
|
|
|
2636
2636
|
}
|
|
2637
2637
|
|
|
2638
2638
|
// Render non-decorated part
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
const normalizedText = normalizeText(text, normalize, tabSize);
|
|
2643
|
-
lineInfo.push(normalizedText, className);
|
|
2644
|
-
currentPos = partEnd;
|
|
2639
|
+
partEnd = nextDecorationStart;
|
|
2640
|
+
text = line.slice(currentPos, partEnd);
|
|
2641
|
+
className = `Token ${TokenMap[tokenType] || 'Unknown'}`;
|
|
2645
2642
|
}
|
|
2643
|
+
const normalizedText = normalizeText(text, normalize, tabSize);
|
|
2644
|
+
lineInfo.push(normalizedText, className);
|
|
2645
|
+
currentPos = partEnd;
|
|
2646
2646
|
}
|
|
2647
2647
|
} else {
|
|
2648
2648
|
// No decoration overlap - render token normally
|
|
@@ -2808,12 +2808,14 @@ const getNewDeltaPercent = (height, scrollBarHeight, relativeY) => {
|
|
|
2808
2808
|
};
|
|
2809
2809
|
};
|
|
2810
2810
|
|
|
2811
|
-
|
|
2811
|
+
const state$b = {
|
|
2812
|
+
enabled: false
|
|
2813
|
+
};
|
|
2812
2814
|
const setEnabled = value => {
|
|
2813
|
-
enabled = value;
|
|
2815
|
+
state$b.enabled = value;
|
|
2814
2816
|
};
|
|
2815
2817
|
const getEnabled = () => {
|
|
2816
|
-
return enabled;
|
|
2818
|
+
return state$b.enabled;
|
|
2817
2819
|
};
|
|
2818
2820
|
|
|
2819
2821
|
// TODO this should be in a separate scrolling module
|
|
@@ -2993,7 +2995,7 @@ const getUrlAtOffset = (editor, offset) => {
|
|
|
2993
2995
|
|
|
2994
2996
|
const EditorChange = 1;
|
|
2995
2997
|
|
|
2996
|
-
const state$
|
|
2998
|
+
const state$a = Object.create(null);
|
|
2997
2999
|
|
|
2998
3000
|
/**
|
|
2999
3001
|
* Register a listener for a specific event type
|
|
@@ -3003,13 +3005,13 @@ const state$6 = Object.create(null);
|
|
|
3003
3005
|
const registerListener$1 = (listenerType, rpcId) => {
|
|
3004
3006
|
number(listenerType);
|
|
3005
3007
|
number(rpcId);
|
|
3006
|
-
if (!Object.hasOwn(state$
|
|
3007
|
-
state$
|
|
3008
|
+
if (!Object.hasOwn(state$a, listenerType)) {
|
|
3009
|
+
state$a[listenerType] = [];
|
|
3008
3010
|
}
|
|
3009
3011
|
|
|
3010
3012
|
// Avoid duplicate registrations
|
|
3011
|
-
if (!state$
|
|
3012
|
-
state$
|
|
3013
|
+
if (!state$a[listenerType].includes(rpcId)) {
|
|
3014
|
+
state$a[listenerType].push(rpcId);
|
|
3013
3015
|
}
|
|
3014
3016
|
};
|
|
3015
3017
|
|
|
@@ -3021,10 +3023,10 @@ const registerListener$1 = (listenerType, rpcId) => {
|
|
|
3021
3023
|
const unregisterListener$1 = (listenerType, rpcId) => {
|
|
3022
3024
|
number(listenerType);
|
|
3023
3025
|
number(rpcId);
|
|
3024
|
-
if (Object.hasOwn(state$
|
|
3025
|
-
const index = state$
|
|
3026
|
+
if (Object.hasOwn(state$a, listenerType)) {
|
|
3027
|
+
const index = state$a[listenerType].indexOf(rpcId);
|
|
3026
3028
|
if (index !== -1) {
|
|
3027
|
-
state$
|
|
3029
|
+
state$a[listenerType].splice(index, 1);
|
|
3028
3030
|
}
|
|
3029
3031
|
}
|
|
3030
3032
|
};
|
|
@@ -3036,7 +3038,7 @@ const unregisterListener$1 = (listenerType, rpcId) => {
|
|
|
3036
3038
|
*/
|
|
3037
3039
|
const getListeners = listenerType => {
|
|
3038
3040
|
number(listenerType);
|
|
3039
|
-
return state$
|
|
3041
|
+
return state$a[listenerType] || [];
|
|
3040
3042
|
};
|
|
3041
3043
|
|
|
3042
3044
|
/**
|
|
@@ -3264,16 +3266,6 @@ const from = (array, getSelection) => {
|
|
|
3264
3266
|
}
|
|
3265
3267
|
return newSelections;
|
|
3266
3268
|
};
|
|
3267
|
-
const push = (selections, startRowIndex, startColumnIndex, endRowIndex, endColumnIndex) => {
|
|
3268
|
-
const oldLength = selections.length;
|
|
3269
|
-
const newSelections = alloc(oldLength + 4);
|
|
3270
|
-
newSelections.set(selections);
|
|
3271
|
-
newSelections[oldLength + 1] = startRowIndex;
|
|
3272
|
-
newSelections[oldLength + 2] = startColumnIndex;
|
|
3273
|
-
newSelections[oldLength + 3] = endRowIndex;
|
|
3274
|
-
newSelections[oldLength + 4] = endColumnIndex;
|
|
3275
|
-
return newSelections;
|
|
3276
|
-
};
|
|
3277
3269
|
|
|
3278
3270
|
// TODO maybe only accept sorted selection edits in the first place
|
|
3279
3271
|
|
|
@@ -3465,13 +3457,10 @@ const applyAutoClosingRangesEdit = (editor, changes) => {
|
|
|
3465
3457
|
const autoStartColumnIndex = autoClosingRanges[i + 1];
|
|
3466
3458
|
const autoEndRowIndex = autoClosingRanges[i + 2];
|
|
3467
3459
|
const autoEndColumnIndex = autoClosingRanges[i + 3];
|
|
3468
|
-
if (changeEndRowIndex === autoEndRowIndex && changeEndColumnIndex === autoEndColumnIndex) {
|
|
3460
|
+
if (changeEndRowIndex === autoEndRowIndex && changeEndColumnIndex === autoEndColumnIndex || changeStartRowIndex === autoStartRowIndex && changeStartColumnIndex >= autoStartColumnIndex && changeEndRowIndex === autoEndRowIndex && changeEndColumnIndex <= autoEndColumnIndex) {
|
|
3469
3461
|
const delta = change.inserted[0].length - change.deleted[0].length;
|
|
3470
3462
|
newAutoClosingRanges.push(autoStartRowIndex, autoStartColumnIndex, autoEndRowIndex, autoEndColumnIndex + delta);
|
|
3471
|
-
}
|
|
3472
|
-
const delta = change.inserted[0].length - change.deleted[0].length;
|
|
3473
|
-
newAutoClosingRanges.push(autoStartRowIndex, autoStartColumnIndex, autoEndRowIndex, autoEndColumnIndex + delta);
|
|
3474
|
-
} else ;
|
|
3463
|
+
}
|
|
3475
3464
|
}
|
|
3476
3465
|
if (isAutoClosingChange(change)) {
|
|
3477
3466
|
newAutoClosingRanges.push(changeStartRowIndex, changeStartColumnIndex + 1, changeEndRowIndex, changeEndColumnIndex + 1);
|
|
@@ -3516,6 +3505,7 @@ const scheduleDocumentAndCursorsSelections = async (editor, changes, selectionCh
|
|
|
3516
3505
|
invalidStartIndex,
|
|
3517
3506
|
lines: newLines,
|
|
3518
3507
|
modified: true,
|
|
3508
|
+
redoStack: [],
|
|
3519
3509
|
selections: newSelections,
|
|
3520
3510
|
undoStack: [...editor.undoStack, changes]
|
|
3521
3511
|
};
|
|
@@ -3623,6 +3613,7 @@ const scheduleDocument = async (editor, changes) => {
|
|
|
3623
3613
|
...editor,
|
|
3624
3614
|
invalidStartIndex,
|
|
3625
3615
|
lines: newLines,
|
|
3616
|
+
redoStack: [],
|
|
3626
3617
|
undoStack: [...editor.undoStack, changes]
|
|
3627
3618
|
};
|
|
3628
3619
|
const incrementalEdits = await getIncrementalEdits(editor, newEditor);
|
|
@@ -3711,6 +3702,7 @@ const emptyEditor = {
|
|
|
3711
3702
|
longestLineWidth: 0,
|
|
3712
3703
|
maxLineY: 0,
|
|
3713
3704
|
minLineY: 0,
|
|
3705
|
+
redoStack: [],
|
|
3714
3706
|
scrollBarHeight: 0,
|
|
3715
3707
|
selectionInfos: [],
|
|
3716
3708
|
selections: new Uint32Array(),
|
|
@@ -4058,6 +4050,7 @@ const createEditor = async ({
|
|
|
4058
4050
|
numberOfVisibleLines: 0,
|
|
4059
4051
|
platform,
|
|
4060
4052
|
primarySelectionIndex: 0,
|
|
4053
|
+
redoStack: [],
|
|
4061
4054
|
rowHeight,
|
|
4062
4055
|
savedSelections,
|
|
4063
4056
|
scrollBarHeight: 0,
|
|
@@ -4132,6 +4125,9 @@ const isEqual$2 = (oldState, newState) => {
|
|
|
4132
4125
|
};
|
|
4133
4126
|
|
|
4134
4127
|
const isEqual$1 = (oldState, newState) => {
|
|
4128
|
+
if (!newState.focused) {
|
|
4129
|
+
return true;
|
|
4130
|
+
}
|
|
4135
4131
|
return oldState.focused === newState.focused && oldState.focus === newState.focus;
|
|
4136
4132
|
};
|
|
4137
4133
|
|
|
@@ -4524,7 +4520,7 @@ const y = (editor, rowIndex) => {
|
|
|
4524
4520
|
return offsetY;
|
|
4525
4521
|
};
|
|
4526
4522
|
|
|
4527
|
-
const state$
|
|
4523
|
+
const state$9 = {
|
|
4528
4524
|
timeout: -1
|
|
4529
4525
|
};
|
|
4530
4526
|
|
|
@@ -4555,7 +4551,7 @@ const editorShowMessage = async (editor, rowIndex, columnIndex, message, isError
|
|
|
4555
4551
|
|
|
4556
4552
|
// TODO use wrapper timing module instead of this
|
|
4557
4553
|
// @ts-ignore
|
|
4558
|
-
state$
|
|
4554
|
+
state$9.timeout = setTimeout(handleTimeout, 3000);
|
|
4559
4555
|
}
|
|
4560
4556
|
return editor;
|
|
4561
4557
|
};
|
|
@@ -4575,8 +4571,8 @@ const showErrorMessage = async (editor, rowIndex, columnIndex, message) => {
|
|
|
4575
4571
|
|
|
4576
4572
|
// @ts-ignore
|
|
4577
4573
|
const editorHideMessage = async editor => {
|
|
4578
|
-
clearTimeout(state$
|
|
4579
|
-
state$
|
|
4574
|
+
clearTimeout(state$9.timeout);
|
|
4575
|
+
state$9.timeout = -1;
|
|
4580
4576
|
// await RendererProcess.invoke(/* Viewlet.send */ 'Viewlet.send', /* id */ editor.uid, /* method */ 'hideOverlayMessage')
|
|
4581
4577
|
return editor;
|
|
4582
4578
|
};
|
|
@@ -4692,12 +4688,12 @@ const launchRenameWorker = async () => {
|
|
|
4692
4688
|
return rpc;
|
|
4693
4689
|
};
|
|
4694
4690
|
|
|
4695
|
-
|
|
4691
|
+
const state$8 = {};
|
|
4696
4692
|
const getOrCreate$2 = () => {
|
|
4697
|
-
if (!workerPromise
|
|
4698
|
-
workerPromise
|
|
4693
|
+
if (!state$8.workerPromise) {
|
|
4694
|
+
state$8.workerPromise = launchRenameWorker();
|
|
4699
4695
|
}
|
|
4700
|
-
return workerPromise
|
|
4696
|
+
return state$8.workerPromise;
|
|
4701
4697
|
};
|
|
4702
4698
|
const invoke$5 = async (method, ...params) => {
|
|
4703
4699
|
const worker = await getOrCreate$2();
|
|
@@ -4817,12 +4813,12 @@ const openColorPicker = async editor => {
|
|
|
4817
4813
|
return addWidgetToEditor(ColorPicker$1, ColorPicker, editor, create$6, newStateGenerator$6);
|
|
4818
4814
|
};
|
|
4819
4815
|
|
|
4820
|
-
const state$
|
|
4816
|
+
const state$7 = {
|
|
4821
4817
|
compositionText: '',
|
|
4822
4818
|
isComposing: false
|
|
4823
4819
|
};
|
|
4824
4820
|
const compositionStart = (editor, event) => {
|
|
4825
|
-
state$
|
|
4821
|
+
state$7.isComposing = true;
|
|
4826
4822
|
return editor;
|
|
4827
4823
|
};
|
|
4828
4824
|
const getCompositionChanges = (selections, data) => {
|
|
@@ -4832,9 +4828,9 @@ const getCompositionChanges = (selections, data) => {
|
|
|
4832
4828
|
const selectionStartColumn = selections[i + 1];
|
|
4833
4829
|
const selectionEndRow = selections[i + 2];
|
|
4834
4830
|
const selectionEndColumn = selections[i + 3];
|
|
4835
|
-
const startColumnIndex = selectionStartColumn - state$
|
|
4831
|
+
const startColumnIndex = selectionStartColumn - state$7.compositionText.length;
|
|
4836
4832
|
changes.push({
|
|
4837
|
-
deleted: [state$
|
|
4833
|
+
deleted: [state$7.compositionText],
|
|
4838
4834
|
end: {
|
|
4839
4835
|
columnIndex: selectionEndColumn,
|
|
4840
4836
|
rowIndex: selectionEndRow
|
|
@@ -4854,7 +4850,7 @@ const compositionUpdate = (editor, data) => {
|
|
|
4854
4850
|
selections
|
|
4855
4851
|
} = editor;
|
|
4856
4852
|
const changes = getCompositionChanges(selections, data);
|
|
4857
|
-
state$
|
|
4853
|
+
state$7.compositionText = data;
|
|
4858
4854
|
return scheduleDocumentAndCursorsSelections(editor, changes);
|
|
4859
4855
|
};
|
|
4860
4856
|
const compositionEnd = (editor, data) => {
|
|
@@ -4862,8 +4858,8 @@ const compositionEnd = (editor, data) => {
|
|
|
4862
4858
|
selections
|
|
4863
4859
|
} = editor;
|
|
4864
4860
|
const changes = getCompositionChanges(selections, data);
|
|
4865
|
-
state$
|
|
4866
|
-
state$
|
|
4861
|
+
state$7.isComposing = false;
|
|
4862
|
+
state$7.compositionText = '';
|
|
4867
4863
|
return scheduleDocumentAndCursorsSelections(editor, changes);
|
|
4868
4864
|
};
|
|
4869
4865
|
|
|
@@ -4932,25 +4928,39 @@ const copy$1 = async editor => {
|
|
|
4932
4928
|
};
|
|
4933
4929
|
|
|
4934
4930
|
// TODO handle multiline selection
|
|
4935
|
-
// TODO handle multiple cursors
|
|
4936
4931
|
|
|
4937
4932
|
const copyLineDown = editor => {
|
|
4938
4933
|
const {
|
|
4939
4934
|
selections
|
|
4940
4935
|
} = editor;
|
|
4941
|
-
const
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
rowIndex
|
|
4946
|
-
}
|
|
4947
|
-
const
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4936
|
+
const rows = [];
|
|
4937
|
+
for (let i = 0; i < selections.length; i += 4) {
|
|
4938
|
+
const rowIndex = selections[i];
|
|
4939
|
+
number(rowIndex);
|
|
4940
|
+
rows.push(rowIndex);
|
|
4941
|
+
}
|
|
4942
|
+
const uniqueRows = [...new Set(rows)].toSorted((a, b) => a - b);
|
|
4943
|
+
const changes = uniqueRows.map(rowIndex => {
|
|
4944
|
+
const position = {
|
|
4945
|
+
columnIndex: 0,
|
|
4946
|
+
rowIndex
|
|
4947
|
+
};
|
|
4948
|
+
return {
|
|
4949
|
+
deleted: [''],
|
|
4950
|
+
end: position,
|
|
4951
|
+
inserted: [getLine(editor, rowIndex), ''],
|
|
4952
|
+
start: position
|
|
4953
|
+
};
|
|
4954
|
+
});
|
|
4955
|
+
const selectionChanges = new Uint32Array(uniqueRows.length * 4);
|
|
4956
|
+
for (let i = 0; i < uniqueRows.length; i++) {
|
|
4957
|
+
const rowIndex = uniqueRows[i] + i + 1;
|
|
4958
|
+
selectionChanges[i * 4] = rowIndex;
|
|
4959
|
+
selectionChanges[i * 4 + 1] = 0;
|
|
4960
|
+
selectionChanges[i * 4 + 2] = rowIndex;
|
|
4961
|
+
selectionChanges[i * 4 + 3] = 0;
|
|
4962
|
+
}
|
|
4963
|
+
return scheduleDocumentAndCursorsSelections(editor, changes, selectionChanges);
|
|
4954
4964
|
};
|
|
4955
4965
|
|
|
4956
4966
|
const copyLineUp = editor => {
|
|
@@ -5059,8 +5069,14 @@ const characterLeft = (line, columnIndex) => {
|
|
|
5059
5069
|
if (!supported()) {
|
|
5060
5070
|
return 1;
|
|
5061
5071
|
}
|
|
5072
|
+
if (columnIndex > line.length) {
|
|
5073
|
+
return 1;
|
|
5074
|
+
}
|
|
5062
5075
|
const segmenter = create$8();
|
|
5063
5076
|
const last = segmenter.at(line, columnIndex - 1);
|
|
5077
|
+
if (!last) {
|
|
5078
|
+
return 1;
|
|
5079
|
+
}
|
|
5064
5080
|
// @ts-ignore
|
|
5065
5081
|
return columnIndex - last.index;
|
|
5066
5082
|
};
|
|
@@ -5939,19 +5955,19 @@ const closeWidgetsMaybe = widgets => {
|
|
|
5939
5955
|
return widgets.filter(isPersistentWidget);
|
|
5940
5956
|
};
|
|
5941
5957
|
|
|
5942
|
-
const state$
|
|
5958
|
+
const state$6 = {
|
|
5943
5959
|
position: {
|
|
5944
5960
|
columnIndex: 0,
|
|
5945
5961
|
rowIndex: 0
|
|
5946
5962
|
}
|
|
5947
5963
|
};
|
|
5948
5964
|
const getPosition$1 = () => {
|
|
5949
|
-
return state$
|
|
5965
|
+
return state$6.position;
|
|
5950
5966
|
};
|
|
5951
5967
|
|
|
5952
5968
|
// @ts-ignore
|
|
5953
5969
|
const setPosition$1 = position => {
|
|
5954
|
-
state$
|
|
5970
|
+
state$6.position = position;
|
|
5955
5971
|
};
|
|
5956
5972
|
|
|
5957
5973
|
const openExternal = async (url, platform) => {
|
|
@@ -6169,20 +6185,20 @@ const handleMouseDown = (state, button, altKey, ctrlKey, x, y, detail) => {
|
|
|
6169
6185
|
}
|
|
6170
6186
|
};
|
|
6171
6187
|
|
|
6172
|
-
const state$
|
|
6188
|
+
const state$5 = {
|
|
6173
6189
|
editor: undefined,
|
|
6174
6190
|
timeout: -1,
|
|
6175
6191
|
x: 0,
|
|
6176
6192
|
y: 0
|
|
6177
6193
|
};
|
|
6178
6194
|
const get = () => {
|
|
6179
|
-
return state$
|
|
6195
|
+
return state$5;
|
|
6180
6196
|
};
|
|
6181
6197
|
const set = (editor, timeout, x, y) => {
|
|
6182
|
-
state$
|
|
6183
|
-
state$
|
|
6184
|
-
state$
|
|
6185
|
-
state$
|
|
6198
|
+
state$5.editor = editor;
|
|
6199
|
+
state$5.timeout = timeout;
|
|
6200
|
+
state$5.x = x;
|
|
6201
|
+
state$5.y = y;
|
|
6186
6202
|
};
|
|
6187
6203
|
|
|
6188
6204
|
const showHover$1 = async (editor, position) => {
|
|
@@ -6323,7 +6339,7 @@ const editorHandleNativeSelectionChange = (editor, range) => {
|
|
|
6323
6339
|
return scheduleSelections(editor, selections);
|
|
6324
6340
|
};
|
|
6325
6341
|
|
|
6326
|
-
const state$
|
|
6342
|
+
const state$4 = {
|
|
6327
6343
|
/**
|
|
6328
6344
|
* @type {any}
|
|
6329
6345
|
*/
|
|
@@ -6338,33 +6354,33 @@ const state$1 = {
|
|
|
6338
6354
|
|
|
6339
6355
|
// @ts-ignore
|
|
6340
6356
|
const setEditor = editor => {
|
|
6341
|
-
state$
|
|
6342
|
-
state$
|
|
6357
|
+
state$4.currentEditor = editor;
|
|
6358
|
+
state$4.hasListener = true;
|
|
6343
6359
|
};
|
|
6344
6360
|
const clearEditor = () => {
|
|
6345
|
-
state$
|
|
6346
|
-
state$
|
|
6347
|
-
state$
|
|
6361
|
+
state$4.currentEditor = undefined;
|
|
6362
|
+
state$4.hasListener = false;
|
|
6363
|
+
state$4.isSelecting = false;
|
|
6348
6364
|
};
|
|
6349
6365
|
const startSelecting = () => {
|
|
6350
|
-
state$
|
|
6366
|
+
state$4.isSelecting = true;
|
|
6351
6367
|
};
|
|
6352
6368
|
const isSelecting = () => {
|
|
6353
|
-
return state$
|
|
6369
|
+
return state$4.isSelecting;
|
|
6354
6370
|
};
|
|
6355
6371
|
|
|
6356
6372
|
// @ts-ignore
|
|
6357
6373
|
const setPosition = position => {
|
|
6358
|
-
state$
|
|
6374
|
+
state$4.position = position;
|
|
6359
6375
|
};
|
|
6360
6376
|
const getEditor$1 = () => {
|
|
6361
|
-
return state$
|
|
6377
|
+
return state$4.currentEditor;
|
|
6362
6378
|
};
|
|
6363
6379
|
const getPosition = () => {
|
|
6364
|
-
return state$
|
|
6380
|
+
return state$4.position;
|
|
6365
6381
|
};
|
|
6366
6382
|
const hasListener = () => {
|
|
6367
|
-
return state$
|
|
6383
|
+
return state$4.hasListener;
|
|
6368
6384
|
};
|
|
6369
6385
|
|
|
6370
6386
|
// @ts-ignore
|
|
@@ -6744,7 +6760,7 @@ const handleTouchEnd = (editor, touchEvent) => {
|
|
|
6744
6760
|
// }
|
|
6745
6761
|
};
|
|
6746
6762
|
|
|
6747
|
-
const state = {
|
|
6763
|
+
const state$3 = {
|
|
6748
6764
|
deltaY: 0,
|
|
6749
6765
|
touchOffsetY: 0
|
|
6750
6766
|
};
|
|
@@ -6755,8 +6771,8 @@ const handleTouchStart = (editor, touchEvent) => {
|
|
|
6755
6771
|
return;
|
|
6756
6772
|
}
|
|
6757
6773
|
const firstTouch = touchEvent.touches[0];
|
|
6758
|
-
state.touchOffsetY = firstTouch.y;
|
|
6759
|
-
state.deltaY = editor.deltaY;
|
|
6774
|
+
state$3.touchOffsetY = firstTouch.y;
|
|
6775
|
+
state$3.deltaY = editor.deltaY;
|
|
6760
6776
|
// const position = EditorPosition.at(editor, firstTouch.x, firstTouch.y)
|
|
6761
6777
|
// EditorMoveSelection.state.position = position
|
|
6762
6778
|
// state.date = Date.now()
|
|
@@ -6797,7 +6813,7 @@ const handleTouchMove = (editor, touchEvent) => {
|
|
|
6797
6813
|
return;
|
|
6798
6814
|
}
|
|
6799
6815
|
const firstTouch = touchEvent.touches[0];
|
|
6800
|
-
const offsetY = state.deltaY + (state.touchOffsetY - firstTouch.y);
|
|
6816
|
+
const offsetY = state$3.deltaY + (state$3.touchOffsetY - firstTouch.y);
|
|
6801
6817
|
setDeltaYFixedValue(editor, offsetY);
|
|
6802
6818
|
};
|
|
6803
6819
|
|
|
@@ -7288,6 +7304,22 @@ const paste = async editor => {
|
|
|
7288
7304
|
return pasteText(editor, text);
|
|
7289
7305
|
};
|
|
7290
7306
|
|
|
7307
|
+
const redo = state => {
|
|
7308
|
+
const {
|
|
7309
|
+
redoStack = []
|
|
7310
|
+
} = state;
|
|
7311
|
+
if (redoStack.length === 0) {
|
|
7312
|
+
return state;
|
|
7313
|
+
}
|
|
7314
|
+
const last = redoStack.at(-1);
|
|
7315
|
+
const newState = {
|
|
7316
|
+
...state,
|
|
7317
|
+
redoStack: redoStack.slice(0, -1),
|
|
7318
|
+
undoStack: [...state.undoStack, last]
|
|
7319
|
+
};
|
|
7320
|
+
return scheduleDocumentAndCursorsSelectionIsUndo(newState, last);
|
|
7321
|
+
};
|
|
7322
|
+
|
|
7291
7323
|
const getErrorMessage$1 = error => {
|
|
7292
7324
|
if (!error) {
|
|
7293
7325
|
return `Error: ${error}`;
|
|
@@ -7577,10 +7609,7 @@ const isMultiLineMatch = (lines, rowIndex, wordParts) => {
|
|
|
7577
7609
|
return false;
|
|
7578
7610
|
}
|
|
7579
7611
|
}
|
|
7580
|
-
|
|
7581
|
-
return false;
|
|
7582
|
-
}
|
|
7583
|
-
return true;
|
|
7612
|
+
return lines[rowIndex + j].startsWith(wordParts[j]);
|
|
7584
7613
|
};
|
|
7585
7614
|
|
|
7586
7615
|
// TODO handle virtual space
|
|
@@ -7819,7 +7848,13 @@ const getSelectionEditsSingleLineWord = (lines, selections) => {
|
|
|
7819
7848
|
const columnIndexAfter = line.indexOf(word, lastSelectionEndColumnIndex);
|
|
7820
7849
|
if (columnIndexAfter !== -1) {
|
|
7821
7850
|
const columnIndexAfterEnd = columnIndexAfter + word.length;
|
|
7822
|
-
const newSelections =
|
|
7851
|
+
const newSelections = new Uint32Array(selections.length + 4);
|
|
7852
|
+
newSelections.set(selections, 0);
|
|
7853
|
+
const insertIndex = selections.length;
|
|
7854
|
+
newSelections[insertIndex] = rowIndex;
|
|
7855
|
+
newSelections[insertIndex + 1] = columnIndexAfter;
|
|
7856
|
+
newSelections[insertIndex + 2] = rowIndex;
|
|
7857
|
+
newSelections[insertIndex + 3] = columnIndexAfterEnd;
|
|
7823
7858
|
return {
|
|
7824
7859
|
revealRange: newSelections.length - 4,
|
|
7825
7860
|
selectionEdits: newSelections
|
|
@@ -7899,13 +7934,12 @@ const getSelectNextOccurrenceResult = editor => {
|
|
|
7899
7934
|
for (let i = 0; i < selections.length; i += 4) {
|
|
7900
7935
|
const [selectionStartRow, selectionStartColumn, selectionEndRow, selectionEndColumn] = getSelectionPairs(selections, i);
|
|
7901
7936
|
const wordMatch = getWordMatchAtPosition(lines, selectionStartRow, selectionStartColumn);
|
|
7937
|
+
newSelections[i] = selectionStartRow;
|
|
7902
7938
|
if (wordMatch.start === wordMatch.end) {
|
|
7903
|
-
newSelections[i] = selectionStartRow;
|
|
7904
7939
|
newSelections[i + 1] = selectionStartColumn;
|
|
7905
7940
|
newSelections[i + 2] = selectionEndRow;
|
|
7906
7941
|
newSelections[i + 3] = selectionEndColumn;
|
|
7907
7942
|
} else {
|
|
7908
|
-
newSelections[i] = selectionStartRow;
|
|
7909
7943
|
newSelections[i + 1] = wordMatch.start;
|
|
7910
7944
|
newSelections[i + 2] = selectionStartRow;
|
|
7911
7945
|
newSelections[i + 3] = wordMatch.end;
|
|
@@ -8165,12 +8199,12 @@ const launchHoverWorker = async () => {
|
|
|
8165
8199
|
return rpc;
|
|
8166
8200
|
};
|
|
8167
8201
|
|
|
8168
|
-
|
|
8202
|
+
const state$2 = {};
|
|
8169
8203
|
const getOrCreate$1 = () => {
|
|
8170
|
-
if (!workerPromise
|
|
8171
|
-
workerPromise
|
|
8204
|
+
if (!state$2.workerPromise) {
|
|
8205
|
+
state$2.workerPromise = launchHoverWorker();
|
|
8172
8206
|
}
|
|
8173
|
-
return workerPromise
|
|
8207
|
+
return state$2.workerPromise;
|
|
8174
8208
|
};
|
|
8175
8209
|
const invoke$2 = async (method, ...params) => {
|
|
8176
8210
|
const worker = await getOrCreate$1();
|
|
@@ -8249,12 +8283,12 @@ const launchSourceActionWorker = async () => {
|
|
|
8249
8283
|
return rpc;
|
|
8250
8284
|
};
|
|
8251
8285
|
|
|
8252
|
-
|
|
8286
|
+
const state$1 = {};
|
|
8253
8287
|
const getOrCreate = () => {
|
|
8254
|
-
if (!workerPromise) {
|
|
8255
|
-
workerPromise = launchSourceActionWorker();
|
|
8288
|
+
if (!state$1.workerPromise) {
|
|
8289
|
+
state$1.workerPromise = launchSourceActionWorker();
|
|
8256
8290
|
}
|
|
8257
|
-
return workerPromise;
|
|
8291
|
+
return state$1.workerPromise;
|
|
8258
8292
|
};
|
|
8259
8293
|
const invoke$1 = async (method, ...params) => {
|
|
8260
8294
|
const worker = await getOrCreate();
|
|
@@ -8941,10 +8975,14 @@ const undo = state => {
|
|
|
8941
8975
|
if (undoStack.length === 0) {
|
|
8942
8976
|
return state;
|
|
8943
8977
|
}
|
|
8944
|
-
|
|
8945
|
-
const last = undoStack.pop();
|
|
8978
|
+
const last = undoStack.at(-1);
|
|
8946
8979
|
const inverseChanges = last.map(inverseChange);
|
|
8947
|
-
|
|
8980
|
+
const newState = {
|
|
8981
|
+
...state,
|
|
8982
|
+
redoStack: [...(state.redoStack || []), last],
|
|
8983
|
+
undoStack: undoStack.slice(0, -1)
|
|
8984
|
+
};
|
|
8985
|
+
return scheduleDocumentAndCursorsSelectionIsUndo(newState, inverseChanges);
|
|
8948
8986
|
};
|
|
8949
8987
|
|
|
8950
8988
|
// @ts-ignore
|
|
@@ -10741,12 +10779,14 @@ const restoreWidgetState = async (keys, savedStates) => {
|
|
|
10741
10779
|
return newEditors;
|
|
10742
10780
|
};
|
|
10743
10781
|
|
|
10744
|
-
|
|
10782
|
+
const state = {
|
|
10783
|
+
isReloading: false
|
|
10784
|
+
};
|
|
10745
10785
|
const hotReload = async () => {
|
|
10746
|
-
if (isReloading) {
|
|
10786
|
+
if (state.isReloading) {
|
|
10747
10787
|
return;
|
|
10748
10788
|
}
|
|
10749
|
-
isReloading = true;
|
|
10789
|
+
state.isReloading = true;
|
|
10750
10790
|
|
|
10751
10791
|
// TODO use getEditors
|
|
10752
10792
|
const keys = getKeys$2();
|
|
@@ -10760,7 +10800,7 @@ const hotReload = async () => {
|
|
|
10760
10800
|
// TODO ask renderer worker to rerender all editors
|
|
10761
10801
|
// @ts-ignore
|
|
10762
10802
|
await invoke$b(`Editor.rerender`);
|
|
10763
|
-
isReloading = false;
|
|
10803
|
+
state.isReloading = false;
|
|
10764
10804
|
};
|
|
10765
10805
|
|
|
10766
10806
|
const sendMessagePortToSyntaxHighlightingWorker = async port => {
|
|
@@ -11661,6 +11701,9 @@ const renderIncremental = (oldState, newState) => {
|
|
|
11661
11701
|
const oldDom = getDom(oldState);
|
|
11662
11702
|
const newDom = getDom(newState);
|
|
11663
11703
|
const patches = diffTree(oldDom, newDom);
|
|
11704
|
+
if (patches.length === 0) {
|
|
11705
|
+
return [];
|
|
11706
|
+
}
|
|
11664
11707
|
return [SetPatches, newState.uid, patches];
|
|
11665
11708
|
};
|
|
11666
11709
|
|
|
@@ -11885,14 +11928,15 @@ const renderEditor = async id => {
|
|
|
11885
11928
|
const commands = [];
|
|
11886
11929
|
set$7(id, newState, newState);
|
|
11887
11930
|
for (const item of render$6) {
|
|
11888
|
-
if (
|
|
11889
|
-
|
|
11890
|
-
|
|
11891
|
-
|
|
11892
|
-
|
|
11893
|
-
|
|
11894
|
-
|
|
11895
|
-
|
|
11931
|
+
if (item.isEqual(oldState, newState)) {
|
|
11932
|
+
continue;
|
|
11933
|
+
}
|
|
11934
|
+
const result = await item.apply(oldState, newState);
|
|
11935
|
+
// @ts-ignore
|
|
11936
|
+
if (item.multiple) {
|
|
11937
|
+
commands.push(...result);
|
|
11938
|
+
} else if (result.length > 0) {
|
|
11939
|
+
commands.push(result);
|
|
11896
11940
|
}
|
|
11897
11941
|
}
|
|
11898
11942
|
return commands;
|
|
@@ -12060,64 +12104,63 @@ const wrapCommand = fn => async (editorUid, ...args) => {
|
|
|
12060
12104
|
return newEditorWithDerivedState;
|
|
12061
12105
|
};
|
|
12062
12106
|
|
|
12063
|
-
const wrapCommandOld = wrapCommand;
|
|
12064
12107
|
const commandMap = {
|
|
12065
12108
|
'ActivateByEvent.activateByEvent': activateByEvent,
|
|
12066
12109
|
'CodeGenerator.accept': codeGeneratorAccept,
|
|
12067
12110
|
'ColorPicker.loadContent': loadContent$3,
|
|
12068
|
-
'Editor.addCursorAbove':
|
|
12069
|
-
'Editor.addCursorBelow':
|
|
12070
|
-
'Editor.applyDocumentEdits':
|
|
12071
|
-
'Editor.applyEdit':
|
|
12111
|
+
'Editor.addCursorAbove': wrapCommand(addCursorAbove),
|
|
12112
|
+
'Editor.addCursorBelow': wrapCommand(addCursorBelow),
|
|
12113
|
+
'Editor.applyDocumentEdits': wrapCommand(applyDocumentEdits),
|
|
12114
|
+
'Editor.applyEdit': wrapCommand(applyEdit),
|
|
12072
12115
|
'Editor.applyEdit2': applyEdits2,
|
|
12073
|
-
'Editor.applyWorkspaceEdit':
|
|
12074
|
-
'Editor.braceCompletion':
|
|
12075
|
-
'Editor.cancelSelection':
|
|
12076
|
-
'Editor.closeCodeGenerator':
|
|
12077
|
-
'Editor.closeFind':
|
|
12116
|
+
'Editor.applyWorkspaceEdit': wrapCommand(applyWorkspaceEdit),
|
|
12117
|
+
'Editor.braceCompletion': wrapCommand(braceCompletion),
|
|
12118
|
+
'Editor.cancelSelection': wrapCommand(cancelSelection),
|
|
12119
|
+
'Editor.closeCodeGenerator': wrapCommand(closeCodeGenerator),
|
|
12120
|
+
'Editor.closeFind': wrapCommand(closeFind),
|
|
12078
12121
|
'Editor.closeFind2': closeFind2,
|
|
12079
|
-
'Editor.closeRename':
|
|
12080
|
-
'Editor.closeSourceAction':
|
|
12122
|
+
'Editor.closeRename': wrapCommand(closeRename),
|
|
12123
|
+
'Editor.closeSourceAction': wrapCommand(closeSourceAction),
|
|
12081
12124
|
'Editor.closeWidget2': closeWidget2,
|
|
12082
|
-
'Editor.compositionEnd':
|
|
12083
|
-
'Editor.compositionStart':
|
|
12084
|
-
'Editor.compositionUpdate':
|
|
12085
|
-
'Editor.contextMenu':
|
|
12086
|
-
'Editor.copy':
|
|
12087
|
-
'Editor.copyLineDown':
|
|
12088
|
-
'Editor.copyLineUp':
|
|
12125
|
+
'Editor.compositionEnd': wrapCommand(compositionEnd),
|
|
12126
|
+
'Editor.compositionStart': wrapCommand(compositionStart),
|
|
12127
|
+
'Editor.compositionUpdate': wrapCommand(compositionUpdate),
|
|
12128
|
+
'Editor.contextMenu': wrapCommand(handleContextMenu),
|
|
12129
|
+
'Editor.copy': wrapCommand(copy$1),
|
|
12130
|
+
'Editor.copyLineDown': wrapCommand(copyLineDown),
|
|
12131
|
+
'Editor.copyLineUp': wrapCommand(copyLineUp),
|
|
12089
12132
|
'Editor.create': createEditor,
|
|
12090
12133
|
'Editor.create2': createEditor2,
|
|
12091
|
-
'Editor.cursorCharacterLeft':
|
|
12092
|
-
'Editor.cursorCharacterRight':
|
|
12093
|
-
'Editor.cursorDown':
|
|
12094
|
-
'Editor.cursorEnd':
|
|
12095
|
-
'Editor.cursorHome':
|
|
12096
|
-
'Editor.cursorLeft':
|
|
12097
|
-
'Editor.cursorRight':
|
|
12098
|
-
'Editor.cursorSet':
|
|
12099
|
-
'Editor.cursorUp':
|
|
12100
|
-
'Editor.cursorWordLeft':
|
|
12101
|
-
'Editor.cursorWordPartLeft':
|
|
12102
|
-
'Editor.cursorWordPartRight':
|
|
12103
|
-
'Editor.cursorWordRight':
|
|
12104
|
-
'Editor.cut':
|
|
12105
|
-
'Editor.deleteAll':
|
|
12106
|
-
'Editor.deleteAllLeft':
|
|
12107
|
-
'Editor.deleteAllRight':
|
|
12108
|
-
'Editor.deleteCharacterLeft':
|
|
12109
|
-
'Editor.deleteCharacterRight':
|
|
12110
|
-
'Editor.deleteHorizontalRight':
|
|
12111
|
-
'Editor.deleteLeft':
|
|
12112
|
-
'Editor.deleteRight':
|
|
12113
|
-
'Editor.deleteWordLeft':
|
|
12114
|
-
'Editor.deleteWordPartLeft':
|
|
12115
|
-
'Editor.deleteWordPartRight':
|
|
12116
|
-
'Editor.deleteWordRight':
|
|
12134
|
+
'Editor.cursorCharacterLeft': wrapCommand(cursorCharacterLeft),
|
|
12135
|
+
'Editor.cursorCharacterRight': wrapCommand(cursorCharacterRight),
|
|
12136
|
+
'Editor.cursorDown': wrapCommand(cursorDown),
|
|
12137
|
+
'Editor.cursorEnd': wrapCommand(cursorEnd),
|
|
12138
|
+
'Editor.cursorHome': wrapCommand(cursorHome),
|
|
12139
|
+
'Editor.cursorLeft': wrapCommand(cursorCharacterLeft),
|
|
12140
|
+
'Editor.cursorRight': wrapCommand(cursorCharacterRight),
|
|
12141
|
+
'Editor.cursorSet': wrapCommand(cursorSet),
|
|
12142
|
+
'Editor.cursorUp': wrapCommand(cursorUp),
|
|
12143
|
+
'Editor.cursorWordLeft': wrapCommand(cursorWordLeft),
|
|
12144
|
+
'Editor.cursorWordPartLeft': wrapCommand(cursorWordPartLeft),
|
|
12145
|
+
'Editor.cursorWordPartRight': wrapCommand(cursorWordPartRight),
|
|
12146
|
+
'Editor.cursorWordRight': wrapCommand(cursorWordRight),
|
|
12147
|
+
'Editor.cut': wrapCommand(cut$1),
|
|
12148
|
+
'Editor.deleteAll': wrapCommand(deleteAll),
|
|
12149
|
+
'Editor.deleteAllLeft': wrapCommand(deleteAllLeft),
|
|
12150
|
+
'Editor.deleteAllRight': wrapCommand(deleteAllRight),
|
|
12151
|
+
'Editor.deleteCharacterLeft': wrapCommand(deleteCharacterLeft),
|
|
12152
|
+
'Editor.deleteCharacterRight': wrapCommand(deleteCharacterRight),
|
|
12153
|
+
'Editor.deleteHorizontalRight': wrapCommand(editorDeleteHorizontalRight),
|
|
12154
|
+
'Editor.deleteLeft': wrapCommand(deleteCharacterLeft),
|
|
12155
|
+
'Editor.deleteRight': wrapCommand(deleteCharacterRight),
|
|
12156
|
+
'Editor.deleteWordLeft': wrapCommand(deleteWordLeft),
|
|
12157
|
+
'Editor.deleteWordPartLeft': wrapCommand(deleteWordPartLeft),
|
|
12158
|
+
'Editor.deleteWordPartRight': wrapCommand(deleteWordPartRight),
|
|
12159
|
+
'Editor.deleteWordRight': wrapCommand(deleteWordRight),
|
|
12117
12160
|
'Editor.diff2': diff2,
|
|
12118
|
-
'Editor.executeWidgetCommand':
|
|
12119
|
-
'Editor.findAllReferences':
|
|
12120
|
-
'Editor.format':
|
|
12161
|
+
'Editor.executeWidgetCommand': wrapCommand(executeWidgetCommand),
|
|
12162
|
+
'Editor.findAllReferences': wrapCommand(findAllReferences$1),
|
|
12163
|
+
'Editor.format': wrapCommand(format),
|
|
12121
12164
|
'Editor.getCommandIds': getCommandIds,
|
|
12122
12165
|
'Editor.getDiagnostics': getDiagnostics$1,
|
|
12123
12166
|
'Editor.getKeyBindings': getKeyBindings,
|
|
@@ -12141,107 +12184,108 @@ const commandMap = {
|
|
|
12141
12184
|
'Editor.getWordAtOffset2': getWordAtOffset2,
|
|
12142
12185
|
'Editor.getWordBefore': getWordBefore,
|
|
12143
12186
|
'Editor.getWordBefore2': getWordBefore2,
|
|
12144
|
-
'Editor.goToDefinition':
|
|
12145
|
-
'Editor.goToTypeDefinition':
|
|
12146
|
-
'Editor.handleBeforeInput':
|
|
12147
|
-
'Editor.handleBeforeInputFromContentEditable':
|
|
12148
|
-
'Editor.handleBlur':
|
|
12149
|
-
'Editor.handleClickAtPosition':
|
|
12150
|
-
'Editor.handleContextMenu':
|
|
12151
|
-
'Editor.handleDoubleClick':
|
|
12152
|
-
'Editor.handleFocus':
|
|
12153
|
-
'Editor.handleMouseDown':
|
|
12154
|
-
'Editor.handleMouseMove':
|
|
12155
|
-
'Editor.handleMouseMoveWithAltKey':
|
|
12187
|
+
'Editor.goToDefinition': wrapCommand(goToDefinition),
|
|
12188
|
+
'Editor.goToTypeDefinition': wrapCommand(goToTypeDefinition),
|
|
12189
|
+
'Editor.handleBeforeInput': wrapCommand(handleBeforeInput),
|
|
12190
|
+
'Editor.handleBeforeInputFromContentEditable': wrapCommand(handleBeforeInputFromContentEditable),
|
|
12191
|
+
'Editor.handleBlur': wrapCommand(handleBlur$1),
|
|
12192
|
+
'Editor.handleClickAtPosition': wrapCommand(handleClickAtPosition),
|
|
12193
|
+
'Editor.handleContextMenu': wrapCommand(handleContextMenu),
|
|
12194
|
+
'Editor.handleDoubleClick': wrapCommand(handleDoubleClick),
|
|
12195
|
+
'Editor.handleFocus': wrapCommand(handleFocus$1),
|
|
12196
|
+
'Editor.handleMouseDown': wrapCommand(handleMouseDown),
|
|
12197
|
+
'Editor.handleMouseMove': wrapCommand(handleMouseMove),
|
|
12198
|
+
'Editor.handleMouseMoveWithAltKey': wrapCommand(handleMouseMoveWithAltKey),
|
|
12156
12199
|
'Editor.handleNativeSelectionChange': editorHandleNativeSelectionChange,
|
|
12157
|
-
'Editor.handlePointerCaptureLost':
|
|
12158
|
-
'Editor.handlePointerDown':
|
|
12159
|
-
'Editor.handlePointerMove':
|
|
12160
|
-
'Editor.handlePointerUp':
|
|
12200
|
+
'Editor.handlePointerCaptureLost': wrapCommand(handlePointerCaptureLost),
|
|
12201
|
+
'Editor.handlePointerDown': wrapCommand(handlePointerDown$1),
|
|
12202
|
+
'Editor.handlePointerMove': wrapCommand(handlePointerMove),
|
|
12203
|
+
'Editor.handlePointerUp': wrapCommand(handlePointerUp),
|
|
12161
12204
|
'Editor.handleScrollBarClick': handleScrollBarPointerDown,
|
|
12162
|
-
'Editor.handleScrollBarHorizontalMove':
|
|
12163
|
-
'Editor.handleScrollBarHorizontalPointerDown':
|
|
12164
|
-
'Editor.handleScrollBarMove':
|
|
12165
|
-
'Editor.handleScrollBarPointerDown':
|
|
12166
|
-
'Editor.handleScrollBarVerticalMove':
|
|
12167
|
-
'Editor.handleScrollBarVerticalPointerDown':
|
|
12168
|
-
'Editor.handleScrollBarVerticalPointerMove':
|
|
12169
|
-
'Editor.handleSingleClick':
|
|
12170
|
-
'Editor.handleTab':
|
|
12171
|
-
'Editor.handleTouchEnd':
|
|
12172
|
-
'Editor.handleTouchMove':
|
|
12173
|
-
'Editor.handleTouchStart':
|
|
12174
|
-
'Editor.handleTripleClick':
|
|
12175
|
-
'Editor.handleWheel':
|
|
12205
|
+
'Editor.handleScrollBarHorizontalMove': wrapCommand(handleScrollBarHorizontalMove),
|
|
12206
|
+
'Editor.handleScrollBarHorizontalPointerDown': wrapCommand(handleScrollBarHorizontalPointerDown),
|
|
12207
|
+
'Editor.handleScrollBarMove': wrapCommand(handleScrollBarMove),
|
|
12208
|
+
'Editor.handleScrollBarPointerDown': wrapCommand(handleScrollBarPointerDown),
|
|
12209
|
+
'Editor.handleScrollBarVerticalMove': wrapCommand(handleScrollBarVerticalPointerMove),
|
|
12210
|
+
'Editor.handleScrollBarVerticalPointerDown': wrapCommand(handleScrollBarPointerDown),
|
|
12211
|
+
'Editor.handleScrollBarVerticalPointerMove': wrapCommand(handleScrollBarVerticalPointerMove),
|
|
12212
|
+
'Editor.handleSingleClick': wrapCommand(handleSingleClick),
|
|
12213
|
+
'Editor.handleTab': wrapCommand(handleTab),
|
|
12214
|
+
'Editor.handleTouchEnd': wrapCommand(handleTouchEnd),
|
|
12215
|
+
'Editor.handleTouchMove': wrapCommand(handleTouchMove),
|
|
12216
|
+
'Editor.handleTouchStart': wrapCommand(handleTouchStart),
|
|
12217
|
+
'Editor.handleTripleClick': wrapCommand(handleTripleClick),
|
|
12218
|
+
'Editor.handleWheel': wrapCommand(handleWheel$2),
|
|
12176
12219
|
'Editor.hotReload': hotReload,
|
|
12177
|
-
'Editor.indendLess':
|
|
12178
|
-
'Editor.indentMore':
|
|
12179
|
-
'Editor.insertLineBreak':
|
|
12220
|
+
'Editor.indendLess': wrapCommand(indentLess),
|
|
12221
|
+
'Editor.indentMore': wrapCommand(indentMore),
|
|
12222
|
+
'Editor.insertLineBreak': wrapCommand(insertLineBreak),
|
|
12180
12223
|
'Editor.loadContent': wrapCommand(loadContent),
|
|
12181
|
-
'Editor.moveLineDown':
|
|
12182
|
-
'Editor.moveLineUp':
|
|
12183
|
-
'Editor.moveRectangleSelection':
|
|
12184
|
-
'Editor.moveRectangleSelectionPx':
|
|
12185
|
-
'Editor.moveSelection':
|
|
12186
|
-
'Editor.moveSelectionPx':
|
|
12224
|
+
'Editor.moveLineDown': wrapCommand(moveLineDown),
|
|
12225
|
+
'Editor.moveLineUp': wrapCommand(moveLineUp),
|
|
12226
|
+
'Editor.moveRectangleSelection': wrapCommand(moveRectangleSelection),
|
|
12227
|
+
'Editor.moveRectangleSelectionPx': wrapCommand(moveRectangleSelectionPx),
|
|
12228
|
+
'Editor.moveSelection': wrapCommand(editorMoveSelection),
|
|
12229
|
+
'Editor.moveSelectionPx': wrapCommand(moveSelectionPx),
|
|
12187
12230
|
'Editor.offsetAt': offsetAt,
|
|
12188
|
-
'Editor.openCodeGenerator':
|
|
12189
|
-
'Editor.openColorPicker':
|
|
12190
|
-
'Editor.openCompletion':
|
|
12191
|
-
'Editor.openFind':
|
|
12192
|
-
'Editor.openFind2':
|
|
12193
|
-
'Editor.openRename':
|
|
12194
|
-
'Editor.organizeImports':
|
|
12195
|
-
'Editor.paste':
|
|
12196
|
-
'Editor.pasteText':
|
|
12231
|
+
'Editor.openCodeGenerator': wrapCommand(openCodeGenerator),
|
|
12232
|
+
'Editor.openColorPicker': wrapCommand(openColorPicker),
|
|
12233
|
+
'Editor.openCompletion': wrapCommand(openCompletion),
|
|
12234
|
+
'Editor.openFind': wrapCommand(openFind),
|
|
12235
|
+
'Editor.openFind2': wrapCommand(openFind2),
|
|
12236
|
+
'Editor.openRename': wrapCommand(openRename),
|
|
12237
|
+
'Editor.organizeImports': wrapCommand(organizeImports),
|
|
12238
|
+
'Editor.paste': wrapCommand(paste),
|
|
12239
|
+
'Editor.pasteText': wrapCommand(pasteText),
|
|
12240
|
+
'Editor.redo': wrapCommand(redo),
|
|
12197
12241
|
'Editor.render': renderEditor,
|
|
12198
12242
|
'Editor.render2': render2,
|
|
12199
12243
|
'Editor.renderEventListeners': renderEventListeners,
|
|
12200
|
-
'Editor.replaceRange':
|
|
12201
|
-
'Editor.rerender':
|
|
12202
|
-
'Editor.save':
|
|
12244
|
+
'Editor.replaceRange': wrapCommand(replaceRange),
|
|
12245
|
+
'Editor.rerender': wrapCommand(rerender),
|
|
12246
|
+
'Editor.save': wrapCommand(save),
|
|
12203
12247
|
'Editor.saveState': wrapGetter(saveState),
|
|
12204
|
-
'Editor.selectAll':
|
|
12205
|
-
'Editor.selectAllLeft':
|
|
12206
|
-
'Editor.selectAllOccurrences':
|
|
12207
|
-
'Editor.selectAllRight':
|
|
12208
|
-
'Editor.selectCharacterLeft':
|
|
12209
|
-
'Editor.selectCharacterRight':
|
|
12210
|
-
'Editor.selectDown':
|
|
12211
|
-
'Editor.selectInsideString':
|
|
12212
|
-
'Editor.selectionGrow':
|
|
12213
|
-
'Editor.selectLine':
|
|
12214
|
-
'Editor.selectNextOccurrence':
|
|
12215
|
-
'Editor.selectPreviousOccurrence':
|
|
12216
|
-
'Editor.selectUp':
|
|
12217
|
-
'Editor.selectWord':
|
|
12218
|
-
'Editor.selectWordLeft':
|
|
12219
|
-
'Editor.selectWordRight':
|
|
12220
|
-
'Editor.setDebugEnabled':
|
|
12221
|
-
'Editor.setDecorations':
|
|
12222
|
-
'Editor.setDelta':
|
|
12223
|
-
'Editor.setDeltaY':
|
|
12224
|
-
'Editor.setLanguageId':
|
|
12225
|
-
'Editor.setSelections':
|
|
12248
|
+
'Editor.selectAll': wrapCommand(selectAll),
|
|
12249
|
+
'Editor.selectAllLeft': wrapCommand(editorSelectAllLeft),
|
|
12250
|
+
'Editor.selectAllOccurrences': wrapCommand(selectAllOccurrences),
|
|
12251
|
+
'Editor.selectAllRight': wrapCommand(editorSelectAllRight),
|
|
12252
|
+
'Editor.selectCharacterLeft': wrapCommand(selectCharacterLeft),
|
|
12253
|
+
'Editor.selectCharacterRight': wrapCommand(selectCharacterRight),
|
|
12254
|
+
'Editor.selectDown': wrapCommand(selectDown),
|
|
12255
|
+
'Editor.selectInsideString': wrapCommand(selectInsideString),
|
|
12256
|
+
'Editor.selectionGrow': wrapCommand(selectionGrow),
|
|
12257
|
+
'Editor.selectLine': wrapCommand(selectLine),
|
|
12258
|
+
'Editor.selectNextOccurrence': wrapCommand(selectNextOccurrence),
|
|
12259
|
+
'Editor.selectPreviousOccurrence': wrapCommand(selectPreviousOccurrence),
|
|
12260
|
+
'Editor.selectUp': wrapCommand(selectUp),
|
|
12261
|
+
'Editor.selectWord': wrapCommand(selectWord),
|
|
12262
|
+
'Editor.selectWordLeft': wrapCommand(selectWordLeft),
|
|
12263
|
+
'Editor.selectWordRight': wrapCommand(selectWordRight),
|
|
12264
|
+
'Editor.setDebugEnabled': wrapCommand(setDebugEnabled),
|
|
12265
|
+
'Editor.setDecorations': wrapCommand(setDecorations),
|
|
12266
|
+
'Editor.setDelta': wrapCommand(setDelta),
|
|
12267
|
+
'Editor.setDeltaY': wrapCommand(setDeltaY),
|
|
12268
|
+
'Editor.setLanguageId': wrapCommand(setLanguageId),
|
|
12269
|
+
'Editor.setSelections': wrapCommand(setSelections),
|
|
12226
12270
|
'Editor.setSelections2': setSelections2,
|
|
12227
|
-
'Editor.setText':
|
|
12271
|
+
'Editor.setText': wrapCommand(setText),
|
|
12228
12272
|
'Editor.showHover': showHover,
|
|
12229
12273
|
'Editor.showHover2': showHover3,
|
|
12230
12274
|
'Editor.showSourceActions': showSourceActions,
|
|
12231
12275
|
'Editor.showSourceActions2': showSourceActions,
|
|
12232
12276
|
'Editor.showSourceActions3': showSourceActions,
|
|
12233
|
-
'Editor.sortLinesAscending':
|
|
12234
|
-
'Editor.tabCompletion':
|
|
12277
|
+
'Editor.sortLinesAscending': wrapCommand(sortLinesAscending),
|
|
12278
|
+
'Editor.tabCompletion': wrapCommand(tabCompletion),
|
|
12235
12279
|
'Editor.terminate': terminate,
|
|
12236
|
-
'Editor.toggleBlockComment':
|
|
12237
|
-
'Editor.toggleComment':
|
|
12238
|
-
'Editor.toggleLineComment':
|
|
12239
|
-
'Editor.type':
|
|
12240
|
-
'Editor.typeWithAutoClosing':
|
|
12241
|
-
'Editor.undo':
|
|
12242
|
-
'Editor.unIndent':
|
|
12280
|
+
'Editor.toggleBlockComment': wrapCommand(toggleBlockComment),
|
|
12281
|
+
'Editor.toggleComment': wrapCommand(toggleComment),
|
|
12282
|
+
'Editor.toggleLineComment': wrapCommand(editorToggleLineComment),
|
|
12283
|
+
'Editor.type': wrapCommand(type),
|
|
12284
|
+
'Editor.typeWithAutoClosing': wrapCommand(typeWithAutoClosing),
|
|
12285
|
+
'Editor.undo': wrapCommand(undo),
|
|
12286
|
+
'Editor.unIndent': wrapCommand(editorUnindent),
|
|
12243
12287
|
'Editor.updateDebugInfo': updateDebugInfo,
|
|
12244
|
-
'Editor.updateDiagnostics':
|
|
12288
|
+
'Editor.updateDiagnostics': wrapCommand(updateDiagnostics),
|
|
12245
12289
|
'EditorCompletion.close': close$4,
|
|
12246
12290
|
'EditorCompletion.closeDetails': closeDetails$1,
|
|
12247
12291
|
'EditorCompletion.focusFirst': focusFirst$1,
|