@lvce-editor/file-search-worker 5.5.0 → 5.6.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 +659 -771
- package/package.json +1 -1
|
@@ -891,310 +891,6 @@ const Script = 2;
|
|
|
891
891
|
|
|
892
892
|
const minimumSliderSize = 20;
|
|
893
893
|
|
|
894
|
-
const Command = '>';
|
|
895
|
-
const Symbol$1 = '@';
|
|
896
|
-
const WorkspaceSymbol$1 = '#';
|
|
897
|
-
const GoToLine$1 = ':';
|
|
898
|
-
const View$1 = 'view ';
|
|
899
|
-
const None$2 = '';
|
|
900
|
-
|
|
901
|
-
const getQuickPickPrefix = value => {
|
|
902
|
-
if (value.startsWith(Command)) {
|
|
903
|
-
return Command;
|
|
904
|
-
}
|
|
905
|
-
if (value.startsWith(Symbol$1)) {
|
|
906
|
-
return Symbol$1;
|
|
907
|
-
}
|
|
908
|
-
if (value.startsWith(WorkspaceSymbol$1)) {
|
|
909
|
-
return WorkspaceSymbol$1;
|
|
910
|
-
}
|
|
911
|
-
if (value.startsWith(GoToLine$1)) {
|
|
912
|
-
return GoToLine$1;
|
|
913
|
-
}
|
|
914
|
-
if (value.startsWith(View$1)) {
|
|
915
|
-
return View$1;
|
|
916
|
-
}
|
|
917
|
-
return None$2;
|
|
918
|
-
};
|
|
919
|
-
|
|
920
|
-
const CommandPalette = 'quickPick://commandPalette';
|
|
921
|
-
const Commands = 'quickPick://commands';
|
|
922
|
-
const File$2 = 'quickPick://file';
|
|
923
|
-
const EveryThing = 'quickPick://everything';
|
|
924
|
-
const Recent = 'quickPick://recent';
|
|
925
|
-
const ColorTheme = 'quickPick://color-theme';
|
|
926
|
-
const Symbol = 'quickPick://symbol';
|
|
927
|
-
const View = 'quickPick://view';
|
|
928
|
-
const WorkspaceSymbol = 'quickPick://workspace-symbol';
|
|
929
|
-
const Custom = 'quickPick://custom';
|
|
930
|
-
const GoToLine = 'quickPick://go-to-line';
|
|
931
|
-
|
|
932
|
-
// TODO use numeric enum for quickpick entry id
|
|
933
|
-
const getQuickPickProviderId = prefix => {
|
|
934
|
-
switch (prefix) {
|
|
935
|
-
case Command:
|
|
936
|
-
return Commands;
|
|
937
|
-
case Symbol$1:
|
|
938
|
-
return Symbol;
|
|
939
|
-
case WorkspaceSymbol$1:
|
|
940
|
-
return WorkspaceSymbol;
|
|
941
|
-
case GoToLine$1:
|
|
942
|
-
return GoToLine;
|
|
943
|
-
case View$1:
|
|
944
|
-
return View;
|
|
945
|
-
default:
|
|
946
|
-
return File$2;
|
|
947
|
-
}
|
|
948
|
-
};
|
|
949
|
-
|
|
950
|
-
const getVisibleItems$i = (picks, icons) => {
|
|
951
|
-
return [];
|
|
952
|
-
};
|
|
953
|
-
|
|
954
|
-
const Hide = 'hide';
|
|
955
|
-
const KeepOpen = '';
|
|
956
|
-
|
|
957
|
-
const emptyObject = {};
|
|
958
|
-
const RE_PLACEHOLDER = /\{(PH\d+)\}/g;
|
|
959
|
-
const i18nString = (key, placeholders = emptyObject) => {
|
|
960
|
-
if (placeholders === emptyObject) {
|
|
961
|
-
return key;
|
|
962
|
-
}
|
|
963
|
-
const replacer = (match, rest) => {
|
|
964
|
-
return placeholders[rest];
|
|
965
|
-
};
|
|
966
|
-
return key.replaceAll(RE_PLACEHOLDER, replacer);
|
|
967
|
-
};
|
|
968
|
-
|
|
969
|
-
const Files = 'Files';
|
|
970
|
-
const NoMatchingColorThemesFound = 'No matching color themes found';
|
|
971
|
-
const NoMatchingResults = 'No matching results';
|
|
972
|
-
const NoRecentlyOpenedFoldersFound = 'No recently opened folders found';
|
|
973
|
-
const NoResults = 'No Results';
|
|
974
|
-
const NoSymbolFound = 'No symbol found';
|
|
975
|
-
const NoWorkspaceSymbolsFound = 'no workspace symbols found';
|
|
976
|
-
const OpenRecent = 'Open Recent';
|
|
977
|
-
const SelectColorTheme = 'Select Color Theme';
|
|
978
|
-
const SelectToOpen = 'Select to open';
|
|
979
|
-
const TypeNameOfCommandToRun = 'Type the name of a command to run.';
|
|
980
|
-
const QuickOpen = 'Quick open';
|
|
981
|
-
|
|
982
|
-
const noMatchingColorThemesFound = () => {
|
|
983
|
-
return i18nString(NoMatchingColorThemesFound);
|
|
984
|
-
};
|
|
985
|
-
const selectColorTheme = () => {
|
|
986
|
-
return i18nString(SelectColorTheme);
|
|
987
|
-
};
|
|
988
|
-
const typeNameofCommandToRun = () => {
|
|
989
|
-
return i18nString(TypeNameOfCommandToRun);
|
|
990
|
-
};
|
|
991
|
-
const noMatchingResults = () => {
|
|
992
|
-
return i18nString(NoMatchingResults);
|
|
993
|
-
};
|
|
994
|
-
const files = () => {
|
|
995
|
-
return i18nString(Files);
|
|
996
|
-
};
|
|
997
|
-
const noResults = () => {
|
|
998
|
-
return i18nString(NoResults);
|
|
999
|
-
};
|
|
1000
|
-
const selectToOpen = () => {
|
|
1001
|
-
return i18nString(SelectToOpen);
|
|
1002
|
-
};
|
|
1003
|
-
const openRecent = () => {
|
|
1004
|
-
return i18nString(OpenRecent);
|
|
1005
|
-
};
|
|
1006
|
-
const noRecentlyOpenedFoldersFound = () => {
|
|
1007
|
-
return i18nString(NoRecentlyOpenedFoldersFound);
|
|
1008
|
-
};
|
|
1009
|
-
const noSymbolFound = () => {
|
|
1010
|
-
return i18nString(NoSymbolFound);
|
|
1011
|
-
};
|
|
1012
|
-
const noWorkspaceSymbolsFound = () => {
|
|
1013
|
-
return i18nString(NoWorkspaceSymbolsFound);
|
|
1014
|
-
};
|
|
1015
|
-
const quickOpen = () => {
|
|
1016
|
-
return i18nString(QuickOpen);
|
|
1017
|
-
};
|
|
1018
|
-
|
|
1019
|
-
const name$9 = 'noop';
|
|
1020
|
-
const getPlaceholder$9 = () => {
|
|
1021
|
-
return '';
|
|
1022
|
-
};
|
|
1023
|
-
const getNoResults$9 = () => {
|
|
1024
|
-
return noResults();
|
|
1025
|
-
};
|
|
1026
|
-
const getPicks$9 = async value => {
|
|
1027
|
-
return [];
|
|
1028
|
-
};
|
|
1029
|
-
const selectPick$9 = async item => {
|
|
1030
|
-
return {
|
|
1031
|
-
command: Hide
|
|
1032
|
-
};
|
|
1033
|
-
};
|
|
1034
|
-
const getFilterValue$9 = value => {
|
|
1035
|
-
return value;
|
|
1036
|
-
};
|
|
1037
|
-
const getPickFilterValue$9 = pick => {
|
|
1038
|
-
return pick;
|
|
1039
|
-
};
|
|
1040
|
-
const getVisibleItems$h = getVisibleItems$i;
|
|
1041
|
-
|
|
1042
|
-
const QuickPickNoop = {
|
|
1043
|
-
__proto__: null,
|
|
1044
|
-
getFilterValue: getFilterValue$9,
|
|
1045
|
-
getNoResults: getNoResults$9,
|
|
1046
|
-
getPickFilterValue: getPickFilterValue$9,
|
|
1047
|
-
getPicks: getPicks$9,
|
|
1048
|
-
getPlaceholder: getPlaceholder$9,
|
|
1049
|
-
getVisibleItems: getVisibleItems$h,
|
|
1050
|
-
name: name$9,
|
|
1051
|
-
selectPick: selectPick$9
|
|
1052
|
-
};
|
|
1053
|
-
|
|
1054
|
-
const state$b = {
|
|
1055
|
-
provider: QuickPickNoop,
|
|
1056
|
-
prefix: 'string-that-should-never-match-another-string'
|
|
1057
|
-
};
|
|
1058
|
-
const getVisibleItems$g = (picks, icons) => {
|
|
1059
|
-
const items = picks.map(pick => pick.pick);
|
|
1060
|
-
const visibleItems = state$b.provider.getVisibleItems(items, icons);
|
|
1061
|
-
return visibleItems;
|
|
1062
|
-
};
|
|
1063
|
-
|
|
1064
|
-
const state$a = Object.create(null);
|
|
1065
|
-
const register$1 = modules => {
|
|
1066
|
-
Object.assign(state$a, modules);
|
|
1067
|
-
};
|
|
1068
|
-
const get$1 = moduleId => {
|
|
1069
|
-
const module = state$a[moduleId];
|
|
1070
|
-
if (!module) {
|
|
1071
|
-
throw new Error(`unknown module "${moduleId}"`);
|
|
1072
|
-
}
|
|
1073
|
-
return module;
|
|
1074
|
-
};
|
|
1075
|
-
|
|
1076
|
-
// TODO avoid global variable
|
|
1077
|
-
|
|
1078
|
-
// TODO don't store provider in state, only serialized value like provider-id
|
|
1079
|
-
|
|
1080
|
-
/**
|
|
1081
|
-
* @type {string}
|
|
1082
|
-
*/
|
|
1083
|
-
const name$8 = 'everything';
|
|
1084
|
-
const getPlaceholder$8 = () => {
|
|
1085
|
-
return state$b.provider.getPlaceholder();
|
|
1086
|
-
};
|
|
1087
|
-
const getLabel$5 = () => {
|
|
1088
|
-
return '';
|
|
1089
|
-
};
|
|
1090
|
-
const getNoResults$8 = () => {
|
|
1091
|
-
return state$b.provider.getNoResults();
|
|
1092
|
-
};
|
|
1093
|
-
const getPicks$8 = async value => {
|
|
1094
|
-
const prefix = getQuickPickPrefix(value);
|
|
1095
|
-
|
|
1096
|
-
// TODO race condition
|
|
1097
|
-
if (state$b.prefix !== prefix) {
|
|
1098
|
-
state$b.prefix = prefix;
|
|
1099
|
-
const providerId = getQuickPickProviderId(prefix);
|
|
1100
|
-
const provider = get$1(providerId);
|
|
1101
|
-
state$b.provider = provider;
|
|
1102
|
-
}
|
|
1103
|
-
// TODO this line is a bit duplicated with getFilterValue
|
|
1104
|
-
const slicedValue = value.slice(prefix.length).trimStart();
|
|
1105
|
-
const picks = await state$b.provider.getPicks(slicedValue);
|
|
1106
|
-
return picks;
|
|
1107
|
-
};
|
|
1108
|
-
const selectPick$8 = item => {
|
|
1109
|
-
const {
|
|
1110
|
-
provider
|
|
1111
|
-
} = state$b;
|
|
1112
|
-
return provider.selectPick(item);
|
|
1113
|
-
};
|
|
1114
|
-
const openCommandPalette = () => {
|
|
1115
|
-
// show('>')
|
|
1116
|
-
};
|
|
1117
|
-
const openView = () => {
|
|
1118
|
-
// show('view ')
|
|
1119
|
-
};
|
|
1120
|
-
const getFilterValue$8 = value => {
|
|
1121
|
-
return value.slice(state$b.prefix.length).trim();
|
|
1122
|
-
};
|
|
1123
|
-
const getPickFilterValue$8 = pick => {
|
|
1124
|
-
const {
|
|
1125
|
-
provider
|
|
1126
|
-
} = state$b;
|
|
1127
|
-
return provider.getPickFilterValue(pick);
|
|
1128
|
-
};
|
|
1129
|
-
const getPickDescription$d = pick => {
|
|
1130
|
-
const {
|
|
1131
|
-
provider
|
|
1132
|
-
} = state$b;
|
|
1133
|
-
// @ts-ignore
|
|
1134
|
-
if (provider.getPickDescription) {
|
|
1135
|
-
// @ts-ignore
|
|
1136
|
-
return provider.getPickDescription(pick);
|
|
1137
|
-
}
|
|
1138
|
-
return '';
|
|
1139
|
-
};
|
|
1140
|
-
const getPickLabel$e = pick => {
|
|
1141
|
-
const {
|
|
1142
|
-
provider
|
|
1143
|
-
} = state$b;
|
|
1144
|
-
// @ts-ignore
|
|
1145
|
-
return provider.getPickLabel(pick);
|
|
1146
|
-
};
|
|
1147
|
-
const getPickIcon$e = pick => {
|
|
1148
|
-
const {
|
|
1149
|
-
provider
|
|
1150
|
-
} = state$b;
|
|
1151
|
-
// @ts-ignore
|
|
1152
|
-
return provider.getPickIcon(pick);
|
|
1153
|
-
};
|
|
1154
|
-
const getPickFileIcon$2 = pick => {
|
|
1155
|
-
const {
|
|
1156
|
-
provider
|
|
1157
|
-
} = state$b;
|
|
1158
|
-
// @ts-ignore
|
|
1159
|
-
if (provider.getPickFileIcon) {
|
|
1160
|
-
// @ts-ignore
|
|
1161
|
-
return provider.getPickFileIcon(pick);
|
|
1162
|
-
}
|
|
1163
|
-
return undefined;
|
|
1164
|
-
};
|
|
1165
|
-
const isPrepared$8 = () => {
|
|
1166
|
-
const {
|
|
1167
|
-
provider
|
|
1168
|
-
} = state$b;
|
|
1169
|
-
// @ts-ignore
|
|
1170
|
-
if (provider.isPrepared) {
|
|
1171
|
-
// @ts-ignore
|
|
1172
|
-
return provider.isPrepared();
|
|
1173
|
-
}
|
|
1174
|
-
return false;
|
|
1175
|
-
};
|
|
1176
|
-
|
|
1177
|
-
const QuickPickEntriesEverything = {
|
|
1178
|
-
__proto__: null,
|
|
1179
|
-
getFilterValue: getFilterValue$8,
|
|
1180
|
-
getLabel: getLabel$5,
|
|
1181
|
-
getNoResults: getNoResults$8,
|
|
1182
|
-
getPickDescription: getPickDescription$d,
|
|
1183
|
-
getPickFileIcon: getPickFileIcon$2,
|
|
1184
|
-
getPickFilterValue: getPickFilterValue$8,
|
|
1185
|
-
getPickIcon: getPickIcon$e,
|
|
1186
|
-
getPickLabel: getPickLabel$e,
|
|
1187
|
-
getPicks: getPicks$8,
|
|
1188
|
-
getPlaceholder: getPlaceholder$8,
|
|
1189
|
-
getVisibleItems: getVisibleItems$g,
|
|
1190
|
-
isPrepared: isPrepared$8,
|
|
1191
|
-
name: name$8,
|
|
1192
|
-
openCommandPalette,
|
|
1193
|
-
openView,
|
|
1194
|
-
selectPick: selectPick$8,
|
|
1195
|
-
state: state$b
|
|
1196
|
-
};
|
|
1197
|
-
|
|
1198
894
|
const Default$1 = 0;
|
|
1199
895
|
const Finished = 2;
|
|
1200
896
|
|
|
@@ -1217,7 +913,7 @@ const create$2 = () => {
|
|
|
1217
913
|
};
|
|
1218
914
|
|
|
1219
915
|
const {
|
|
1220
|
-
get,
|
|
916
|
+
get: get$1,
|
|
1221
917
|
set,
|
|
1222
918
|
remove
|
|
1223
919
|
} = create$2();
|
|
@@ -1288,18 +984,16 @@ const handleWheel = (state, deltaMode, deltaY) => {
|
|
|
1288
984
|
return setDeltaY(state, state.deltaY + deltaY);
|
|
1289
985
|
};
|
|
1290
986
|
|
|
1291
|
-
const create = (uid, uri, listItemHeight, x, y, width, height, platform, args) => {
|
|
987
|
+
const create = (uid, uri, listItemHeight, x, y, width, height, platform, args, workspaceUri) => {
|
|
1292
988
|
const state = {
|
|
989
|
+
workspaceUri,
|
|
1293
990
|
uid,
|
|
1294
991
|
icons: [],
|
|
1295
992
|
state: Default$1,
|
|
1296
993
|
picks: [],
|
|
1297
994
|
recentPicks: [],
|
|
1298
|
-
recentPickIds:
|
|
1299
|
-
// TODO use object.create(null) instead
|
|
995
|
+
recentPickIds: Object.create(null),
|
|
1300
996
|
versionId: 0,
|
|
1301
|
-
provider: QuickPickEntriesEverything,
|
|
1302
|
-
// TODO make this dynamic again
|
|
1303
997
|
warned: [],
|
|
1304
998
|
maxVisibleItems: 10,
|
|
1305
999
|
uri,
|
|
@@ -1372,7 +1066,7 @@ const diff2 = uid => {
|
|
|
1372
1066
|
const {
|
|
1373
1067
|
oldState,
|
|
1374
1068
|
newState
|
|
1375
|
-
} = get(uid);
|
|
1069
|
+
} = get$1(uid);
|
|
1376
1070
|
return diff(oldState, newState);
|
|
1377
1071
|
};
|
|
1378
1072
|
|
|
@@ -1380,24 +1074,18 @@ const dispose = uid => {
|
|
|
1380
1074
|
remove(uid);
|
|
1381
1075
|
};
|
|
1382
1076
|
|
|
1383
|
-
const emptyDirent = {
|
|
1384
|
-
name: '',
|
|
1385
|
-
path: '',
|
|
1386
|
-
type: 0
|
|
1387
|
-
};
|
|
1388
|
-
|
|
1389
1077
|
const getIconsCached = (paths, fileIconCache) => {
|
|
1390
1078
|
return paths.map(path => fileIconCache[path]);
|
|
1391
1079
|
};
|
|
1392
1080
|
|
|
1393
|
-
const File$
|
|
1081
|
+
const File$2 = 7;
|
|
1394
1082
|
|
|
1395
1083
|
const getMissingIconRequests = (dirents, fileIconCache) => {
|
|
1396
1084
|
const missingRequests = [];
|
|
1397
1085
|
for (const dirent of dirents) {
|
|
1398
1086
|
if (!(dirent.path in fileIconCache)) {
|
|
1399
1087
|
missingRequests.push({
|
|
1400
|
-
type: File$
|
|
1088
|
+
type: File$2,
|
|
1401
1089
|
name: dirent.name,
|
|
1402
1090
|
path: dirent.path
|
|
1403
1091
|
});
|
|
@@ -1411,7 +1099,7 @@ const requestFileIcons = async requests => {
|
|
|
1411
1099
|
if (!request.name) {
|
|
1412
1100
|
return '';
|
|
1413
1101
|
}
|
|
1414
|
-
return request.type === File$
|
|
1102
|
+
return request.type === File$2 ? invoke$1('IconTheme.getFileIcon', {
|
|
1415
1103
|
name: request.name
|
|
1416
1104
|
}) : invoke$1('IconTheme.getFolderIcon', {
|
|
1417
1105
|
name: request.name
|
|
@@ -1437,7 +1125,11 @@ const updateIconCache = (iconCache, missingRequests, newIcons) => {
|
|
|
1437
1125
|
|
|
1438
1126
|
const getQuickPickFileIcons = async (provider, items, fileIconCache) => {
|
|
1439
1127
|
const dirents = items.map(item => {
|
|
1440
|
-
const dirent =
|
|
1128
|
+
const dirent = {
|
|
1129
|
+
type: item.direntType,
|
|
1130
|
+
name: item.label,
|
|
1131
|
+
path: item.uri
|
|
1132
|
+
};
|
|
1441
1133
|
return dirent;
|
|
1442
1134
|
});
|
|
1443
1135
|
const missingRequests = getMissingIconRequests(dirents, fileIconCache);
|
|
@@ -1451,20 +1143,42 @@ const getQuickPickFileIcons = async (provider, items, fileIconCache) => {
|
|
|
1451
1143
|
};
|
|
1452
1144
|
};
|
|
1453
1145
|
|
|
1146
|
+
const state$b = Object.create(null);
|
|
1147
|
+
const register$1 = modules => {
|
|
1148
|
+
Object.assign(state$b, modules);
|
|
1149
|
+
};
|
|
1150
|
+
const get = moduleId => {
|
|
1151
|
+
const module = state$b[moduleId];
|
|
1152
|
+
if (!module) {
|
|
1153
|
+
throw new Error(`unknown module "${moduleId}"`);
|
|
1154
|
+
}
|
|
1155
|
+
return module;
|
|
1156
|
+
};
|
|
1157
|
+
const getProperty = (moduleId, property) => {
|
|
1158
|
+
const m = get(moduleId);
|
|
1159
|
+
const fn = m[property];
|
|
1160
|
+
return fn;
|
|
1161
|
+
};
|
|
1162
|
+
const getPicks$b = id => {
|
|
1163
|
+
return getProperty(id, 'getPicks');
|
|
1164
|
+
};
|
|
1165
|
+
|
|
1454
1166
|
const focusIndex = async (state, index) => {
|
|
1455
1167
|
const {
|
|
1456
|
-
|
|
1168
|
+
uri,
|
|
1457
1169
|
maxVisibleItems,
|
|
1458
1170
|
items,
|
|
1459
1171
|
minLineY,
|
|
1460
1172
|
maxLineY,
|
|
1461
1173
|
fileIconCache
|
|
1462
1174
|
} = state;
|
|
1175
|
+
const provider = get(uri);
|
|
1176
|
+
|
|
1463
1177
|
// TODO get types working
|
|
1464
1178
|
// @ts-ignore
|
|
1465
1179
|
if (provider.focusPick) {
|
|
1466
1180
|
// @ts-ignore
|
|
1467
|
-
await provider.focusPick(items[index]
|
|
1181
|
+
await provider.focusPick(items[index]);
|
|
1468
1182
|
}
|
|
1469
1183
|
if (index < minLineY + 1) {
|
|
1470
1184
|
const minLineY = index;
|
|
@@ -1751,15 +1465,6 @@ const getNewValue = (value, inputType, data, selectionStart, selectionEnd) => {
|
|
|
1751
1465
|
return fn(value, selectionStart, selectionEnd, data);
|
|
1752
1466
|
};
|
|
1753
1467
|
|
|
1754
|
-
const emptyMatches = [];
|
|
1755
|
-
|
|
1756
|
-
const convertToPick = item => {
|
|
1757
|
-
return {
|
|
1758
|
-
pick: item,
|
|
1759
|
-
matches: emptyMatches
|
|
1760
|
-
};
|
|
1761
|
-
};
|
|
1762
|
-
|
|
1763
1468
|
const Diagonal = 1;
|
|
1764
1469
|
const Left = 2;
|
|
1765
1470
|
|
|
@@ -1919,38 +1624,17 @@ const filterQuickPickItem = (pattern, word) => {
|
|
|
1919
1624
|
return matches;
|
|
1920
1625
|
};
|
|
1921
1626
|
|
|
1922
|
-
|
|
1923
|
-
const pathBaseName = path => {
|
|
1924
|
-
return path.slice(path.lastIndexOf('/') + 1);
|
|
1925
|
-
};
|
|
1926
|
-
|
|
1927
|
-
// TODO this should be in FileSystem module
|
|
1928
|
-
const pathDirName = path => {
|
|
1929
|
-
const pathSeparator = '/';
|
|
1930
|
-
const index = path.lastIndexOf(pathSeparator);
|
|
1931
|
-
if (index === -1) {
|
|
1932
|
-
return '';
|
|
1933
|
-
}
|
|
1934
|
-
return path.slice(0, index);
|
|
1935
|
-
};
|
|
1936
|
-
|
|
1937
|
-
const filterQuickPickItems = (items, value, provider) => {
|
|
1627
|
+
const filterQuickPickItems = (items, value) => {
|
|
1938
1628
|
if (!value) {
|
|
1939
|
-
return items
|
|
1629
|
+
return items;
|
|
1940
1630
|
}
|
|
1941
1631
|
const results = [];
|
|
1942
1632
|
for (const item of items) {
|
|
1943
|
-
|
|
1944
|
-
if (provider) {
|
|
1945
|
-
// @ts-ignore
|
|
1946
|
-
filterValue = provider.getPickLabel(item);
|
|
1947
|
-
} else {
|
|
1948
|
-
filterValue = pathBaseName(item);
|
|
1949
|
-
}
|
|
1633
|
+
const filterValue = item.label;
|
|
1950
1634
|
const matches = filterQuickPickItem(value, filterValue);
|
|
1951
1635
|
if (matches.length > 0) {
|
|
1952
1636
|
results.push({
|
|
1953
|
-
|
|
1637
|
+
...item,
|
|
1954
1638
|
matches
|
|
1955
1639
|
});
|
|
1956
1640
|
}
|
|
@@ -1958,11 +1642,16 @@ const filterQuickPickItems = (items, value, provider) => {
|
|
|
1958
1642
|
return results;
|
|
1959
1643
|
};
|
|
1960
1644
|
|
|
1645
|
+
const getPicks$a = (id, searchValue) => {
|
|
1646
|
+
const fn = getPicks$b(id);
|
|
1647
|
+
return fn(searchValue);
|
|
1648
|
+
};
|
|
1649
|
+
|
|
1961
1650
|
// TODO when user types letters -> no need to query provider again -> just filter existing results
|
|
1962
1651
|
const setValue = async (state, newValue) => {
|
|
1963
1652
|
const {
|
|
1964
1653
|
value,
|
|
1965
|
-
|
|
1654
|
+
uri,
|
|
1966
1655
|
minLineY,
|
|
1967
1656
|
maxLineY,
|
|
1968
1657
|
fileIconCache
|
|
@@ -1970,9 +1659,11 @@ const setValue = async (state, newValue) => {
|
|
|
1970
1659
|
if (value === newValue) {
|
|
1971
1660
|
return state;
|
|
1972
1661
|
}
|
|
1973
|
-
const
|
|
1662
|
+
const provider = get(uri);
|
|
1663
|
+
const newPicks = await getPicks$a(uri, newValue);
|
|
1664
|
+
// @ts-ignore
|
|
1974
1665
|
const filterValue = provider.getFilterValue(newValue);
|
|
1975
|
-
const items = filterQuickPickItems(newPicks, filterValue
|
|
1666
|
+
const items = filterQuickPickItems(newPicks, filterValue);
|
|
1976
1667
|
const focusedIndex = items.length === 0 ? -1 : 0;
|
|
1977
1668
|
const sliced = newPicks.slice(minLineY, maxLineY);
|
|
1978
1669
|
const {
|
|
@@ -2032,17 +1723,22 @@ const getPick = (items, index) => {
|
|
|
2032
1723
|
// }
|
|
2033
1724
|
// index -= state.recentPicks.length
|
|
2034
1725
|
if (index < items.length) {
|
|
2035
|
-
return items[index]
|
|
1726
|
+
return items[index];
|
|
2036
1727
|
}
|
|
2037
1728
|
console.warn('no pick matching index', index);
|
|
1729
|
+
return undefined;
|
|
2038
1730
|
};
|
|
2039
1731
|
|
|
1732
|
+
const Hide = 'hide';
|
|
1733
|
+
const KeepOpen = '';
|
|
1734
|
+
|
|
2040
1735
|
const selectIndex = async (state, index, button = /* left */0) => {
|
|
2041
1736
|
const {
|
|
2042
1737
|
minLineY,
|
|
2043
|
-
|
|
1738
|
+
uri,
|
|
2044
1739
|
items
|
|
2045
1740
|
} = state;
|
|
1741
|
+
const provider = get(uri);
|
|
2046
1742
|
const actualIndex = index + minLineY;
|
|
2047
1743
|
const pick = getPick(items, actualIndex);
|
|
2048
1744
|
if (!pick) {
|
|
@@ -2112,16 +1808,17 @@ const loadContent = async state => {
|
|
|
2112
1808
|
fileIconCache
|
|
2113
1809
|
} = state;
|
|
2114
1810
|
const value = getDefaultValue(uri);
|
|
2115
|
-
const provider = get
|
|
1811
|
+
const provider = get(uri);
|
|
2116
1812
|
// @ts-ignore
|
|
2117
1813
|
if (provider.setArgs) {
|
|
2118
1814
|
// @ts-ignore
|
|
2119
1815
|
provider.setArgs(args);
|
|
2120
1816
|
}
|
|
2121
|
-
const newPicks = await
|
|
1817
|
+
const newPicks = await getPicks$a(uri, value);
|
|
2122
1818
|
array(newPicks);
|
|
1819
|
+
// @ts-ignore
|
|
2123
1820
|
const filterValue = provider.getFilterValue(value);
|
|
2124
|
-
const items = filterQuickPickItems(newPicks, filterValue
|
|
1821
|
+
const items = filterQuickPickItems(newPicks, filterValue);
|
|
2125
1822
|
const minLineY = 0;
|
|
2126
1823
|
const maxLineY = Math.min(minLineY + state.maxVisibleItems, newPicks.length);
|
|
2127
1824
|
const sliced = newPicks.slice(minLineY, maxLineY);
|
|
@@ -2139,7 +1836,6 @@ const loadContent = async state => {
|
|
|
2139
1836
|
maxLineY,
|
|
2140
1837
|
value,
|
|
2141
1838
|
cursorOffset: value.length,
|
|
2142
|
-
provider,
|
|
2143
1839
|
inputSource: Script,
|
|
2144
1840
|
focused: true,
|
|
2145
1841
|
fileIconCache: newFileIconCache,
|
|
@@ -2147,19 +1843,24 @@ const loadContent = async state => {
|
|
|
2147
1843
|
};
|
|
2148
1844
|
};
|
|
2149
1845
|
|
|
2150
|
-
const state$
|
|
1846
|
+
const state$a = {
|
|
2151
1847
|
menuEntries: []
|
|
2152
1848
|
};
|
|
2153
1849
|
const getAll = () => {
|
|
2154
|
-
return state$
|
|
1850
|
+
return state$a.menuEntries;
|
|
2155
1851
|
};
|
|
2156
1852
|
const add = menuEntries => {
|
|
2157
|
-
state$
|
|
1853
|
+
state$a.menuEntries = [...state$a.menuEntries, ...menuEntries];
|
|
2158
1854
|
};
|
|
2159
1855
|
|
|
2160
|
-
const getVisible$1 = (
|
|
1856
|
+
const getVisible$1 = (items, minLineY, maxLineY, icons) => {
|
|
2161
1857
|
const range = items.slice(minLineY, maxLineY);
|
|
2162
|
-
const protoVisibleItems =
|
|
1858
|
+
const protoVisibleItems = range.map((item, index) => {
|
|
1859
|
+
return {
|
|
1860
|
+
...item,
|
|
1861
|
+
fileIcon: icons[index]
|
|
1862
|
+
};
|
|
1863
|
+
});
|
|
2163
1864
|
return protoVisibleItems;
|
|
2164
1865
|
};
|
|
2165
1866
|
|
|
@@ -2176,7 +1877,7 @@ const getVisible = (setSize, protoVisibleItems, minLineY, focusedIndex) => {
|
|
|
2176
1877
|
};
|
|
2177
1878
|
|
|
2178
1879
|
const createQuickPickViewModel = (oldState, newState) => {
|
|
2179
|
-
const protoVisibleItems = getVisible$1(newState.
|
|
1880
|
+
const protoVisibleItems = getVisible$1(newState.items, newState.minLineY, newState.maxLineY, newState.icons);
|
|
2180
1881
|
const visibleItems = getVisible(newState.items.length, protoVisibleItems, newState.minLineY, newState.focusedIndex);
|
|
2181
1882
|
const oldFocusedIndex = oldState.focusedIndex - oldState.minLineY;
|
|
2182
1883
|
const newFocusedIndex = newState.focusedIndex - newState.minLineY;
|
|
@@ -2223,7 +1924,7 @@ const renderHeight = newState => {
|
|
|
2223
1924
|
|
|
2224
1925
|
const ComboBox = 'combobox';
|
|
2225
1926
|
const ListBox = 'listbox';
|
|
2226
|
-
const None$
|
|
1927
|
+
const None$2 = 'none';
|
|
2227
1928
|
const Option = 'option';
|
|
2228
1929
|
|
|
2229
1930
|
const FileIcon = 'FileIcon';
|
|
@@ -2236,7 +1937,9 @@ const QuickPickItem = 'QuickPickItem';
|
|
|
2236
1937
|
const QuickPickItemActive$1 = 'QuickPickItemActive';
|
|
2237
1938
|
const QuickPickItemDescription = 'QuickPickItemDescription';
|
|
2238
1939
|
const QuickPickItemLabel = 'QuickPickItemLabel';
|
|
1940
|
+
const QuickPickMaskIcon = 'QuickPickMaskIcon';
|
|
2239
1941
|
const QuickPickItems$1 = 'QuickPickItems';
|
|
1942
|
+
const MaskIcon = 'MaskIcon';
|
|
2240
1943
|
const Viewlet = 'Viewlet';
|
|
2241
1944
|
|
|
2242
1945
|
const HandleBeforeInput = 'handleBeforeInput';
|
|
@@ -2250,6 +1953,68 @@ const QuickPick = 'QuickPick';
|
|
|
2250
1953
|
const QuickPickItems = 'QuickPickItems';
|
|
2251
1954
|
const QuickPickItemActive = 'QuickPickItemActive';
|
|
2252
1955
|
|
|
1956
|
+
const emptyObject = {};
|
|
1957
|
+
const RE_PLACEHOLDER = /\{(PH\d+)\}/g;
|
|
1958
|
+
const i18nString = (key, placeholders = emptyObject) => {
|
|
1959
|
+
if (placeholders === emptyObject) {
|
|
1960
|
+
return key;
|
|
1961
|
+
}
|
|
1962
|
+
const replacer = (match, rest) => {
|
|
1963
|
+
return placeholders[rest];
|
|
1964
|
+
};
|
|
1965
|
+
return key.replaceAll(RE_PLACEHOLDER, replacer);
|
|
1966
|
+
};
|
|
1967
|
+
|
|
1968
|
+
const Files = 'Files';
|
|
1969
|
+
const NoMatchingColorThemesFound = 'No matching color themes found';
|
|
1970
|
+
const NoMatchingResults = 'No matching results';
|
|
1971
|
+
const NoRecentlyOpenedFoldersFound = 'No recently opened folders found';
|
|
1972
|
+
const NoResults = 'No Results';
|
|
1973
|
+
const NoSymbolFound = 'No symbol found';
|
|
1974
|
+
const NoWorkspaceSymbolsFound = 'no workspace symbols found';
|
|
1975
|
+
const OpenRecent = 'Open Recent';
|
|
1976
|
+
const SelectColorTheme = 'Select Color Theme';
|
|
1977
|
+
const SelectToOpen = 'Select to open';
|
|
1978
|
+
const TypeNameOfCommandToRun = 'Type the name of a command to run.';
|
|
1979
|
+
const QuickOpen = 'Quick open';
|
|
1980
|
+
|
|
1981
|
+
const noMatchingColorThemesFound = () => {
|
|
1982
|
+
return i18nString(NoMatchingColorThemesFound);
|
|
1983
|
+
};
|
|
1984
|
+
const selectColorTheme = () => {
|
|
1985
|
+
return i18nString(SelectColorTheme);
|
|
1986
|
+
};
|
|
1987
|
+
const typeNameofCommandToRun = () => {
|
|
1988
|
+
return i18nString(TypeNameOfCommandToRun);
|
|
1989
|
+
};
|
|
1990
|
+
const noMatchingResults = () => {
|
|
1991
|
+
return i18nString(NoMatchingResults);
|
|
1992
|
+
};
|
|
1993
|
+
const files = () => {
|
|
1994
|
+
return i18nString(Files);
|
|
1995
|
+
};
|
|
1996
|
+
const noResults = () => {
|
|
1997
|
+
return i18nString(NoResults);
|
|
1998
|
+
};
|
|
1999
|
+
const selectToOpen = () => {
|
|
2000
|
+
return i18nString(SelectToOpen);
|
|
2001
|
+
};
|
|
2002
|
+
const openRecent = () => {
|
|
2003
|
+
return i18nString(OpenRecent);
|
|
2004
|
+
};
|
|
2005
|
+
const noRecentlyOpenedFoldersFound = () => {
|
|
2006
|
+
return i18nString(NoRecentlyOpenedFoldersFound);
|
|
2007
|
+
};
|
|
2008
|
+
const noSymbolFound = () => {
|
|
2009
|
+
return i18nString(NoSymbolFound);
|
|
2010
|
+
};
|
|
2011
|
+
const noWorkspaceSymbolsFound = () => {
|
|
2012
|
+
return i18nString(NoWorkspaceSymbolsFound);
|
|
2013
|
+
};
|
|
2014
|
+
const quickOpen = () => {
|
|
2015
|
+
return i18nString(QuickOpen);
|
|
2016
|
+
};
|
|
2017
|
+
|
|
2253
2018
|
const Div = 4;
|
|
2254
2019
|
const Input = 6;
|
|
2255
2020
|
const Span = 8;
|
|
@@ -2285,6 +2050,41 @@ const getQuickPickHeaderVirtualDom = () => {
|
|
|
2285
2050
|
}, getQuickPickInputVirtualDom()];
|
|
2286
2051
|
};
|
|
2287
2052
|
|
|
2053
|
+
const emptyHighlightSections = [];
|
|
2054
|
+
|
|
2055
|
+
const getHighlightSections = (highlights, label) => {
|
|
2056
|
+
if (highlights.length === 0) {
|
|
2057
|
+
return emptyHighlightSections;
|
|
2058
|
+
}
|
|
2059
|
+
const sections = [];
|
|
2060
|
+
let position = 0;
|
|
2061
|
+
for (let i = 0; i < highlights.length; i += 2) {
|
|
2062
|
+
const highlightStart = highlights[i];
|
|
2063
|
+
const highlightEnd = highlights[i + 1];
|
|
2064
|
+
if (position < highlightStart) {
|
|
2065
|
+
const beforeText = label.slice(position, highlightStart);
|
|
2066
|
+
sections.push({
|
|
2067
|
+
highlighted: false,
|
|
2068
|
+
text: beforeText
|
|
2069
|
+
});
|
|
2070
|
+
}
|
|
2071
|
+
const highlightText = label.slice(highlightStart, highlightEnd);
|
|
2072
|
+
sections.push({
|
|
2073
|
+
highlighted: true,
|
|
2074
|
+
text: highlightText
|
|
2075
|
+
});
|
|
2076
|
+
position = highlightEnd;
|
|
2077
|
+
}
|
|
2078
|
+
if (position < label.length) {
|
|
2079
|
+
const afterText = label.slice(position);
|
|
2080
|
+
sections.push({
|
|
2081
|
+
highlighted: false,
|
|
2082
|
+
text: afterText
|
|
2083
|
+
});
|
|
2084
|
+
}
|
|
2085
|
+
return sections;
|
|
2086
|
+
};
|
|
2087
|
+
|
|
2288
2088
|
const mergeClassNames = (...classNames) => {
|
|
2289
2089
|
return classNames.filter(Boolean).join(' ');
|
|
2290
2090
|
};
|
|
@@ -2302,32 +2102,34 @@ const quickPickHighlight = {
|
|
|
2302
2102
|
className: QuickPickHighlight,
|
|
2303
2103
|
childCount: 1
|
|
2304
2104
|
};
|
|
2305
|
-
const
|
|
2105
|
+
const getHighlights = (highlights, label) => {
|
|
2306
2106
|
const labelDom = {
|
|
2307
2107
|
type: Div,
|
|
2308
2108
|
className: QuickPickItemLabel,
|
|
2309
2109
|
childCount: 0
|
|
2310
2110
|
};
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
const highlightStart = highlights[i];
|
|
2315
|
-
const highlightEnd = highlights[i + 1];
|
|
2316
|
-
if (position < highlightStart) {
|
|
2317
|
-
const beforeText = label.slice(position, highlightStart);
|
|
2318
|
-
labelDom.childCount++;
|
|
2319
|
-
dom.push(text(beforeText));
|
|
2320
|
-
}
|
|
2321
|
-
const highlightText = label.slice(highlightStart, highlightEnd);
|
|
2322
|
-
labelDom.childCount++;
|
|
2323
|
-
dom.push(quickPickHighlight, text(highlightText));
|
|
2324
|
-
position = highlightEnd;
|
|
2325
|
-
}
|
|
2326
|
-
if (position < label.length) {
|
|
2327
|
-
const afterText = label.slice(position);
|
|
2111
|
+
const nodes = [labelDom];
|
|
2112
|
+
const sections = getHighlightSections(highlights, label);
|
|
2113
|
+
if (sections.length === 0) {
|
|
2328
2114
|
labelDom.childCount++;
|
|
2329
|
-
|
|
2115
|
+
nodes.push(text(label));
|
|
2116
|
+
} else {
|
|
2117
|
+
for (const section of sections) {
|
|
2118
|
+
if (section.highlighted) {
|
|
2119
|
+
labelDom.childCount++;
|
|
2120
|
+
nodes.push(quickPickHighlight, text(section.text));
|
|
2121
|
+
} else {
|
|
2122
|
+
labelDom.childCount++;
|
|
2123
|
+
nodes.push(text(section.text));
|
|
2124
|
+
}
|
|
2125
|
+
}
|
|
2330
2126
|
}
|
|
2127
|
+
return nodes;
|
|
2128
|
+
};
|
|
2129
|
+
|
|
2130
|
+
const addHighlights = (dom, highlights, label) => {
|
|
2131
|
+
const domHighlights = getHighlights(highlights, label);
|
|
2132
|
+
dom.push(...domHighlights);
|
|
2331
2133
|
};
|
|
2332
2134
|
|
|
2333
2135
|
const getFileIconVirtualDom = icon => {
|
|
@@ -2335,7 +2137,7 @@ const getFileIconVirtualDom = icon => {
|
|
|
2335
2137
|
type: Img,
|
|
2336
2138
|
className: FileIcon,
|
|
2337
2139
|
src: icon,
|
|
2338
|
-
role: None$
|
|
2140
|
+
role: None$2,
|
|
2339
2141
|
childCount: 0
|
|
2340
2142
|
};
|
|
2341
2143
|
};
|
|
@@ -2364,7 +2166,7 @@ const getQuickPickItemVirtualDom = visibleItem => {
|
|
|
2364
2166
|
const parent = dom[0];
|
|
2365
2167
|
if (isActive) {
|
|
2366
2168
|
// @ts-ignore
|
|
2367
|
-
parent.id =
|
|
2169
|
+
parent.id = QuickPickItemActive;
|
|
2368
2170
|
parent.className += ' ' + QuickPickItemActive$1;
|
|
2369
2171
|
}
|
|
2370
2172
|
if (fileIcon) {
|
|
@@ -2374,7 +2176,7 @@ const getQuickPickItemVirtualDom = visibleItem => {
|
|
|
2374
2176
|
parent.childCount++;
|
|
2375
2177
|
dom.push({
|
|
2376
2178
|
type: Div,
|
|
2377
|
-
className: mergeClassNames(
|
|
2179
|
+
className: mergeClassNames(QuickPickMaskIcon, MaskIcon, `MaskIcon${icon}`),
|
|
2378
2180
|
childCount: 0
|
|
2379
2181
|
});
|
|
2380
2182
|
}
|
|
@@ -2478,7 +2280,7 @@ const render2 = (uid, diffResult) => {
|
|
|
2478
2280
|
const {
|
|
2479
2281
|
oldState,
|
|
2480
2282
|
newState
|
|
2481
|
-
} = get(uid);
|
|
2283
|
+
} = get$1(uid);
|
|
2482
2284
|
if (oldState === newState) {
|
|
2483
2285
|
return [];
|
|
2484
2286
|
}
|
|
@@ -2516,7 +2318,7 @@ const selectCurrentIndex = state => {
|
|
|
2516
2318
|
|
|
2517
2319
|
const findLabelIndex = (items, label) => {
|
|
2518
2320
|
for (let i = 0; i < items.length; i++) {
|
|
2519
|
-
if (items[i].
|
|
2321
|
+
if (items[i].label === label) {
|
|
2520
2322
|
return i;
|
|
2521
2323
|
}
|
|
2522
2324
|
}
|
|
@@ -2536,12 +2338,12 @@ const wrapCommand = fn => {
|
|
|
2536
2338
|
const wrapped = async (uid, ...args) => {
|
|
2537
2339
|
const {
|
|
2538
2340
|
newState
|
|
2539
|
-
} = get(uid);
|
|
2341
|
+
} = get$1(uid);
|
|
2540
2342
|
const newerState = await fn(newState, ...args);
|
|
2541
2343
|
if (newState === newerState) {
|
|
2542
2344
|
return;
|
|
2543
2345
|
}
|
|
2544
|
-
const latest = get(uid);
|
|
2346
|
+
const latest = get$1(uid);
|
|
2545
2347
|
set(uid, latest.oldState, newerState);
|
|
2546
2348
|
};
|
|
2547
2349
|
return wrapped;
|
|
@@ -2575,47 +2377,118 @@ const commandMap = {
|
|
|
2575
2377
|
'QuickPick.setDeltaY': wrapCommand(setDeltaY),
|
|
2576
2378
|
'QuickPick.setValue': wrapCommand(setValue),
|
|
2577
2379
|
// deprecated
|
|
2578
|
-
'QuickPick.loadEntries2': get
|
|
2380
|
+
'QuickPick.loadEntries2': get
|
|
2579
2381
|
};
|
|
2580
2382
|
|
|
2581
|
-
const
|
|
2582
|
-
return '';
|
|
2383
|
+
const getColorThemeNames = async () => {
|
|
2384
|
+
return invoke$1(/* Ajax.getJson */'ColorTheme.getColorThemeNames');
|
|
2583
2385
|
};
|
|
2584
|
-
|
|
2386
|
+
|
|
2387
|
+
const toProtoVisibleItem$1 = name => {
|
|
2388
|
+
const pick = {
|
|
2389
|
+
label: name,
|
|
2390
|
+
description: '',
|
|
2391
|
+
fileIcon: '',
|
|
2392
|
+
icon: '',
|
|
2393
|
+
matches: [],
|
|
2394
|
+
direntType: 0,
|
|
2395
|
+
uri: ''
|
|
2396
|
+
};
|
|
2397
|
+
return pick;
|
|
2398
|
+
};
|
|
2399
|
+
const getPicks$9 = async searchValue => {
|
|
2400
|
+
const colorThemeNames = await getColorThemeNames();
|
|
2401
|
+
const picks = colorThemeNames.map(toProtoVisibleItem$1);
|
|
2402
|
+
return picks;
|
|
2403
|
+
};
|
|
2404
|
+
|
|
2405
|
+
const emptyMatches = [];
|
|
2406
|
+
|
|
2407
|
+
const getWorkspacePath = async () => {
|
|
2408
|
+
return invoke$1('Workspace.getPath');
|
|
2409
|
+
};
|
|
2410
|
+
|
|
2411
|
+
const RE_PROTOCOL = /^([a-z-]+):\/\//;
|
|
2412
|
+
const getProtocol = uri => {
|
|
2413
|
+
const protocolMatch = uri.match(RE_PROTOCOL);
|
|
2414
|
+
if (protocolMatch) {
|
|
2415
|
+
return protocolMatch[1];
|
|
2416
|
+
}
|
|
2585
2417
|
return '';
|
|
2586
2418
|
};
|
|
2587
|
-
|
|
2588
|
-
|
|
2419
|
+
|
|
2420
|
+
const state$9 = Object.create(null);
|
|
2421
|
+
const register = modules => {
|
|
2422
|
+
Object.assign(state$9, modules);
|
|
2589
2423
|
};
|
|
2590
|
-
const
|
|
2591
|
-
|
|
2592
|
-
const pick = item.pick;
|
|
2593
|
-
return {
|
|
2594
|
-
description: getPickDescription$c(),
|
|
2595
|
-
fileIcon: '',
|
|
2596
|
-
icon: getPickIcon$d(),
|
|
2597
|
-
label: getPickLabel$d(pick),
|
|
2598
|
-
matches: []
|
|
2599
|
-
};
|
|
2600
|
-
});
|
|
2601
|
-
return visibleItems;
|
|
2424
|
+
const getModule = protocol => {
|
|
2425
|
+
return state$9[protocol];
|
|
2602
2426
|
};
|
|
2603
2427
|
|
|
2604
|
-
const
|
|
2605
|
-
|
|
2428
|
+
const searchFile$5 = async (path, value, prepare, assetDir) => {
|
|
2429
|
+
const protocol = getProtocol(path);
|
|
2430
|
+
// TODO call different providers depending on protocol
|
|
2431
|
+
const fn = getModule(protocol);
|
|
2432
|
+
const result = await fn(path, value, prepare, assetDir);
|
|
2433
|
+
return result;
|
|
2606
2434
|
};
|
|
2607
2435
|
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
return
|
|
2436
|
+
// TODO this should be in FileSystem module
|
|
2437
|
+
const pathBaseName = path => {
|
|
2438
|
+
return path.slice(path.lastIndexOf('/') + 1);
|
|
2439
|
+
};
|
|
2440
|
+
|
|
2441
|
+
// TODO this should be in FileSystem module
|
|
2442
|
+
const pathDirName = path => {
|
|
2443
|
+
const pathSeparator = '/';
|
|
2444
|
+
const index = path.lastIndexOf(pathSeparator);
|
|
2445
|
+
if (index === -1) {
|
|
2446
|
+
return '';
|
|
2447
|
+
}
|
|
2448
|
+
return path.slice(0, index);
|
|
2449
|
+
};
|
|
2450
|
+
|
|
2451
|
+
const searchFile$4 = async (path, value) => {
|
|
2452
|
+
const prepare = true;
|
|
2453
|
+
const files = await searchFile$5(/* path */path, /* searchTerm */value, prepare, '');
|
|
2454
|
+
return files;
|
|
2455
|
+
};
|
|
2456
|
+
const convertToPick = uri => {
|
|
2457
|
+
const baseName = pathBaseName(uri);
|
|
2458
|
+
const dirName = pathDirName(uri);
|
|
2459
|
+
return {
|
|
2460
|
+
description: dirName,
|
|
2461
|
+
direntType: File$2,
|
|
2462
|
+
fileIcon: '',
|
|
2463
|
+
icon: '',
|
|
2464
|
+
label: baseName,
|
|
2465
|
+
matches: emptyMatches,
|
|
2466
|
+
uri
|
|
2467
|
+
};
|
|
2468
|
+
};
|
|
2469
|
+
|
|
2470
|
+
// TODO handle files differently
|
|
2471
|
+
// e.g. when there are many files, don't need
|
|
2472
|
+
// to compute the fileIcon for all files
|
|
2473
|
+
|
|
2474
|
+
const getPicks$8 = async searchValue => {
|
|
2475
|
+
// TODO cache workspace path
|
|
2476
|
+
const workspace = await getWorkspacePath();
|
|
2477
|
+
if (!workspace) {
|
|
2478
|
+
return [];
|
|
2479
|
+
}
|
|
2480
|
+
const files = await searchFile$4(workspace, searchValue);
|
|
2481
|
+
const picks = files.map(convertToPick);
|
|
2482
|
+
return picks;
|
|
2611
2483
|
};
|
|
2612
2484
|
|
|
2613
2485
|
const setColorTheme = id => {
|
|
2614
2486
|
return invoke$1(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
|
|
2615
2487
|
};
|
|
2616
2488
|
|
|
2617
|
-
const selectPick$
|
|
2618
|
-
|
|
2489
|
+
const selectPick$9 = async pick => {
|
|
2490
|
+
const id = pick.label;
|
|
2491
|
+
await setColorTheme(/* colorThemeId */id);
|
|
2619
2492
|
return {
|
|
2620
2493
|
command: Hide
|
|
2621
2494
|
};
|
|
@@ -2625,38 +2498,37 @@ const focusPick = async pick => {
|
|
|
2625
2498
|
await setColorTheme(/* colorThemeId */pick);
|
|
2626
2499
|
};
|
|
2627
2500
|
|
|
2628
|
-
const getPlaceholder$
|
|
2501
|
+
const getPlaceholder$9 = () => {
|
|
2629
2502
|
return selectColorTheme();
|
|
2630
2503
|
};
|
|
2631
|
-
const getLabel$
|
|
2504
|
+
const getLabel$5 = () => {
|
|
2632
2505
|
return selectColorTheme();
|
|
2633
2506
|
};
|
|
2634
|
-
const
|
|
2635
|
-
const getFilterValue$7 = value => {
|
|
2507
|
+
const getFilterValue$9 = value => {
|
|
2636
2508
|
return value;
|
|
2637
2509
|
};
|
|
2638
|
-
const getNoResults$
|
|
2510
|
+
const getNoResults$9 = () => {
|
|
2639
2511
|
return {
|
|
2640
2512
|
label: noMatchingColorThemesFound()
|
|
2641
2513
|
};
|
|
2642
2514
|
};
|
|
2643
|
-
const getPickFilterValue$
|
|
2515
|
+
const getPickFilterValue$9 = pick => {
|
|
2644
2516
|
return pick;
|
|
2645
2517
|
};
|
|
2646
|
-
const getPickLabel$
|
|
2518
|
+
const getPickLabel$8 = pick => {
|
|
2647
2519
|
return pick;
|
|
2648
2520
|
};
|
|
2649
|
-
const getPickIcon$
|
|
2521
|
+
const getPickIcon$8 = pick => {
|
|
2650
2522
|
return '';
|
|
2651
2523
|
};
|
|
2652
2524
|
const state$8 = {};
|
|
2653
|
-
const getPickDescription$
|
|
2525
|
+
const getPickDescription$8 = value => {
|
|
2654
2526
|
return '';
|
|
2655
2527
|
};
|
|
2656
|
-
const isPrepared$
|
|
2528
|
+
const isPrepared$8 = () => {
|
|
2657
2529
|
return false;
|
|
2658
2530
|
};
|
|
2659
|
-
const name$
|
|
2531
|
+
const name$9 = '';
|
|
2660
2532
|
const getHelpEntries$2 = () => {
|
|
2661
2533
|
return [];
|
|
2662
2534
|
};
|
|
@@ -2664,43 +2536,22 @@ const getHelpEntries$2 = () => {
|
|
|
2664
2536
|
const QuickPickEntriesColorTheme = {
|
|
2665
2537
|
__proto__: null,
|
|
2666
2538
|
focusPick,
|
|
2667
|
-
getFilterValue: getFilterValue$
|
|
2539
|
+
getFilterValue: getFilterValue$9,
|
|
2668
2540
|
getHelpEntries: getHelpEntries$2,
|
|
2669
|
-
getLabel: getLabel$
|
|
2670
|
-
getNoResults: getNoResults$
|
|
2671
|
-
getPickDescription: getPickDescription$
|
|
2672
|
-
getPickFilterValue: getPickFilterValue$
|
|
2673
|
-
getPickIcon: getPickIcon$
|
|
2674
|
-
getPickLabel: getPickLabel$
|
|
2675
|
-
getPicks: getPicks$
|
|
2676
|
-
getPlaceholder: getPlaceholder$
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
selectPick: selectPick$7,
|
|
2541
|
+
getLabel: getLabel$5,
|
|
2542
|
+
getNoResults: getNoResults$9,
|
|
2543
|
+
getPickDescription: getPickDescription$8,
|
|
2544
|
+
getPickFilterValue: getPickFilterValue$9,
|
|
2545
|
+
getPickIcon: getPickIcon$8,
|
|
2546
|
+
getPickLabel: getPickLabel$8,
|
|
2547
|
+
getPicks: getPicks$9,
|
|
2548
|
+
getPlaceholder: getPlaceholder$9,
|
|
2549
|
+
isPrepared: isPrepared$8,
|
|
2550
|
+
name: name$9,
|
|
2551
|
+
selectPick: selectPick$9,
|
|
2681
2552
|
state: state$8
|
|
2682
2553
|
};
|
|
2683
2554
|
|
|
2684
|
-
const getPickIcon$b = () => {
|
|
2685
|
-
return '';
|
|
2686
|
-
};
|
|
2687
|
-
const getPickLabel$b = pick => {
|
|
2688
|
-
return pick.label;
|
|
2689
|
-
};
|
|
2690
|
-
const getVisibleItems$d = (picks, icons) => {
|
|
2691
|
-
const visibleItems = picks.map((item, index) => {
|
|
2692
|
-
const pick = item;
|
|
2693
|
-
return {
|
|
2694
|
-
description: pick.description || '',
|
|
2695
|
-
fileIcon: '',
|
|
2696
|
-
icon: getPickIcon$b(),
|
|
2697
|
-
label: getPickLabel$b(pick),
|
|
2698
|
-
matches: []
|
|
2699
|
-
};
|
|
2700
|
-
});
|
|
2701
|
-
return visibleItems;
|
|
2702
|
-
};
|
|
2703
|
-
|
|
2704
2555
|
const handleError = async (error, notify = true, prefix = '') => {
|
|
2705
2556
|
console.error(error);
|
|
2706
2557
|
};
|
|
@@ -2753,11 +2604,25 @@ const getExtensionPicks = async () => {
|
|
|
2753
2604
|
return [];
|
|
2754
2605
|
}
|
|
2755
2606
|
};
|
|
2756
|
-
const
|
|
2607
|
+
const toProtoVisibleItem = item => {
|
|
2608
|
+
const pick = {
|
|
2609
|
+
// @ts-ignore
|
|
2610
|
+
id: item.id,
|
|
2611
|
+
label: item.label,
|
|
2612
|
+
description: '',
|
|
2613
|
+
fileIcon: '',
|
|
2614
|
+
icon: '',
|
|
2615
|
+
matches: []
|
|
2616
|
+
};
|
|
2617
|
+
return pick;
|
|
2618
|
+
};
|
|
2619
|
+
const getPicks$7 = async () => {
|
|
2620
|
+
// TODO get picks in parallel
|
|
2757
2621
|
const builtinPicks = await getBuiltinPicks();
|
|
2758
2622
|
const extensionPicks = await getExtensionPicks();
|
|
2759
2623
|
const allPicks = [...builtinPicks, ...extensionPicks];
|
|
2760
|
-
|
|
2624
|
+
const converted = allPicks.map(toProtoVisibleItem);
|
|
2625
|
+
return converted;
|
|
2761
2626
|
};
|
|
2762
2627
|
|
|
2763
2628
|
const shouldHide = item => {
|
|
@@ -2791,80 +2656,125 @@ const selectPickExtension = async item => {
|
|
|
2791
2656
|
command: Hide
|
|
2792
2657
|
};
|
|
2793
2658
|
};
|
|
2794
|
-
const selectPick$
|
|
2795
|
-
|
|
2659
|
+
const selectPick$8 = async item => {
|
|
2660
|
+
// @ts-ignore
|
|
2661
|
+
const id = item.id;
|
|
2662
|
+
if (id.startsWith('ext.')) {
|
|
2796
2663
|
return selectPickExtension(item);
|
|
2797
2664
|
}
|
|
2798
2665
|
return selectPickBuiltin(item);
|
|
2799
2666
|
};
|
|
2800
2667
|
|
|
2801
|
-
const name$
|
|
2668
|
+
const name$8 = 'command';
|
|
2802
2669
|
const state$7 = {};
|
|
2803
|
-
const isPrepared$
|
|
2670
|
+
const isPrepared$7 = () => {
|
|
2804
2671
|
return false;
|
|
2805
2672
|
};
|
|
2806
|
-
const getPickDescription$
|
|
2673
|
+
const getPickDescription$7 = () => {
|
|
2807
2674
|
return '';
|
|
2808
2675
|
};
|
|
2809
|
-
const getPlaceholder$
|
|
2676
|
+
const getPlaceholder$8 = () => {
|
|
2810
2677
|
return typeNameofCommandToRun();
|
|
2811
2678
|
};
|
|
2812
|
-
const getLabel$
|
|
2679
|
+
const getLabel$4 = () => {
|
|
2813
2680
|
return '';
|
|
2814
2681
|
};
|
|
2815
|
-
const getNoResults$
|
|
2682
|
+
const getNoResults$8 = () => {
|
|
2816
2683
|
return {
|
|
2817
2684
|
label: noMatchingResults()
|
|
2818
2685
|
};
|
|
2819
2686
|
};
|
|
2820
|
-
const
|
|
2821
|
-
const getFilterValue$6 = value => {
|
|
2687
|
+
const getFilterValue$8 = value => {
|
|
2822
2688
|
return value.trim();
|
|
2823
2689
|
};
|
|
2824
|
-
const getPickFilterValue$
|
|
2690
|
+
const getPickFilterValue$8 = pick => {
|
|
2825
2691
|
return pick.label;
|
|
2826
2692
|
};
|
|
2827
|
-
const getPickLabel$
|
|
2693
|
+
const getPickLabel$7 = pick => {
|
|
2828
2694
|
return pick.label;
|
|
2829
2695
|
};
|
|
2830
|
-
const getPickIcon$
|
|
2696
|
+
const getPickIcon$7 = () => {
|
|
2831
2697
|
return '';
|
|
2832
2698
|
};
|
|
2833
2699
|
|
|
2834
2700
|
const QuickPickEntriesCommand = {
|
|
2835
2701
|
__proto__: null,
|
|
2836
|
-
getFilterValue: getFilterValue$
|
|
2837
|
-
getLabel: getLabel$
|
|
2838
|
-
getNoResults: getNoResults$
|
|
2839
|
-
getPickDescription: getPickDescription$
|
|
2840
|
-
getPickFilterValue: getPickFilterValue$
|
|
2841
|
-
getPickIcon: getPickIcon$
|
|
2842
|
-
getPickLabel: getPickLabel$
|
|
2843
|
-
getPicks: getPicks$
|
|
2844
|
-
getPlaceholder: getPlaceholder$
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
selectPick: selectPick$6,
|
|
2702
|
+
getFilterValue: getFilterValue$8,
|
|
2703
|
+
getLabel: getLabel$4,
|
|
2704
|
+
getNoResults: getNoResults$8,
|
|
2705
|
+
getPickDescription: getPickDescription$7,
|
|
2706
|
+
getPickFilterValue: getPickFilterValue$8,
|
|
2707
|
+
getPickIcon: getPickIcon$7,
|
|
2708
|
+
getPickLabel: getPickLabel$7,
|
|
2709
|
+
getPicks: getPicks$7,
|
|
2710
|
+
getPlaceholder: getPlaceholder$8,
|
|
2711
|
+
isPrepared: isPrepared$7,
|
|
2712
|
+
name: name$8,
|
|
2713
|
+
selectPick: selectPick$8,
|
|
2849
2714
|
state: state$7
|
|
2850
2715
|
};
|
|
2851
2716
|
|
|
2852
2717
|
const Tag$1 = 'Tag';
|
|
2853
2718
|
const Cloud$1 = 'Cloud';
|
|
2854
2719
|
const SourceControl$1 = 'SourceControl';
|
|
2855
|
-
const None = '';
|
|
2720
|
+
const None$1 = '';
|
|
2856
2721
|
|
|
2857
2722
|
const SourceControl = 1;
|
|
2858
2723
|
const Cloud = 2;
|
|
2859
2724
|
const Tag = 3;
|
|
2860
2725
|
|
|
2861
|
-
const
|
|
2862
|
-
|
|
2726
|
+
const state$6 = {
|
|
2727
|
+
args: []
|
|
2728
|
+
};
|
|
2729
|
+
|
|
2730
|
+
const selectPick$7 = async pick => {
|
|
2731
|
+
const {
|
|
2732
|
+
args
|
|
2733
|
+
} = state$6;
|
|
2734
|
+
const resolve = args[2];
|
|
2735
|
+
resolve(pick);
|
|
2736
|
+
return {
|
|
2737
|
+
command: Hide
|
|
2738
|
+
};
|
|
2739
|
+
};
|
|
2740
|
+
|
|
2741
|
+
const name$7 = 'custom';
|
|
2742
|
+
const setArgs = args => {
|
|
2743
|
+
state$6.args = args;
|
|
2744
|
+
};
|
|
2745
|
+
const getPlaceholder$7 = () => {
|
|
2746
|
+
return '';
|
|
2747
|
+
};
|
|
2748
|
+
const getLabel$3 = () => {
|
|
2749
|
+
return 'Custom';
|
|
2750
|
+
};
|
|
2751
|
+
|
|
2752
|
+
// TODO help entries should not be here
|
|
2753
|
+
const getHelpEntries$1 = () => {
|
|
2754
|
+
return [];
|
|
2863
2755
|
};
|
|
2864
|
-
const
|
|
2756
|
+
const getNoResults$7 = () => {
|
|
2757
|
+
return {
|
|
2758
|
+
label: noMatchingResults()
|
|
2759
|
+
};
|
|
2760
|
+
};
|
|
2761
|
+
const getPicks$6 = async searchValue => {
|
|
2762
|
+
const items = state$6.args[1] || [];
|
|
2763
|
+
return items;
|
|
2764
|
+
};
|
|
2765
|
+
const getFilterValue$7 = value => {
|
|
2766
|
+
return value;
|
|
2767
|
+
};
|
|
2768
|
+
const getPickFilterValue$7 = pick => {
|
|
2769
|
+
return pick;
|
|
2770
|
+
};
|
|
2771
|
+
const getPickLabel$6 = pick => {
|
|
2865
2772
|
return pick.label;
|
|
2866
2773
|
};
|
|
2867
|
-
const
|
|
2774
|
+
const getPickDescription$6 = pick => {
|
|
2775
|
+
return pick.description || '';
|
|
2776
|
+
};
|
|
2777
|
+
const convertIcon = icon => {
|
|
2868
2778
|
switch (icon) {
|
|
2869
2779
|
case SourceControl:
|
|
2870
2780
|
return SourceControl$1;
|
|
@@ -2873,190 +2783,253 @@ const convertIcon$1 = icon => {
|
|
|
2873
2783
|
case Tag:
|
|
2874
2784
|
return Tag$1;
|
|
2875
2785
|
default:
|
|
2876
|
-
return None;
|
|
2786
|
+
return None$1;
|
|
2877
2787
|
}
|
|
2878
2788
|
};
|
|
2879
|
-
const getPickIcon$
|
|
2880
|
-
return convertIcon
|
|
2789
|
+
const getPickIcon$6 = pick => {
|
|
2790
|
+
return convertIcon(pick.icon);
|
|
2881
2791
|
};
|
|
2882
|
-
const
|
|
2883
|
-
|
|
2884
|
-
description: getPickDescription$9(pick),
|
|
2885
|
-
fileIcon: '',
|
|
2886
|
-
icon: getPickIcon$9(pick),
|
|
2887
|
-
label: getPickLabel$9(pick),
|
|
2888
|
-
matches: []
|
|
2889
|
-
}));
|
|
2890
|
-
return visibleItems;
|
|
2792
|
+
const isPrepared$6 = () => {
|
|
2793
|
+
return true;
|
|
2891
2794
|
};
|
|
2892
2795
|
|
|
2893
|
-
const
|
|
2894
|
-
|
|
2895
|
-
|
|
2796
|
+
const QuickPickEntriesCustom = {
|
|
2797
|
+
__proto__: null,
|
|
2798
|
+
getFilterValue: getFilterValue$7,
|
|
2799
|
+
getHelpEntries: getHelpEntries$1,
|
|
2800
|
+
getLabel: getLabel$3,
|
|
2801
|
+
getNoResults: getNoResults$7,
|
|
2802
|
+
getPickDescription: getPickDescription$6,
|
|
2803
|
+
getPickFilterValue: getPickFilterValue$7,
|
|
2804
|
+
getPickIcon: getPickIcon$6,
|
|
2805
|
+
getPickLabel: getPickLabel$6,
|
|
2806
|
+
getPicks: getPicks$6,
|
|
2807
|
+
getPlaceholder: getPlaceholder$7,
|
|
2808
|
+
isPrepared: isPrepared$6,
|
|
2809
|
+
name: name$7,
|
|
2810
|
+
selectPick: selectPick$7,
|
|
2811
|
+
setArgs,
|
|
2812
|
+
state: state$6
|
|
2896
2813
|
};
|
|
2897
|
-
|
|
2898
|
-
|
|
2814
|
+
|
|
2815
|
+
const name$6 = 'noop';
|
|
2816
|
+
const getPlaceholder$6 = () => {
|
|
2817
|
+
return '';
|
|
2818
|
+
};
|
|
2819
|
+
const getNoResults$6 = () => {
|
|
2820
|
+
return noResults();
|
|
2821
|
+
};
|
|
2822
|
+
const getPicks$5 = async value => {
|
|
2823
|
+
return [];
|
|
2824
|
+
};
|
|
2825
|
+
const selectPick$6 = async item => {
|
|
2826
|
+
return {
|
|
2827
|
+
command: Hide
|
|
2828
|
+
};
|
|
2829
|
+
};
|
|
2830
|
+
const getFilterValue$6 = value => {
|
|
2831
|
+
return value;
|
|
2832
|
+
};
|
|
2833
|
+
const getPickFilterValue$6 = pick => {
|
|
2834
|
+
return pick;
|
|
2835
|
+
};
|
|
2836
|
+
|
|
2837
|
+
const QuickPickNoop = {
|
|
2838
|
+
__proto__: null,
|
|
2839
|
+
getFilterValue: getFilterValue$6,
|
|
2840
|
+
getNoResults: getNoResults$6,
|
|
2841
|
+
getPickFilterValue: getPickFilterValue$6,
|
|
2842
|
+
getPicks: getPicks$5,
|
|
2843
|
+
getPlaceholder: getPlaceholder$6,
|
|
2844
|
+
name: name$6,
|
|
2845
|
+
selectPick: selectPick$6
|
|
2846
|
+
};
|
|
2847
|
+
|
|
2848
|
+
const state$5 = {
|
|
2849
|
+
provider: QuickPickNoop,
|
|
2850
|
+
prefix: 'string-that-should-never-match-another-string'
|
|
2851
|
+
};
|
|
2852
|
+
|
|
2853
|
+
const Command = '>';
|
|
2854
|
+
const Symbol$1 = '@';
|
|
2855
|
+
const WorkspaceSymbol$1 = '#';
|
|
2856
|
+
const GoToLine$1 = ':';
|
|
2857
|
+
const View$1 = 'view ';
|
|
2858
|
+
const None = '';
|
|
2859
|
+
|
|
2860
|
+
const getQuickPickPrefix = value => {
|
|
2861
|
+
if (value.startsWith(Command)) {
|
|
2862
|
+
return Command;
|
|
2863
|
+
}
|
|
2864
|
+
if (value.startsWith(Symbol$1)) {
|
|
2865
|
+
return Symbol$1;
|
|
2866
|
+
}
|
|
2867
|
+
if (value.startsWith(WorkspaceSymbol$1)) {
|
|
2868
|
+
return WorkspaceSymbol$1;
|
|
2869
|
+
}
|
|
2870
|
+
if (value.startsWith(GoToLine$1)) {
|
|
2871
|
+
return GoToLine$1;
|
|
2872
|
+
}
|
|
2873
|
+
if (value.startsWith(View$1)) {
|
|
2874
|
+
return View$1;
|
|
2875
|
+
}
|
|
2876
|
+
return None;
|
|
2877
|
+
};
|
|
2878
|
+
|
|
2879
|
+
const CommandPalette = 'quickPick://commandPalette';
|
|
2880
|
+
const Commands = 'quickPick://commands';
|
|
2881
|
+
const File$1 = 'quickPick://file';
|
|
2882
|
+
const EveryThing = 'quickPick://everything';
|
|
2883
|
+
const Recent = 'quickPick://recent';
|
|
2884
|
+
const ColorTheme = 'quickPick://color-theme';
|
|
2885
|
+
const Symbol = 'quickPick://symbol';
|
|
2886
|
+
const View = 'quickPick://view';
|
|
2887
|
+
const WorkspaceSymbol = 'quickPick://workspace-symbol';
|
|
2888
|
+
const Custom = 'quickPick://custom';
|
|
2889
|
+
const GoToLine = 'quickPick://go-to-line';
|
|
2890
|
+
|
|
2891
|
+
// TODO use numeric enum for quickpick entry id
|
|
2892
|
+
const getQuickPickProviderId = prefix => {
|
|
2893
|
+
switch (prefix) {
|
|
2894
|
+
case Command:
|
|
2895
|
+
return Commands;
|
|
2896
|
+
case Symbol$1:
|
|
2897
|
+
return Symbol;
|
|
2898
|
+
case WorkspaceSymbol$1:
|
|
2899
|
+
return WorkspaceSymbol;
|
|
2900
|
+
case GoToLine$1:
|
|
2901
|
+
return GoToLine;
|
|
2902
|
+
case View$1:
|
|
2903
|
+
return View;
|
|
2904
|
+
default:
|
|
2905
|
+
return File$1;
|
|
2906
|
+
}
|
|
2907
|
+
};
|
|
2908
|
+
|
|
2909
|
+
const getPicks$4 = async value => {
|
|
2910
|
+
const prefix = getQuickPickPrefix(value);
|
|
2911
|
+
const providerId = getQuickPickProviderId(prefix);
|
|
2912
|
+
|
|
2913
|
+
// TODO race condition
|
|
2914
|
+
if (state$5.prefix !== prefix) {
|
|
2915
|
+
state$5.prefix = prefix;
|
|
2916
|
+
const provider = get(providerId);
|
|
2917
|
+
state$5.provider = provider;
|
|
2918
|
+
}
|
|
2919
|
+
// TODO this line is a bit duplicated with getFilterValue
|
|
2920
|
+
const slicedValue = value.slice(prefix.length).trimStart();
|
|
2921
|
+
const picks = await getPicks$a(providerId, slicedValue);
|
|
2922
|
+
return picks;
|
|
2923
|
+
};
|
|
2924
|
+
|
|
2925
|
+
const selectPick$5 = item => {
|
|
2926
|
+
const {
|
|
2927
|
+
provider
|
|
2928
|
+
} = state$5;
|
|
2929
|
+
return provider.selectPick(item);
|
|
2899
2930
|
};
|
|
2931
|
+
|
|
2932
|
+
// TODO avoid global variable
|
|
2933
|
+
|
|
2934
|
+
// TODO don't store provider in state, only serialized value like provider-id
|
|
2935
|
+
|
|
2936
|
+
/**
|
|
2937
|
+
* @type {string}
|
|
2938
|
+
*/
|
|
2939
|
+
const name$5 = 'everything';
|
|
2900
2940
|
const getPlaceholder$5 = () => {
|
|
2901
|
-
|
|
2941
|
+
// @ts-ignore
|
|
2942
|
+
return state$5.provider.getPlaceholder();
|
|
2902
2943
|
};
|
|
2903
2944
|
const getLabel$2 = () => {
|
|
2904
|
-
return '
|
|
2905
|
-
};
|
|
2906
|
-
|
|
2907
|
-
// TODO help entries should not be here
|
|
2908
|
-
const getHelpEntries$1 = () => {
|
|
2909
|
-
return [];
|
|
2945
|
+
return '';
|
|
2910
2946
|
};
|
|
2911
2947
|
const getNoResults$5 = () => {
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
};
|
|
2948
|
+
// @ts-ignore
|
|
2949
|
+
return state$5.provider.getNoResults();
|
|
2915
2950
|
};
|
|
2916
|
-
const
|
|
2917
|
-
|
|
2918
|
-
return items;
|
|
2951
|
+
const openCommandPalette = () => {
|
|
2952
|
+
// show('>')
|
|
2919
2953
|
};
|
|
2920
|
-
const
|
|
2921
|
-
|
|
2922
|
-
args
|
|
2923
|
-
} = state$6;
|
|
2924
|
-
const resolve = args[2];
|
|
2925
|
-
resolve(pick);
|
|
2926
|
-
return {
|
|
2927
|
-
command: Hide
|
|
2928
|
-
};
|
|
2954
|
+
const openView = () => {
|
|
2955
|
+
// show('view ')
|
|
2929
2956
|
};
|
|
2930
2957
|
const getFilterValue$5 = value => {
|
|
2931
|
-
return value;
|
|
2958
|
+
return value.slice(state$5.prefix.length).trim();
|
|
2932
2959
|
};
|
|
2933
2960
|
const getPickFilterValue$5 = pick => {
|
|
2934
|
-
|
|
2961
|
+
const {
|
|
2962
|
+
provider
|
|
2963
|
+
} = state$5;
|
|
2964
|
+
// @ts-ignore
|
|
2965
|
+
return provider.getPickFilterValue(pick);
|
|
2935
2966
|
};
|
|
2936
|
-
const
|
|
2937
|
-
|
|
2967
|
+
const getPickDescription$5 = pick => {
|
|
2968
|
+
const {
|
|
2969
|
+
provider
|
|
2970
|
+
} = state$5;
|
|
2971
|
+
// @ts-ignore
|
|
2972
|
+
if (provider.getPickDescription) {
|
|
2973
|
+
// @ts-ignore
|
|
2974
|
+
return provider.getPickDescription(pick);
|
|
2975
|
+
}
|
|
2976
|
+
return '';
|
|
2938
2977
|
};
|
|
2939
|
-
const
|
|
2940
|
-
|
|
2978
|
+
const getPickLabel$5 = pick => {
|
|
2979
|
+
const {
|
|
2980
|
+
provider
|
|
2981
|
+
} = state$5;
|
|
2982
|
+
// @ts-ignore
|
|
2983
|
+
return provider.getPickLabel(pick);
|
|
2941
2984
|
};
|
|
2942
|
-
const
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
case Tag:
|
|
2949
|
-
return Tag$1;
|
|
2950
|
-
default:
|
|
2951
|
-
return None;
|
|
2952
|
-
}
|
|
2985
|
+
const getPickIcon$5 = pick => {
|
|
2986
|
+
const {
|
|
2987
|
+
provider
|
|
2988
|
+
} = state$5;
|
|
2989
|
+
// @ts-ignore
|
|
2990
|
+
return provider.getPickIcon(pick);
|
|
2953
2991
|
};
|
|
2954
|
-
const
|
|
2955
|
-
|
|
2992
|
+
const getPickFileIcon$2 = pick => {
|
|
2993
|
+
const {
|
|
2994
|
+
provider
|
|
2995
|
+
} = state$5;
|
|
2996
|
+
// @ts-ignore
|
|
2997
|
+
if (provider.getPickFileIcon) {
|
|
2998
|
+
// @ts-ignore
|
|
2999
|
+
return provider.getPickFileIcon(pick);
|
|
3000
|
+
}
|
|
3001
|
+
return undefined;
|
|
2956
3002
|
};
|
|
2957
3003
|
const isPrepared$5 = () => {
|
|
2958
|
-
|
|
3004
|
+
const {
|
|
3005
|
+
provider
|
|
3006
|
+
} = state$5;
|
|
3007
|
+
// @ts-ignore
|
|
3008
|
+
if (provider.isPrepared) {
|
|
3009
|
+
// @ts-ignore
|
|
3010
|
+
return provider.isPrepared();
|
|
3011
|
+
}
|
|
3012
|
+
return false;
|
|
2959
3013
|
};
|
|
2960
|
-
const getVisibleItems$a = getVisibleItems$b;
|
|
2961
3014
|
|
|
2962
|
-
const
|
|
3015
|
+
const QuickPickEntriesEverything = {
|
|
2963
3016
|
__proto__: null,
|
|
2964
3017
|
getFilterValue: getFilterValue$5,
|
|
2965
|
-
getHelpEntries: getHelpEntries$1,
|
|
2966
3018
|
getLabel: getLabel$2,
|
|
2967
3019
|
getNoResults: getNoResults$5,
|
|
2968
|
-
getPickDescription: getPickDescription$
|
|
3020
|
+
getPickDescription: getPickDescription$5,
|
|
3021
|
+
getPickFileIcon: getPickFileIcon$2,
|
|
2969
3022
|
getPickFilterValue: getPickFilterValue$5,
|
|
2970
|
-
getPickIcon: getPickIcon$
|
|
2971
|
-
getPickLabel: getPickLabel$
|
|
2972
|
-
getPicks: getPicks$
|
|
3023
|
+
getPickIcon: getPickIcon$5,
|
|
3024
|
+
getPickLabel: getPickLabel$5,
|
|
3025
|
+
getPicks: getPicks$4,
|
|
2973
3026
|
getPlaceholder: getPlaceholder$5,
|
|
2974
|
-
getVisibleItems: getVisibleItems$a,
|
|
2975
3027
|
isPrepared: isPrepared$5,
|
|
2976
3028
|
name: name$5,
|
|
3029
|
+
openCommandPalette,
|
|
3030
|
+
openView,
|
|
2977
3031
|
selectPick: selectPick$5,
|
|
2978
|
-
|
|
2979
|
-
state: state$6
|
|
2980
|
-
};
|
|
2981
|
-
|
|
2982
|
-
const RE_PROTOCOL = /^([a-z-]+):\/\//;
|
|
2983
|
-
const getProtocol = uri => {
|
|
2984
|
-
const protocolMatch = uri.match(RE_PROTOCOL);
|
|
2985
|
-
if (protocolMatch) {
|
|
2986
|
-
return protocolMatch[1];
|
|
2987
|
-
}
|
|
2988
|
-
return '';
|
|
2989
|
-
};
|
|
2990
|
-
|
|
2991
|
-
const getVisibleItems$9 = (files, icons) => {
|
|
2992
|
-
const visibleItems = files.map((item, i) => {
|
|
2993
|
-
const pick = item.pick;
|
|
2994
|
-
const label = getPickLabel$7(pick);
|
|
2995
|
-
const description = getPickDescription$7(pick);
|
|
2996
|
-
const icon = getPickIcon$7();
|
|
2997
|
-
const fileIcon = icons[i];
|
|
2998
|
-
return {
|
|
2999
|
-
label,
|
|
3000
|
-
description,
|
|
3001
|
-
icon,
|
|
3002
|
-
fileIcon,
|
|
3003
|
-
matches: item.matches
|
|
3004
|
-
};
|
|
3005
|
-
});
|
|
3006
|
-
return visibleItems;
|
|
3007
|
-
};
|
|
3008
|
-
const getPickLabel$7 = pick => {
|
|
3009
|
-
if (typeof pick === 'object') {
|
|
3010
|
-
pick = pick.pick;
|
|
3011
|
-
}
|
|
3012
|
-
const baseName = pathBaseName(pick);
|
|
3013
|
-
return baseName;
|
|
3014
|
-
};
|
|
3015
|
-
const getPickDescription$7 = pick => {
|
|
3016
|
-
if (typeof pick === 'object') {
|
|
3017
|
-
pick = pick.pick;
|
|
3018
|
-
}
|
|
3019
|
-
const dirName = pathDirName(pick);
|
|
3020
|
-
return dirName;
|
|
3021
|
-
};
|
|
3022
|
-
const getPickIcon$7 = () => {
|
|
3023
|
-
return '';
|
|
3024
|
-
};
|
|
3025
|
-
|
|
3026
|
-
const getWorkspacePath = async () => {
|
|
3027
|
-
return invoke$1('Workspace.getPath');
|
|
3028
|
-
};
|
|
3029
|
-
|
|
3030
|
-
const state$5 = Object.create(null);
|
|
3031
|
-
const register = modules => {
|
|
3032
|
-
Object.assign(state$5, modules);
|
|
3033
|
-
};
|
|
3034
|
-
const getModule = protocol => {
|
|
3035
|
-
return state$5[protocol];
|
|
3036
|
-
};
|
|
3037
|
-
|
|
3038
|
-
const searchFile$5 = async (path, value, prepare, assetDir) => {
|
|
3039
|
-
const protocol = getProtocol(path);
|
|
3040
|
-
// TODO call different providers depending on protocol
|
|
3041
|
-
const fn = getModule(protocol);
|
|
3042
|
-
const result = await fn(path, value, prepare, assetDir);
|
|
3043
|
-
return result;
|
|
3044
|
-
};
|
|
3045
|
-
|
|
3046
|
-
const searchFile$4 = async (path, value) => {
|
|
3047
|
-
const prepare = true;
|
|
3048
|
-
// @ts-ignore
|
|
3049
|
-
const files = await searchFile$5(/* path */path, /* searchTerm */value, prepare);
|
|
3050
|
-
return files;
|
|
3051
|
-
};
|
|
3052
|
-
const getPicks$4 = async searchValue => {
|
|
3053
|
-
// TODO cache workspace path
|
|
3054
|
-
const workspace = await getWorkspacePath();
|
|
3055
|
-
if (!workspace) {
|
|
3056
|
-
return [];
|
|
3057
|
-
}
|
|
3058
|
-
const files = await searchFile$4(workspace, searchValue);
|
|
3059
|
-
return files;
|
|
3032
|
+
state: state$5
|
|
3060
3033
|
};
|
|
3061
3034
|
|
|
3062
3035
|
const openUri = async uri => {
|
|
@@ -3064,11 +3037,10 @@ const openUri = async uri => {
|
|
|
3064
3037
|
};
|
|
3065
3038
|
|
|
3066
3039
|
const selectPick$4 = async pick => {
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
}
|
|
3040
|
+
const description = pick.description;
|
|
3041
|
+
const fileName = pick.label;
|
|
3070
3042
|
const workspace = await getWorkspacePath();
|
|
3071
|
-
const absolutePath = `${workspace}/${
|
|
3043
|
+
const absolutePath = `${workspace}/${description}/${fileName}`;
|
|
3072
3044
|
await openUri(absolutePath);
|
|
3073
3045
|
return {
|
|
3074
3046
|
command: Hide
|
|
@@ -3097,35 +3069,29 @@ const getPickFilterValue$4 = pick => {
|
|
|
3097
3069
|
}
|
|
3098
3070
|
return pick;
|
|
3099
3071
|
};
|
|
3100
|
-
const getPickLabel$
|
|
3072
|
+
const getPickLabel$4 = pick => {
|
|
3101
3073
|
if (typeof pick === 'object') {
|
|
3102
3074
|
pick = pick.pick;
|
|
3103
3075
|
}
|
|
3104
3076
|
const baseName = pathBaseName(pick);
|
|
3105
3077
|
return baseName;
|
|
3106
3078
|
};
|
|
3107
|
-
const getPickDescription$
|
|
3079
|
+
const getPickDescription$4 = pick => {
|
|
3108
3080
|
if (typeof pick === 'object') {
|
|
3109
3081
|
pick = pick.pick;
|
|
3110
3082
|
}
|
|
3111
3083
|
const dirName = pathDirName(pick);
|
|
3112
3084
|
return dirName;
|
|
3113
3085
|
};
|
|
3114
|
-
const getPickIcon$
|
|
3086
|
+
const getPickIcon$4 = () => {
|
|
3115
3087
|
return '';
|
|
3116
3088
|
};
|
|
3117
3089
|
const getPickFileIcon$1 = pick => {
|
|
3118
|
-
|
|
3119
|
-
pick = pick.pick;
|
|
3120
|
-
}
|
|
3121
|
-
if (typeof pick === 'object') {
|
|
3122
|
-
pick = pick.pick;
|
|
3123
|
-
}
|
|
3124
|
-
const baseName = pathBaseName(pick);
|
|
3090
|
+
const path = `${pick.description}/${pick.label}`;
|
|
3125
3091
|
return {
|
|
3126
|
-
type: File$
|
|
3127
|
-
name:
|
|
3128
|
-
path
|
|
3092
|
+
type: File$2,
|
|
3093
|
+
name: pick.label,
|
|
3094
|
+
path
|
|
3129
3095
|
};
|
|
3130
3096
|
};
|
|
3131
3097
|
const isPrepared$4 = () => {
|
|
@@ -3134,21 +3100,19 @@ const isPrepared$4 = () => {
|
|
|
3134
3100
|
const protocol = getProtocol(workspace);
|
|
3135
3101
|
return !protocol;
|
|
3136
3102
|
};
|
|
3137
|
-
const getVisibleItems$8 = getVisibleItems$9;
|
|
3138
3103
|
|
|
3139
3104
|
const QuickPickEntriesFile = {
|
|
3140
3105
|
__proto__: null,
|
|
3141
3106
|
getFilterValue: getFilterValue$4,
|
|
3142
3107
|
getLabel: getLabel$1,
|
|
3143
3108
|
getNoResults: getNoResults$4,
|
|
3144
|
-
getPickDescription: getPickDescription$
|
|
3109
|
+
getPickDescription: getPickDescription$4,
|
|
3145
3110
|
getPickFileIcon: getPickFileIcon$1,
|
|
3146
3111
|
getPickFilterValue: getPickFilterValue$4,
|
|
3147
|
-
getPickIcon: getPickIcon$
|
|
3148
|
-
getPickLabel: getPickLabel$
|
|
3149
|
-
getPicks: getPicks$
|
|
3112
|
+
getPickIcon: getPickIcon$4,
|
|
3113
|
+
getPickLabel: getPickLabel$4,
|
|
3114
|
+
getPicks: getPicks$8,
|
|
3150
3115
|
getPlaceholder: getPlaceholder$4,
|
|
3151
|
-
getVisibleItems: getVisibleItems$8,
|
|
3152
3116
|
isPrepared: isPrepared$4,
|
|
3153
3117
|
name: name$4,
|
|
3154
3118
|
selectPick: selectPick$4,
|
|
@@ -3159,37 +3123,13 @@ const getRecentlyOpened = () => {
|
|
|
3159
3123
|
return invoke$1(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
|
|
3160
3124
|
};
|
|
3161
3125
|
|
|
3162
|
-
const getPickDescription$5 = pick => {
|
|
3163
|
-
return pathDirName(pick);
|
|
3164
|
-
};
|
|
3165
|
-
const getPickIcon$5 = () => {
|
|
3166
|
-
return '';
|
|
3167
|
-
};
|
|
3168
|
-
const getPickLabel$5 = pick => {
|
|
3169
|
-
return pathBaseName(pick);
|
|
3170
|
-
};
|
|
3171
|
-
const getVisibleItems$7 = (picks, icons) => {
|
|
3172
|
-
const visibleItems = picks.map((item, index) => {
|
|
3173
|
-
const pick = item.pick;
|
|
3174
|
-
const fileIcon = icons[index];
|
|
3175
|
-
return {
|
|
3176
|
-
description: getPickDescription$5(pick),
|
|
3177
|
-
fileIcon,
|
|
3178
|
-
icon: getPickIcon$5(),
|
|
3179
|
-
label: getPickLabel$5(pick),
|
|
3180
|
-
matches: pick.matches || []
|
|
3181
|
-
};
|
|
3182
|
-
});
|
|
3183
|
-
return visibleItems;
|
|
3184
|
-
};
|
|
3185
|
-
|
|
3186
3126
|
const openWorkspaceFolder = uri => {
|
|
3187
3127
|
return invoke$1(/* Workspace.setPath */'Workspace.setPath', /* path */uri);
|
|
3188
3128
|
};
|
|
3189
3129
|
|
|
3190
3130
|
// TODO selectPick should be independent of show/hide
|
|
3191
3131
|
const selectPick$3 = async pick => {
|
|
3192
|
-
const path = pick
|
|
3132
|
+
const path = `${pick.description}/${pick.label}`;
|
|
3193
3133
|
await openWorkspaceFolder(path);
|
|
3194
3134
|
return {
|
|
3195
3135
|
command: Hide
|
|
@@ -3217,34 +3157,28 @@ const getPicks$3 = async () => {
|
|
|
3217
3157
|
const recentlyOpened = await getRecentlyOpened();
|
|
3218
3158
|
return recentlyOpened;
|
|
3219
3159
|
};
|
|
3220
|
-
const getVisibleItems$6 = getVisibleItems$7;
|
|
3221
3160
|
const getFilterValue$3 = value => {
|
|
3222
3161
|
return pathBaseName(value);
|
|
3223
3162
|
};
|
|
3224
3163
|
const getPickFilterValue$3 = pick => {
|
|
3225
3164
|
return pathBaseName(pick);
|
|
3226
3165
|
};
|
|
3227
|
-
const getPickLabel$
|
|
3166
|
+
const getPickLabel$3 = pick => {
|
|
3228
3167
|
return pathBaseName(pick);
|
|
3229
3168
|
};
|
|
3230
|
-
const getPickDescription$
|
|
3169
|
+
const getPickDescription$3 = pick => {
|
|
3231
3170
|
return pathDirName(pick);
|
|
3232
3171
|
};
|
|
3233
|
-
const getPickIcon$
|
|
3172
|
+
const getPickIcon$3 = () => {
|
|
3234
3173
|
return '';
|
|
3235
3174
|
};
|
|
3236
3175
|
const getPickFileIcon = pick => {
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
}
|
|
3240
|
-
if (typeof pick === 'object') {
|
|
3241
|
-
pick = pick.pick;
|
|
3242
|
-
}
|
|
3243
|
-
const baseName = pathBaseName(pick);
|
|
3176
|
+
const baseName = pick.label;
|
|
3177
|
+
const path = `${pick.description}/${pick.label}`;
|
|
3244
3178
|
return {
|
|
3245
|
-
type: File$
|
|
3179
|
+
type: File$2,
|
|
3246
3180
|
name: baseName,
|
|
3247
|
-
path
|
|
3181
|
+
path
|
|
3248
3182
|
};
|
|
3249
3183
|
};
|
|
3250
3184
|
const state$3 = {};
|
|
@@ -3258,24 +3192,19 @@ const QuickPickEntriesOpenRecent = {
|
|
|
3258
3192
|
getFilterValue: getFilterValue$3,
|
|
3259
3193
|
getLabel,
|
|
3260
3194
|
getNoResults: getNoResults$3,
|
|
3261
|
-
getPickDescription: getPickDescription$
|
|
3195
|
+
getPickDescription: getPickDescription$3,
|
|
3262
3196
|
getPickFileIcon,
|
|
3263
3197
|
getPickFilterValue: getPickFilterValue$3,
|
|
3264
|
-
getPickIcon: getPickIcon$
|
|
3265
|
-
getPickLabel: getPickLabel$
|
|
3198
|
+
getPickIcon: getPickIcon$3,
|
|
3199
|
+
getPickLabel: getPickLabel$3,
|
|
3266
3200
|
getPicks: getPicks$3,
|
|
3267
3201
|
getPlaceholder: getPlaceholder$3,
|
|
3268
|
-
getVisibleItems: getVisibleItems$6,
|
|
3269
3202
|
isPrepared: isPrepared$3,
|
|
3270
3203
|
name: name$3,
|
|
3271
3204
|
selectPick: selectPick$3,
|
|
3272
3205
|
state: state$3
|
|
3273
3206
|
};
|
|
3274
3207
|
|
|
3275
|
-
const getVisibleItems$5 = picks => {
|
|
3276
|
-
return [];
|
|
3277
|
-
};
|
|
3278
|
-
|
|
3279
3208
|
const selectPick$2 = async item => {
|
|
3280
3209
|
return {
|
|
3281
3210
|
command: Hide
|
|
@@ -3295,12 +3224,11 @@ const getPicks$2 = async () => {
|
|
|
3295
3224
|
const picks = [];
|
|
3296
3225
|
return picks;
|
|
3297
3226
|
};
|
|
3298
|
-
const getVisibleItems$4 = getVisibleItems$5;
|
|
3299
3227
|
const getFilterValue$2 = value => {
|
|
3300
3228
|
return value;
|
|
3301
3229
|
};
|
|
3302
3230
|
const state$2 = {};
|
|
3303
|
-
const getPickDescription$
|
|
3231
|
+
const getPickDescription$2 = value => {
|
|
3304
3232
|
return '';
|
|
3305
3233
|
};
|
|
3306
3234
|
const isPrepared$2 = () => {
|
|
@@ -3309,10 +3237,10 @@ const isPrepared$2 = () => {
|
|
|
3309
3237
|
const getPickFilterValue$2 = value => {
|
|
3310
3238
|
return value;
|
|
3311
3239
|
};
|
|
3312
|
-
const getPickLabel$
|
|
3240
|
+
const getPickLabel$2 = value => {
|
|
3313
3241
|
return value;
|
|
3314
3242
|
};
|
|
3315
|
-
const getPickIcon$
|
|
3243
|
+
const getPickIcon$2 = value => {
|
|
3316
3244
|
return '';
|
|
3317
3245
|
};
|
|
3318
3246
|
|
|
@@ -3320,44 +3248,23 @@ const QuickPickEntriesSymbol = {
|
|
|
3320
3248
|
__proto__: null,
|
|
3321
3249
|
getFilterValue: getFilterValue$2,
|
|
3322
3250
|
getNoResults: getNoResults$2,
|
|
3323
|
-
getPickDescription: getPickDescription$
|
|
3251
|
+
getPickDescription: getPickDescription$2,
|
|
3324
3252
|
getPickFilterValue: getPickFilterValue$2,
|
|
3325
|
-
getPickIcon: getPickIcon$
|
|
3326
|
-
getPickLabel: getPickLabel$
|
|
3253
|
+
getPickIcon: getPickIcon$2,
|
|
3254
|
+
getPickLabel: getPickLabel$2,
|
|
3327
3255
|
getPicks: getPicks$2,
|
|
3328
3256
|
getPlaceholder: getPlaceholder$2,
|
|
3329
|
-
getVisibleItems: getVisibleItems$4,
|
|
3330
3257
|
isPrepared: isPrepared$2,
|
|
3331
3258
|
name: name$2,
|
|
3332
3259
|
selectPick: selectPick$2,
|
|
3333
3260
|
state: state$2
|
|
3334
3261
|
};
|
|
3335
3262
|
|
|
3336
|
-
const getPickDescription$2 = () => {
|
|
3337
|
-
return '';
|
|
3338
|
-
};
|
|
3339
|
-
const getPickIcon$2 = value => {
|
|
3340
|
-
return '';
|
|
3341
|
-
};
|
|
3342
|
-
const getPickLabel$2 = value => {
|
|
3343
|
-
return value;
|
|
3344
|
-
};
|
|
3345
|
-
const getVisibleItems$3 = picks => {
|
|
3346
|
-
const visibleItems = picks.map((pick, index) => ({
|
|
3347
|
-
description: getPickDescription$2(),
|
|
3348
|
-
fileIcon: '',
|
|
3349
|
-
icon: getPickIcon$2(),
|
|
3350
|
-
label: getPickLabel$2(pick),
|
|
3351
|
-
matches: []
|
|
3352
|
-
}));
|
|
3353
|
-
return visibleItems;
|
|
3354
|
-
};
|
|
3355
|
-
|
|
3356
3263
|
const selectPick$1 = async item => {
|
|
3357
3264
|
// Command.execute(/* openView */ 549, /* viewName */ item.label)
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3265
|
+
return {
|
|
3266
|
+
command: Hide
|
|
3267
|
+
};
|
|
3361
3268
|
};
|
|
3362
3269
|
|
|
3363
3270
|
// TODO probably not needed
|
|
@@ -3397,7 +3304,6 @@ const isPrepared$1 = () => {
|
|
|
3397
3304
|
const getPickDescription$1 = () => {
|
|
3398
3305
|
return '';
|
|
3399
3306
|
};
|
|
3400
|
-
const getVisibleItems$2 = getVisibleItems$3;
|
|
3401
3307
|
|
|
3402
3308
|
const QuickPickEntriesView = {
|
|
3403
3309
|
__proto__: null,
|
|
@@ -3410,24 +3316,12 @@ const QuickPickEntriesView = {
|
|
|
3410
3316
|
getPickLabel: getPickLabel$1,
|
|
3411
3317
|
getPicks: getPicks$1,
|
|
3412
3318
|
getPlaceholder: getPlaceholder$1,
|
|
3413
|
-
getVisibleItems: getVisibleItems$2,
|
|
3414
3319
|
isPrepared: isPrepared$1,
|
|
3415
3320
|
name: name$1,
|
|
3416
3321
|
selectPick: selectPick$1,
|
|
3417
3322
|
state: state$1
|
|
3418
3323
|
};
|
|
3419
3324
|
|
|
3420
|
-
const getVisibleItems$1 = picks => {
|
|
3421
|
-
const visibleItems = picks.map((pick, index) => ({
|
|
3422
|
-
description: '',
|
|
3423
|
-
fileIcon: '',
|
|
3424
|
-
icon: '',
|
|
3425
|
-
label: pick.label || '',
|
|
3426
|
-
matches: []
|
|
3427
|
-
}));
|
|
3428
|
-
return visibleItems;
|
|
3429
|
-
};
|
|
3430
|
-
|
|
3431
3325
|
const selectPick = async item => {
|
|
3432
3326
|
return {
|
|
3433
3327
|
command: Hide
|
|
@@ -3466,7 +3360,6 @@ const getPicks = async () => {
|
|
|
3466
3360
|
const getFilterValue = value => {
|
|
3467
3361
|
return value;
|
|
3468
3362
|
};
|
|
3469
|
-
const getVisibleItems = getVisibleItems$1;
|
|
3470
3363
|
|
|
3471
3364
|
const QuickPickEntriesWorkspaceSymbol = {
|
|
3472
3365
|
__proto__: null,
|
|
@@ -3478,7 +3371,6 @@ const QuickPickEntriesWorkspaceSymbol = {
|
|
|
3478
3371
|
getPickLabel,
|
|
3479
3372
|
getPicks,
|
|
3480
3373
|
getPlaceholder,
|
|
3481
|
-
getVisibleItems,
|
|
3482
3374
|
isPrepared,
|
|
3483
3375
|
name,
|
|
3484
3376
|
selectPick,
|
|
@@ -3491,7 +3383,7 @@ const quickPickEntriesModules = {
|
|
|
3491
3383
|
[Commands]: QuickPickEntriesCommand,
|
|
3492
3384
|
[Custom]: QuickPickEntriesCustom,
|
|
3493
3385
|
[EveryThing]: QuickPickEntriesEverything,
|
|
3494
|
-
[File$
|
|
3386
|
+
[File$1]: QuickPickEntriesFile,
|
|
3495
3387
|
[Recent]: QuickPickEntriesOpenRecent,
|
|
3496
3388
|
[Symbol]: QuickPickEntriesSymbol,
|
|
3497
3389
|
[View]: QuickPickEntriesView,
|
|
@@ -3546,11 +3438,7 @@ const searchFile = async (path, value, prepare) => {
|
|
|
3546
3438
|
};
|
|
3547
3439
|
const stdout = await invoke('SearchFile.searchFile', options);
|
|
3548
3440
|
const lines = splitLines(stdout);
|
|
3549
|
-
|
|
3550
|
-
return lines;
|
|
3551
|
-
}
|
|
3552
|
-
const filtered = filterQuickPickItems(lines, value);
|
|
3553
|
-
return filtered;
|
|
3441
|
+
return lines;
|
|
3554
3442
|
};
|
|
3555
3443
|
|
|
3556
3444
|
const searchModules = {
|