@lvce-editor/quick-pick-worker 4.13.2 → 4.14.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/quickPickWorkerMain.js +156 -101
- package/package.json +1 -1
|
@@ -157,7 +157,6 @@ const walkValue = (value, transferrables, isTransferrable) => {
|
|
|
157
157
|
for (const property of Object.values(value)) {
|
|
158
158
|
walkValue(property, transferrables, isTransferrable);
|
|
159
159
|
}
|
|
160
|
-
return;
|
|
161
160
|
}
|
|
162
161
|
};
|
|
163
162
|
const getTransferrables = value => {
|
|
@@ -311,7 +310,14 @@ class IpcError extends VError {
|
|
|
311
310
|
const cause = new Error(message);
|
|
312
311
|
// @ts-ignore
|
|
313
312
|
cause.code = code;
|
|
314
|
-
|
|
313
|
+
if (stack) {
|
|
314
|
+
Object.defineProperty(cause, 'stack', {
|
|
315
|
+
configurable: true,
|
|
316
|
+
enumerable: false,
|
|
317
|
+
value: stack,
|
|
318
|
+
writable: true
|
|
319
|
+
});
|
|
320
|
+
}
|
|
315
321
|
super(cause, betterMessage);
|
|
316
322
|
} else {
|
|
317
323
|
super(betterMessage);
|
|
@@ -1020,6 +1026,34 @@ const listen$1 = async (module, options) => {
|
|
|
1020
1026
|
return ipc;
|
|
1021
1027
|
};
|
|
1022
1028
|
|
|
1029
|
+
const createSharedLazyRpc = factory => {
|
|
1030
|
+
let rpcPromise;
|
|
1031
|
+
const getOrCreate = () => {
|
|
1032
|
+
if (!rpcPromise) {
|
|
1033
|
+
rpcPromise = factory();
|
|
1034
|
+
}
|
|
1035
|
+
return rpcPromise;
|
|
1036
|
+
};
|
|
1037
|
+
return {
|
|
1038
|
+
async dispose() {
|
|
1039
|
+
const rpc = await getOrCreate();
|
|
1040
|
+
await rpc.dispose();
|
|
1041
|
+
},
|
|
1042
|
+
async invoke(method, ...params) {
|
|
1043
|
+
const rpc = await getOrCreate();
|
|
1044
|
+
return rpc.invoke(method, ...params);
|
|
1045
|
+
},
|
|
1046
|
+
async invokeAndTransfer(method, ...params) {
|
|
1047
|
+
const rpc = await getOrCreate();
|
|
1048
|
+
return rpc.invokeAndTransfer(method, ...params);
|
|
1049
|
+
},
|
|
1050
|
+
async send(method, ...params) {
|
|
1051
|
+
const rpc = await getOrCreate();
|
|
1052
|
+
rpc.send(method, ...params);
|
|
1053
|
+
}
|
|
1054
|
+
};
|
|
1055
|
+
};
|
|
1056
|
+
|
|
1023
1057
|
const create$8 = async ({
|
|
1024
1058
|
commandMap,
|
|
1025
1059
|
isMessagePortOpen = true,
|
|
@@ -1055,34 +1089,6 @@ const create$7 = async ({
|
|
|
1055
1089
|
});
|
|
1056
1090
|
};
|
|
1057
1091
|
|
|
1058
|
-
const createSharedLazyRpc = factory => {
|
|
1059
|
-
let rpcPromise;
|
|
1060
|
-
const getOrCreate = () => {
|
|
1061
|
-
if (!rpcPromise) {
|
|
1062
|
-
rpcPromise = factory();
|
|
1063
|
-
}
|
|
1064
|
-
return rpcPromise;
|
|
1065
|
-
};
|
|
1066
|
-
return {
|
|
1067
|
-
async dispose() {
|
|
1068
|
-
const rpc = await getOrCreate();
|
|
1069
|
-
await rpc.dispose();
|
|
1070
|
-
},
|
|
1071
|
-
async invoke(method, ...params) {
|
|
1072
|
-
const rpc = await getOrCreate();
|
|
1073
|
-
return rpc.invoke(method, ...params);
|
|
1074
|
-
},
|
|
1075
|
-
async invokeAndTransfer(method, ...params) {
|
|
1076
|
-
const rpc = await getOrCreate();
|
|
1077
|
-
return rpc.invokeAndTransfer(method, ...params);
|
|
1078
|
-
},
|
|
1079
|
-
async send(method, ...params) {
|
|
1080
|
-
const rpc = await getOrCreate();
|
|
1081
|
-
rpc.send(method, ...params);
|
|
1082
|
-
}
|
|
1083
|
-
};
|
|
1084
|
-
};
|
|
1085
|
-
|
|
1086
1092
|
const create$6 = async ({
|
|
1087
1093
|
commandMap,
|
|
1088
1094
|
isMessagePortOpen,
|
|
@@ -1129,7 +1135,7 @@ const createMockRpc = ({
|
|
|
1129
1135
|
};
|
|
1130
1136
|
|
|
1131
1137
|
const rpcs = Object.create(null);
|
|
1132
|
-
const set$
|
|
1138
|
+
const set$8 = (id, rpc) => {
|
|
1133
1139
|
rpcs[id] = rpc;
|
|
1134
1140
|
};
|
|
1135
1141
|
const get$2 = id => {
|
|
@@ -1162,7 +1168,7 @@ const create$4 = rpcId => {
|
|
|
1162
1168
|
const mockRpc = createMockRpc({
|
|
1163
1169
|
commandMap
|
|
1164
1170
|
});
|
|
1165
|
-
set$
|
|
1171
|
+
set$8(rpcId, mockRpc);
|
|
1166
1172
|
// @ts-ignore
|
|
1167
1173
|
mockRpc[Symbol.dispose] = () => {
|
|
1168
1174
|
remove$1(rpcId);
|
|
@@ -1171,79 +1177,97 @@ const create$4 = rpcId => {
|
|
|
1171
1177
|
return mockRpc;
|
|
1172
1178
|
},
|
|
1173
1179
|
set(rpc) {
|
|
1174
|
-
set$
|
|
1180
|
+
set$8(rpcId, rpc);
|
|
1175
1181
|
}
|
|
1176
1182
|
};
|
|
1177
1183
|
};
|
|
1178
1184
|
|
|
1185
|
+
const Div = 4;
|
|
1186
|
+
const Input = 6;
|
|
1187
|
+
const Span = 8;
|
|
1188
|
+
const Text = 12;
|
|
1189
|
+
const Img = 17;
|
|
1190
|
+
const Reference = 100;
|
|
1191
|
+
|
|
1179
1192
|
const EditorWorker = 99;
|
|
1180
1193
|
const ExtensionManagementWorker = 9006;
|
|
1194
|
+
const RendererProcess = 1670;
|
|
1181
1195
|
const RendererWorker = 1;
|
|
1182
1196
|
|
|
1183
1197
|
const SetDom2 = 'Viewlet.setDom2';
|
|
1198
|
+
const SetFocusContext = 'Viewlet.setFocusContext';
|
|
1184
1199
|
const SetPatches = 'Viewlet.setPatches';
|
|
1185
1200
|
|
|
1186
1201
|
const FocusQuickPickInput = 20;
|
|
1187
1202
|
|
|
1188
1203
|
const {
|
|
1189
|
-
invoke: invoke$
|
|
1190
|
-
set: set$
|
|
1204
|
+
invoke: invoke$6,
|
|
1205
|
+
set: set$7
|
|
1191
1206
|
} = create$4(EditorWorker);
|
|
1192
1207
|
const getLines = async editorUid => {
|
|
1193
|
-
const lines = await invoke$
|
|
1208
|
+
const lines = await invoke$6('Editor.getLines2', editorUid);
|
|
1194
1209
|
return lines;
|
|
1195
1210
|
};
|
|
1196
1211
|
|
|
1197
1212
|
const {
|
|
1198
|
-
invoke: invoke$
|
|
1199
|
-
set: set$
|
|
1213
|
+
invoke: invoke$5,
|
|
1214
|
+
set: set$6
|
|
1200
1215
|
} = create$4(ExtensionManagementWorker);
|
|
1201
1216
|
const getLanguages = (platform, assetDir) => {
|
|
1202
|
-
return invoke$
|
|
1217
|
+
return invoke$5('Extensions.getLanguages', platform, assetDir);
|
|
1203
1218
|
};
|
|
1204
1219
|
|
|
1205
1220
|
const {
|
|
1206
|
-
invoke: invoke$
|
|
1207
|
-
set: set$
|
|
1221
|
+
invoke: invoke$4,
|
|
1222
|
+
set: set$5
|
|
1208
1223
|
} = create$4(7013);
|
|
1209
1224
|
|
|
1210
1225
|
const {
|
|
1211
|
-
invoke: invoke$
|
|
1226
|
+
invoke: invoke$3,
|
|
1227
|
+
set: set$4
|
|
1228
|
+
} = create$4(RendererProcess);
|
|
1229
|
+
|
|
1230
|
+
const {
|
|
1231
|
+
invoke: invoke$2,
|
|
1212
1232
|
invokeAndTransfer,
|
|
1213
|
-
set: set$
|
|
1233
|
+
set: set$3
|
|
1214
1234
|
} = create$4(RendererWorker);
|
|
1215
1235
|
const sendMessagePortToEditorWorker = async (port, rpcId) => {
|
|
1216
1236
|
const command = 'HandleMessagePort.handleMessagePort';
|
|
1217
1237
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToEditorWorker', port, command, rpcId);
|
|
1218
1238
|
};
|
|
1219
1239
|
const setFocus = key => {
|
|
1220
|
-
return invoke$
|
|
1240
|
+
return invoke$2('Focus.setFocus', key);
|
|
1221
1241
|
};
|
|
1222
1242
|
const getFileIcon = async options => {
|
|
1223
|
-
return invoke$
|
|
1243
|
+
return invoke$2('IconTheme.getFileIcon', options);
|
|
1224
1244
|
};
|
|
1225
1245
|
const getFolderIcon = async options => {
|
|
1226
|
-
return invoke$
|
|
1246
|
+
return invoke$2('IconTheme.getFolderIcon', options);
|
|
1227
1247
|
};
|
|
1228
1248
|
const closeWidget$1 = async widgetId => {
|
|
1229
|
-
return invoke$
|
|
1249
|
+
return invoke$2('Viewlet.closeWidget', widgetId);
|
|
1230
1250
|
};
|
|
1231
1251
|
const sendMessagePortToFileSearchWorker2 = async (port, rpcId = 0) => {
|
|
1232
1252
|
const command = 'FileSearch.handleMessagePort';
|
|
1233
1253
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSearchWorker', port, command, rpcId);
|
|
1234
1254
|
};
|
|
1235
1255
|
const getActiveEditorId = () => {
|
|
1236
|
-
return invoke$
|
|
1256
|
+
return invoke$2('GetActiveEditor.getActiveEditorId');
|
|
1237
1257
|
};
|
|
1238
1258
|
const sendMessagePortToExtensionManagementWorker = async (port, rpcId) => {
|
|
1239
1259
|
const command = 'Extensions.handleMessagePort';
|
|
1240
1260
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionManagementWorker', port, command, rpcId);
|
|
1241
1261
|
};
|
|
1242
1262
|
const openUri$1 = async (uri, focus, options) => {
|
|
1243
|
-
await invoke$
|
|
1263
|
+
await invoke$2('Main.openUri', {
|
|
1264
|
+
...options,
|
|
1265
|
+
focus,
|
|
1266
|
+
uri
|
|
1267
|
+
});
|
|
1244
1268
|
};
|
|
1245
1269
|
const showErrorDialog$1 = async errorInfo => {
|
|
1246
|
-
await invoke$
|
|
1270
|
+
await invoke$2('ErrorHandling.showErrorDialog', errorInfo);
|
|
1247
1271
|
};
|
|
1248
1272
|
|
|
1249
1273
|
const closeWidget = async id => {
|
|
@@ -1251,11 +1275,11 @@ const closeWidget = async id => {
|
|
|
1251
1275
|
await closeWidget$1(id);
|
|
1252
1276
|
};
|
|
1253
1277
|
|
|
1254
|
-
const state$
|
|
1278
|
+
const state$4 = {
|
|
1255
1279
|
value: 0
|
|
1256
1280
|
};
|
|
1257
1281
|
const create$3 = () => {
|
|
1258
|
-
return ++state$
|
|
1282
|
+
return ++state$4.value;
|
|
1259
1283
|
};
|
|
1260
1284
|
|
|
1261
1285
|
const callbacks$1 = Object.create(null);
|
|
@@ -1319,7 +1343,7 @@ const close = async state => {
|
|
|
1319
1343
|
}
|
|
1320
1344
|
executeCallback(resolveId, result);
|
|
1321
1345
|
} else {
|
|
1322
|
-
await invoke$
|
|
1346
|
+
await invoke$2('QuickPick.executeCallback', resolveId, result);
|
|
1323
1347
|
}
|
|
1324
1348
|
}
|
|
1325
1349
|
}
|
|
@@ -1480,7 +1504,7 @@ const {
|
|
|
1480
1504
|
get: get$1,
|
|
1481
1505
|
getCommandIds,
|
|
1482
1506
|
registerCommands,
|
|
1483
|
-
set: set$
|
|
1507
|
+
set: set$2,
|
|
1484
1508
|
wrapAsyncCommand,
|
|
1485
1509
|
wrapCommand
|
|
1486
1510
|
} = create$2();
|
|
@@ -1688,7 +1712,7 @@ const create = (uid, uri, listItemHeight, x, y, width, height, platform, args, _
|
|
|
1688
1712
|
platform,
|
|
1689
1713
|
value: ''
|
|
1690
1714
|
};
|
|
1691
|
-
set$
|
|
1715
|
+
set$2(uid, state, state);
|
|
1692
1716
|
};
|
|
1693
1717
|
|
|
1694
1718
|
const RenderItems = 1;
|
|
@@ -1747,7 +1771,7 @@ const dispose = uid => {
|
|
|
1747
1771
|
};
|
|
1748
1772
|
|
|
1749
1773
|
const setColorTheme = id => {
|
|
1750
|
-
return invoke$
|
|
1774
|
+
return invoke$2(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
|
|
1751
1775
|
};
|
|
1752
1776
|
|
|
1753
1777
|
const focusPick$1 = async pick => {
|
|
@@ -2394,7 +2418,7 @@ const getFinalDeltaY = (height, itemHeight, itemsLength) => {
|
|
|
2394
2418
|
};
|
|
2395
2419
|
|
|
2396
2420
|
const getColorThemeNames = async (assetDir, platform) => {
|
|
2397
|
-
return invoke$
|
|
2421
|
+
return invoke$2('ColorTheme.getColorThemeNames', assetDir, platform);
|
|
2398
2422
|
};
|
|
2399
2423
|
|
|
2400
2424
|
const toProtoVisibleItem$4 = name => {
|
|
@@ -2472,21 +2496,21 @@ const warn = (...args) => {
|
|
|
2472
2496
|
console.warn(...args);
|
|
2473
2497
|
};
|
|
2474
2498
|
|
|
2475
|
-
const state$
|
|
2499
|
+
const state$3 = {
|
|
2476
2500
|
menuEntries: []
|
|
2477
2501
|
};
|
|
2478
2502
|
const getAll = async () => {
|
|
2479
2503
|
try {
|
|
2480
2504
|
// @ts-ignore
|
|
2481
|
-
const entries = await invoke$
|
|
2505
|
+
const entries = await invoke$2('Layout.getAllQuickPickMenuEntries');
|
|
2482
2506
|
return entries || [];
|
|
2483
2507
|
} catch {
|
|
2484
2508
|
// ignore
|
|
2485
2509
|
}
|
|
2486
|
-
return state$
|
|
2510
|
+
return state$3.menuEntries;
|
|
2487
2511
|
};
|
|
2488
2512
|
const add$1 = menuEntries => {
|
|
2489
|
-
state$
|
|
2513
|
+
state$3.menuEntries = [...state$3.menuEntries, ...menuEntries];
|
|
2490
2514
|
};
|
|
2491
2515
|
|
|
2492
2516
|
const changeLanguageModePick = {
|
|
@@ -2513,7 +2537,7 @@ const getExtensionPicks = async (assetDir, platform) => {
|
|
|
2513
2537
|
// Assert.number(platform)
|
|
2514
2538
|
// TODO ask extension management worker directly
|
|
2515
2539
|
// TODO don't call this every time, cache the results
|
|
2516
|
-
const extensionPicks = await invoke$
|
|
2540
|
+
const extensionPicks = await invoke$2('ExtensionHost.getCommands', assetDir, platform);
|
|
2517
2541
|
if (!extensionPicks) {
|
|
2518
2542
|
return [];
|
|
2519
2543
|
}
|
|
@@ -2557,7 +2581,7 @@ const getPicks$c = async (value, args, {
|
|
|
2557
2581
|
return converted;
|
|
2558
2582
|
};
|
|
2559
2583
|
|
|
2560
|
-
const state$
|
|
2584
|
+
const state$2 = {
|
|
2561
2585
|
args: [],
|
|
2562
2586
|
items: Object.create(null)
|
|
2563
2587
|
};
|
|
@@ -2567,24 +2591,24 @@ const idState = {
|
|
|
2567
2591
|
};
|
|
2568
2592
|
const add = items => {
|
|
2569
2593
|
const nextId = ++idState.value;
|
|
2570
|
-
state$
|
|
2594
|
+
state$2.items[nextId] = items;
|
|
2571
2595
|
return nextId;
|
|
2572
2596
|
};
|
|
2573
2597
|
const get = id => {
|
|
2574
|
-
return state$
|
|
2598
|
+
return state$2.items[id] || [];
|
|
2575
2599
|
};
|
|
2576
2600
|
const remove = id => {
|
|
2577
|
-
delete state$
|
|
2601
|
+
delete state$2.items[id];
|
|
2578
2602
|
};
|
|
2579
2603
|
|
|
2580
|
-
const state = {
|
|
2604
|
+
const state$1 = {
|
|
2581
2605
|
rpc: undefined
|
|
2582
2606
|
};
|
|
2583
|
-
const set = newRpc => {
|
|
2584
|
-
state.rpc = newRpc;
|
|
2607
|
+
const set$1 = newRpc => {
|
|
2608
|
+
state$1.rpc = newRpc;
|
|
2585
2609
|
};
|
|
2586
|
-
const invoke = (method, ...args) => {
|
|
2587
|
-
return state.rpc.invoke(method, ...args);
|
|
2610
|
+
const invoke$1 = (method, ...args) => {
|
|
2611
|
+
return state$1.rpc.invoke(method, ...args);
|
|
2588
2612
|
};
|
|
2589
2613
|
|
|
2590
2614
|
const toProtoVisibleItem$2 = item => {
|
|
@@ -2610,11 +2634,11 @@ const toProtoVisibleItem$2 = item => {
|
|
|
2610
2634
|
};
|
|
2611
2635
|
};
|
|
2612
2636
|
const getPicks$b = async (searchValue, args) => {
|
|
2613
|
-
state$
|
|
2637
|
+
state$2.args = args;
|
|
2614
2638
|
const options = args.at(-1);
|
|
2615
2639
|
let items;
|
|
2616
2640
|
if (options?.mode === 'quickInput') {
|
|
2617
|
-
items = searchValue === '' && options?.customItemsId ? get(options.customItemsId) : await invoke('ExtensionHostQuickPick.renderQuickInput', options.quickInputId, searchValue);
|
|
2641
|
+
items = searchValue === '' && options?.customItemsId ? get(options.customItemsId) : await invoke$1('ExtensionHostQuickPick.renderQuickInput', options.quickInputId, searchValue);
|
|
2618
2642
|
} else {
|
|
2619
2643
|
items = options?.customItemsId ? get(options.customItemsId) : args[1] || [];
|
|
2620
2644
|
}
|
|
@@ -2625,11 +2649,11 @@ const getPicks$b = async (searchValue, args) => {
|
|
|
2625
2649
|
const emptyMatches = [];
|
|
2626
2650
|
|
|
2627
2651
|
const getWorkspacePath = async () => {
|
|
2628
|
-
return invoke$
|
|
2652
|
+
return invoke$2('Workspace.getPath');
|
|
2629
2653
|
};
|
|
2630
2654
|
|
|
2631
2655
|
const searchFile$1 = async (path, value, prepare, assetDir) => {
|
|
2632
|
-
const result = await invoke$
|
|
2656
|
+
const result = await invoke$4('FileSearch.searchFile', path, value, prepare, assetDir);
|
|
2633
2657
|
return result;
|
|
2634
2658
|
};
|
|
2635
2659
|
|
|
@@ -2972,7 +2996,7 @@ const uniq = array => {
|
|
|
2972
2996
|
return [...new Set(array)];
|
|
2973
2997
|
};
|
|
2974
2998
|
const getRecentlyOpened = async () => {
|
|
2975
|
-
const recentlyOpened = await invoke$
|
|
2999
|
+
const recentlyOpened = await invoke$2(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
|
|
2976
3000
|
return uniq(recentlyOpened);
|
|
2977
3001
|
};
|
|
2978
3002
|
|
|
@@ -3064,7 +3088,7 @@ const selectPickBuiltin = async item => {
|
|
|
3064
3088
|
}
|
|
3065
3089
|
const args = item.args || [];
|
|
3066
3090
|
// TODO ids should be all numbers for efficiency -> also directly can call command
|
|
3067
|
-
await invoke$
|
|
3091
|
+
await invoke$2(item.id, ...args);
|
|
3068
3092
|
if (shouldHide(item)) {
|
|
3069
3093
|
return {
|
|
3070
3094
|
command: Hide
|
|
@@ -3077,7 +3101,7 @@ const selectPickBuiltin = async item => {
|
|
|
3077
3101
|
const selectPickExtension = async item => {
|
|
3078
3102
|
const id = item.id.slice(4); // TODO lots of string allocation with 'ext.' find a better way to separate builtin commands from extension commands
|
|
3079
3103
|
try {
|
|
3080
|
-
await invoke$
|
|
3104
|
+
await invoke$2('ExtensionHost.executeCommand', id);
|
|
3081
3105
|
} catch (error) {
|
|
3082
3106
|
await handleError(error, false);
|
|
3083
3107
|
await showErrorDialog(error);
|
|
@@ -3110,7 +3134,7 @@ const getOptions = args => {
|
|
|
3110
3134
|
const selectPick$8 = async (_pick, value) => {
|
|
3111
3135
|
const {
|
|
3112
3136
|
args
|
|
3113
|
-
} = state$
|
|
3137
|
+
} = state$2;
|
|
3114
3138
|
const options = getOptions(args);
|
|
3115
3139
|
if (options.executeItemCommand && _pick.command) {
|
|
3116
3140
|
return {
|
|
@@ -3135,7 +3159,7 @@ const selectPick$8 = async (_pick, value) => {
|
|
|
3135
3159
|
}
|
|
3136
3160
|
executeCallback(resolveId, result);
|
|
3137
3161
|
} else {
|
|
3138
|
-
await invoke$
|
|
3162
|
+
await invoke$2('QuickPick.executeCallback', resolveId, result);
|
|
3139
3163
|
}
|
|
3140
3164
|
return {
|
|
3141
3165
|
command: Hide
|
|
@@ -3160,12 +3184,12 @@ const selectPick$7 = async pick => {
|
|
|
3160
3184
|
};
|
|
3161
3185
|
|
|
3162
3186
|
const setCursor = async (rowIndex, columnIndex) => {
|
|
3163
|
-
await invoke$
|
|
3187
|
+
await invoke$2('Editor.cursorSet', rowIndex, columnIndex);
|
|
3164
3188
|
};
|
|
3165
3189
|
|
|
3166
3190
|
const goToPositionAndFocus = async (rowIndex, columnIndex) => {
|
|
3167
3191
|
await setCursor(rowIndex, columnIndex);
|
|
3168
|
-
await invoke$
|
|
3192
|
+
await invoke$2('Editor.handleFocus');
|
|
3169
3193
|
};
|
|
3170
3194
|
|
|
3171
3195
|
const selectPickGoToColumn = async (item, value) => {
|
|
@@ -3210,14 +3234,14 @@ const selectPick$5 = async item => {
|
|
|
3210
3234
|
const selectPick$4 = async pick => {
|
|
3211
3235
|
const editorId = await getActiveEditorId();
|
|
3212
3236
|
const value = pick.value;
|
|
3213
|
-
await invoke$
|
|
3237
|
+
await invoke$2('Viewlet.executeViewletCommand', editorId, 'setLanguageId', value.languageId, value.tokenizePath);
|
|
3214
3238
|
return {
|
|
3215
3239
|
command: Hide
|
|
3216
3240
|
};
|
|
3217
3241
|
};
|
|
3218
3242
|
|
|
3219
3243
|
const openWorkspaceFolder = uri => {
|
|
3220
|
-
return invoke$
|
|
3244
|
+
return invoke$2(/* Workspace.setPath */'Workspace.setPath', /* path */uri);
|
|
3221
3245
|
};
|
|
3222
3246
|
|
|
3223
3247
|
// TODO selectPick should be independent of show/hide
|
|
@@ -3459,7 +3483,7 @@ const handleBlur = async state => {
|
|
|
3459
3483
|
const options = args.at(-1);
|
|
3460
3484
|
if (!options?.executeItemCommand) {
|
|
3461
3485
|
const resolveId = args[2];
|
|
3462
|
-
await invoke$
|
|
3486
|
+
await invoke$2('QuickPick.executeCallback', resolveId, getCancelResult(args));
|
|
3463
3487
|
}
|
|
3464
3488
|
}
|
|
3465
3489
|
await closeWidget(state.uid);
|
|
@@ -3715,7 +3739,7 @@ const selectIndex = async (state, index, button = /* left */0) => {
|
|
|
3715
3739
|
case Hide:
|
|
3716
3740
|
await closeWidget(state.uid);
|
|
3717
3741
|
if (selectPickResult.itemCommand) {
|
|
3718
|
-
await invoke$
|
|
3742
|
+
await invoke$2(selectPickResult.itemCommand, ...(selectPickResult.itemCommandArgs || []));
|
|
3719
3743
|
}
|
|
3720
3744
|
return state;
|
|
3721
3745
|
case OpenColorTheme:
|
|
@@ -3772,6 +3796,31 @@ const handleMessagePort = async port => {
|
|
|
3772
3796
|
isMessagePortOpen: true,
|
|
3773
3797
|
messagePort: port
|
|
3774
3798
|
});
|
|
3799
|
+
set$1(rpc);
|
|
3800
|
+
};
|
|
3801
|
+
|
|
3802
|
+
const state = {
|
|
3803
|
+
connected: false
|
|
3804
|
+
};
|
|
3805
|
+
const isConnected = () => {
|
|
3806
|
+
const {
|
|
3807
|
+
connected
|
|
3808
|
+
} = state;
|
|
3809
|
+
return connected;
|
|
3810
|
+
};
|
|
3811
|
+
const invoke = (method, ...params) => {
|
|
3812
|
+
return invoke$3(method, ...params);
|
|
3813
|
+
};
|
|
3814
|
+
const set = rpc => {
|
|
3815
|
+
set$4(rpc);
|
|
3816
|
+
state.connected = true;
|
|
3817
|
+
};
|
|
3818
|
+
|
|
3819
|
+
const handleRendererProcessMessagePort = async port => {
|
|
3820
|
+
const rpc = await create$8({
|
|
3821
|
+
commandMap: {},
|
|
3822
|
+
messagePort: port
|
|
3823
|
+
});
|
|
3775
3824
|
set(rpc);
|
|
3776
3825
|
};
|
|
3777
3826
|
|
|
@@ -3810,13 +3859,6 @@ const renderHeight = (_oldState, newState) => {
|
|
|
3810
3859
|
return ['Viewlet.send', uid, /* method */SetItemsHeight, /* height */height];
|
|
3811
3860
|
};
|
|
3812
3861
|
|
|
3813
|
-
const Div = 4;
|
|
3814
|
-
const Input = 6;
|
|
3815
|
-
const Span = 8;
|
|
3816
|
-
const Text = 12;
|
|
3817
|
-
const Img = 17;
|
|
3818
|
-
const Reference = 100;
|
|
3819
|
-
|
|
3820
3862
|
const mergeClassNames = (...classNames) => {
|
|
3821
3863
|
return classNames.filter(Boolean).join(' ');
|
|
3822
3864
|
};
|
|
@@ -4538,6 +4580,15 @@ const applyRender = (oldState, newState, diffResult) => {
|
|
|
4538
4580
|
return commands;
|
|
4539
4581
|
};
|
|
4540
4582
|
|
|
4583
|
+
const isFocusContextCommand = command => {
|
|
4584
|
+
return Array.isArray(command) && command[0] === SetFocusContext;
|
|
4585
|
+
};
|
|
4586
|
+
const renderDirect = async (uid, commands) => {
|
|
4587
|
+
const rendererWorkerCommands = commands.filter(isFocusContextCommand);
|
|
4588
|
+
const rendererProcessCommands = commands.filter(command => !isFocusContextCommand(command));
|
|
4589
|
+
const transactionId = await invoke('Viewlet.queueCommands', uid, rendererProcessCommands);
|
|
4590
|
+
return [...rendererWorkerCommands, ['Viewlet.commitPending', uid, transactionId]];
|
|
4591
|
+
};
|
|
4541
4592
|
const render2 = (uid, diffResult) => {
|
|
4542
4593
|
const {
|
|
4543
4594
|
newState,
|
|
@@ -4546,9 +4597,12 @@ const render2 = (uid, diffResult) => {
|
|
|
4546
4597
|
if (oldState === newState) {
|
|
4547
4598
|
return [];
|
|
4548
4599
|
}
|
|
4549
|
-
set$
|
|
4600
|
+
set$2(uid, newState, newState);
|
|
4550
4601
|
const commands = applyRender(oldState, newState, diffResult);
|
|
4551
|
-
|
|
4602
|
+
if (!isConnected()) {
|
|
4603
|
+
return commands;
|
|
4604
|
+
}
|
|
4605
|
+
return renderDirect(uid, commands);
|
|
4552
4606
|
};
|
|
4553
4607
|
|
|
4554
4608
|
const renderEventListeners = () => {
|
|
@@ -4620,7 +4674,7 @@ const showQuickInput = async ({
|
|
|
4620
4674
|
const customItemsId = add(initialItems);
|
|
4621
4675
|
const picks = [];
|
|
4622
4676
|
try {
|
|
4623
|
-
const result = await invoke$
|
|
4677
|
+
const result = await invoke$2('QuickPick.showCustom', picks, {
|
|
4624
4678
|
customItemsId,
|
|
4625
4679
|
ignoreFocusOut,
|
|
4626
4680
|
initialValue,
|
|
@@ -4652,7 +4706,7 @@ const showQuickPick = async ({
|
|
|
4652
4706
|
promise
|
|
4653
4707
|
} = registerCallback();
|
|
4654
4708
|
try {
|
|
4655
|
-
await invoke$
|
|
4709
|
+
await invoke$2('Viewlet.openWidget', QuickPick, 'custom', [], id, {
|
|
4656
4710
|
acceptInput,
|
|
4657
4711
|
callbackOwner: 'quickPickWorker',
|
|
4658
4712
|
customItemsId,
|
|
@@ -4688,6 +4742,7 @@ const commandMap = {
|
|
|
4688
4742
|
'QuickPick.handleFocus': wrapCommand(handleFocus),
|
|
4689
4743
|
'QuickPick.handleInput': wrapAsyncCommand(handleInputWithContext),
|
|
4690
4744
|
'QuickPick.handleMessagePort': handleMessagePort,
|
|
4745
|
+
'QuickPick.handleRendererProcessMessagePort': handleRendererProcessMessagePort,
|
|
4691
4746
|
'QuickPick.handleScrollBarPointerDown': wrapCommand(handleScrollBarPointerDown),
|
|
4692
4747
|
'QuickPick.handleScrollBarPointerMove': wrapCommand(handleScrollBarPointerMove),
|
|
4693
4748
|
'QuickPick.handleScrollBarPointerUp': wrapCommand(handleScrollBarPointerUp),
|
|
@@ -4713,7 +4768,7 @@ const initializeEditorWorker = async () => {
|
|
|
4713
4768
|
await sendMessagePortToEditorWorker(port, 0);
|
|
4714
4769
|
}
|
|
4715
4770
|
});
|
|
4716
|
-
set$
|
|
4771
|
+
set$7(rpc);
|
|
4717
4772
|
};
|
|
4718
4773
|
|
|
4719
4774
|
const initializeExtensionManagementWorker = async () => {
|
|
@@ -4723,7 +4778,7 @@ const initializeExtensionManagementWorker = async () => {
|
|
|
4723
4778
|
await sendMessagePortToExtensionManagementWorker(port, 0);
|
|
4724
4779
|
}
|
|
4725
4780
|
});
|
|
4726
|
-
set$
|
|
4781
|
+
set$6(rpc);
|
|
4727
4782
|
};
|
|
4728
4783
|
|
|
4729
4784
|
const initializeFileSearchWorker = async () => {
|
|
@@ -4733,14 +4788,14 @@ const initializeFileSearchWorker = async () => {
|
|
|
4733
4788
|
await sendMessagePortToFileSearchWorker2(port, 0);
|
|
4734
4789
|
}
|
|
4735
4790
|
});
|
|
4736
|
-
set$
|
|
4791
|
+
set$5(rpc);
|
|
4737
4792
|
};
|
|
4738
4793
|
|
|
4739
4794
|
const initializeRendererWorker = async () => {
|
|
4740
4795
|
const rpc = await create$5({
|
|
4741
4796
|
commandMap: commandMap
|
|
4742
4797
|
});
|
|
4743
|
-
set$
|
|
4798
|
+
set$3(rpc);
|
|
4744
4799
|
};
|
|
4745
4800
|
|
|
4746
4801
|
const listen = async () => {
|