@lvce-editor/text-search-worker 3.12.0 → 3.13.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/textSearchWorkerMain.js +455 -104
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const Two = '2.0';
|
|
2
|
-
const create$4 = (method, params) => {
|
|
2
|
+
const create$4$1 = (method, params) => {
|
|
3
3
|
return {
|
|
4
4
|
jsonrpc: Two,
|
|
5
5
|
method,
|
|
@@ -19,14 +19,14 @@ const remove$1 = id => {
|
|
|
19
19
|
delete state$2.callbacks[id];
|
|
20
20
|
};
|
|
21
21
|
let id = 0;
|
|
22
|
-
const create$3 = () => {
|
|
22
|
+
const create$3$1 = () => {
|
|
23
23
|
return ++id;
|
|
24
24
|
};
|
|
25
25
|
const warn = (...args) => {
|
|
26
26
|
console.warn(...args);
|
|
27
27
|
};
|
|
28
28
|
const registerPromise = () => {
|
|
29
|
-
const id = create$3();
|
|
29
|
+
const id = create$3$1();
|
|
30
30
|
const {
|
|
31
31
|
resolve,
|
|
32
32
|
promise
|
|
@@ -47,7 +47,7 @@ const resolve = (id, response) => {
|
|
|
47
47
|
fn(response);
|
|
48
48
|
remove$1(id);
|
|
49
49
|
};
|
|
50
|
-
const create$2 = (method, params) => {
|
|
50
|
+
const create$2$1 = (method, params) => {
|
|
51
51
|
const {
|
|
52
52
|
id,
|
|
53
53
|
promise
|
|
@@ -237,7 +237,7 @@ const getErrorResponse = (message, error, preparePrettyError, logError) => {
|
|
|
237
237
|
const errorProperty = getErrorProperty(error, prettyError);
|
|
238
238
|
return create$1$2(message, errorProperty);
|
|
239
239
|
};
|
|
240
|
-
const create$
|
|
240
|
+
const create$6 = (message, result) => {
|
|
241
241
|
return {
|
|
242
242
|
jsonrpc: Two,
|
|
243
243
|
id: message.id,
|
|
@@ -246,7 +246,7 @@ const create$5 = (message, result) => {
|
|
|
246
246
|
};
|
|
247
247
|
const getSuccessResponse = (message, result) => {
|
|
248
248
|
const resultProperty = result ?? null;
|
|
249
|
-
return create$
|
|
249
|
+
return create$6(message, resultProperty);
|
|
250
250
|
};
|
|
251
251
|
const getResponse = async (message, ipc, execute, preparePrettyError, logError, requiresSocket) => {
|
|
252
252
|
try {
|
|
@@ -326,7 +326,7 @@ const invokeHelper = async (ipc, method, params, useSendAndTransfer) => {
|
|
|
326
326
|
const {
|
|
327
327
|
message,
|
|
328
328
|
promise
|
|
329
|
-
} = create$2(method, params);
|
|
329
|
+
} = create$2$1(method, params);
|
|
330
330
|
if (useSendAndTransfer && ipc.sendAndTransfer) {
|
|
331
331
|
ipc.sendAndTransfer(message);
|
|
332
332
|
} else {
|
|
@@ -336,13 +336,13 @@ const invokeHelper = async (ipc, method, params, useSendAndTransfer) => {
|
|
|
336
336
|
return unwrapJsonRpcResult(responseMessage);
|
|
337
337
|
};
|
|
338
338
|
const send = (transport, method, ...params) => {
|
|
339
|
-
const message = create$4(method, params);
|
|
339
|
+
const message = create$4$1(method, params);
|
|
340
340
|
transport.send(message);
|
|
341
341
|
};
|
|
342
342
|
const invoke$2 = (ipc, method, ...params) => {
|
|
343
343
|
return invokeHelper(ipc, method, params, false);
|
|
344
344
|
};
|
|
345
|
-
const invokeAndTransfer = (ipc, method, ...params) => {
|
|
345
|
+
const invokeAndTransfer$1 = (ipc, method, ...params) => {
|
|
346
346
|
return invokeHelper(ipc, method, params, true);
|
|
347
347
|
};
|
|
348
348
|
|
|
@@ -639,7 +639,7 @@ let VError$1 = class VError extends Error {
|
|
|
639
639
|
}
|
|
640
640
|
}
|
|
641
641
|
};
|
|
642
|
-
class IpcError extends VError$1 {
|
|
642
|
+
let IpcError$1 = class IpcError extends VError$1 {
|
|
643
643
|
// @ts-ignore
|
|
644
644
|
constructor(betterMessage, stdout = '', stderr = '') {
|
|
645
645
|
if (stdout || stderr) {
|
|
@@ -664,7 +664,7 @@ class IpcError extends VError$1 {
|
|
|
664
664
|
// @ts-ignore
|
|
665
665
|
this.stderr = stderr;
|
|
666
666
|
}
|
|
667
|
-
}
|
|
667
|
+
};
|
|
668
668
|
const withResolvers = () => {
|
|
669
669
|
let _resolve;
|
|
670
670
|
const promise = new Promise(resolve => {
|
|
@@ -693,7 +693,7 @@ const listen$1$1 = async () => {
|
|
|
693
693
|
const parentIpc = wrap$5(parentIpcRaw);
|
|
694
694
|
const firstMessage = await waitForFirstMessage(parentIpc);
|
|
695
695
|
if (firstMessage.method !== 'initialize') {
|
|
696
|
-
throw new IpcError('unexpected first message');
|
|
696
|
+
throw new IpcError$1('unexpected first message');
|
|
697
697
|
}
|
|
698
698
|
const type = firstMessage.params[0];
|
|
699
699
|
if (type === 'message-port') {
|
|
@@ -756,7 +756,7 @@ const createRpc = ipc => {
|
|
|
756
756
|
return invoke$2(ipc, method, ...params);
|
|
757
757
|
},
|
|
758
758
|
invokeAndTransfer(method, ...params) {
|
|
759
|
-
return invokeAndTransfer(ipc, method, ...params);
|
|
759
|
+
return invokeAndTransfer$1(ipc, method, ...params);
|
|
760
760
|
}
|
|
761
761
|
};
|
|
762
762
|
return rpc;
|
|
@@ -840,6 +840,11 @@ const invoke$1 = (method, ...params) => {
|
|
|
840
840
|
// @ts-ignore
|
|
841
841
|
return rpc.invoke(method, ...params);
|
|
842
842
|
};
|
|
843
|
+
const invokeAndTransfer = (method, ...params) => {
|
|
844
|
+
const rpc = state$1.rpc;
|
|
845
|
+
// @ts-ignore
|
|
846
|
+
return rpc.invokeAndTransfer(method, ...params);
|
|
847
|
+
};
|
|
843
848
|
const setRpc = rpc => {
|
|
844
849
|
state$1.rpc = rpc;
|
|
845
850
|
};
|
|
@@ -870,7 +875,7 @@ const set = (uid, oldState, newState) => {
|
|
|
870
875
|
};
|
|
871
876
|
};
|
|
872
877
|
|
|
873
|
-
const create$
|
|
878
|
+
const create$5 = ({
|
|
874
879
|
itemHeight,
|
|
875
880
|
headerHeight = 0,
|
|
876
881
|
minimumSliderSize = 20
|
|
@@ -883,6 +888,7 @@ const create$1 = ({
|
|
|
883
888
|
itemHeight,
|
|
884
889
|
headerHeight,
|
|
885
890
|
items: [],
|
|
891
|
+
listItems: [],
|
|
886
892
|
minimumSliderSize,
|
|
887
893
|
focusedIndex: -1,
|
|
888
894
|
touchOffsetY: 0,
|
|
@@ -893,7 +899,7 @@ const create$1 = ({
|
|
|
893
899
|
};
|
|
894
900
|
};
|
|
895
901
|
|
|
896
|
-
const create = (uid, x, y, width, height, workspacePath, assetDir, itemHeight, value = '', replacement = '') => {
|
|
902
|
+
const create$4 = (uid, x, y, width, height, workspacePath, assetDir, itemHeight, value = '', replacement = '') => {
|
|
897
903
|
const state = {
|
|
898
904
|
uid,
|
|
899
905
|
searchResults: [],
|
|
@@ -906,7 +912,7 @@ const create = (uid, x, y, width, height, workspacePath, assetDir, itemHeight, v
|
|
|
906
912
|
y,
|
|
907
913
|
width,
|
|
908
914
|
height,
|
|
909
|
-
...create$
|
|
915
|
+
...create$5({
|
|
910
916
|
itemHeight: itemHeight || 22,
|
|
911
917
|
minimumSliderSize: minimumSliderSize,
|
|
912
918
|
headerHeight: 61 // TODO
|
|
@@ -1274,29 +1280,29 @@ const focusMatchCase$1 = state => {
|
|
|
1274
1280
|
};
|
|
1275
1281
|
};
|
|
1276
1282
|
|
|
1277
|
-
const PreserveCase = 1 << 0; // 1
|
|
1278
|
-
const UseRegularExpression = 1 << 1; // 2
|
|
1283
|
+
const PreserveCase$1 = 1 << 0; // 1
|
|
1284
|
+
const UseRegularExpression$1 = 1 << 1; // 2
|
|
1279
1285
|
const ReplaceExpanded = 1 << 2; // 4
|
|
1280
|
-
const MatchWholeWord = 1 << 3; // 8
|
|
1281
|
-
const MatchCase = 1 << 4; // 16
|
|
1286
|
+
const MatchWholeWord$1 = 1 << 3; // 8
|
|
1287
|
+
const MatchCase$1 = 1 << 4; // 16
|
|
1282
1288
|
const DetailsExpanded = 1 << 5; // 32
|
|
1283
1289
|
const OpenEditors = 1 << 6; // 64
|
|
1284
1290
|
const UseIgnoreFiles = 1 << 7; // 128
|
|
1285
1291
|
|
|
1286
1292
|
const hasPreserveCase = flags => {
|
|
1287
|
-
return (flags & PreserveCase) === PreserveCase;
|
|
1293
|
+
return (flags & PreserveCase$1) === PreserveCase$1;
|
|
1288
1294
|
};
|
|
1289
1295
|
const hasUseRegularExpression = flags => {
|
|
1290
|
-
return (flags & UseRegularExpression) === UseRegularExpression;
|
|
1296
|
+
return (flags & UseRegularExpression$1) === UseRegularExpression$1;
|
|
1291
1297
|
};
|
|
1292
1298
|
const hasReplaceExpanded = flags => {
|
|
1293
1299
|
return (flags & ReplaceExpanded) === ReplaceExpanded;
|
|
1294
1300
|
};
|
|
1295
1301
|
const hasMatchWholeWord = flags => {
|
|
1296
|
-
return (flags & MatchWholeWord) === MatchWholeWord;
|
|
1302
|
+
return (flags & MatchWholeWord$1) === MatchWholeWord$1;
|
|
1297
1303
|
};
|
|
1298
1304
|
const hasMatchCase = flags => {
|
|
1299
|
-
return (flags & MatchCase) === MatchCase;
|
|
1305
|
+
return (flags & MatchCase$1) === MatchCase$1;
|
|
1300
1306
|
};
|
|
1301
1307
|
const hasDetailsExpanded = flags => {
|
|
1302
1308
|
return (flags & DetailsExpanded) === DetailsExpanded;
|
|
@@ -1691,26 +1697,8 @@ const getDisplayResult = (result, fileIcons, fileIconIndex, itemHeight, i, setSi
|
|
|
1691
1697
|
}
|
|
1692
1698
|
};
|
|
1693
1699
|
|
|
1694
|
-
const
|
|
1695
|
-
const filteredResults = [];
|
|
1696
|
-
let isExcluded = false;
|
|
1697
|
-
for (const result of results) {
|
|
1698
|
-
if (result.type === File$1) {
|
|
1699
|
-
if (collapsedPaths.includes(result.text)) {
|
|
1700
|
-
isExcluded = true;
|
|
1701
|
-
} else {
|
|
1702
|
-
isExcluded = false;
|
|
1703
|
-
}
|
|
1704
|
-
}
|
|
1705
|
-
if (!isExcluded) {
|
|
1706
|
-
filteredResults.push(result);
|
|
1707
|
-
}
|
|
1708
|
-
}
|
|
1709
|
-
return filteredResults;
|
|
1710
|
-
};
|
|
1711
|
-
const getDisplayResults = (results, itemHeight, resultCount, searchTerm, minLineY, maxLineY, replacement, collapsedPaths, fileIcons, focusedIndex) => {
|
|
1700
|
+
const getDisplayResults = (results, itemHeight, resultCount, searchTerm, minLineY, maxLineY, replacement, fileIcons, focusedIndex) => {
|
|
1712
1701
|
const displayResults = [];
|
|
1713
|
-
const filteredResults = getFilteredResults(results, collapsedPaths);
|
|
1714
1702
|
const setSize = resultCount;
|
|
1715
1703
|
const searchTermLength = searchTerm.length;
|
|
1716
1704
|
let fileResult = {
|
|
@@ -1718,7 +1706,7 @@ const getDisplayResults = (results, itemHeight, resultCount, searchTerm, minLine
|
|
|
1718
1706
|
};
|
|
1719
1707
|
let fileIconIndex = 0;
|
|
1720
1708
|
for (let i = minLineY; i < maxLineY; i++) {
|
|
1721
|
-
const result =
|
|
1709
|
+
const result = results[i];
|
|
1722
1710
|
const displayResult = getDisplayResult(result, fileIcons, fileIconIndex, itemHeight, i, setSize, searchTermLength, replacement, focusedIndex);
|
|
1723
1711
|
displayResults.push(displayResult);
|
|
1724
1712
|
if (result.type === File$1) {
|
|
@@ -1845,18 +1833,34 @@ const getSearchFieldVirtualDom = (name, placeholder, onInput, insideButtons, out
|
|
|
1845
1833
|
return dom;
|
|
1846
1834
|
};
|
|
1847
1835
|
|
|
1836
|
+
const FilesToExclude = 'FilesToExclude';
|
|
1837
|
+
const FilesToInclude = 'FilesToInclude';
|
|
1838
|
+
const MatchCase = 'MatchCase';
|
|
1839
|
+
const MatchWholeWord = 'MatchWholeWord';
|
|
1840
|
+
const PreserveCase = 'PreserveCase';
|
|
1841
|
+
const ReplaceAll = 'ReplaceAll';
|
|
1842
|
+
const ReplaceValue = 'ReplaceValue';
|
|
1843
|
+
const SearchOnlyOpenEditors = 'SearchOnlyOpenEditors';
|
|
1844
|
+
const SearchValue = 'SearchValue';
|
|
1845
|
+
const ToggleReplace = 'ToggleReplace';
|
|
1846
|
+
const ToggleSearchDetails = 'ToggleSearchDetails';
|
|
1847
|
+
const UseExcludeSettings = 'UseExcludeSettings';
|
|
1848
|
+
const UseRegularExpression = 'UseRegularExpression';
|
|
1849
|
+
|
|
1848
1850
|
const getSearchHeaderDetailsExpandedVirtualDom = (flags, message) => {
|
|
1849
1851
|
const includeButtons = [{
|
|
1850
1852
|
icon: MaskIconBook,
|
|
1851
1853
|
title: searchOnlyOpenEditors(),
|
|
1852
1854
|
command: 'searchOnlyOpenEditors',
|
|
1853
|
-
checked: Boolean(flags & OpenEditors)
|
|
1855
|
+
checked: Boolean(flags & OpenEditors),
|
|
1856
|
+
name: SearchOnlyOpenEditors
|
|
1854
1857
|
}];
|
|
1855
1858
|
const excludeButtons = [{
|
|
1856
1859
|
icon: MaskIconExclude,
|
|
1857
1860
|
title: useExcludeSettings(),
|
|
1858
1861
|
command: 'toggleUseExcludeSettings',
|
|
1859
|
-
checked: Boolean(flags & UseIgnoreFiles)
|
|
1862
|
+
checked: Boolean(flags & UseIgnoreFiles),
|
|
1863
|
+
name: UseExcludeSettings
|
|
1860
1864
|
}];
|
|
1861
1865
|
return [{
|
|
1862
1866
|
type: Div,
|
|
@@ -1870,11 +1874,11 @@ const getSearchHeaderDetailsExpandedVirtualDom = (flags, message) => {
|
|
|
1870
1874
|
type: H4,
|
|
1871
1875
|
className: SearchHeaderDetailsHeading,
|
|
1872
1876
|
childCount: 1
|
|
1873
|
-
}, text(filesToInclude()), ...getSearchFieldVirtualDom(
|
|
1877
|
+
}, text(filesToInclude()), ...getSearchFieldVirtualDom(FilesToInclude, 'Include', 'handleIncludeInput', includeButtons, []), {
|
|
1874
1878
|
type: H4,
|
|
1875
1879
|
className: SearchHeaderDetailsHeading,
|
|
1876
1880
|
childCount: 1
|
|
1877
|
-
}, text(filesToExclude()), ...getSearchFieldVirtualDom(
|
|
1881
|
+
}, text(filesToExclude()), ...getSearchFieldVirtualDom(FilesToExclude, 'Exclude', 'handleExcludeInput', excludeButtons, []), ...getSearchMessageVirtualDom(message)];
|
|
1878
1882
|
};
|
|
1879
1883
|
|
|
1880
1884
|
const getSearchHeaderDetailsVirtualDom = (flags, message) => {
|
|
@@ -1911,28 +1915,33 @@ const getSearchHeaderTopVirtualDom = flags => {
|
|
|
1911
1915
|
className: SearchHeaderTopRight,
|
|
1912
1916
|
role: None,
|
|
1913
1917
|
childCount: hasReplaceExpanded(flags) ? 2 : 1
|
|
1914
|
-
}, ...getSearchFieldVirtualDom(
|
|
1918
|
+
}, ...getSearchFieldVirtualDom(SearchValue, 'Search', 'handleInput', [{
|
|
1915
1919
|
icon: MaskIconCaseSensitive,
|
|
1916
1920
|
checked: hasMatchCase(flags),
|
|
1917
|
-
title: matchCase()
|
|
1921
|
+
title: matchCase(),
|
|
1922
|
+
name: MatchCase
|
|
1918
1923
|
}, {
|
|
1919
1924
|
icon: MaskIconWholeWord,
|
|
1920
1925
|
checked: hasMatchWholeWord(flags),
|
|
1921
|
-
title: matchWholeWord()
|
|
1926
|
+
title: matchWholeWord(),
|
|
1927
|
+
name: MatchWholeWord
|
|
1922
1928
|
}, {
|
|
1923
1929
|
icon: MaskIconRegex,
|
|
1924
1930
|
checked: hasUseRegularExpression(flags),
|
|
1925
|
-
title: useRegularExpression()
|
|
1931
|
+
title: useRegularExpression(),
|
|
1932
|
+
name: UseRegularExpression
|
|
1926
1933
|
}], [])];
|
|
1927
1934
|
if (hasReplaceExpanded(flags)) {
|
|
1928
|
-
dom.push(...getSearchFieldVirtualDom(
|
|
1935
|
+
dom.push(...getSearchFieldVirtualDom(ReplaceValue, 'Replace', 'handleReplaceInput', [{
|
|
1929
1936
|
icon: MaskIconPreserveCase,
|
|
1930
1937
|
checked: hasPreserveCase(flags),
|
|
1931
|
-
title: preserveCase()
|
|
1938
|
+
title: preserveCase(),
|
|
1939
|
+
name: PreserveCase
|
|
1932
1940
|
}], [{
|
|
1933
1941
|
icon: MaskIconReplaceAll,
|
|
1934
1942
|
checked: false,
|
|
1935
|
-
title: replaceAll$1()
|
|
1943
|
+
title: replaceAll$1(),
|
|
1944
|
+
name: ReplaceAll
|
|
1936
1945
|
}]));
|
|
1937
1946
|
}
|
|
1938
1947
|
return dom;
|
|
@@ -2446,7 +2455,7 @@ function promisifyRequest(request) {
|
|
|
2446
2455
|
request.removeEventListener('error', error);
|
|
2447
2456
|
};
|
|
2448
2457
|
const success = () => {
|
|
2449
|
-
resolve(wrap(request.result));
|
|
2458
|
+
resolve(wrap$2(request.result));
|
|
2450
2459
|
unlisten();
|
|
2451
2460
|
};
|
|
2452
2461
|
const error = () => {
|
|
@@ -2496,7 +2505,7 @@ let idbProxyTraps = {
|
|
|
2496
2505
|
}
|
|
2497
2506
|
}
|
|
2498
2507
|
// Else transform whatever we get back.
|
|
2499
|
-
return wrap(target[prop]);
|
|
2508
|
+
return wrap$2(target[prop]);
|
|
2500
2509
|
},
|
|
2501
2510
|
set(target, prop, value) {
|
|
2502
2511
|
target[prop] = value;
|
|
@@ -2525,13 +2534,13 @@ function wrapFunction(func) {
|
|
|
2525
2534
|
// Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use
|
|
2526
2535
|
// the original object.
|
|
2527
2536
|
func.apply(unwrap(this), args);
|
|
2528
|
-
return wrap(this.request);
|
|
2537
|
+
return wrap$2(this.request);
|
|
2529
2538
|
};
|
|
2530
2539
|
}
|
|
2531
2540
|
return function (...args) {
|
|
2532
2541
|
// Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use
|
|
2533
2542
|
// the original object.
|
|
2534
|
-
return wrap(func.apply(unwrap(this), args));
|
|
2543
|
+
return wrap$2(func.apply(unwrap(this), args));
|
|
2535
2544
|
};
|
|
2536
2545
|
}
|
|
2537
2546
|
function transformCachableValue(value) {
|
|
@@ -2543,7 +2552,7 @@ function transformCachableValue(value) {
|
|
|
2543
2552
|
// Return the same value back if we're not going to transform it.
|
|
2544
2553
|
return value;
|
|
2545
2554
|
}
|
|
2546
|
-
function wrap(value) {
|
|
2555
|
+
function wrap$2(value) {
|
|
2547
2556
|
// We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because
|
|
2548
2557
|
// IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.
|
|
2549
2558
|
if (value instanceof IDBRequest) return promisifyRequest(value);
|
|
@@ -2575,10 +2584,10 @@ function openDB(name, version, {
|
|
|
2575
2584
|
terminated
|
|
2576
2585
|
} = {}) {
|
|
2577
2586
|
const request = indexedDB.open(name, version);
|
|
2578
|
-
const openPromise = wrap(request);
|
|
2587
|
+
const openPromise = wrap$2(request);
|
|
2579
2588
|
if (upgrade) {
|
|
2580
2589
|
request.addEventListener('upgradeneeded', event => {
|
|
2581
|
-
upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction), event);
|
|
2590
|
+
upgrade(wrap$2(request.result), event.oldVersion, event.newVersion, wrap$2(request.transaction), event);
|
|
2582
2591
|
});
|
|
2583
2592
|
}
|
|
2584
2593
|
if (blocked) {
|
|
@@ -2888,6 +2897,7 @@ const handleUpdate = async (state, update) => {
|
|
|
2888
2897
|
maxLineY: 0,
|
|
2889
2898
|
deltaY: 0,
|
|
2890
2899
|
items: [],
|
|
2900
|
+
listItems: [],
|
|
2891
2901
|
matchCount: 0,
|
|
2892
2902
|
message: '',
|
|
2893
2903
|
loaded: true
|
|
@@ -2922,6 +2932,7 @@ const handleUpdate = async (state, update) => {
|
|
|
2922
2932
|
deltaY: 0,
|
|
2923
2933
|
value,
|
|
2924
2934
|
items: results,
|
|
2935
|
+
listItems: results,
|
|
2925
2936
|
message,
|
|
2926
2937
|
maxLineY: maxLineY,
|
|
2927
2938
|
scrollBarHeight,
|
|
@@ -2938,6 +2949,7 @@ const handleUpdate = async (state, update) => {
|
|
|
2938
2949
|
...partialNewState,
|
|
2939
2950
|
message: `${error}`,
|
|
2940
2951
|
items: [],
|
|
2952
|
+
listItems: [],
|
|
2941
2953
|
matchCount: 0,
|
|
2942
2954
|
fileCount: 0,
|
|
2943
2955
|
minLineY: 0,
|
|
@@ -2982,6 +2994,10 @@ const handleInput = (state, value, inputSource = Script) => {
|
|
|
2982
2994
|
});
|
|
2983
2995
|
};
|
|
2984
2996
|
|
|
2997
|
+
const handleListBlur = state => {
|
|
2998
|
+
return state;
|
|
2999
|
+
};
|
|
3000
|
+
|
|
2985
3001
|
const handleReplaceInput = (state, value, inputSource = Script) => {
|
|
2986
3002
|
return handleUpdate(state, {
|
|
2987
3003
|
replacement: value,
|
|
@@ -3007,6 +3023,296 @@ const handleSharedInput = (state, name, value, inputSource = Script) => {
|
|
|
3007
3023
|
return fn(state, value, inputSource);
|
|
3008
3024
|
};
|
|
3009
3025
|
|
|
3026
|
+
const NodeAlternate = 8;
|
|
3027
|
+
|
|
3028
|
+
const getData = event => {
|
|
3029
|
+
const {
|
|
3030
|
+
data
|
|
3031
|
+
} = event;
|
|
3032
|
+
return data;
|
|
3033
|
+
};
|
|
3034
|
+
|
|
3035
|
+
const getPortTuple = () => {
|
|
3036
|
+
const {
|
|
3037
|
+
port1,
|
|
3038
|
+
port2
|
|
3039
|
+
} = new MessageChannel();
|
|
3040
|
+
return {
|
|
3041
|
+
port1,
|
|
3042
|
+
port2
|
|
3043
|
+
};
|
|
3044
|
+
};
|
|
3045
|
+
|
|
3046
|
+
const Open = 1;
|
|
3047
|
+
const Close = 2;
|
|
3048
|
+
|
|
3049
|
+
const Https = 'https:';
|
|
3050
|
+
const Ws = 'ws:';
|
|
3051
|
+
const Wss = 'wss:';
|
|
3052
|
+
|
|
3053
|
+
const getWebSocketProtocol = () => {
|
|
3054
|
+
return location.protocol === Https ? Wss : Ws;
|
|
3055
|
+
};
|
|
3056
|
+
|
|
3057
|
+
const getWebSocketUrl = (type, host) => {
|
|
3058
|
+
const wsProtocol = getWebSocketProtocol();
|
|
3059
|
+
return `${wsProtocol}//${host}/websocket/${type}`;
|
|
3060
|
+
};
|
|
3061
|
+
|
|
3062
|
+
class IpcError extends Error {
|
|
3063
|
+
constructor(message) {
|
|
3064
|
+
super(message);
|
|
3065
|
+
this.name = 'IpcError';
|
|
3066
|
+
}
|
|
3067
|
+
}
|
|
3068
|
+
|
|
3069
|
+
const stringifyCompact = value => {
|
|
3070
|
+
return JSON.stringify(value);
|
|
3071
|
+
};
|
|
3072
|
+
const parse = content => {
|
|
3073
|
+
if (content === 'undefined') {
|
|
3074
|
+
return null;
|
|
3075
|
+
}
|
|
3076
|
+
// TODO use better json parse to throw more helpful error messages if json is invalid
|
|
3077
|
+
try {
|
|
3078
|
+
return JSON.parse(content);
|
|
3079
|
+
} catch (error) {
|
|
3080
|
+
throw new VError(error, 'failed to parse json');
|
|
3081
|
+
}
|
|
3082
|
+
};
|
|
3083
|
+
|
|
3084
|
+
const create$3 = (url, args) => {
|
|
3085
|
+
const webSocket = new WebSocket(url, args);
|
|
3086
|
+
const reconnect = () => {
|
|
3087
|
+
const originalOnMessage = context.webSocket.onmessage;
|
|
3088
|
+
context.webSocket = new WebSocket(url, args);
|
|
3089
|
+
context.webSocket.onmessage = originalOnMessage;
|
|
3090
|
+
context.webSocket.onclose = handleClose;
|
|
3091
|
+
};
|
|
3092
|
+
const handleClose = () => {
|
|
3093
|
+
setTimeout(reconnect, 2000);
|
|
3094
|
+
};
|
|
3095
|
+
const context = {
|
|
3096
|
+
webSocket,
|
|
3097
|
+
get onmessage() {
|
|
3098
|
+
return this.webSocket.onmessage;
|
|
3099
|
+
},
|
|
3100
|
+
set onmessage(value) {
|
|
3101
|
+
this.webSocket.onmessage = value;
|
|
3102
|
+
},
|
|
3103
|
+
send(message) {
|
|
3104
|
+
this.webSocket.send(message);
|
|
3105
|
+
},
|
|
3106
|
+
addEventListener(type, listener) {
|
|
3107
|
+
this.webSocket.addEventListener(type, listener);
|
|
3108
|
+
},
|
|
3109
|
+
removeEventListener(type, listener) {
|
|
3110
|
+
this.webSocket.removeEventListener(type, listener);
|
|
3111
|
+
}
|
|
3112
|
+
};
|
|
3113
|
+
webSocket.onclose = handleClose;
|
|
3114
|
+
return context;
|
|
3115
|
+
};
|
|
3116
|
+
|
|
3117
|
+
const getFirstEvent = (eventTarget, eventMap) => {
|
|
3118
|
+
const {
|
|
3119
|
+
resolve,
|
|
3120
|
+
promise
|
|
3121
|
+
} = Promise.withResolvers();
|
|
3122
|
+
const listenerMap = Object.create(null);
|
|
3123
|
+
const cleanup = value => {
|
|
3124
|
+
for (const event of Object.keys(eventMap)) {
|
|
3125
|
+
eventTarget.removeEventListener(event, listenerMap[event]);
|
|
3126
|
+
}
|
|
3127
|
+
resolve(value);
|
|
3128
|
+
};
|
|
3129
|
+
for (const [event, type] of Object.entries(eventMap)) {
|
|
3130
|
+
const listener = event => {
|
|
3131
|
+
cleanup({
|
|
3132
|
+
type,
|
|
3133
|
+
event
|
|
3134
|
+
});
|
|
3135
|
+
};
|
|
3136
|
+
eventTarget.addEventListener(event, listener);
|
|
3137
|
+
listenerMap[event] = listener;
|
|
3138
|
+
}
|
|
3139
|
+
return promise;
|
|
3140
|
+
};
|
|
3141
|
+
|
|
3142
|
+
const waitForWebSocketToBeOpen = webSocket => {
|
|
3143
|
+
return getFirstEvent(webSocket, {
|
|
3144
|
+
open: Open,
|
|
3145
|
+
close: Close
|
|
3146
|
+
});
|
|
3147
|
+
};
|
|
3148
|
+
|
|
3149
|
+
const getHost = () => {
|
|
3150
|
+
return location.host;
|
|
3151
|
+
};
|
|
3152
|
+
|
|
3153
|
+
const create$2 = async ({
|
|
3154
|
+
type
|
|
3155
|
+
}) => {
|
|
3156
|
+
string(type);
|
|
3157
|
+
const host = getHost();
|
|
3158
|
+
const wsUrl = getWebSocketUrl(type, host);
|
|
3159
|
+
const webSocket = create$3(wsUrl);
|
|
3160
|
+
const firstWebSocketEvent = await waitForWebSocketToBeOpen(webSocket);
|
|
3161
|
+
if (firstWebSocketEvent.type === Close) {
|
|
3162
|
+
throw new IpcError('Websocket connection was immediately closed');
|
|
3163
|
+
}
|
|
3164
|
+
return webSocket;
|
|
3165
|
+
};
|
|
3166
|
+
const getMessage = event => {
|
|
3167
|
+
return parse(event.data);
|
|
3168
|
+
};
|
|
3169
|
+
const wrap$1 = webSocket => {
|
|
3170
|
+
return {
|
|
3171
|
+
webSocket,
|
|
3172
|
+
/**
|
|
3173
|
+
* @type {any}
|
|
3174
|
+
*/
|
|
3175
|
+
listener: undefined,
|
|
3176
|
+
get onmessage() {
|
|
3177
|
+
return this.listener;
|
|
3178
|
+
},
|
|
3179
|
+
set onmessage(listener) {
|
|
3180
|
+
this.listener = listener;
|
|
3181
|
+
const wrappedListener = event => {
|
|
3182
|
+
const message = getMessage(event);
|
|
3183
|
+
const syntheticEvent = {
|
|
3184
|
+
data: message,
|
|
3185
|
+
target: this
|
|
3186
|
+
};
|
|
3187
|
+
listener(syntheticEvent);
|
|
3188
|
+
};
|
|
3189
|
+
this.webSocket.onmessage = wrappedListener;
|
|
3190
|
+
},
|
|
3191
|
+
send(message) {
|
|
3192
|
+
const stringifiedMessage = stringifyCompact(message);
|
|
3193
|
+
this.webSocket.send(stringifiedMessage);
|
|
3194
|
+
}
|
|
3195
|
+
};
|
|
3196
|
+
};
|
|
3197
|
+
|
|
3198
|
+
const IpcParentWithWebSocket = {
|
|
3199
|
+
__proto__: null,
|
|
3200
|
+
create: create$2,
|
|
3201
|
+
wrap: wrap$1
|
|
3202
|
+
};
|
|
3203
|
+
|
|
3204
|
+
const Web = 1;
|
|
3205
|
+
const Electron = 2;
|
|
3206
|
+
const Remote = 3;
|
|
3207
|
+
|
|
3208
|
+
const sendMessagePortToElectron = async (port, initialCommand, ipcId) => {
|
|
3209
|
+
object(port);
|
|
3210
|
+
string(initialCommand);
|
|
3211
|
+
await invokeAndTransfer(initialCommand, port, ipcId);
|
|
3212
|
+
};
|
|
3213
|
+
|
|
3214
|
+
const create$1 = async options => {
|
|
3215
|
+
switch (options.platform) {
|
|
3216
|
+
case Web:
|
|
3217
|
+
case Remote:
|
|
3218
|
+
const module = IpcParentWithWebSocket;
|
|
3219
|
+
const rawIpc = await module.create(options);
|
|
3220
|
+
if (options.raw) {
|
|
3221
|
+
return rawIpc;
|
|
3222
|
+
}
|
|
3223
|
+
return {
|
|
3224
|
+
rawIpc,
|
|
3225
|
+
module
|
|
3226
|
+
};
|
|
3227
|
+
case Electron:
|
|
3228
|
+
const {
|
|
3229
|
+
port1,
|
|
3230
|
+
port2
|
|
3231
|
+
} = getPortTuple();
|
|
3232
|
+
await sendMessagePortToElectron(port2, options.initialCommand, options.ipcId);
|
|
3233
|
+
return port1;
|
|
3234
|
+
default:
|
|
3235
|
+
throw new Error('unsupported platform');
|
|
3236
|
+
}
|
|
3237
|
+
};
|
|
3238
|
+
const wrap = port => {
|
|
3239
|
+
if (!(port instanceof MessagePort)) {
|
|
3240
|
+
return port.module.wrap(port.rawIpc);
|
|
3241
|
+
}
|
|
3242
|
+
return {
|
|
3243
|
+
port,
|
|
3244
|
+
/**
|
|
3245
|
+
* @type {any}
|
|
3246
|
+
*/
|
|
3247
|
+
listener: undefined,
|
|
3248
|
+
get onmessage() {
|
|
3249
|
+
return this.listener;
|
|
3250
|
+
},
|
|
3251
|
+
set onmessage(listener) {
|
|
3252
|
+
this.listener = listener;
|
|
3253
|
+
const wrappedListener = event => {
|
|
3254
|
+
const data = getData(event);
|
|
3255
|
+
const syntheticEvent = {
|
|
3256
|
+
data,
|
|
3257
|
+
target: this
|
|
3258
|
+
};
|
|
3259
|
+
listener(syntheticEvent);
|
|
3260
|
+
};
|
|
3261
|
+
this.port.onmessage = wrappedListener;
|
|
3262
|
+
},
|
|
3263
|
+
send(message) {
|
|
3264
|
+
this.port.postMessage(message);
|
|
3265
|
+
},
|
|
3266
|
+
sendAndTransfer(message, transfer) {
|
|
3267
|
+
this.port.postMessage(message, transfer);
|
|
3268
|
+
}
|
|
3269
|
+
};
|
|
3270
|
+
};
|
|
3271
|
+
|
|
3272
|
+
const IpcParentWithNodeAlternate = {
|
|
3273
|
+
__proto__: null,
|
|
3274
|
+
create: create$1,
|
|
3275
|
+
wrap
|
|
3276
|
+
};
|
|
3277
|
+
|
|
3278
|
+
const getModule = method => {
|
|
3279
|
+
switch (method) {
|
|
3280
|
+
case NodeAlternate:
|
|
3281
|
+
return IpcParentWithNodeAlternate;
|
|
3282
|
+
default:
|
|
3283
|
+
throw new Error('unexpected ipc type');
|
|
3284
|
+
}
|
|
3285
|
+
};
|
|
3286
|
+
|
|
3287
|
+
const create = async ({
|
|
3288
|
+
method,
|
|
3289
|
+
...options
|
|
3290
|
+
}) => {
|
|
3291
|
+
const module = getModule(method);
|
|
3292
|
+
// @ts-ignore
|
|
3293
|
+
const rawIpc = await module.create(options);
|
|
3294
|
+
if (options.noReturn) {
|
|
3295
|
+
return undefined;
|
|
3296
|
+
}
|
|
3297
|
+
if (options.raw) {
|
|
3298
|
+
return rawIpc;
|
|
3299
|
+
}
|
|
3300
|
+
const ipc = module.wrap(rawIpc);
|
|
3301
|
+
return ipc;
|
|
3302
|
+
};
|
|
3303
|
+
|
|
3304
|
+
const launchSearchProcess = async () => {
|
|
3305
|
+
const ipc = await create({
|
|
3306
|
+
method: NodeAlternate,
|
|
3307
|
+
type: 'search-process',
|
|
3308
|
+
name: 'Search Process',
|
|
3309
|
+
initialCommand: 'HandleMessagePortForSearchProcess.handleMessagePortForSearchProcess'
|
|
3310
|
+
});
|
|
3311
|
+
// TODO
|
|
3312
|
+
// HandleIpc.handleIpc(ipc)
|
|
3313
|
+
return ipc;
|
|
3314
|
+
};
|
|
3315
|
+
|
|
3010
3316
|
const first = () => {
|
|
3011
3317
|
return 0;
|
|
3012
3318
|
};
|
|
@@ -3144,23 +3450,65 @@ const focusPreviousPage = state => {
|
|
|
3144
3450
|
return focusIndex(state, indexPreviousPage);
|
|
3145
3451
|
};
|
|
3146
3452
|
|
|
3147
|
-
const getListIndex = (eventX, eventY, x, y, deltaY, itemHeight) => {
|
|
3148
|
-
const relativeY = eventY - y + deltaY;
|
|
3453
|
+
const getListIndex = (eventX, eventY, x, y, deltaY, itemHeight, topHeight) => {
|
|
3454
|
+
const relativeY = eventY - y - topHeight + deltaY;
|
|
3149
3455
|
const index = Math.floor(relativeY / itemHeight);
|
|
3150
3456
|
return index;
|
|
3151
3457
|
};
|
|
3152
3458
|
|
|
3459
|
+
const getTopHeight = flags => {
|
|
3460
|
+
if (flags & ReplaceExpanded && flags & DetailsExpanded) {
|
|
3461
|
+
return 190;
|
|
3462
|
+
}
|
|
3463
|
+
if (flags & DetailsExpanded) {
|
|
3464
|
+
return 158;
|
|
3465
|
+
}
|
|
3466
|
+
if (flags & ReplaceExpanded) {
|
|
3467
|
+
return 93;
|
|
3468
|
+
}
|
|
3469
|
+
return 61;
|
|
3470
|
+
};
|
|
3471
|
+
|
|
3472
|
+
const getFilteredResults = (results, collapsedPaths) => {
|
|
3473
|
+
if (collapsedPaths.length === 0) {
|
|
3474
|
+
return results;
|
|
3475
|
+
}
|
|
3476
|
+
const filteredResults = [];
|
|
3477
|
+
let isExcluded = false;
|
|
3478
|
+
for (const result of results) {
|
|
3479
|
+
if (result.type === File$1) {
|
|
3480
|
+
if (collapsedPaths.includes(result.text)) {
|
|
3481
|
+
isExcluded = true;
|
|
3482
|
+
} else {
|
|
3483
|
+
isExcluded = false;
|
|
3484
|
+
}
|
|
3485
|
+
}
|
|
3486
|
+
if (!isExcluded) {
|
|
3487
|
+
filteredResults.push(result);
|
|
3488
|
+
}
|
|
3489
|
+
}
|
|
3490
|
+
return filteredResults;
|
|
3491
|
+
};
|
|
3492
|
+
|
|
3153
3493
|
const selectIndexFile = (state, searchResult, index) => {
|
|
3154
3494
|
const {
|
|
3155
|
-
collapsedPaths
|
|
3495
|
+
collapsedPaths,
|
|
3496
|
+
items,
|
|
3497
|
+
maxLineY
|
|
3156
3498
|
} = state;
|
|
3157
3499
|
const path = getAbsolutePath(searchResult.text);
|
|
3158
3500
|
string(path);
|
|
3501
|
+
const pathWithDot = `.${path}`;
|
|
3502
|
+
const newCollapsedPaths = [...collapsedPaths, path, pathWithDot];
|
|
3503
|
+
const filteredResults = getFilteredResults(items, collapsedPaths);
|
|
3504
|
+
const newMaxLineY = Math.min(maxLineY, filteredResults.length);
|
|
3159
3505
|
return {
|
|
3160
3506
|
...state,
|
|
3161
|
-
collapsedPaths:
|
|
3507
|
+
collapsedPaths: newCollapsedPaths,
|
|
3162
3508
|
listFocusedIndex: index,
|
|
3163
|
-
listFocused: true
|
|
3509
|
+
listFocused: true,
|
|
3510
|
+
listItems: filteredResults,
|
|
3511
|
+
maxLineY: newMaxLineY
|
|
3164
3512
|
};
|
|
3165
3513
|
};
|
|
3166
3514
|
|
|
@@ -3224,14 +3572,16 @@ const selectIndex = async (state, index) => {
|
|
|
3224
3572
|
}
|
|
3225
3573
|
};
|
|
3226
3574
|
|
|
3227
|
-
const handleClickAt =
|
|
3575
|
+
const handleClickAt = (state, eventX, eventY) => {
|
|
3228
3576
|
const {
|
|
3229
3577
|
x,
|
|
3230
3578
|
y,
|
|
3231
3579
|
itemHeight,
|
|
3232
|
-
deltaY
|
|
3580
|
+
deltaY,
|
|
3581
|
+
flags
|
|
3233
3582
|
} = state;
|
|
3234
|
-
const
|
|
3583
|
+
const topHeight = getTopHeight(flags);
|
|
3584
|
+
const index = getListIndex(eventX, eventY, x, y, deltaY, itemHeight, topHeight);
|
|
3235
3585
|
return selectIndex(state, index);
|
|
3236
3586
|
};
|
|
3237
3587
|
|
|
@@ -3410,35 +3760,34 @@ const refresh = state => {
|
|
|
3410
3760
|
return handleUpdate(state, {});
|
|
3411
3761
|
};
|
|
3412
3762
|
|
|
3413
|
-
// TODO just return name
|
|
3414
3763
|
const getFocusSelector = focusKey => {
|
|
3415
3764
|
switch (focusKey) {
|
|
3416
3765
|
case FocusSearchInput:
|
|
3417
|
-
return
|
|
3766
|
+
return SearchValue;
|
|
3418
3767
|
case FocusSearchReplaceInput:
|
|
3419
|
-
return
|
|
3768
|
+
return ReplaceValue;
|
|
3420
3769
|
case FocusToggleDetails:
|
|
3421
|
-
return
|
|
3770
|
+
return ToggleSearchDetails;
|
|
3422
3771
|
case FocusSearchMatchCase:
|
|
3423
|
-
return
|
|
3772
|
+
return MatchCase;
|
|
3424
3773
|
case FocusSearchPreserveCase:
|
|
3425
|
-
return
|
|
3774
|
+
return PreserveCase;
|
|
3426
3775
|
case FocusSearchRegex:
|
|
3427
|
-
return
|
|
3776
|
+
return UseRegularExpression;
|
|
3428
3777
|
case FocusSearchIncludeInput:
|
|
3429
|
-
return
|
|
3778
|
+
return FilesToInclude;
|
|
3430
3779
|
case FocusSearchExcludeInput:
|
|
3431
|
-
return
|
|
3780
|
+
return FilesToExclude;
|
|
3432
3781
|
case FocusSearchWholeWord:
|
|
3433
|
-
return
|
|
3782
|
+
return MatchWholeWord;
|
|
3434
3783
|
case FocusSearchReplaceAll:
|
|
3435
|
-
return
|
|
3784
|
+
return ReplaceAll;
|
|
3436
3785
|
case FocusSearchOpenEditors:
|
|
3437
|
-
return
|
|
3786
|
+
return SearchOnlyOpenEditors;
|
|
3438
3787
|
case FocusIgnoreFiles:
|
|
3439
|
-
return
|
|
3788
|
+
return UseExcludeSettings;
|
|
3440
3789
|
case FocusToggleReplace:
|
|
3441
|
-
return
|
|
3790
|
+
return ToggleReplace;
|
|
3442
3791
|
default:
|
|
3443
3792
|
return '';
|
|
3444
3793
|
}
|
|
@@ -3449,7 +3798,7 @@ const renderItems = {
|
|
|
3449
3798
|
return oldState.items === newState.items && oldState.minLineY === newState.minLineY && oldState.maxLineY === newState.maxLineY && oldState.replacement === newState.replacement && oldState.flags === newState.flags && oldState.message === newState.message && oldState.loaded === newState.loaded && oldState.collapsedPaths === newState.collapsedPaths && oldState.listFocusedIndex === newState.listFocusedIndex && oldState.listFocused === newState.listFocused && oldState.icons === newState.icons;
|
|
3450
3799
|
},
|
|
3451
3800
|
apply(oldState, newState) {
|
|
3452
|
-
const displayResults = getDisplayResults(newState.
|
|
3801
|
+
const displayResults = getDisplayResults(newState.listItems, newState.itemHeight, newState.fileCount, newState.value, newState.minLineY, newState.maxLineY, newState.replacement, newState.icons, newState.listFocusedIndex);
|
|
3453
3802
|
const focusOutline = newState.listFocused && newState.listFocusedIndex === -1;
|
|
3454
3803
|
const dom = getSearchVirtualDom(displayResults, newState.flags, newState.message, focusOutline);
|
|
3455
3804
|
return ['Viewlet.setDom2', newState.uid, dom];
|
|
@@ -3460,8 +3809,8 @@ const renderFocus = {
|
|
|
3460
3809
|
return oldState.focus === newState.focus || newState.focusSource === User;
|
|
3461
3810
|
},
|
|
3462
3811
|
apply(oldState, newState) {
|
|
3463
|
-
const
|
|
3464
|
-
return ['Viewlet.
|
|
3812
|
+
const name = newState.focusSource === User ? '' : getFocusSelector(newState.focus);
|
|
3813
|
+
return ['Viewlet.focusElementByName', name];
|
|
3465
3814
|
}
|
|
3466
3815
|
};
|
|
3467
3816
|
const renderValue = {
|
|
@@ -3634,29 +3983,29 @@ const setFocus = async focusKey => {
|
|
|
3634
3983
|
|
|
3635
3984
|
const getSearchFocusKey = key => {
|
|
3636
3985
|
switch (key) {
|
|
3637
|
-
case
|
|
3986
|
+
case SearchValue:
|
|
3638
3987
|
return FocusSearchInput;
|
|
3639
|
-
case
|
|
3988
|
+
case ReplaceValue:
|
|
3640
3989
|
return FocusSearchReplaceInput;
|
|
3641
|
-
case
|
|
3990
|
+
case MatchCase:
|
|
3642
3991
|
return FocusSearchMatchCase;
|
|
3643
|
-
case
|
|
3992
|
+
case MatchWholeWord:
|
|
3644
3993
|
return FocusSearchWholeWord;
|
|
3645
|
-
case
|
|
3994
|
+
case UseRegularExpression:
|
|
3646
3995
|
return FocusSearchRegex;
|
|
3647
|
-
case
|
|
3996
|
+
case ReplaceAll:
|
|
3648
3997
|
return FocusSearchReplaceAll;
|
|
3649
|
-
case
|
|
3998
|
+
case PreserveCase:
|
|
3650
3999
|
return FocusSearchPreserveCase;
|
|
3651
|
-
case
|
|
4000
|
+
case ToggleSearchDetails:
|
|
3652
4001
|
return FocusToggleDetails;
|
|
3653
|
-
case
|
|
4002
|
+
case FilesToInclude:
|
|
3654
4003
|
return FocusSearchIncludeInput;
|
|
3655
|
-
case
|
|
4004
|
+
case FilesToExclude:
|
|
3656
4005
|
return FocusSearchExcludeInput;
|
|
3657
|
-
case
|
|
4006
|
+
case SearchOnlyOpenEditors:
|
|
3658
4007
|
return FocusSearchOpenEditors;
|
|
3659
|
-
case
|
|
4008
|
+
case UseExcludeSettings:
|
|
3660
4009
|
return FocusIgnoreFiles;
|
|
3661
4010
|
default:
|
|
3662
4011
|
return Empty$1;
|
|
@@ -3753,11 +4102,11 @@ const toggleDetailsExpanded = state => {
|
|
|
3753
4102
|
};
|
|
3754
4103
|
|
|
3755
4104
|
const toggleMatchCase = state => {
|
|
3756
|
-
return toggleSearchFlag(state, MatchCase);
|
|
4105
|
+
return toggleSearchFlag(state, MatchCase$1);
|
|
3757
4106
|
};
|
|
3758
4107
|
|
|
3759
4108
|
const toggleMatchWholeWord = state => {
|
|
3760
|
-
return toggleSearchFlag(state, MatchWholeWord);
|
|
4109
|
+
return toggleSearchFlag(state, MatchWholeWord$1);
|
|
3761
4110
|
};
|
|
3762
4111
|
|
|
3763
4112
|
const toggleOpenEditors = state => {
|
|
@@ -3765,7 +4114,7 @@ const toggleOpenEditors = state => {
|
|
|
3765
4114
|
};
|
|
3766
4115
|
|
|
3767
4116
|
const togglePreserveCase = state => {
|
|
3768
|
-
return toggleSearchFlag(state, PreserveCase);
|
|
4117
|
+
return toggleSearchFlag(state, PreserveCase$1);
|
|
3769
4118
|
};
|
|
3770
4119
|
|
|
3771
4120
|
const toggleReplace = state => {
|
|
@@ -3777,7 +4126,7 @@ const toggleUseIgnoreFiles = state => {
|
|
|
3777
4126
|
};
|
|
3778
4127
|
|
|
3779
4128
|
const toggleUseRegularExpression = state => {
|
|
3780
|
-
return toggleSearchFlag(state, UseRegularExpression);
|
|
4129
|
+
return toggleSearchFlag(state, UseRegularExpression$1);
|
|
3781
4130
|
};
|
|
3782
4131
|
|
|
3783
4132
|
const Keyboard = -1;
|
|
@@ -3862,12 +4211,14 @@ const commandMap = {
|
|
|
3862
4211
|
'TextSearch.handleIconThemeChange': wrapCommand(handleIconThemeChange),
|
|
3863
4212
|
'TextSearch.handleIncludeInput': wrapCommand(handleIncludeInput),
|
|
3864
4213
|
'TextSearch.handleInput': wrapCommand(handleInput),
|
|
4214
|
+
'TextSearch.handleListBlur': wrapCommand(handleListBlur),
|
|
3865
4215
|
'TextSearch.handleReplaceInput': wrapCommand(handleReplaceInput),
|
|
3866
4216
|
'TextSearch.handleScrollBarCaptureLost': wrapCommand(handleScrollBarCaptureLost),
|
|
3867
4217
|
'TextSearch.handleScrollBarClick': wrapCommand(handleScrollBarClick),
|
|
3868
4218
|
'TextSearch.handleScrollBarMove': wrapCommand(handleScrollBarMove),
|
|
3869
4219
|
'TextSearch.handleSharedInput': wrapCommand(handleSharedInput),
|
|
3870
4220
|
'TextSearch.handleWheel': wrapCommand(handleWheel),
|
|
4221
|
+
'TextSearch.launchSearchProcess': wrapCommand(launchSearchProcess),
|
|
3871
4222
|
'TextSearch.loadContent': wrapCommand(loadContent),
|
|
3872
4223
|
'TextSearch.refresh': wrapCommand(refresh),
|
|
3873
4224
|
'TextSearch.replaceAll': wrapCommand(replaceAll),
|
|
@@ -3882,7 +4233,7 @@ const commandMap = {
|
|
|
3882
4233
|
'TextSearch.toggleUseIgnoreFiles': wrapCommand(toggleUseIgnoreFiles),
|
|
3883
4234
|
'TextSearch.toggleUseRegularExpression': wrapCommand(toggleUseRegularExpression),
|
|
3884
4235
|
// not wrapped
|
|
3885
|
-
'TextSearch.create': create,
|
|
4236
|
+
'TextSearch.create': create$4,
|
|
3886
4237
|
'TextSearch.render': doRender,
|
|
3887
4238
|
'TextSearch.saveState': saveState,
|
|
3888
4239
|
'TextSearch.getKeyBindings': getKeyBindings,
|