@lvce-editor/file-search-worker 5.20.0 → 6.1.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/fileSearchWorkerMain.js +27 -13
- package/package.json +1 -1
|
@@ -2283,7 +2283,13 @@ const warn = (...args) => {
|
|
|
2283
2283
|
const state$2 = {
|
|
2284
2284
|
menuEntries: []
|
|
2285
2285
|
};
|
|
2286
|
-
const getAll = () => {
|
|
2286
|
+
const getAll = async () => {
|
|
2287
|
+
try {
|
|
2288
|
+
// @ts-ignore
|
|
2289
|
+
return await invoke$1('Layout.getAllQuickPickMenuEntries');
|
|
2290
|
+
} catch {
|
|
2291
|
+
// ignore
|
|
2292
|
+
}
|
|
2287
2293
|
return state$2.menuEntries;
|
|
2288
2294
|
};
|
|
2289
2295
|
const add = menuEntries => {
|
|
@@ -2292,7 +2298,7 @@ const add = menuEntries => {
|
|
|
2292
2298
|
|
|
2293
2299
|
// TODO combine Ajax with cache (specify strategy: cacheFirst, networkFirst)
|
|
2294
2300
|
const getBuiltinPicks = async () => {
|
|
2295
|
-
const builtinPicks = getAll();
|
|
2301
|
+
const builtinPicks = await getAll();
|
|
2296
2302
|
return builtinPicks;
|
|
2297
2303
|
};
|
|
2298
2304
|
const prefixIdWithExt = item => {
|
|
@@ -2310,6 +2316,7 @@ const prefixIdWithExt = item => {
|
|
|
2310
2316
|
};
|
|
2311
2317
|
const getExtensionPicks = async () => {
|
|
2312
2318
|
try {
|
|
2319
|
+
// TODO ask extension host worker directly
|
|
2313
2320
|
// TODO don't call this every time
|
|
2314
2321
|
const extensionPicks = await invoke$1('ExtensionHost.getCommands');
|
|
2315
2322
|
if (!extensionPicks) {
|
|
@@ -2330,12 +2337,12 @@ const toProtoVisibleItem$1 = item => {
|
|
|
2330
2337
|
icon: '',
|
|
2331
2338
|
matches: [],
|
|
2332
2339
|
direntType: 0,
|
|
2333
|
-
uri: ''
|
|
2340
|
+
uri: '',
|
|
2341
|
+
// @ts-ignore
|
|
2342
|
+
id: item.id,
|
|
2343
|
+
args: item.args
|
|
2334
2344
|
};
|
|
2335
2345
|
// @ts-ignore
|
|
2336
|
-
pick.id = item.id;
|
|
2337
|
-
// @ts-ignore
|
|
2338
|
-
pick.args = item.args;
|
|
2339
2346
|
return pick;
|
|
2340
2347
|
};
|
|
2341
2348
|
const getPicks$b = async () => {
|
|
@@ -2601,15 +2608,21 @@ const getRecentlyOpened = () => {
|
|
|
2601
2608
|
return invoke$1(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
|
|
2602
2609
|
};
|
|
2603
2610
|
|
|
2611
|
+
const getLabel = uri => {
|
|
2612
|
+
if (uri.startsWith('file://')) {
|
|
2613
|
+
return uri.slice('file://'.length);
|
|
2614
|
+
}
|
|
2615
|
+
return uri;
|
|
2616
|
+
};
|
|
2604
2617
|
const toProtoVisibleItem = uri => {
|
|
2605
2618
|
return {
|
|
2606
|
-
label: uri,
|
|
2619
|
+
label: getLabel(uri),
|
|
2607
2620
|
description: '',
|
|
2608
2621
|
fileIcon: '',
|
|
2609
2622
|
icon: '',
|
|
2610
2623
|
matches: [],
|
|
2611
2624
|
direntType: Directory,
|
|
2612
|
-
uri
|
|
2625
|
+
uri
|
|
2613
2626
|
};
|
|
2614
2627
|
};
|
|
2615
2628
|
const getPicks$6 = async () => {
|
|
@@ -2739,8 +2752,10 @@ const openWorkspaceFolder = uri => {
|
|
|
2739
2752
|
|
|
2740
2753
|
// TODO selectPick should be independent of show/hide
|
|
2741
2754
|
const selectPick$3 = async pick => {
|
|
2742
|
-
const
|
|
2743
|
-
|
|
2755
|
+
const {
|
|
2756
|
+
uri
|
|
2757
|
+
} = pick;
|
|
2758
|
+
await openWorkspaceFolder(uri);
|
|
2744
2759
|
return {
|
|
2745
2760
|
command: Hide
|
|
2746
2761
|
};
|
|
@@ -3326,15 +3341,14 @@ const getQuickPickItemVirtualDom = visibleItem => {
|
|
|
3326
3341
|
highlights,
|
|
3327
3342
|
fileIcon
|
|
3328
3343
|
} = visibleItem;
|
|
3329
|
-
const dom = [
|
|
3330
|
-
dom.push({
|
|
3344
|
+
const dom = [{
|
|
3331
3345
|
type: Div,
|
|
3332
3346
|
className: QuickPickItem,
|
|
3333
3347
|
role: Option,
|
|
3334
3348
|
ariaPosInSet: posInSet,
|
|
3335
3349
|
ariaSetSize: setSize,
|
|
3336
3350
|
childCount: 1
|
|
3337
|
-
}
|
|
3351
|
+
}];
|
|
3338
3352
|
const parent = dom[0];
|
|
3339
3353
|
if (isActive) {
|
|
3340
3354
|
// @ts-ignore
|