@lvce-editor/quick-pick-worker 4.20.1 → 4.20.2
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 +48 -42
- package/package.json +1 -1
|
@@ -1364,34 +1364,34 @@ const SetPatches = 'Viewlet.setPatches';
|
|
|
1364
1364
|
const FocusQuickPickInput = 20;
|
|
1365
1365
|
|
|
1366
1366
|
const {
|
|
1367
|
-
invoke: invoke$
|
|
1367
|
+
invoke: invoke$7,
|
|
1368
1368
|
set: set$7
|
|
1369
1369
|
} = create$4(EditorWorker);
|
|
1370
1370
|
const getLines = async editorUid => {
|
|
1371
|
-
const lines = await invoke$
|
|
1371
|
+
const lines = await invoke$7('Editor.getLines2', editorUid);
|
|
1372
1372
|
return lines;
|
|
1373
1373
|
};
|
|
1374
1374
|
|
|
1375
1375
|
const {
|
|
1376
|
-
invoke: invoke$
|
|
1376
|
+
invoke: invoke$6,
|
|
1377
1377
|
set: set$6
|
|
1378
1378
|
} = create$4(ExtensionManagementWorker);
|
|
1379
1379
|
const getLanguages = (platform, assetDir) => {
|
|
1380
|
-
return invoke$
|
|
1380
|
+
return invoke$6('Extensions.getLanguages', platform, assetDir);
|
|
1381
1381
|
};
|
|
1382
1382
|
|
|
1383
1383
|
const {
|
|
1384
|
-
invoke: invoke$
|
|
1384
|
+
invoke: invoke$5,
|
|
1385
1385
|
set: set$5
|
|
1386
1386
|
} = create$4(7013);
|
|
1387
1387
|
|
|
1388
1388
|
const {
|
|
1389
|
-
invoke: invoke$
|
|
1389
|
+
invoke: invoke$4,
|
|
1390
1390
|
set: set$4
|
|
1391
1391
|
} = create$4(RendererProcess);
|
|
1392
1392
|
|
|
1393
1393
|
const {
|
|
1394
|
-
invoke: invoke$
|
|
1394
|
+
invoke: invoke$3,
|
|
1395
1395
|
invokeAndTransfer,
|
|
1396
1396
|
set: set$3
|
|
1397
1397
|
} = create$4(RendererWorker);
|
|
@@ -1400,37 +1400,37 @@ const sendMessagePortToEditorWorker = async (port, rpcId) => {
|
|
|
1400
1400
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToEditorWorker', port, command, rpcId);
|
|
1401
1401
|
};
|
|
1402
1402
|
const setFocus = key => {
|
|
1403
|
-
return invoke$
|
|
1403
|
+
return invoke$3('Focus.setFocus', key);
|
|
1404
1404
|
};
|
|
1405
1405
|
const getFileIcon = async options => {
|
|
1406
|
-
return invoke$
|
|
1406
|
+
return invoke$3('IconTheme.getFileIcon', options);
|
|
1407
1407
|
};
|
|
1408
1408
|
const getFolderIcon = async options => {
|
|
1409
|
-
return invoke$
|
|
1409
|
+
return invoke$3('IconTheme.getFolderIcon', options);
|
|
1410
1410
|
};
|
|
1411
1411
|
const closeWidget$1 = async widgetId => {
|
|
1412
|
-
return invoke$
|
|
1412
|
+
return invoke$3('Viewlet.closeWidget', widgetId);
|
|
1413
1413
|
};
|
|
1414
1414
|
const sendMessagePortToFileSearchWorker2 = async (port, rpcId = 0) => {
|
|
1415
1415
|
const command = 'FileSearch.handleMessagePort';
|
|
1416
1416
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSearchWorker', port, command, rpcId);
|
|
1417
1417
|
};
|
|
1418
1418
|
const getActiveEditorId = () => {
|
|
1419
|
-
return invoke$
|
|
1419
|
+
return invoke$3('GetActiveEditor.getActiveEditorId');
|
|
1420
1420
|
};
|
|
1421
1421
|
const sendMessagePortToExtensionManagementWorker = async (port, rpcId) => {
|
|
1422
1422
|
const command = 'Extensions.handleMessagePort';
|
|
1423
1423
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionManagementWorker', port, command, rpcId);
|
|
1424
1424
|
};
|
|
1425
1425
|
const openUri$1 = async (uri, focus, options) => {
|
|
1426
|
-
await invoke$
|
|
1426
|
+
await invoke$3('Main.openUri', {
|
|
1427
1427
|
...options,
|
|
1428
1428
|
focus,
|
|
1429
1429
|
uri
|
|
1430
1430
|
});
|
|
1431
1431
|
};
|
|
1432
1432
|
const showErrorDialog$1 = async errorInfo => {
|
|
1433
|
-
await invoke$
|
|
1433
|
+
await invoke$3('ErrorHandling.showErrorDialog', errorInfo);
|
|
1434
1434
|
};
|
|
1435
1435
|
|
|
1436
1436
|
const closeWidget = async id => {
|
|
@@ -1508,7 +1508,7 @@ const close = async state => {
|
|
|
1508
1508
|
}
|
|
1509
1509
|
executeCallback(resolveId, result);
|
|
1510
1510
|
} else {
|
|
1511
|
-
await invoke$
|
|
1511
|
+
await invoke$3('QuickPick.executeCallback', resolveId, result);
|
|
1512
1512
|
}
|
|
1513
1513
|
}
|
|
1514
1514
|
}
|
|
@@ -2057,7 +2057,7 @@ const dispose = uid => {
|
|
|
2057
2057
|
};
|
|
2058
2058
|
|
|
2059
2059
|
const setColorTheme = id => {
|
|
2060
|
-
return invoke$
|
|
2060
|
+
return invoke$3(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
|
|
2061
2061
|
};
|
|
2062
2062
|
|
|
2063
2063
|
const focusPick$1 = async pick => {
|
|
@@ -2710,7 +2710,7 @@ const getFinalDeltaY = (height, itemHeight, itemsLength) => {
|
|
|
2710
2710
|
};
|
|
2711
2711
|
|
|
2712
2712
|
const getColorThemeNames = async (assetDir, platform) => {
|
|
2713
|
-
return invoke$
|
|
2713
|
+
return invoke$3('ColorTheme.getColorThemeNames', assetDir, platform);
|
|
2714
2714
|
};
|
|
2715
2715
|
|
|
2716
2716
|
const toProtoVisibleItem$4 = name => {
|
|
@@ -2794,7 +2794,7 @@ const state$3 = {
|
|
|
2794
2794
|
const getAll = async () => {
|
|
2795
2795
|
try {
|
|
2796
2796
|
// @ts-ignore
|
|
2797
|
-
const entries = await invoke$
|
|
2797
|
+
const entries = await invoke$3('Layout.getAllQuickPickMenuEntries');
|
|
2798
2798
|
return entries || [];
|
|
2799
2799
|
} catch {
|
|
2800
2800
|
// ignore
|
|
@@ -2829,7 +2829,7 @@ const getExtensionPicks = async (assetDir, platform, applicationId) => {
|
|
|
2829
2829
|
// Assert.number(platform)
|
|
2830
2830
|
// TODO ask extension management worker directly
|
|
2831
2831
|
// TODO don't call this every time, cache the results
|
|
2832
|
-
const extensionPicks = applicationId === undefined ? await invoke$
|
|
2832
|
+
const extensionPicks = applicationId === undefined ? await invoke$3('ExtensionHost.getCommands', assetDir, platform) : await invoke$3('Application.execute', applicationId, 'ExtensionHost.getCommands', assetDir, platform);
|
|
2833
2833
|
if (!extensionPicks) {
|
|
2834
2834
|
return [];
|
|
2835
2835
|
}
|
|
@@ -2900,7 +2900,7 @@ const state$1 = {
|
|
|
2900
2900
|
const set$1 = newRpc => {
|
|
2901
2901
|
state$1.rpc = newRpc;
|
|
2902
2902
|
};
|
|
2903
|
-
const invoke$
|
|
2903
|
+
const invoke$2 = (method, ...args) => {
|
|
2904
2904
|
return state$1.rpc.invoke(method, ...args);
|
|
2905
2905
|
};
|
|
2906
2906
|
|
|
@@ -2931,7 +2931,7 @@ const getPicks$d = async (searchValue, args) => {
|
|
|
2931
2931
|
const options = args.at(-1);
|
|
2932
2932
|
let items;
|
|
2933
2933
|
if (options?.mode === 'quickInput') {
|
|
2934
|
-
items = searchValue === '' && options?.customItemsId ? get(options.customItemsId) : await invoke$
|
|
2934
|
+
items = searchValue === '' && options?.customItemsId ? get(options.customItemsId) : await invoke$2('ExtensionHostQuickPick.renderQuickInput', options.quickInputId, searchValue);
|
|
2935
2935
|
} else {
|
|
2936
2936
|
items = options?.customItemsId ? get(options.customItemsId) : args[1] || [];
|
|
2937
2937
|
}
|
|
@@ -2956,11 +2956,11 @@ const getPicks$c = async () => {
|
|
|
2956
2956
|
const emptyMatches = [];
|
|
2957
2957
|
|
|
2958
2958
|
const getWorkspacePath = async () => {
|
|
2959
|
-
return invoke$
|
|
2959
|
+
return invoke$3('Workspace.getPath');
|
|
2960
2960
|
};
|
|
2961
2961
|
|
|
2962
2962
|
const searchFile$1 = async (path, value, prepare, assetDir) => {
|
|
2963
|
-
const result = await invoke$
|
|
2963
|
+
const result = await invoke$5('FileSearch.searchFile', path, value, prepare, assetDir);
|
|
2964
2964
|
return result;
|
|
2965
2965
|
};
|
|
2966
2966
|
|
|
@@ -3354,7 +3354,7 @@ const uniq = array => {
|
|
|
3354
3354
|
});
|
|
3355
3355
|
};
|
|
3356
3356
|
const getRecentlyOpened = async () => {
|
|
3357
|
-
const recentlyOpened = await invoke$
|
|
3357
|
+
const recentlyOpened = await invoke$3(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
|
|
3358
3358
|
return uniq(recentlyOpened);
|
|
3359
3359
|
};
|
|
3360
3360
|
|
|
@@ -3469,7 +3469,7 @@ const selectPickBuiltin = async item => {
|
|
|
3469
3469
|
}
|
|
3470
3470
|
const args = item.args || [];
|
|
3471
3471
|
// TODO ids should be all numbers for efficiency -> also directly can call command
|
|
3472
|
-
await invoke$
|
|
3472
|
+
await invoke$3(item.id, ...args);
|
|
3473
3473
|
if (shouldHide(item)) {
|
|
3474
3474
|
return {
|
|
3475
3475
|
command: Hide
|
|
@@ -3483,9 +3483,9 @@ const selectPickExtension = async (item, applicationId) => {
|
|
|
3483
3483
|
const id = item.id.slice(4); // TODO lots of string allocation with 'ext.' find a better way to separate builtin commands from extension commands
|
|
3484
3484
|
try {
|
|
3485
3485
|
if (applicationId === undefined) {
|
|
3486
|
-
await invoke$
|
|
3486
|
+
await invoke$3('ExtensionHost.executeCommand', id);
|
|
3487
3487
|
} else {
|
|
3488
|
-
await invoke$
|
|
3488
|
+
await invoke$3('Application.execute', applicationId, 'ExtensionHost.executeCommand', id);
|
|
3489
3489
|
}
|
|
3490
3490
|
} catch (error) {
|
|
3491
3491
|
await handleError(error, false);
|
|
@@ -3544,7 +3544,7 @@ const selectPick$a = async (_pick, value) => {
|
|
|
3544
3544
|
}
|
|
3545
3545
|
executeCallback(resolveId, result);
|
|
3546
3546
|
} else {
|
|
3547
|
-
await invoke$
|
|
3547
|
+
await invoke$3('QuickPick.executeCallback', resolveId, result);
|
|
3548
3548
|
}
|
|
3549
3549
|
return {
|
|
3550
3550
|
command: Hide
|
|
@@ -3553,7 +3553,7 @@ const selectPick$a = async (_pick, value) => {
|
|
|
3553
3553
|
|
|
3554
3554
|
const selectPick$9 = async pick => {
|
|
3555
3555
|
const editorId = await getActiveEditorId();
|
|
3556
|
-
await invoke$
|
|
3556
|
+
await invoke$3('Viewlet.executeViewletCommand', editorId, 'setEndOfLine', pick.value);
|
|
3557
3557
|
return {
|
|
3558
3558
|
command: Hide
|
|
3559
3559
|
};
|
|
@@ -3577,12 +3577,12 @@ const selectPick$8 = async pick => {
|
|
|
3577
3577
|
};
|
|
3578
3578
|
|
|
3579
3579
|
const setCursor = async (rowIndex, columnIndex) => {
|
|
3580
|
-
await invoke$
|
|
3580
|
+
await invoke$3('Editor.cursorSet', rowIndex, columnIndex);
|
|
3581
3581
|
};
|
|
3582
3582
|
|
|
3583
3583
|
const goToPositionAndFocus = async (rowIndex, columnIndex) => {
|
|
3584
3584
|
await setCursor(rowIndex, columnIndex);
|
|
3585
|
-
await invoke$
|
|
3585
|
+
await invoke$3('Editor.handleFocus');
|
|
3586
3586
|
};
|
|
3587
3587
|
|
|
3588
3588
|
const selectPickGoToColumn = async (item, value) => {
|
|
@@ -3625,7 +3625,7 @@ const selectPick$6 = async item => {
|
|
|
3625
3625
|
|
|
3626
3626
|
const selectPick$5 = async pick => {
|
|
3627
3627
|
const editorId = await getActiveEditorId();
|
|
3628
|
-
await invoke$
|
|
3628
|
+
await invoke$3('Viewlet.executeViewletCommand', editorId, 'setIndentation', pick.value);
|
|
3629
3629
|
return {
|
|
3630
3630
|
command: Hide
|
|
3631
3631
|
};
|
|
@@ -3634,7 +3634,7 @@ const selectPick$5 = async pick => {
|
|
|
3634
3634
|
const selectPick$4 = async pick => {
|
|
3635
3635
|
const editorId = await getActiveEditorId();
|
|
3636
3636
|
const value = pick.value;
|
|
3637
|
-
await invoke$
|
|
3637
|
+
await invoke$3('Viewlet.executeViewletCommand', editorId, 'setLanguageId', value.languageId, value.tokenizePath);
|
|
3638
3638
|
return {
|
|
3639
3639
|
command: Hide
|
|
3640
3640
|
};
|
|
@@ -3642,7 +3642,7 @@ const selectPick$4 = async pick => {
|
|
|
3642
3642
|
|
|
3643
3643
|
const openWorkspaceFolder = uri => {
|
|
3644
3644
|
const command = uri.includes('://') ? 'Workspace.setUri' : 'Workspace.setPath';
|
|
3645
|
-
return invoke$
|
|
3645
|
+
return invoke$3(command, uri);
|
|
3646
3646
|
};
|
|
3647
3647
|
|
|
3648
3648
|
// TODO selectPick should be independent of show/hide
|
|
@@ -3890,7 +3890,7 @@ const handleBlur = async state => {
|
|
|
3890
3890
|
const options = args.at(-1);
|
|
3891
3891
|
if (!options?.executeItemCommand) {
|
|
3892
3892
|
const resolveId = args[2];
|
|
3893
|
-
await invoke$
|
|
3893
|
+
await invoke$3('QuickPick.executeCallback', resolveId, getCancelResult(args));
|
|
3894
3894
|
}
|
|
3895
3895
|
}
|
|
3896
3896
|
await closeWidget(state.uid);
|
|
@@ -4158,7 +4158,7 @@ const selectIndex = async (state, index, button = /* left */0) => {
|
|
|
4158
4158
|
case Hide:
|
|
4159
4159
|
await closeWidget(state.uid);
|
|
4160
4160
|
if (selectPickResult.itemCommand) {
|
|
4161
|
-
await invoke$
|
|
4161
|
+
await invoke$3(selectPickResult.itemCommand, ...(selectPickResult.itemCommandArgs || []));
|
|
4162
4162
|
}
|
|
4163
4163
|
return state;
|
|
4164
4164
|
case OpenColorTheme:
|
|
@@ -4227,8 +4227,8 @@ const isConnected = () => {
|
|
|
4227
4227
|
} = state;
|
|
4228
4228
|
return connected;
|
|
4229
4229
|
};
|
|
4230
|
-
const invoke = (method, ...params) => {
|
|
4231
|
-
return invoke$
|
|
4230
|
+
const invoke$1 = (method, ...params) => {
|
|
4231
|
+
return invoke$4(method, ...params);
|
|
4232
4232
|
};
|
|
4233
4233
|
const set = rpc => {
|
|
4234
4234
|
set$4(rpc);
|
|
@@ -4242,7 +4242,7 @@ const handleRendererProcessMessagePort = async (port, viewletCommandMap, setAsRe
|
|
|
4242
4242
|
throw new TypeError(`Viewlet command not found: ${command}`);
|
|
4243
4243
|
}
|
|
4244
4244
|
await fn(uid, ...args);
|
|
4245
|
-
await invoke$
|
|
4245
|
+
await invoke$3('Viewlet.requestRender', uid);
|
|
4246
4246
|
};
|
|
4247
4247
|
const rpc = await create$8({
|
|
4248
4248
|
commandMap: {
|
|
@@ -5055,7 +5055,7 @@ const isFocusContextCommand = command => {
|
|
|
5055
5055
|
const renderDirect = async (uid, commands) => {
|
|
5056
5056
|
const rendererWorkerCommands = commands.filter(isFocusContextCommand);
|
|
5057
5057
|
const rendererProcessCommands = commands.filter(command => !isFocusContextCommand(command));
|
|
5058
|
-
const transactionId = await invoke('Viewlet.queueCommands', uid, rendererProcessCommands);
|
|
5058
|
+
const transactionId = await invoke$1('Viewlet.queueCommands', uid, rendererProcessCommands);
|
|
5059
5059
|
return [...rendererWorkerCommands, ['Viewlet.commitPending', uid, transactionId]];
|
|
5060
5060
|
};
|
|
5061
5061
|
const render2 = (uid, diffResult) => {
|
|
@@ -5156,7 +5156,12 @@ const serialize = command => {
|
|
|
5156
5156
|
};
|
|
5157
5157
|
};
|
|
5158
5158
|
|
|
5159
|
+
const invoke = async (applicationId, method, ...args) => {
|
|
5160
|
+
return applicationId === undefined ? invoke$3(method, ...args) : invoke$3('Application.execute', applicationId, method, ...args);
|
|
5161
|
+
};
|
|
5162
|
+
|
|
5159
5163
|
const showQuickInput = async ({
|
|
5164
|
+
applicationId,
|
|
5160
5165
|
id,
|
|
5161
5166
|
ignoreFocusOut,
|
|
5162
5167
|
initialItems = [],
|
|
@@ -5167,7 +5172,7 @@ const showQuickInput = async ({
|
|
|
5167
5172
|
const customItemsId = add(initialItems);
|
|
5168
5173
|
const picks = [];
|
|
5169
5174
|
try {
|
|
5170
|
-
const result = await invoke
|
|
5175
|
+
const result = await invoke(applicationId, 'QuickPick.showCustom', picks, {
|
|
5171
5176
|
customItemsId,
|
|
5172
5177
|
ignoreFocusOut,
|
|
5173
5178
|
initialValue,
|
|
@@ -5189,6 +5194,7 @@ const QuickPick = 'QuickPick';
|
|
|
5189
5194
|
|
|
5190
5195
|
const showQuickPick = async ({
|
|
5191
5196
|
acceptInput = false,
|
|
5197
|
+
applicationId,
|
|
5192
5198
|
items,
|
|
5193
5199
|
placeholder = '',
|
|
5194
5200
|
waitUntil = 'selected'
|
|
@@ -5199,7 +5205,7 @@ const showQuickPick = async ({
|
|
|
5199
5205
|
promise
|
|
5200
5206
|
} = registerCallback();
|
|
5201
5207
|
try {
|
|
5202
|
-
await invoke
|
|
5208
|
+
await invoke(applicationId, 'Viewlet.openWidget', QuickPick, 'custom', [], id, {
|
|
5203
5209
|
acceptInput,
|
|
5204
5210
|
callbackOwner: 'quickPickWorker',
|
|
5205
5211
|
customItemsId,
|