@lvce-editor/source-control-worker 1.15.0 → 1.17.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/sourceControlWorkerMain.js +529 -92
- package/package.json +1 -1
|
@@ -60,37 +60,45 @@ class AssertionError extends Error {
|
|
|
60
60
|
this.name = 'AssertionError';
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
+
const Object$1 = 1;
|
|
64
|
+
const Number$1 = 2;
|
|
65
|
+
const Array$1 = 3;
|
|
66
|
+
const String = 4;
|
|
67
|
+
const Boolean$1 = 5;
|
|
68
|
+
const Function = 6;
|
|
69
|
+
const Null = 7;
|
|
70
|
+
const Unknown = 8;
|
|
63
71
|
const getType = value => {
|
|
64
72
|
switch (typeof value) {
|
|
65
73
|
case 'number':
|
|
66
|
-
return
|
|
74
|
+
return Number$1;
|
|
67
75
|
case 'function':
|
|
68
|
-
return
|
|
76
|
+
return Function;
|
|
69
77
|
case 'string':
|
|
70
|
-
return
|
|
78
|
+
return String;
|
|
71
79
|
case 'object':
|
|
72
80
|
if (value === null) {
|
|
73
|
-
return
|
|
81
|
+
return Null;
|
|
74
82
|
}
|
|
75
83
|
if (Array.isArray(value)) {
|
|
76
|
-
return
|
|
84
|
+
return Array$1;
|
|
77
85
|
}
|
|
78
|
-
return
|
|
86
|
+
return Object$1;
|
|
79
87
|
case 'boolean':
|
|
80
|
-
return
|
|
88
|
+
return Boolean$1;
|
|
81
89
|
default:
|
|
82
|
-
return
|
|
90
|
+
return Unknown;
|
|
83
91
|
}
|
|
84
92
|
};
|
|
85
93
|
const number = value => {
|
|
86
94
|
const type = getType(value);
|
|
87
|
-
if (type !==
|
|
95
|
+
if (type !== Number$1) {
|
|
88
96
|
throw new AssertionError('expected value to be of type number');
|
|
89
97
|
}
|
|
90
98
|
};
|
|
91
99
|
const string = value => {
|
|
92
100
|
const type = getType(value);
|
|
93
|
-
if (type !==
|
|
101
|
+
if (type !== String) {
|
|
94
102
|
throw new AssertionError('expected value to be of type string');
|
|
95
103
|
}
|
|
96
104
|
};
|
|
@@ -513,7 +521,7 @@ const create$4$1 = (method, params) => {
|
|
|
513
521
|
};
|
|
514
522
|
};
|
|
515
523
|
const callbacks = Object.create(null);
|
|
516
|
-
const set$
|
|
524
|
+
const set$6 = (id, fn) => {
|
|
517
525
|
callbacks[id] = fn;
|
|
518
526
|
};
|
|
519
527
|
const get$3 = id => {
|
|
@@ -523,16 +531,16 @@ const remove = id => {
|
|
|
523
531
|
delete callbacks[id];
|
|
524
532
|
};
|
|
525
533
|
let id = 0;
|
|
526
|
-
const create$3
|
|
534
|
+
const create$3 = () => {
|
|
527
535
|
return ++id;
|
|
528
536
|
};
|
|
529
537
|
const registerPromise = () => {
|
|
530
|
-
const id = create$3
|
|
538
|
+
const id = create$3();
|
|
531
539
|
const {
|
|
532
540
|
resolve,
|
|
533
541
|
promise
|
|
534
542
|
} = Promise.withResolvers();
|
|
535
|
-
set$
|
|
543
|
+
set$6(id, resolve);
|
|
536
544
|
return {
|
|
537
545
|
id,
|
|
538
546
|
promise
|
|
@@ -612,7 +620,8 @@ const splitLines = lines => {
|
|
|
612
620
|
return lines.split(NewLine);
|
|
613
621
|
};
|
|
614
622
|
const getCurrentStack = () => {
|
|
615
|
-
const
|
|
623
|
+
const stackLinesToSkip = 3;
|
|
624
|
+
const currentStack = joinLines(splitLines(new Error().stack || '').slice(stackLinesToSkip));
|
|
616
625
|
return currentStack;
|
|
617
626
|
};
|
|
618
627
|
const getNewLineIndex = (string, startIndex = undefined) => {
|
|
@@ -746,20 +755,20 @@ const getErrorProperty = (error, prettyError) => {
|
|
|
746
755
|
}
|
|
747
756
|
};
|
|
748
757
|
};
|
|
749
|
-
const create$1$1 = (
|
|
758
|
+
const create$1$1 = (id, error) => {
|
|
750
759
|
return {
|
|
751
760
|
jsonrpc: Two,
|
|
752
|
-
id
|
|
761
|
+
id,
|
|
753
762
|
error
|
|
754
763
|
};
|
|
755
764
|
};
|
|
756
|
-
const getErrorResponse = (
|
|
765
|
+
const getErrorResponse = (id, error, preparePrettyError, logError) => {
|
|
757
766
|
const prettyError = preparePrettyError(error);
|
|
758
767
|
logError(error, prettyError);
|
|
759
768
|
const errorProperty = getErrorProperty(error, prettyError);
|
|
760
|
-
return create$1$1(
|
|
769
|
+
return create$1$1(id, errorProperty);
|
|
761
770
|
};
|
|
762
|
-
const create$
|
|
771
|
+
const create$6 = (message, result) => {
|
|
763
772
|
return {
|
|
764
773
|
jsonrpc: Two,
|
|
765
774
|
id: message.id,
|
|
@@ -768,14 +777,29 @@ const create$5 = (message, result) => {
|
|
|
768
777
|
};
|
|
769
778
|
const getSuccessResponse = (message, result) => {
|
|
770
779
|
const resultProperty = result ?? null;
|
|
771
|
-
return create$
|
|
780
|
+
return create$6(message, resultProperty);
|
|
781
|
+
};
|
|
782
|
+
const getErrorResponseSimple = (id, error) => {
|
|
783
|
+
return {
|
|
784
|
+
jsonrpc: Two,
|
|
785
|
+
id,
|
|
786
|
+
error: {
|
|
787
|
+
code: Custom,
|
|
788
|
+
// @ts-ignore
|
|
789
|
+
message: error.message,
|
|
790
|
+
data: error
|
|
791
|
+
}
|
|
792
|
+
};
|
|
772
793
|
};
|
|
773
794
|
const getResponse = async (message, ipc, execute, preparePrettyError, logError, requiresSocket) => {
|
|
774
795
|
try {
|
|
775
796
|
const result = requiresSocket(message.method) ? await execute(message.method, ipc, ...message.params) : await execute(message.method, ...message.params);
|
|
776
797
|
return getSuccessResponse(message, result);
|
|
777
798
|
} catch (error) {
|
|
778
|
-
|
|
799
|
+
if (ipc.canUseSimpleErrorResponse) {
|
|
800
|
+
return getErrorResponseSimple(message.id, error);
|
|
801
|
+
}
|
|
802
|
+
return getErrorResponse(message.id, error, preparePrettyError, logError);
|
|
779
803
|
}
|
|
780
804
|
};
|
|
781
805
|
const defaultPreparePrettyError = error => {
|
|
@@ -830,7 +854,7 @@ const handleJsonRpcMessage = async (...args) => {
|
|
|
830
854
|
try {
|
|
831
855
|
ipc.send(response);
|
|
832
856
|
} catch (error) {
|
|
833
|
-
const errorResponse = getErrorResponse(message, error, preparePrettyError, logError);
|
|
857
|
+
const errorResponse = getErrorResponse(message.id, error, preparePrettyError, logError);
|
|
834
858
|
ipc.send(errorResponse);
|
|
835
859
|
}
|
|
836
860
|
return;
|
|
@@ -861,13 +885,19 @@ const send = (transport, method, ...params) => {
|
|
|
861
885
|
const message = create$4$1(method, params);
|
|
862
886
|
transport.send(message);
|
|
863
887
|
};
|
|
864
|
-
const invoke$
|
|
888
|
+
const invoke$4 = (ipc, method, ...params) => {
|
|
865
889
|
return invokeHelper(ipc, method, params, false);
|
|
866
890
|
};
|
|
867
|
-
const invokeAndTransfer$
|
|
891
|
+
const invokeAndTransfer$3 = (ipc, method, ...params) => {
|
|
868
892
|
return invokeHelper(ipc, method, params, true);
|
|
869
893
|
};
|
|
870
894
|
|
|
895
|
+
class CommandNotFoundError extends Error {
|
|
896
|
+
constructor(command) {
|
|
897
|
+
super(`Command not found ${command}`);
|
|
898
|
+
this.name = 'CommandNotFoundError';
|
|
899
|
+
}
|
|
900
|
+
}
|
|
871
901
|
const commands = Object.create(null);
|
|
872
902
|
const register = commandMap => {
|
|
873
903
|
Object.assign(commands, commandMap);
|
|
@@ -878,7 +908,7 @@ const getCommand = key => {
|
|
|
878
908
|
const execute = (command, ...args) => {
|
|
879
909
|
const fn = getCommand(command);
|
|
880
910
|
if (!fn) {
|
|
881
|
-
throw new
|
|
911
|
+
throw new CommandNotFoundError(command);
|
|
882
912
|
}
|
|
883
913
|
return fn(...args);
|
|
884
914
|
};
|
|
@@ -894,10 +924,10 @@ const createRpc = ipc => {
|
|
|
894
924
|
send(ipc, method, ...params);
|
|
895
925
|
},
|
|
896
926
|
invoke(method, ...params) {
|
|
897
|
-
return invoke$
|
|
927
|
+
return invoke$4(ipc, method, ...params);
|
|
898
928
|
},
|
|
899
929
|
invokeAndTransfer(method, ...params) {
|
|
900
|
-
return invokeAndTransfer$
|
|
930
|
+
return invokeAndTransfer$3(ipc, method, ...params);
|
|
901
931
|
},
|
|
902
932
|
async dispose() {
|
|
903
933
|
await ipc?.dispose();
|
|
@@ -935,7 +965,7 @@ const listen$1 = async (module, options) => {
|
|
|
935
965
|
const ipc = module.wrap(rawIpc);
|
|
936
966
|
return ipc;
|
|
937
967
|
};
|
|
938
|
-
const create$
|
|
968
|
+
const create$5 = async ({
|
|
939
969
|
commandMap,
|
|
940
970
|
messagePort
|
|
941
971
|
}) => {
|
|
@@ -951,20 +981,20 @@ const create$3 = async ({
|
|
|
951
981
|
messagePort.start();
|
|
952
982
|
return rpc;
|
|
953
983
|
};
|
|
954
|
-
const create$
|
|
984
|
+
const create$4 = async ({
|
|
955
985
|
commandMap,
|
|
956
986
|
messagePort
|
|
957
987
|
}) => {
|
|
958
|
-
return create$
|
|
988
|
+
return create$5({
|
|
959
989
|
commandMap,
|
|
960
990
|
messagePort
|
|
961
991
|
});
|
|
962
992
|
};
|
|
963
993
|
const PlainMessagePortRpcParent = {
|
|
964
994
|
__proto__: null,
|
|
965
|
-
create: create$
|
|
995
|
+
create: create$4
|
|
966
996
|
};
|
|
967
|
-
const create$
|
|
997
|
+
const create$2 = async ({
|
|
968
998
|
commandMap
|
|
969
999
|
}) => {
|
|
970
1000
|
// TODO create a commandMap per rpc instance
|
|
@@ -976,11 +1006,35 @@ const create$4 = async ({
|
|
|
976
1006
|
};
|
|
977
1007
|
const WebWorkerRpcClient = {
|
|
978
1008
|
__proto__: null,
|
|
979
|
-
create: create$
|
|
1009
|
+
create: create$2
|
|
1010
|
+
};
|
|
1011
|
+
const createMockRpc = ({
|
|
1012
|
+
commandMap
|
|
1013
|
+
}) => {
|
|
1014
|
+
const invocations = [];
|
|
1015
|
+
const invoke = (method, ...params) => {
|
|
1016
|
+
invocations.push([method, ...params]);
|
|
1017
|
+
const command = commandMap[method];
|
|
1018
|
+
if (!command) {
|
|
1019
|
+
throw new Error(`command ${method} not found`);
|
|
1020
|
+
}
|
|
1021
|
+
return command(...params);
|
|
1022
|
+
};
|
|
1023
|
+
const mockRpc = {
|
|
1024
|
+
invoke,
|
|
1025
|
+
invokeAndTransfer: invoke,
|
|
1026
|
+
invocations
|
|
1027
|
+
};
|
|
1028
|
+
return mockRpc;
|
|
980
1029
|
};
|
|
981
1030
|
|
|
1031
|
+
const toCommandId = key => {
|
|
1032
|
+
const dotIndex = key.indexOf('.');
|
|
1033
|
+
return key.slice(dotIndex + 1);
|
|
1034
|
+
};
|
|
982
1035
|
const create$1 = () => {
|
|
983
1036
|
const states = Object.create(null);
|
|
1037
|
+
const commandMapRef = {};
|
|
984
1038
|
return {
|
|
985
1039
|
get(uid) {
|
|
986
1040
|
return states[uid];
|
|
@@ -1021,6 +1075,15 @@ const create$1 = () => {
|
|
|
1021
1075
|
};
|
|
1022
1076
|
return wrapped;
|
|
1023
1077
|
},
|
|
1078
|
+
wrapGetter(fn) {
|
|
1079
|
+
const wrapped = (uid, ...args) => {
|
|
1080
|
+
const {
|
|
1081
|
+
newState
|
|
1082
|
+
} = states[uid];
|
|
1083
|
+
return fn(newState, ...args);
|
|
1084
|
+
};
|
|
1085
|
+
return wrapped;
|
|
1086
|
+
},
|
|
1024
1087
|
diff(uid, modules, numbers) {
|
|
1025
1088
|
const {
|
|
1026
1089
|
oldState,
|
|
@@ -1034,14 +1097,24 @@ const create$1 = () => {
|
|
|
1034
1097
|
}
|
|
1035
1098
|
}
|
|
1036
1099
|
return diffResult;
|
|
1100
|
+
},
|
|
1101
|
+
getCommandIds() {
|
|
1102
|
+
const keys = Object.keys(commandMapRef);
|
|
1103
|
+
const ids = keys.map(toCommandId);
|
|
1104
|
+
return ids;
|
|
1105
|
+
},
|
|
1106
|
+
registerCommands(commandMap) {
|
|
1107
|
+
Object.assign(commandMapRef, commandMap);
|
|
1037
1108
|
}
|
|
1038
1109
|
};
|
|
1039
1110
|
};
|
|
1040
1111
|
|
|
1041
1112
|
const {
|
|
1042
1113
|
get: get$2,
|
|
1043
|
-
set: set$
|
|
1044
|
-
wrapCommand
|
|
1114
|
+
set: set$5,
|
|
1115
|
+
wrapCommand,
|
|
1116
|
+
getCommandIds,
|
|
1117
|
+
registerCommands
|
|
1045
1118
|
} = create$1();
|
|
1046
1119
|
|
|
1047
1120
|
const create2 = (id, uri, x, y, width, height, workspacePath) => {
|
|
@@ -1080,7 +1153,7 @@ const create2 = (id, uri, x, y, width, height, workspacePath) => {
|
|
|
1080
1153
|
x,
|
|
1081
1154
|
y
|
|
1082
1155
|
};
|
|
1083
|
-
set$
|
|
1156
|
+
set$5(id, state, state);
|
|
1084
1157
|
};
|
|
1085
1158
|
|
|
1086
1159
|
const RenderItems = 4;
|
|
@@ -1113,12 +1186,6 @@ const diff2 = uid => {
|
|
|
1113
1186
|
return result;
|
|
1114
1187
|
};
|
|
1115
1188
|
|
|
1116
|
-
const commandIds = ['acceptInput', 'focus', 'focusFirst', 'focusIndex', 'focusLast', 'focusNext', 'focusNone', 'focusPrevious', 'getInfo', 'handleClick', 'handleClickAt', 'handleClickSourceControlButtons', 'handleFocus', 'handleIconThemeChange', 'handleMouseOut', 'handleMouseOutAt', 'handleMouseOver', 'handleMouseOverAt', 'handleWheel', 'refresh', 'selectIndex'];
|
|
1117
|
-
|
|
1118
|
-
const getCommandIds = () => {
|
|
1119
|
-
return commandIds;
|
|
1120
|
-
};
|
|
1121
|
-
|
|
1122
1189
|
const getInfo = uid => {
|
|
1123
1190
|
const {
|
|
1124
1191
|
newState
|
|
@@ -1126,16 +1193,31 @@ const getInfo = uid => {
|
|
|
1126
1193
|
return newState.allGroups;
|
|
1127
1194
|
};
|
|
1128
1195
|
|
|
1196
|
+
const None = 'none';
|
|
1197
|
+
const ToolBar = 'toolbar';
|
|
1198
|
+
const Tree = 'tree';
|
|
1199
|
+
const TreeItem$1 = 'treeitem';
|
|
1200
|
+
|
|
1201
|
+
const Button$1 = 1;
|
|
1202
|
+
const Div = 4;
|
|
1203
|
+
const Input = 6;
|
|
1204
|
+
const Span = 8;
|
|
1205
|
+
const Text = 12;
|
|
1206
|
+
const Img = 17;
|
|
1207
|
+
|
|
1208
|
+
const DebugWorker = 55;
|
|
1209
|
+
const ExtensionHostWorker = 44;
|
|
1210
|
+
const RendererWorker$1 = 1;
|
|
1211
|
+
const SourceControlWorker = 66;
|
|
1212
|
+
|
|
1129
1213
|
const rpcs = Object.create(null);
|
|
1130
|
-
const set$
|
|
1214
|
+
const set$4 = (id, rpc) => {
|
|
1131
1215
|
rpcs[id] = rpc;
|
|
1132
1216
|
};
|
|
1133
1217
|
const get$1 = id => {
|
|
1134
1218
|
return rpcs[id];
|
|
1135
1219
|
};
|
|
1136
1220
|
|
|
1137
|
-
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
1138
|
-
|
|
1139
1221
|
const create = rpcId => {
|
|
1140
1222
|
return {
|
|
1141
1223
|
// @ts-ignore
|
|
@@ -1151,38 +1233,406 @@ const create = rpcId => {
|
|
|
1151
1233
|
return rpc.invokeAndTransfer(method, ...params);
|
|
1152
1234
|
},
|
|
1153
1235
|
set(rpc) {
|
|
1154
|
-
set$
|
|
1236
|
+
set$4(rpcId, rpc);
|
|
1237
|
+
},
|
|
1238
|
+
async dispose() {
|
|
1239
|
+
const rpc = get$1(rpcId);
|
|
1240
|
+
await rpc.dispose();
|
|
1155
1241
|
}
|
|
1156
1242
|
};
|
|
1157
1243
|
};
|
|
1158
|
-
|
|
1159
|
-
const RendererWorker$1 = 1;
|
|
1244
|
+
|
|
1160
1245
|
const {
|
|
1161
|
-
invoke: invoke$
|
|
1162
|
-
|
|
1246
|
+
invoke: invoke$3,
|
|
1247
|
+
invokeAndTransfer: invokeAndTransfer$2,
|
|
1248
|
+
set: set$3,
|
|
1249
|
+
dispose: dispose$1
|
|
1163
1250
|
} = create(ExtensionHostWorker);
|
|
1251
|
+
const executeReferenceProvider = async (id, offset) => {
|
|
1252
|
+
// @ts-ignore
|
|
1253
|
+
return invoke$3('ExtensionHostReference.executeReferenceProvider', id, offset);
|
|
1254
|
+
};
|
|
1255
|
+
const executeFileReferenceProvider = async id => {
|
|
1256
|
+
// @ts-ignore
|
|
1257
|
+
return invoke$3('ExtensionHostReference.executeFileReferenceProvider', id);
|
|
1258
|
+
};
|
|
1259
|
+
const getRuntimeStatus = async extensionId => {
|
|
1260
|
+
// @ts-ignore
|
|
1261
|
+
return invoke$3('ExtensionHost.getRuntimeStatus', extensionId);
|
|
1262
|
+
};
|
|
1263
|
+
const registerMockRpc$1 = commandMap => {
|
|
1264
|
+
const mockRpc = createMockRpc({
|
|
1265
|
+
commandMap
|
|
1266
|
+
});
|
|
1267
|
+
set$3(mockRpc);
|
|
1268
|
+
return mockRpc;
|
|
1269
|
+
};
|
|
1270
|
+
|
|
1164
1271
|
const ExtensionHost = {
|
|
1165
1272
|
__proto__: null,
|
|
1166
|
-
|
|
1167
|
-
|
|
1273
|
+
dispose: dispose$1,
|
|
1274
|
+
executeFileReferenceProvider,
|
|
1275
|
+
executeReferenceProvider,
|
|
1276
|
+
getRuntimeStatus,
|
|
1277
|
+
invoke: invoke$3,
|
|
1278
|
+
invokeAndTransfer: invokeAndTransfer$2,
|
|
1279
|
+
registerMockRpc: registerMockRpc$1,
|
|
1280
|
+
set: set$3
|
|
1168
1281
|
};
|
|
1282
|
+
|
|
1169
1283
|
const {
|
|
1170
1284
|
invoke: invoke$2,
|
|
1171
|
-
invokeAndTransfer: invokeAndTransfer$
|
|
1172
|
-
set: set$2
|
|
1285
|
+
invokeAndTransfer: invokeAndTransfer$1,
|
|
1286
|
+
set: set$2,
|
|
1287
|
+
dispose
|
|
1173
1288
|
} = create(RendererWorker$1);
|
|
1289
|
+
const searchFileHtml = async uri => {
|
|
1290
|
+
return invoke$2('ExtensionHost.searchFileWithHtml', uri);
|
|
1291
|
+
};
|
|
1292
|
+
const getFilePathElectron = async file => {
|
|
1293
|
+
return invoke$2('FileSystemHandle.getFilePathElectron', file);
|
|
1294
|
+
};
|
|
1295
|
+
const showContextMenu = async (x, y, id, ...args) => {
|
|
1296
|
+
return invoke$2('ContextMenu.show', x, y, id, ...args);
|
|
1297
|
+
};
|
|
1298
|
+
const getElectronVersion = async () => {
|
|
1299
|
+
return invoke$2('Process.getElectronVersion');
|
|
1300
|
+
};
|
|
1301
|
+
const applyBulkReplacement = async bulkEdits => {
|
|
1302
|
+
await invoke$2('BulkReplacement.applyBulkReplacement', bulkEdits);
|
|
1303
|
+
};
|
|
1304
|
+
const setColorTheme = async id => {
|
|
1305
|
+
// @ts-ignore
|
|
1306
|
+
return invoke$2(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
|
|
1307
|
+
};
|
|
1308
|
+
const getNodeVersion = async () => {
|
|
1309
|
+
return invoke$2('Process.getNodeVersion');
|
|
1310
|
+
};
|
|
1311
|
+
const getChromeVersion = async () => {
|
|
1312
|
+
return invoke$2('Process.getChromeVersion');
|
|
1313
|
+
};
|
|
1314
|
+
const getV8Version = async () => {
|
|
1315
|
+
return invoke$2('Process.getV8Version');
|
|
1316
|
+
};
|
|
1317
|
+
const getFileHandles = async fileIds => {
|
|
1318
|
+
const files = await invoke$2('FileSystemHandle.getFileHandles', fileIds);
|
|
1319
|
+
return files;
|
|
1320
|
+
};
|
|
1321
|
+
const setWorkspacePath = async path => {
|
|
1322
|
+
await invoke$2('Workspace.setPath', path);
|
|
1323
|
+
};
|
|
1324
|
+
const registerWebViewInterceptor = async (id, port) => {
|
|
1325
|
+
await invokeAndTransfer$1('WebView.registerInterceptor', id, port);
|
|
1326
|
+
};
|
|
1327
|
+
const unregisterWebViewInterceptor = async id => {
|
|
1328
|
+
await invoke$2('WebView.unregisterInterceptor', id);
|
|
1329
|
+
};
|
|
1330
|
+
const sendMessagePortToEditorWorker = async (port, rpcId) => {
|
|
1331
|
+
const command = 'HandleMessagePort.handleMessagePort';
|
|
1332
|
+
// @ts-ignore
|
|
1333
|
+
await invokeAndTransfer$1('SendMessagePortToExtensionHostWorker.sendMessagePortToEditorWorker', port, command, rpcId);
|
|
1334
|
+
};
|
|
1335
|
+
const sendMessagePortToErrorWorker = async (port, rpcId) => {
|
|
1336
|
+
const command = 'Errors.handleMessagePort';
|
|
1337
|
+
// @ts-ignore
|
|
1338
|
+
await invokeAndTransfer$1('SendMessagePortToExtensionHostWorker.sendMessagePortToErrorWorker', port, command, rpcId);
|
|
1339
|
+
};
|
|
1340
|
+
const sendMessagePortToMarkdownWorker = async (port, rpcId) => {
|
|
1341
|
+
const command = 'Markdown.handleMessagePort';
|
|
1342
|
+
// @ts-ignore
|
|
1343
|
+
await invokeAndTransfer$1('SendMessagePortToExtensionHostWorker.sendMessagePortToMarkdownWorker', port, command, rpcId);
|
|
1344
|
+
};
|
|
1345
|
+
const sendMessagePortToFileSystemWorker = async (port, rpcId) => {
|
|
1346
|
+
const command = 'FileSystem.handleMessagePort';
|
|
1347
|
+
// @ts-ignore
|
|
1348
|
+
await invokeAndTransfer$1('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSystemWorker', port, command, rpcId);
|
|
1349
|
+
};
|
|
1350
|
+
const readFile$1 = async uri => {
|
|
1351
|
+
return invoke$2('FileSystem.readFile', uri);
|
|
1352
|
+
};
|
|
1353
|
+
const getWebViewSecret = async key => {
|
|
1354
|
+
// @ts-ignore
|
|
1355
|
+
return invoke$2('WebView.getSecret', key);
|
|
1356
|
+
};
|
|
1357
|
+
const setWebViewPort = async (uid, port, origin, portType) => {
|
|
1358
|
+
return invokeAndTransfer$1('WebView.setPort', uid, port, origin, portType);
|
|
1359
|
+
};
|
|
1360
|
+
const setFocus = key => {
|
|
1361
|
+
return invoke$2('Focus.setFocus', key);
|
|
1362
|
+
};
|
|
1363
|
+
const getFileIcon$1 = async options => {
|
|
1364
|
+
return invoke$2('IconTheme.getFileIcon', options);
|
|
1365
|
+
};
|
|
1366
|
+
const getColorThemeNames = async () => {
|
|
1367
|
+
return invoke$2('ColorTheme.getColorThemeNames');
|
|
1368
|
+
};
|
|
1369
|
+
const disableExtension = async id => {
|
|
1370
|
+
// @ts-ignore
|
|
1371
|
+
return invoke$2('ExtensionManagement.disable', id);
|
|
1372
|
+
};
|
|
1373
|
+
const enableExtension = async id => {
|
|
1374
|
+
// @ts-ignore
|
|
1375
|
+
return invoke$2('ExtensionManagement.enable', id);
|
|
1376
|
+
};
|
|
1377
|
+
const handleDebugChange = async params => {
|
|
1378
|
+
// @ts-ignore
|
|
1379
|
+
return invoke$2('Run And Debug.handleChange', params);
|
|
1380
|
+
};
|
|
1381
|
+
const getFolderIcon = async options => {
|
|
1382
|
+
return invoke$2('IconTheme.getFolderIcon', options);
|
|
1383
|
+
};
|
|
1384
|
+
const closeWidget = async widgetId => {
|
|
1385
|
+
return invoke$2('Viewlet.closeWidget', widgetId);
|
|
1386
|
+
};
|
|
1387
|
+
const sendMessagePortToExtensionHostWorker$1 = async (port, rpcId = 0) => {
|
|
1388
|
+
const command = 'HandleMessagePort.handleMessagePort2';
|
|
1389
|
+
await invokeAndTransfer$1('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, rpcId);
|
|
1390
|
+
};
|
|
1391
|
+
const sendMessagePortToSearchProcess = async port => {
|
|
1392
|
+
await invokeAndTransfer$1('SendMessagePortToElectron.sendMessagePortToElectron', port, 'HandleMessagePortForSearchProcess.handleMessagePortForSearchProcess');
|
|
1393
|
+
};
|
|
1394
|
+
const confirm = async (message, options) => {
|
|
1395
|
+
// @ts-ignore
|
|
1396
|
+
const result = await invoke$2('ConfirmPrompt.prompt', message, options);
|
|
1397
|
+
return result;
|
|
1398
|
+
};
|
|
1399
|
+
const getRecentlyOpened = async () => {
|
|
1400
|
+
return invoke$2(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
|
|
1401
|
+
};
|
|
1402
|
+
const getKeyBindings = async () => {
|
|
1403
|
+
return invoke$2('KeyBindingsInitial.getKeyBindings');
|
|
1404
|
+
};
|
|
1405
|
+
const writeClipBoardText = async text => {
|
|
1406
|
+
await invoke$2('ClipBoard.writeText', /* text */text);
|
|
1407
|
+
};
|
|
1408
|
+
const writeClipBoardImage = async blob => {
|
|
1409
|
+
// @ts-ignore
|
|
1410
|
+
await invoke$2('ClipBoard.writeImage', /* text */blob);
|
|
1411
|
+
};
|
|
1412
|
+
const searchFileMemory = async uri => {
|
|
1413
|
+
// @ts-ignore
|
|
1414
|
+
return invoke$2('ExtensionHost.searchFileWithMemory', uri);
|
|
1415
|
+
};
|
|
1416
|
+
const searchFileFetch = async uri => {
|
|
1417
|
+
return invoke$2('ExtensionHost.searchFileWithFetch', uri);
|
|
1418
|
+
};
|
|
1419
|
+
const showMessageBox = async options => {
|
|
1420
|
+
return invoke$2('ElectronDialog.showMessageBox', options);
|
|
1421
|
+
};
|
|
1422
|
+
const handleDebugResumed = async params => {
|
|
1423
|
+
await invoke$2('Run And Debug.handleResumed', params);
|
|
1424
|
+
};
|
|
1425
|
+
const openWidget = async name => {
|
|
1426
|
+
await invoke$2('Viewlet.openWidget', name);
|
|
1427
|
+
};
|
|
1428
|
+
const getIcons = async requests => {
|
|
1429
|
+
const icons = await invoke$2('IconTheme.getIcons', requests);
|
|
1430
|
+
return icons;
|
|
1431
|
+
};
|
|
1432
|
+
const activateByEvent$1 = event => {
|
|
1433
|
+
return invoke$2('ExtensionHostManagement.activateByEvent', event);
|
|
1434
|
+
};
|
|
1435
|
+
const setAdditionalFocus = focusKey => {
|
|
1436
|
+
// @ts-ignore
|
|
1437
|
+
return invoke$2('Focus.setAdditionalFocus', focusKey);
|
|
1438
|
+
};
|
|
1439
|
+
const getActiveEditorId = () => {
|
|
1440
|
+
// @ts-ignore
|
|
1441
|
+
return invoke$2('GetActiveEditor.getActiveEditorId');
|
|
1442
|
+
};
|
|
1443
|
+
const getWorkspacePath = () => {
|
|
1444
|
+
return invoke$2('Workspace.getPath');
|
|
1445
|
+
};
|
|
1446
|
+
const sendMessagePortToRendererProcess = async port => {
|
|
1447
|
+
const command = 'HandleMessagePort.handleMessagePort';
|
|
1448
|
+
// @ts-ignore
|
|
1449
|
+
await invokeAndTransfer$1('SendMessagePortToExtensionHostWorker.sendMessagePortToRendererProcess', port, command, DebugWorker);
|
|
1450
|
+
};
|
|
1451
|
+
const getPreference = async key => {
|
|
1452
|
+
return await invoke$2('Preferences.get', key);
|
|
1453
|
+
};
|
|
1454
|
+
const getAllExtensions = async () => {
|
|
1455
|
+
return invoke$2('ExtensionManagement.getAllExtensions');
|
|
1456
|
+
};
|
|
1457
|
+
const rerenderEditor = async key => {
|
|
1458
|
+
// @ts-ignore
|
|
1459
|
+
return invoke$2('Editor.rerender', key);
|
|
1460
|
+
};
|
|
1461
|
+
const handleDebugPaused = async params => {
|
|
1462
|
+
await invoke$2('Run And Debug.handlePaused', params);
|
|
1463
|
+
};
|
|
1464
|
+
const openUri$1 = async (uri, focus, options) => {
|
|
1465
|
+
await invoke$2('Main.openUri', uri, focus, options);
|
|
1466
|
+
};
|
|
1467
|
+
const sendMessagePortToSyntaxHighlightingWorker = async port => {
|
|
1468
|
+
await invokeAndTransfer$1(
|
|
1469
|
+
// @ts-ignore
|
|
1470
|
+
'SendMessagePortToSyntaxHighlightingWorker.sendMessagePortToSyntaxHighlightingWorker', port, 'HandleMessagePort.handleMessagePort2');
|
|
1471
|
+
};
|
|
1472
|
+
const handleDebugScriptParsed = async script => {
|
|
1473
|
+
await invoke$2('Run And Debug.handleScriptParsed', script);
|
|
1474
|
+
};
|
|
1475
|
+
const getWindowId = async () => {
|
|
1476
|
+
return invoke$2('GetWindowId.getWindowId');
|
|
1477
|
+
};
|
|
1478
|
+
const getBlob = async uri => {
|
|
1479
|
+
// @ts-ignore
|
|
1480
|
+
return invoke$2('FileSystem.getBlob', uri);
|
|
1481
|
+
};
|
|
1482
|
+
const getExtensionCommands = async () => {
|
|
1483
|
+
return invoke$2('ExtensionHost.getCommands');
|
|
1484
|
+
};
|
|
1485
|
+
const showErrorDialog = async errorInfo => {
|
|
1486
|
+
// @ts-ignore
|
|
1487
|
+
await invoke$2('ErrorHandling.showErrorDialog', errorInfo);
|
|
1488
|
+
};
|
|
1489
|
+
const getFolderSize = async uri => {
|
|
1490
|
+
// @ts-ignore
|
|
1491
|
+
return await invoke$2('FileSystem.getFolderSize', uri);
|
|
1492
|
+
};
|
|
1493
|
+
const getExtension = async id => {
|
|
1494
|
+
// @ts-ignore
|
|
1495
|
+
return invoke$2('ExtensionManagement.getExtension', id);
|
|
1496
|
+
};
|
|
1497
|
+
const getMarkdownDom = async html => {
|
|
1498
|
+
// @ts-ignore
|
|
1499
|
+
return invoke$2('Markdown.getVirtualDom', html);
|
|
1500
|
+
};
|
|
1501
|
+
const renderMarkdown = async (markdown, options) => {
|
|
1502
|
+
// @ts-ignore
|
|
1503
|
+
return invoke$2('Markdown.renderMarkdown', markdown, options);
|
|
1504
|
+
};
|
|
1505
|
+
const openNativeFolder = async uri => {
|
|
1506
|
+
// @ts-ignore
|
|
1507
|
+
await invoke$2('OpenNativeFolder.openNativeFolder', uri);
|
|
1508
|
+
};
|
|
1509
|
+
const uninstallExtension = async id => {
|
|
1510
|
+
return invoke$2('ExtensionManagement.uninstall', id);
|
|
1511
|
+
};
|
|
1512
|
+
const installExtension = async id => {
|
|
1513
|
+
// @ts-ignore
|
|
1514
|
+
return invoke$2('ExtensionManagement.install', id);
|
|
1515
|
+
};
|
|
1516
|
+
const openExtensionSearch = async () => {
|
|
1517
|
+
// @ts-ignore
|
|
1518
|
+
return invoke$2('SideBar.openViewlet', 'Extensions');
|
|
1519
|
+
};
|
|
1520
|
+
const setExtensionsSearchValue = async searchValue => {
|
|
1521
|
+
// @ts-ignore
|
|
1522
|
+
return invoke$2('Extensions.handleInput', searchValue);
|
|
1523
|
+
};
|
|
1524
|
+
const openExternal = async uri => {
|
|
1525
|
+
// @ts-ignore
|
|
1526
|
+
await invoke$2('Open.openExternal', uri);
|
|
1527
|
+
};
|
|
1528
|
+
const openUrl = async uri => {
|
|
1529
|
+
// @ts-ignore
|
|
1530
|
+
await invoke$2('Open.openUrl', uri);
|
|
1531
|
+
};
|
|
1532
|
+
const getAllPreferences = async () => {
|
|
1533
|
+
// @ts-ignore
|
|
1534
|
+
return invoke$2('Preferences.getAll');
|
|
1535
|
+
};
|
|
1536
|
+
const showSaveFilePicker = async () => {
|
|
1537
|
+
// @ts-ignore
|
|
1538
|
+
return invoke$2('FilePicker.showSaveFilePicker');
|
|
1539
|
+
};
|
|
1540
|
+
const getLogsDir = async () => {
|
|
1541
|
+
// @ts-ignore
|
|
1542
|
+
return invoke$2('PlatformPaths.getLogsDir');
|
|
1543
|
+
};
|
|
1544
|
+
const registerMockRpc = commandMap => {
|
|
1545
|
+
const mockRpc = createMockRpc({
|
|
1546
|
+
commandMap
|
|
1547
|
+
});
|
|
1548
|
+
set$2(mockRpc);
|
|
1549
|
+
return mockRpc;
|
|
1550
|
+
};
|
|
1551
|
+
|
|
1174
1552
|
const RendererWorker = {
|
|
1175
1553
|
__proto__: null,
|
|
1554
|
+
activateByEvent: activateByEvent$1,
|
|
1555
|
+
applyBulkReplacement,
|
|
1556
|
+
closeWidget,
|
|
1557
|
+
confirm,
|
|
1558
|
+
disableExtension,
|
|
1559
|
+
dispose,
|
|
1560
|
+
enableExtension,
|
|
1561
|
+
getActiveEditorId,
|
|
1562
|
+
getAllExtensions,
|
|
1563
|
+
getAllPreferences,
|
|
1564
|
+
getBlob,
|
|
1565
|
+
getChromeVersion,
|
|
1566
|
+
getColorThemeNames,
|
|
1567
|
+
getElectronVersion,
|
|
1568
|
+
getExtension,
|
|
1569
|
+
getExtensionCommands,
|
|
1570
|
+
getFileHandles,
|
|
1571
|
+
getFileIcon: getFileIcon$1,
|
|
1572
|
+
getFilePathElectron,
|
|
1573
|
+
getFolderIcon,
|
|
1574
|
+
getFolderSize,
|
|
1575
|
+
getIcons,
|
|
1576
|
+
getKeyBindings,
|
|
1577
|
+
getLogsDir,
|
|
1578
|
+
getMarkdownDom,
|
|
1579
|
+
getNodeVersion,
|
|
1580
|
+
getPreference,
|
|
1581
|
+
getRecentlyOpened,
|
|
1582
|
+
getV8Version,
|
|
1583
|
+
getWebViewSecret,
|
|
1584
|
+
getWindowId,
|
|
1585
|
+
getWorkspacePath,
|
|
1586
|
+
handleDebugChange,
|
|
1587
|
+
handleDebugPaused,
|
|
1588
|
+
handleDebugResumed,
|
|
1589
|
+
handleDebugScriptParsed,
|
|
1590
|
+
installExtension,
|
|
1176
1591
|
invoke: invoke$2,
|
|
1177
|
-
invokeAndTransfer: invokeAndTransfer$
|
|
1178
|
-
|
|
1592
|
+
invokeAndTransfer: invokeAndTransfer$1,
|
|
1593
|
+
openExtensionSearch,
|
|
1594
|
+
openExternal,
|
|
1595
|
+
openNativeFolder,
|
|
1596
|
+
openUri: openUri$1,
|
|
1597
|
+
openUrl,
|
|
1598
|
+
openWidget,
|
|
1599
|
+
readFile: readFile$1,
|
|
1600
|
+
registerMockRpc,
|
|
1601
|
+
registerWebViewInterceptor,
|
|
1602
|
+
renderMarkdown,
|
|
1603
|
+
rerenderEditor,
|
|
1604
|
+
searchFileFetch,
|
|
1605
|
+
searchFileHtml,
|
|
1606
|
+
searchFileMemory,
|
|
1607
|
+
sendMessagePortToEditorWorker,
|
|
1608
|
+
sendMessagePortToErrorWorker,
|
|
1609
|
+
sendMessagePortToExtensionHostWorker: sendMessagePortToExtensionHostWorker$1,
|
|
1610
|
+
sendMessagePortToFileSystemWorker,
|
|
1611
|
+
sendMessagePortToMarkdownWorker,
|
|
1612
|
+
sendMessagePortToRendererProcess,
|
|
1613
|
+
sendMessagePortToSearchProcess,
|
|
1614
|
+
sendMessagePortToSyntaxHighlightingWorker,
|
|
1615
|
+
set: set$2,
|
|
1616
|
+
setAdditionalFocus,
|
|
1617
|
+
setColorTheme,
|
|
1618
|
+
setExtensionsSearchValue,
|
|
1619
|
+
setFocus,
|
|
1620
|
+
setWebViewPort,
|
|
1621
|
+
setWorkspacePath,
|
|
1622
|
+
showContextMenu,
|
|
1623
|
+
showErrorDialog,
|
|
1624
|
+
showMessageBox,
|
|
1625
|
+
showSaveFilePicker,
|
|
1626
|
+
uninstallExtension,
|
|
1627
|
+
unregisterWebViewInterceptor,
|
|
1628
|
+
writeClipBoardImage,
|
|
1629
|
+
writeClipBoardText
|
|
1179
1630
|
};
|
|
1180
1631
|
|
|
1181
1632
|
const {
|
|
1182
1633
|
invoke: invoke$1,
|
|
1183
1634
|
invokeAndTransfer,
|
|
1184
|
-
set: set$1
|
|
1185
|
-
} = RendererWorker;
|
|
1635
|
+
set: set$1} = RendererWorker;
|
|
1186
1636
|
|
|
1187
1637
|
const activateByEvent = event => {
|
|
1188
1638
|
return invoke$1('ExtensionHostManagement.activateByEvent', event);
|
|
@@ -1190,8 +1640,7 @@ const activateByEvent = event => {
|
|
|
1190
1640
|
|
|
1191
1641
|
const {
|
|
1192
1642
|
invoke,
|
|
1193
|
-
set
|
|
1194
|
-
} = ExtensionHost;
|
|
1643
|
+
set} = ExtensionHost;
|
|
1195
1644
|
|
|
1196
1645
|
const executeProvider = async ({
|
|
1197
1646
|
event,
|
|
@@ -1830,8 +2279,6 @@ const getPortTuple = () => {
|
|
|
1830
2279
|
};
|
|
1831
2280
|
};
|
|
1832
2281
|
|
|
1833
|
-
const SourceControlWorker = 66;
|
|
1834
|
-
|
|
1835
2282
|
const sendMessagePortToExtensionHostWorker = async port => {
|
|
1836
2283
|
const command = 'HandleMessagePort.handleMessagePort2';
|
|
1837
2284
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, SourceControlWorker);
|
|
@@ -1859,6 +2306,18 @@ const initialize = async () => {
|
|
|
1859
2306
|
set(extensionHostRpc);
|
|
1860
2307
|
};
|
|
1861
2308
|
|
|
2309
|
+
const mergeClassNames = (...classNames) => {
|
|
2310
|
+
return classNames.filter(Boolean).join(' ');
|
|
2311
|
+
};
|
|
2312
|
+
|
|
2313
|
+
const text = data => {
|
|
2314
|
+
return {
|
|
2315
|
+
type: Text,
|
|
2316
|
+
text: data,
|
|
2317
|
+
childCount: 0
|
|
2318
|
+
};
|
|
2319
|
+
};
|
|
2320
|
+
|
|
1862
2321
|
const Actions = 'Actions';
|
|
1863
2322
|
const SourceControlButtons = 'SourceControlButtons';
|
|
1864
2323
|
const Grow = 'Grow';
|
|
@@ -1885,7 +2344,7 @@ const SplitButtonDropDown = 'SplitButtonDropDown';
|
|
|
1885
2344
|
const SplitButtonDropDownDisabled = 'SplitButtonDropDownDisabled';
|
|
1886
2345
|
const SplitButtonSeparator = 'SplitButtonSeparator';
|
|
1887
2346
|
const StrikeThrough = 'StrikeThrough';
|
|
1888
|
-
const TreeItem
|
|
2347
|
+
const TreeItem = 'TreeItem';
|
|
1889
2348
|
const Viewlet = 'Viewlet';
|
|
1890
2349
|
|
|
1891
2350
|
const HandleClickAt = 'handleClickAt';
|
|
@@ -1922,12 +2381,6 @@ const sourceControlInput = () => {
|
|
|
1922
2381
|
return i18nString(SourceControlInput);
|
|
1923
2382
|
};
|
|
1924
2383
|
|
|
1925
|
-
const Button$1 = 1;
|
|
1926
|
-
const Div = 4;
|
|
1927
|
-
const Input = 6;
|
|
1928
|
-
const Span = 8;
|
|
1929
|
-
const Img = 17;
|
|
1930
|
-
|
|
1931
2384
|
const getSourceControlHeaderVirtualDom = () => {
|
|
1932
2385
|
return [{
|
|
1933
2386
|
type: Div,
|
|
@@ -1948,23 +2401,6 @@ const getSourceControlHeaderVirtualDom = () => {
|
|
|
1948
2401
|
}];
|
|
1949
2402
|
};
|
|
1950
2403
|
|
|
1951
|
-
const None = 'none';
|
|
1952
|
-
const ToolBar = 'toolbar';
|
|
1953
|
-
const Tree = 'tree';
|
|
1954
|
-
const TreeItem = 'treeitem';
|
|
1955
|
-
|
|
1956
|
-
const mergeClassNames = (...classNames) => {
|
|
1957
|
-
return classNames.filter(Boolean).join(' ');
|
|
1958
|
-
};
|
|
1959
|
-
const Text = 12;
|
|
1960
|
-
const text = data => {
|
|
1961
|
-
return {
|
|
1962
|
-
type: Text,
|
|
1963
|
-
text: data,
|
|
1964
|
-
childCount: 0
|
|
1965
|
-
};
|
|
1966
|
-
};
|
|
1967
|
-
|
|
1968
2404
|
const getBadgeVirtualDom = (className, count) => {
|
|
1969
2405
|
return [{
|
|
1970
2406
|
type: Div,
|
|
@@ -2035,8 +2471,8 @@ const createItemDirectory = item => {
|
|
|
2035
2471
|
const hasButtons = buttons.length;
|
|
2036
2472
|
return [{
|
|
2037
2473
|
type: Div,
|
|
2038
|
-
className: TreeItem
|
|
2039
|
-
role: TreeItem,
|
|
2474
|
+
className: TreeItem,
|
|
2475
|
+
role: TreeItem$1,
|
|
2040
2476
|
ariaExpanded: type === DirectoryExpanded,
|
|
2041
2477
|
ariaPosInSet: posInSet,
|
|
2042
2478
|
ariaSetSize: setSize,
|
|
@@ -2095,8 +2531,8 @@ const createItemOther = item => {
|
|
|
2095
2531
|
const buttonsDom = getButtonsVirtualDom(buttons);
|
|
2096
2532
|
dom.push({
|
|
2097
2533
|
type: Div,
|
|
2098
|
-
className: TreeItem
|
|
2099
|
-
role: TreeItem,
|
|
2534
|
+
className: TreeItem,
|
|
2535
|
+
role: TreeItem$1,
|
|
2100
2536
|
ariaPosInSet: posInSet,
|
|
2101
2537
|
ariaSetSize: setSize,
|
|
2102
2538
|
title: file,
|
|
@@ -2227,7 +2663,7 @@ const render2 = (uid, diffResult) => {
|
|
|
2227
2663
|
oldState,
|
|
2228
2664
|
newState
|
|
2229
2665
|
} = get$2(uid);
|
|
2230
|
-
set$
|
|
2666
|
+
set$5(uid, newState, newState);
|
|
2231
2667
|
const commands = applyRender(oldState, newState, diffResult);
|
|
2232
2668
|
return commands;
|
|
2233
2669
|
};
|
|
@@ -2375,6 +2811,7 @@ const commandMap = {
|
|
|
2375
2811
|
};
|
|
2376
2812
|
|
|
2377
2813
|
const listen = async () => {
|
|
2814
|
+
registerCommands(commandMap);
|
|
2378
2815
|
const rpc = await WebWorkerRpcClient.create({
|
|
2379
2816
|
commandMap: commandMap
|
|
2380
2817
|
});
|