@lvce-editor/explorer-view 2.49.0 → 2.50.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/explorerViewWorkerMain.js +40 -25
- package/package.json +1 -1
|
@@ -431,7 +431,7 @@ const create$4 = (method, params) => {
|
|
|
431
431
|
};
|
|
432
432
|
};
|
|
433
433
|
const callbacks = Object.create(null);
|
|
434
|
-
const set$
|
|
434
|
+
const set$2 = (id, fn) => {
|
|
435
435
|
callbacks[id] = fn;
|
|
436
436
|
};
|
|
437
437
|
const get$2 = id => {
|
|
@@ -450,7 +450,7 @@ const registerPromise = () => {
|
|
|
450
450
|
resolve,
|
|
451
451
|
promise
|
|
452
452
|
} = Promise.withResolvers();
|
|
453
|
-
set$
|
|
453
|
+
set$2(id, resolve);
|
|
454
454
|
return {
|
|
455
455
|
id,
|
|
456
456
|
promise
|
|
@@ -664,18 +664,18 @@ const getErrorProperty = (error, prettyError) => {
|
|
|
664
664
|
}
|
|
665
665
|
};
|
|
666
666
|
};
|
|
667
|
-
const create$1$1 = (
|
|
667
|
+
const create$1$1 = (id, error) => {
|
|
668
668
|
return {
|
|
669
669
|
jsonrpc: Two,
|
|
670
|
-
id
|
|
670
|
+
id,
|
|
671
671
|
error
|
|
672
672
|
};
|
|
673
673
|
};
|
|
674
|
-
const getErrorResponse = (
|
|
674
|
+
const getErrorResponse = (id, error, preparePrettyError, logError) => {
|
|
675
675
|
const prettyError = preparePrettyError(error);
|
|
676
676
|
logError(error, prettyError);
|
|
677
677
|
const errorProperty = getErrorProperty(error, prettyError);
|
|
678
|
-
return create$1$1(
|
|
678
|
+
return create$1$1(id, errorProperty);
|
|
679
679
|
};
|
|
680
680
|
const create$5 = (message, result) => {
|
|
681
681
|
return {
|
|
@@ -688,12 +688,27 @@ const getSuccessResponse = (message, result) => {
|
|
|
688
688
|
const resultProperty = result ?? null;
|
|
689
689
|
return create$5(message, resultProperty);
|
|
690
690
|
};
|
|
691
|
+
const getErrorResponseSimple = (id, error) => {
|
|
692
|
+
return {
|
|
693
|
+
jsonrpc: Two,
|
|
694
|
+
id,
|
|
695
|
+
error: {
|
|
696
|
+
code: Custom,
|
|
697
|
+
// @ts-ignore
|
|
698
|
+
message: error.message,
|
|
699
|
+
data: error
|
|
700
|
+
}
|
|
701
|
+
};
|
|
702
|
+
};
|
|
691
703
|
const getResponse = async (message, ipc, execute, preparePrettyError, logError, requiresSocket) => {
|
|
692
704
|
try {
|
|
693
705
|
const result = requiresSocket(message.method) ? await execute(message.method, ipc, ...message.params) : await execute(message.method, ...message.params);
|
|
694
706
|
return getSuccessResponse(message, result);
|
|
695
707
|
} catch (error) {
|
|
696
|
-
|
|
708
|
+
if (ipc.canUseSimpleErrorResponse) {
|
|
709
|
+
return getErrorResponseSimple(message.id, error);
|
|
710
|
+
}
|
|
711
|
+
return getErrorResponse(message.id, error, preparePrettyError, logError);
|
|
697
712
|
}
|
|
698
713
|
};
|
|
699
714
|
const defaultPreparePrettyError = error => {
|
|
@@ -748,7 +763,7 @@ const handleJsonRpcMessage = async (...args) => {
|
|
|
748
763
|
try {
|
|
749
764
|
ipc.send(response);
|
|
750
765
|
} catch (error) {
|
|
751
|
-
const errorResponse = getErrorResponse(message, error, preparePrettyError, logError);
|
|
766
|
+
const errorResponse = getErrorResponse(message.id, error, preparePrettyError, logError);
|
|
752
767
|
ipc.send(errorResponse);
|
|
753
768
|
}
|
|
754
769
|
return;
|
|
@@ -779,7 +794,7 @@ const send = (transport, method, ...params) => {
|
|
|
779
794
|
const message = create$4(method, params);
|
|
780
795
|
transport.send(message);
|
|
781
796
|
};
|
|
782
|
-
const invoke$
|
|
797
|
+
const invoke$2 = (ipc, method, ...params) => {
|
|
783
798
|
return invokeHelper(ipc, method, params, false);
|
|
784
799
|
};
|
|
785
800
|
const invokeAndTransfer = (ipc, method, ...params) => {
|
|
@@ -812,7 +827,7 @@ const createRpc = ipc => {
|
|
|
812
827
|
send(ipc, method, ...params);
|
|
813
828
|
},
|
|
814
829
|
invoke(method, ...params) {
|
|
815
|
-
return invoke$
|
|
830
|
+
return invoke$2(ipc, method, ...params);
|
|
816
831
|
},
|
|
817
832
|
invokeAndTransfer(method, ...params) {
|
|
818
833
|
return invokeAndTransfer(ipc, method, ...params);
|
|
@@ -874,7 +889,7 @@ const Copy$2 = 3;
|
|
|
874
889
|
const Rename$2 = 4;
|
|
875
890
|
|
|
876
891
|
const rpcs = Object.create(null);
|
|
877
|
-
const set$
|
|
892
|
+
const set$d = (id, rpc) => {
|
|
878
893
|
rpcs[id] = rpc;
|
|
879
894
|
};
|
|
880
895
|
const get$1 = id => {
|
|
@@ -898,19 +913,19 @@ const create$2 = rpcId => {
|
|
|
898
913
|
return rpc.invokeAndTransfer(method, ...params);
|
|
899
914
|
},
|
|
900
915
|
set(rpc) {
|
|
901
|
-
set$
|
|
916
|
+
set$d(rpcId, rpc);
|
|
902
917
|
}
|
|
903
918
|
};
|
|
904
919
|
};
|
|
905
920
|
const RendererWorker$1 = 1;
|
|
906
921
|
const {
|
|
907
|
-
invoke: invoke$
|
|
908
|
-
set: set$
|
|
922
|
+
invoke: invoke$3,
|
|
923
|
+
set: set$3
|
|
909
924
|
} = create$2(RendererWorker$1);
|
|
910
925
|
const RendererWorker = {
|
|
911
926
|
__proto__: null,
|
|
912
|
-
invoke: invoke$
|
|
913
|
-
set: set$
|
|
927
|
+
invoke: invoke$3,
|
|
928
|
+
set: set$3
|
|
914
929
|
};
|
|
915
930
|
|
|
916
931
|
const {
|
|
@@ -1252,6 +1267,15 @@ const resolveSymbolicLinks = async (uri, rawDirents) => {
|
|
|
1252
1267
|
return resolvedDirents;
|
|
1253
1268
|
};
|
|
1254
1269
|
|
|
1270
|
+
const getChildDirentsRaw = async uri => {
|
|
1271
|
+
const rawDirents = await readDirWithFileTypes(uri);
|
|
1272
|
+
array(rawDirents);
|
|
1273
|
+
if (hasSymbolicLinks(rawDirents)) {
|
|
1274
|
+
return resolveSymbolicLinks(uri, rawDirents);
|
|
1275
|
+
}
|
|
1276
|
+
return rawDirents;
|
|
1277
|
+
};
|
|
1278
|
+
|
|
1255
1279
|
const RE_CHARACTERS = /^[a-zA-Z.-]+$/;
|
|
1256
1280
|
const compareStringNumeric = (a, b) => {
|
|
1257
1281
|
if (RE_CHARACTERS.test(a) && RE_CHARACTERS.test(b)) {
|
|
@@ -1317,14 +1341,6 @@ const toDisplayDirents = (pathSeparator, rawDirents, parentDirentPath, parentDir
|
|
|
1317
1341
|
return result;
|
|
1318
1342
|
};
|
|
1319
1343
|
|
|
1320
|
-
const getChildDirentsRaw = async uri => {
|
|
1321
|
-
const rawDirents = await readDirWithFileTypes(uri);
|
|
1322
|
-
array(rawDirents);
|
|
1323
|
-
if (hasSymbolicLinks(rawDirents)) {
|
|
1324
|
-
return resolveSymbolicLinks(uri, rawDirents);
|
|
1325
|
-
}
|
|
1326
|
-
return rawDirents;
|
|
1327
|
-
};
|
|
1328
1344
|
const getChildDirents = async (pathSeparator, parentDirentPath, parentDirentDepth, excluded = []) => {
|
|
1329
1345
|
string(pathSeparator);
|
|
1330
1346
|
// TODO use event/actor based code instead, this is impossible to cancel right now
|
|
@@ -3641,7 +3657,6 @@ const handleKeyDown = (state, key) => {
|
|
|
3641
3657
|
}
|
|
3642
3658
|
|
|
3643
3659
|
// @ts-ignore
|
|
3644
|
-
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
3645
3660
|
timeout = setTimeout(async () => {
|
|
3646
3661
|
await invoke$1('Explorer.cancelTypeAhead');
|
|
3647
3662
|
}, focusWordTimeout);
|