@lvce-editor/source-control-worker 1.15.0 → 1.18.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 +629 -191
- 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
|
};
|
|
@@ -505,7 +513,7 @@ const IpcParentWithMessagePort$1 = {
|
|
|
505
513
|
};
|
|
506
514
|
|
|
507
515
|
const Two = '2.0';
|
|
508
|
-
const create$4
|
|
516
|
+
const create$4 = (method, params) => {
|
|
509
517
|
return {
|
|
510
518
|
jsonrpc: Two,
|
|
511
519
|
method,
|
|
@@ -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$5 = (id, fn) => {
|
|
517
525
|
callbacks[id] = fn;
|
|
518
526
|
};
|
|
519
527
|
const get$3 = id => {
|
|
@@ -532,7 +540,7 @@ const registerPromise = () => {
|
|
|
532
540
|
resolve,
|
|
533
541
|
promise
|
|
534
542
|
} = Promise.withResolvers();
|
|
535
|
-
set$
|
|
543
|
+
set$5(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;
|
|
@@ -858,16 +882,22 @@ const invokeHelper = async (ipc, method, params, useSendAndTransfer) => {
|
|
|
858
882
|
return unwrapJsonRpcResult(responseMessage);
|
|
859
883
|
};
|
|
860
884
|
const send = (transport, method, ...params) => {
|
|
861
|
-
const message = create$4
|
|
885
|
+
const message = create$4(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$2 = (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$2(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,25 @@ const create$3 = async ({
|
|
|
951
981
|
messagePort.start();
|
|
952
982
|
return rpc;
|
|
953
983
|
};
|
|
954
|
-
const create$
|
|
984
|
+
const create$3 = async ({
|
|
955
985
|
commandMap,
|
|
956
|
-
|
|
986
|
+
send
|
|
957
987
|
}) => {
|
|
958
|
-
|
|
988
|
+
const {
|
|
989
|
+
port1,
|
|
990
|
+
port2
|
|
991
|
+
} = new MessageChannel();
|
|
992
|
+
await send(port1);
|
|
993
|
+
return create$5({
|
|
959
994
|
commandMap,
|
|
960
|
-
messagePort
|
|
995
|
+
messagePort: port2
|
|
961
996
|
});
|
|
962
997
|
};
|
|
963
|
-
const
|
|
998
|
+
const TransferMessagePortRpcParent = {
|
|
964
999
|
__proto__: null,
|
|
965
|
-
create: create$
|
|
1000
|
+
create: create$3
|
|
966
1001
|
};
|
|
967
|
-
const create$
|
|
1002
|
+
const create$2 = async ({
|
|
968
1003
|
commandMap
|
|
969
1004
|
}) => {
|
|
970
1005
|
// TODO create a commandMap per rpc instance
|
|
@@ -976,11 +1011,481 @@ const create$4 = async ({
|
|
|
976
1011
|
};
|
|
977
1012
|
const WebWorkerRpcClient = {
|
|
978
1013
|
__proto__: null,
|
|
979
|
-
create: create$
|
|
1014
|
+
create: create$2
|
|
1015
|
+
};
|
|
1016
|
+
const createMockRpc = ({
|
|
1017
|
+
commandMap
|
|
1018
|
+
}) => {
|
|
1019
|
+
const invocations = [];
|
|
1020
|
+
const invoke = (method, ...params) => {
|
|
1021
|
+
invocations.push([method, ...params]);
|
|
1022
|
+
const command = commandMap[method];
|
|
1023
|
+
if (!command) {
|
|
1024
|
+
throw new Error(`command ${method} not found`);
|
|
1025
|
+
}
|
|
1026
|
+
return command(...params);
|
|
1027
|
+
};
|
|
1028
|
+
const mockRpc = {
|
|
1029
|
+
invoke,
|
|
1030
|
+
invokeAndTransfer: invoke,
|
|
1031
|
+
invocations
|
|
1032
|
+
};
|
|
1033
|
+
return mockRpc;
|
|
1034
|
+
};
|
|
1035
|
+
|
|
1036
|
+
const None = 'none';
|
|
1037
|
+
const ToolBar = 'toolbar';
|
|
1038
|
+
const Tree = 'tree';
|
|
1039
|
+
const TreeItem$1 = 'treeitem';
|
|
1040
|
+
|
|
1041
|
+
const Button$2 = 1;
|
|
1042
|
+
const Div = 4;
|
|
1043
|
+
const Input = 6;
|
|
1044
|
+
const Span = 8;
|
|
1045
|
+
const Text = 12;
|
|
1046
|
+
const Img = 17;
|
|
1047
|
+
|
|
1048
|
+
const TargetValue = 'event.target.value';
|
|
1049
|
+
const ClientX = 'event.clientX';
|
|
1050
|
+
const ClientY = 'event.clientY';
|
|
1051
|
+
const Button$1 = 'event.button';
|
|
1052
|
+
const DeltaMode = 'event.deltaMode';
|
|
1053
|
+
const DeltaY = 'event.deltaY';
|
|
1054
|
+
const TargetName = 'event.target.name';
|
|
1055
|
+
|
|
1056
|
+
const DebugWorker = 55;
|
|
1057
|
+
const ExtensionHostWorker = 44;
|
|
1058
|
+
const RendererWorker$1 = 1;
|
|
1059
|
+
const SourceControlWorker = 66;
|
|
1060
|
+
|
|
1061
|
+
const SetDom2 = 'Viewlet.setDom2';
|
|
1062
|
+
|
|
1063
|
+
const rpcs = Object.create(null);
|
|
1064
|
+
const set$4 = (id, rpc) => {
|
|
1065
|
+
rpcs[id] = rpc;
|
|
1066
|
+
};
|
|
1067
|
+
const get$2 = id => {
|
|
1068
|
+
return rpcs[id];
|
|
1069
|
+
};
|
|
1070
|
+
|
|
1071
|
+
const create$1 = rpcId => {
|
|
1072
|
+
return {
|
|
1073
|
+
// @ts-ignore
|
|
1074
|
+
invoke(method, ...params) {
|
|
1075
|
+
const rpc = get$2(rpcId);
|
|
1076
|
+
// @ts-ignore
|
|
1077
|
+
return rpc.invoke(method, ...params);
|
|
1078
|
+
},
|
|
1079
|
+
// @ts-ignore
|
|
1080
|
+
invokeAndTransfer(method, ...params) {
|
|
1081
|
+
const rpc = get$2(rpcId);
|
|
1082
|
+
// @ts-ignore
|
|
1083
|
+
return rpc.invokeAndTransfer(method, ...params);
|
|
1084
|
+
},
|
|
1085
|
+
set(rpc) {
|
|
1086
|
+
set$4(rpcId, rpc);
|
|
1087
|
+
},
|
|
1088
|
+
async dispose() {
|
|
1089
|
+
const rpc = get$2(rpcId);
|
|
1090
|
+
await rpc.dispose();
|
|
1091
|
+
}
|
|
1092
|
+
};
|
|
1093
|
+
};
|
|
1094
|
+
|
|
1095
|
+
const {
|
|
1096
|
+
invoke: invoke$3,
|
|
1097
|
+
invokeAndTransfer: invokeAndTransfer$1,
|
|
1098
|
+
set: set$3,
|
|
1099
|
+
dispose: dispose$1
|
|
1100
|
+
} = create$1(ExtensionHostWorker);
|
|
1101
|
+
const executeReferenceProvider = async (id, offset) => {
|
|
1102
|
+
// @ts-ignore
|
|
1103
|
+
return invoke$3('ExtensionHostReference.executeReferenceProvider', id, offset);
|
|
1104
|
+
};
|
|
1105
|
+
const executeFileReferenceProvider = async id => {
|
|
1106
|
+
// @ts-ignore
|
|
1107
|
+
return invoke$3('ExtensionHostReference.executeFileReferenceProvider', id);
|
|
1108
|
+
};
|
|
1109
|
+
const getRuntimeStatus = async extensionId => {
|
|
1110
|
+
// @ts-ignore
|
|
1111
|
+
return invoke$3('ExtensionHost.getRuntimeStatus', extensionId);
|
|
1112
|
+
};
|
|
1113
|
+
const registerMockRpc$1 = commandMap => {
|
|
1114
|
+
const mockRpc = createMockRpc({
|
|
1115
|
+
commandMap
|
|
1116
|
+
});
|
|
1117
|
+
set$3(mockRpc);
|
|
1118
|
+
return mockRpc;
|
|
1119
|
+
};
|
|
1120
|
+
|
|
1121
|
+
const ExtensionHost = {
|
|
1122
|
+
__proto__: null,
|
|
1123
|
+
dispose: dispose$1,
|
|
1124
|
+
executeFileReferenceProvider,
|
|
1125
|
+
executeReferenceProvider,
|
|
1126
|
+
getRuntimeStatus,
|
|
1127
|
+
invoke: invoke$3,
|
|
1128
|
+
invokeAndTransfer: invokeAndTransfer$1,
|
|
1129
|
+
registerMockRpc: registerMockRpc$1,
|
|
1130
|
+
set: set$3
|
|
1131
|
+
};
|
|
1132
|
+
|
|
1133
|
+
const {
|
|
1134
|
+
invoke: invoke$2,
|
|
1135
|
+
invokeAndTransfer,
|
|
1136
|
+
set: set$2,
|
|
1137
|
+
dispose
|
|
1138
|
+
} = create$1(RendererWorker$1);
|
|
1139
|
+
const searchFileHtml = async uri => {
|
|
1140
|
+
return invoke$2('ExtensionHost.searchFileWithHtml', uri);
|
|
1141
|
+
};
|
|
1142
|
+
const getFilePathElectron = async file => {
|
|
1143
|
+
return invoke$2('FileSystemHandle.getFilePathElectron', file);
|
|
1144
|
+
};
|
|
1145
|
+
const showContextMenu = async (x, y, id, ...args) => {
|
|
1146
|
+
return invoke$2('ContextMenu.show', x, y, id, ...args);
|
|
1147
|
+
};
|
|
1148
|
+
const getElectronVersion = async () => {
|
|
1149
|
+
return invoke$2('Process.getElectronVersion');
|
|
1150
|
+
};
|
|
1151
|
+
const applyBulkReplacement = async bulkEdits => {
|
|
1152
|
+
await invoke$2('BulkReplacement.applyBulkReplacement', bulkEdits);
|
|
1153
|
+
};
|
|
1154
|
+
const setColorTheme = async id => {
|
|
1155
|
+
// @ts-ignore
|
|
1156
|
+
return invoke$2(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
|
|
1157
|
+
};
|
|
1158
|
+
const getNodeVersion = async () => {
|
|
1159
|
+
return invoke$2('Process.getNodeVersion');
|
|
1160
|
+
};
|
|
1161
|
+
const getChromeVersion = async () => {
|
|
1162
|
+
return invoke$2('Process.getChromeVersion');
|
|
1163
|
+
};
|
|
1164
|
+
const getV8Version = async () => {
|
|
1165
|
+
return invoke$2('Process.getV8Version');
|
|
1166
|
+
};
|
|
1167
|
+
const getFileHandles = async fileIds => {
|
|
1168
|
+
const files = await invoke$2('FileSystemHandle.getFileHandles', fileIds);
|
|
1169
|
+
return files;
|
|
1170
|
+
};
|
|
1171
|
+
const setWorkspacePath = async path => {
|
|
1172
|
+
await invoke$2('Workspace.setPath', path);
|
|
1173
|
+
};
|
|
1174
|
+
const registerWebViewInterceptor = async (id, port) => {
|
|
1175
|
+
await invokeAndTransfer('WebView.registerInterceptor', id, port);
|
|
1176
|
+
};
|
|
1177
|
+
const unregisterWebViewInterceptor = async id => {
|
|
1178
|
+
await invoke$2('WebView.unregisterInterceptor', id);
|
|
1179
|
+
};
|
|
1180
|
+
const sendMessagePortToEditorWorker = async (port, rpcId) => {
|
|
1181
|
+
const command = 'HandleMessagePort.handleMessagePort';
|
|
1182
|
+
// @ts-ignore
|
|
1183
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToEditorWorker', port, command, rpcId);
|
|
1184
|
+
};
|
|
1185
|
+
const sendMessagePortToErrorWorker = async (port, rpcId) => {
|
|
1186
|
+
const command = 'Errors.handleMessagePort';
|
|
1187
|
+
// @ts-ignore
|
|
1188
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToErrorWorker', port, command, rpcId);
|
|
1189
|
+
};
|
|
1190
|
+
const sendMessagePortToMarkdownWorker = async (port, rpcId) => {
|
|
1191
|
+
const command = 'Markdown.handleMessagePort';
|
|
1192
|
+
// @ts-ignore
|
|
1193
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToMarkdownWorker', port, command, rpcId);
|
|
1194
|
+
};
|
|
1195
|
+
const sendMessagePortToFileSystemWorker = async (port, rpcId) => {
|
|
1196
|
+
const command = 'FileSystem.handleMessagePort';
|
|
1197
|
+
// @ts-ignore
|
|
1198
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSystemWorker', port, command, rpcId);
|
|
1199
|
+
};
|
|
1200
|
+
const readFile$1 = async uri => {
|
|
1201
|
+
return invoke$2('FileSystem.readFile', uri);
|
|
1202
|
+
};
|
|
1203
|
+
const getWebViewSecret = async key => {
|
|
1204
|
+
// @ts-ignore
|
|
1205
|
+
return invoke$2('WebView.getSecret', key);
|
|
1206
|
+
};
|
|
1207
|
+
const setWebViewPort = async (uid, port, origin, portType) => {
|
|
1208
|
+
return invokeAndTransfer('WebView.setPort', uid, port, origin, portType);
|
|
1209
|
+
};
|
|
1210
|
+
const setFocus = key => {
|
|
1211
|
+
return invoke$2('Focus.setFocus', key);
|
|
1212
|
+
};
|
|
1213
|
+
const getFileIcon$1 = async options => {
|
|
1214
|
+
return invoke$2('IconTheme.getFileIcon', options);
|
|
1215
|
+
};
|
|
1216
|
+
const getColorThemeNames = async () => {
|
|
1217
|
+
return invoke$2('ColorTheme.getColorThemeNames');
|
|
1218
|
+
};
|
|
1219
|
+
const disableExtension = async id => {
|
|
1220
|
+
// @ts-ignore
|
|
1221
|
+
return invoke$2('ExtensionManagement.disable', id);
|
|
1222
|
+
};
|
|
1223
|
+
const enableExtension = async id => {
|
|
1224
|
+
// @ts-ignore
|
|
1225
|
+
return invoke$2('ExtensionManagement.enable', id);
|
|
1226
|
+
};
|
|
1227
|
+
const handleDebugChange = async params => {
|
|
1228
|
+
// @ts-ignore
|
|
1229
|
+
return invoke$2('Run And Debug.handleChange', params);
|
|
1230
|
+
};
|
|
1231
|
+
const getFolderIcon = async options => {
|
|
1232
|
+
return invoke$2('IconTheme.getFolderIcon', options);
|
|
1233
|
+
};
|
|
1234
|
+
const closeWidget = async widgetId => {
|
|
1235
|
+
return invoke$2('Viewlet.closeWidget', widgetId);
|
|
1236
|
+
};
|
|
1237
|
+
const sendMessagePortToExtensionHostWorker$1 = async (port, rpcId = 0) => {
|
|
1238
|
+
const command = 'HandleMessagePort.handleMessagePort2';
|
|
1239
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, rpcId);
|
|
1240
|
+
};
|
|
1241
|
+
const sendMessagePortToSearchProcess = async port => {
|
|
1242
|
+
await invokeAndTransfer('SendMessagePortToElectron.sendMessagePortToElectron', port, 'HandleMessagePortForSearchProcess.handleMessagePortForSearchProcess');
|
|
1243
|
+
};
|
|
1244
|
+
const confirm = async (message, options) => {
|
|
1245
|
+
// @ts-ignore
|
|
1246
|
+
const result = await invoke$2('ConfirmPrompt.prompt', message, options);
|
|
1247
|
+
return result;
|
|
1248
|
+
};
|
|
1249
|
+
const getRecentlyOpened = async () => {
|
|
1250
|
+
return invoke$2(/* RecentlyOpened.getRecentlyOpened */'RecentlyOpened.getRecentlyOpened');
|
|
1251
|
+
};
|
|
1252
|
+
const getKeyBindings = async () => {
|
|
1253
|
+
return invoke$2('KeyBindingsInitial.getKeyBindings');
|
|
1254
|
+
};
|
|
1255
|
+
const writeClipBoardText = async text => {
|
|
1256
|
+
await invoke$2('ClipBoard.writeText', /* text */text);
|
|
1257
|
+
};
|
|
1258
|
+
const writeClipBoardImage = async blob => {
|
|
1259
|
+
// @ts-ignore
|
|
1260
|
+
await invoke$2('ClipBoard.writeImage', /* text */blob);
|
|
1261
|
+
};
|
|
1262
|
+
const searchFileMemory = async uri => {
|
|
1263
|
+
// @ts-ignore
|
|
1264
|
+
return invoke$2('ExtensionHost.searchFileWithMemory', uri);
|
|
1265
|
+
};
|
|
1266
|
+
const searchFileFetch = async uri => {
|
|
1267
|
+
return invoke$2('ExtensionHost.searchFileWithFetch', uri);
|
|
1268
|
+
};
|
|
1269
|
+
const showMessageBox = async options => {
|
|
1270
|
+
return invoke$2('ElectronDialog.showMessageBox', options);
|
|
1271
|
+
};
|
|
1272
|
+
const handleDebugResumed = async params => {
|
|
1273
|
+
await invoke$2('Run And Debug.handleResumed', params);
|
|
1274
|
+
};
|
|
1275
|
+
const openWidget = async name => {
|
|
1276
|
+
await invoke$2('Viewlet.openWidget', name);
|
|
1277
|
+
};
|
|
1278
|
+
const getIcons = async requests => {
|
|
1279
|
+
const icons = await invoke$2('IconTheme.getIcons', requests);
|
|
1280
|
+
return icons;
|
|
1281
|
+
};
|
|
1282
|
+
const activateByEvent$1 = event => {
|
|
1283
|
+
return invoke$2('ExtensionHostManagement.activateByEvent', event);
|
|
1284
|
+
};
|
|
1285
|
+
const setAdditionalFocus = focusKey => {
|
|
1286
|
+
// @ts-ignore
|
|
1287
|
+
return invoke$2('Focus.setAdditionalFocus', focusKey);
|
|
1288
|
+
};
|
|
1289
|
+
const getActiveEditorId = () => {
|
|
1290
|
+
// @ts-ignore
|
|
1291
|
+
return invoke$2('GetActiveEditor.getActiveEditorId');
|
|
1292
|
+
};
|
|
1293
|
+
const getWorkspacePath = () => {
|
|
1294
|
+
return invoke$2('Workspace.getPath');
|
|
1295
|
+
};
|
|
1296
|
+
const sendMessagePortToRendererProcess = async port => {
|
|
1297
|
+
const command = 'HandleMessagePort.handleMessagePort';
|
|
1298
|
+
// @ts-ignore
|
|
1299
|
+
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToRendererProcess', port, command, DebugWorker);
|
|
1300
|
+
};
|
|
1301
|
+
const getPreference = async key => {
|
|
1302
|
+
return await invoke$2('Preferences.get', key);
|
|
1303
|
+
};
|
|
1304
|
+
const getAllExtensions = async () => {
|
|
1305
|
+
return invoke$2('ExtensionManagement.getAllExtensions');
|
|
1306
|
+
};
|
|
1307
|
+
const rerenderEditor = async key => {
|
|
1308
|
+
// @ts-ignore
|
|
1309
|
+
return invoke$2('Editor.rerender', key);
|
|
1310
|
+
};
|
|
1311
|
+
const handleDebugPaused = async params => {
|
|
1312
|
+
await invoke$2('Run And Debug.handlePaused', params);
|
|
1313
|
+
};
|
|
1314
|
+
const openUri$1 = async (uri, focus, options) => {
|
|
1315
|
+
await invoke$2('Main.openUri', uri, focus, options);
|
|
1316
|
+
};
|
|
1317
|
+
const sendMessagePortToSyntaxHighlightingWorker = async port => {
|
|
1318
|
+
await invokeAndTransfer(
|
|
1319
|
+
// @ts-ignore
|
|
1320
|
+
'SendMessagePortToSyntaxHighlightingWorker.sendMessagePortToSyntaxHighlightingWorker', port, 'HandleMessagePort.handleMessagePort2');
|
|
1321
|
+
};
|
|
1322
|
+
const handleDebugScriptParsed = async script => {
|
|
1323
|
+
await invoke$2('Run And Debug.handleScriptParsed', script);
|
|
1324
|
+
};
|
|
1325
|
+
const getWindowId = async () => {
|
|
1326
|
+
return invoke$2('GetWindowId.getWindowId');
|
|
1327
|
+
};
|
|
1328
|
+
const getBlob = async uri => {
|
|
1329
|
+
// @ts-ignore
|
|
1330
|
+
return invoke$2('FileSystem.getBlob', uri);
|
|
1331
|
+
};
|
|
1332
|
+
const getExtensionCommands = async () => {
|
|
1333
|
+
return invoke$2('ExtensionHost.getCommands');
|
|
1334
|
+
};
|
|
1335
|
+
const showErrorDialog = async errorInfo => {
|
|
1336
|
+
// @ts-ignore
|
|
1337
|
+
await invoke$2('ErrorHandling.showErrorDialog', errorInfo);
|
|
1338
|
+
};
|
|
1339
|
+
const getFolderSize = async uri => {
|
|
1340
|
+
// @ts-ignore
|
|
1341
|
+
return await invoke$2('FileSystem.getFolderSize', uri);
|
|
1342
|
+
};
|
|
1343
|
+
const getExtension = async id => {
|
|
1344
|
+
// @ts-ignore
|
|
1345
|
+
return invoke$2('ExtensionManagement.getExtension', id);
|
|
1346
|
+
};
|
|
1347
|
+
const getMarkdownDom = async html => {
|
|
1348
|
+
// @ts-ignore
|
|
1349
|
+
return invoke$2('Markdown.getVirtualDom', html);
|
|
1350
|
+
};
|
|
1351
|
+
const renderMarkdown = async (markdown, options) => {
|
|
1352
|
+
// @ts-ignore
|
|
1353
|
+
return invoke$2('Markdown.renderMarkdown', markdown, options);
|
|
1354
|
+
};
|
|
1355
|
+
const openNativeFolder = async uri => {
|
|
1356
|
+
// @ts-ignore
|
|
1357
|
+
await invoke$2('OpenNativeFolder.openNativeFolder', uri);
|
|
1358
|
+
};
|
|
1359
|
+
const uninstallExtension = async id => {
|
|
1360
|
+
return invoke$2('ExtensionManagement.uninstall', id);
|
|
1361
|
+
};
|
|
1362
|
+
const installExtension = async id => {
|
|
1363
|
+
// @ts-ignore
|
|
1364
|
+
return invoke$2('ExtensionManagement.install', id);
|
|
1365
|
+
};
|
|
1366
|
+
const openExtensionSearch = async () => {
|
|
1367
|
+
// @ts-ignore
|
|
1368
|
+
return invoke$2('SideBar.openViewlet', 'Extensions');
|
|
1369
|
+
};
|
|
1370
|
+
const setExtensionsSearchValue = async searchValue => {
|
|
1371
|
+
// @ts-ignore
|
|
1372
|
+
return invoke$2('Extensions.handleInput', searchValue);
|
|
1373
|
+
};
|
|
1374
|
+
const openExternal = async uri => {
|
|
1375
|
+
// @ts-ignore
|
|
1376
|
+
await invoke$2('Open.openExternal', uri);
|
|
1377
|
+
};
|
|
1378
|
+
const openUrl = async uri => {
|
|
1379
|
+
// @ts-ignore
|
|
1380
|
+
await invoke$2('Open.openUrl', uri);
|
|
1381
|
+
};
|
|
1382
|
+
const getAllPreferences = async () => {
|
|
1383
|
+
// @ts-ignore
|
|
1384
|
+
return invoke$2('Preferences.getAll');
|
|
1385
|
+
};
|
|
1386
|
+
const showSaveFilePicker = async () => {
|
|
1387
|
+
// @ts-ignore
|
|
1388
|
+
return invoke$2('FilePicker.showSaveFilePicker');
|
|
1389
|
+
};
|
|
1390
|
+
const getLogsDir = async () => {
|
|
1391
|
+
// @ts-ignore
|
|
1392
|
+
return invoke$2('PlatformPaths.getLogsDir');
|
|
1393
|
+
};
|
|
1394
|
+
const registerMockRpc = commandMap => {
|
|
1395
|
+
const mockRpc = createMockRpc({
|
|
1396
|
+
commandMap
|
|
1397
|
+
});
|
|
1398
|
+
set$2(mockRpc);
|
|
1399
|
+
return mockRpc;
|
|
980
1400
|
};
|
|
981
1401
|
|
|
982
|
-
const
|
|
1402
|
+
const RendererWorker = {
|
|
1403
|
+
__proto__: null,
|
|
1404
|
+
activateByEvent: activateByEvent$1,
|
|
1405
|
+
applyBulkReplacement,
|
|
1406
|
+
closeWidget,
|
|
1407
|
+
confirm,
|
|
1408
|
+
disableExtension,
|
|
1409
|
+
dispose,
|
|
1410
|
+
enableExtension,
|
|
1411
|
+
getActiveEditorId,
|
|
1412
|
+
getAllExtensions,
|
|
1413
|
+
getAllPreferences,
|
|
1414
|
+
getBlob,
|
|
1415
|
+
getChromeVersion,
|
|
1416
|
+
getColorThemeNames,
|
|
1417
|
+
getElectronVersion,
|
|
1418
|
+
getExtension,
|
|
1419
|
+
getExtensionCommands,
|
|
1420
|
+
getFileHandles,
|
|
1421
|
+
getFileIcon: getFileIcon$1,
|
|
1422
|
+
getFilePathElectron,
|
|
1423
|
+
getFolderIcon,
|
|
1424
|
+
getFolderSize,
|
|
1425
|
+
getIcons,
|
|
1426
|
+
getKeyBindings,
|
|
1427
|
+
getLogsDir,
|
|
1428
|
+
getMarkdownDom,
|
|
1429
|
+
getNodeVersion,
|
|
1430
|
+
getPreference,
|
|
1431
|
+
getRecentlyOpened,
|
|
1432
|
+
getV8Version,
|
|
1433
|
+
getWebViewSecret,
|
|
1434
|
+
getWindowId,
|
|
1435
|
+
getWorkspacePath,
|
|
1436
|
+
handleDebugChange,
|
|
1437
|
+
handleDebugPaused,
|
|
1438
|
+
handleDebugResumed,
|
|
1439
|
+
handleDebugScriptParsed,
|
|
1440
|
+
installExtension,
|
|
1441
|
+
invoke: invoke$2,
|
|
1442
|
+
invokeAndTransfer,
|
|
1443
|
+
openExtensionSearch,
|
|
1444
|
+
openExternal,
|
|
1445
|
+
openNativeFolder,
|
|
1446
|
+
openUri: openUri$1,
|
|
1447
|
+
openUrl,
|
|
1448
|
+
openWidget,
|
|
1449
|
+
readFile: readFile$1,
|
|
1450
|
+
registerMockRpc,
|
|
1451
|
+
registerWebViewInterceptor,
|
|
1452
|
+
renderMarkdown,
|
|
1453
|
+
rerenderEditor,
|
|
1454
|
+
searchFileFetch,
|
|
1455
|
+
searchFileHtml,
|
|
1456
|
+
searchFileMemory,
|
|
1457
|
+
sendMessagePortToEditorWorker,
|
|
1458
|
+
sendMessagePortToErrorWorker,
|
|
1459
|
+
sendMessagePortToExtensionHostWorker: sendMessagePortToExtensionHostWorker$1,
|
|
1460
|
+
sendMessagePortToFileSystemWorker,
|
|
1461
|
+
sendMessagePortToMarkdownWorker,
|
|
1462
|
+
sendMessagePortToRendererProcess,
|
|
1463
|
+
sendMessagePortToSearchProcess,
|
|
1464
|
+
sendMessagePortToSyntaxHighlightingWorker,
|
|
1465
|
+
set: set$2,
|
|
1466
|
+
setAdditionalFocus,
|
|
1467
|
+
setColorTheme,
|
|
1468
|
+
setExtensionsSearchValue,
|
|
1469
|
+
setFocus,
|
|
1470
|
+
setWebViewPort,
|
|
1471
|
+
setWorkspacePath,
|
|
1472
|
+
showContextMenu,
|
|
1473
|
+
showErrorDialog,
|
|
1474
|
+
showMessageBox,
|
|
1475
|
+
showSaveFilePicker,
|
|
1476
|
+
uninstallExtension,
|
|
1477
|
+
unregisterWebViewInterceptor,
|
|
1478
|
+
writeClipBoardImage,
|
|
1479
|
+
writeClipBoardText
|
|
1480
|
+
};
|
|
1481
|
+
|
|
1482
|
+
const toCommandId = key => {
|
|
1483
|
+
const dotIndex = key.indexOf('.');
|
|
1484
|
+
return key.slice(dotIndex + 1);
|
|
1485
|
+
};
|
|
1486
|
+
const create = () => {
|
|
983
1487
|
const states = Object.create(null);
|
|
1488
|
+
const commandMapRef = {};
|
|
984
1489
|
return {
|
|
985
1490
|
get(uid) {
|
|
986
1491
|
return states[uid];
|
|
@@ -1021,6 +1526,15 @@ const create$1 = () => {
|
|
|
1021
1526
|
};
|
|
1022
1527
|
return wrapped;
|
|
1023
1528
|
},
|
|
1529
|
+
wrapGetter(fn) {
|
|
1530
|
+
const wrapped = (uid, ...args) => {
|
|
1531
|
+
const {
|
|
1532
|
+
newState
|
|
1533
|
+
} = states[uid];
|
|
1534
|
+
return fn(newState, ...args);
|
|
1535
|
+
};
|
|
1536
|
+
return wrapped;
|
|
1537
|
+
},
|
|
1024
1538
|
diff(uid, modules, numbers) {
|
|
1025
1539
|
const {
|
|
1026
1540
|
oldState,
|
|
@@ -1034,15 +1548,28 @@ const create$1 = () => {
|
|
|
1034
1548
|
}
|
|
1035
1549
|
}
|
|
1036
1550
|
return diffResult;
|
|
1551
|
+
},
|
|
1552
|
+
getCommandIds() {
|
|
1553
|
+
const keys = Object.keys(commandMapRef);
|
|
1554
|
+
const ids = keys.map(toCommandId);
|
|
1555
|
+
return ids;
|
|
1556
|
+
},
|
|
1557
|
+
registerCommands(commandMap) {
|
|
1558
|
+
Object.assign(commandMapRef, commandMap);
|
|
1037
1559
|
}
|
|
1038
1560
|
};
|
|
1039
1561
|
};
|
|
1562
|
+
const terminate = () => {
|
|
1563
|
+
globalThis.close();
|
|
1564
|
+
};
|
|
1040
1565
|
|
|
1041
1566
|
const {
|
|
1042
|
-
get: get$
|
|
1043
|
-
set: set$
|
|
1044
|
-
wrapCommand
|
|
1045
|
-
|
|
1567
|
+
get: get$1,
|
|
1568
|
+
set: set$1,
|
|
1569
|
+
wrapCommand,
|
|
1570
|
+
getCommandIds,
|
|
1571
|
+
registerCommands
|
|
1572
|
+
} = create();
|
|
1046
1573
|
|
|
1047
1574
|
const create2 = (id, uri, x, y, width, height, workspacePath) => {
|
|
1048
1575
|
const state = {
|
|
@@ -1080,7 +1607,7 @@ const create2 = (id, uri, x, y, width, height, workspacePath) => {
|
|
|
1080
1607
|
x,
|
|
1081
1608
|
y
|
|
1082
1609
|
};
|
|
1083
|
-
set$
|
|
1610
|
+
set$1(id, state, state);
|
|
1084
1611
|
};
|
|
1085
1612
|
|
|
1086
1613
|
const RenderItems = 4;
|
|
@@ -1108,90 +1635,25 @@ const diff2 = uid => {
|
|
|
1108
1635
|
const {
|
|
1109
1636
|
oldState,
|
|
1110
1637
|
newState
|
|
1111
|
-
} = get$
|
|
1638
|
+
} = get$1(uid);
|
|
1112
1639
|
const result = diff(oldState, newState);
|
|
1113
1640
|
return result;
|
|
1114
1641
|
};
|
|
1115
1642
|
|
|
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
1643
|
const getInfo = uid => {
|
|
1123
1644
|
const {
|
|
1124
1645
|
newState
|
|
1125
|
-
} = get$
|
|
1646
|
+
} = get$1(uid);
|
|
1126
1647
|
return newState.allGroups;
|
|
1127
1648
|
};
|
|
1128
1649
|
|
|
1129
|
-
const rpcs = Object.create(null);
|
|
1130
|
-
const set$b = (id, rpc) => {
|
|
1131
|
-
rpcs[id] = rpc;
|
|
1132
|
-
};
|
|
1133
|
-
const get$1 = id => {
|
|
1134
|
-
return rpcs[id];
|
|
1135
|
-
};
|
|
1136
|
-
|
|
1137
|
-
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
1138
|
-
|
|
1139
|
-
const create = rpcId => {
|
|
1140
|
-
return {
|
|
1141
|
-
// @ts-ignore
|
|
1142
|
-
invoke(method, ...params) {
|
|
1143
|
-
const rpc = get$1(rpcId);
|
|
1144
|
-
// @ts-ignore
|
|
1145
|
-
return rpc.invoke(method, ...params);
|
|
1146
|
-
},
|
|
1147
|
-
// @ts-ignore
|
|
1148
|
-
invokeAndTransfer(method, ...params) {
|
|
1149
|
-
const rpc = get$1(rpcId);
|
|
1150
|
-
// @ts-ignore
|
|
1151
|
-
return rpc.invokeAndTransfer(method, ...params);
|
|
1152
|
-
},
|
|
1153
|
-
set(rpc) {
|
|
1154
|
-
set$b(rpcId, rpc);
|
|
1155
|
-
}
|
|
1156
|
-
};
|
|
1157
|
-
};
|
|
1158
|
-
const ExtensionHostWorker = 44;
|
|
1159
|
-
const RendererWorker$1 = 1;
|
|
1160
|
-
const {
|
|
1161
|
-
invoke: invoke$7,
|
|
1162
|
-
set: set$7
|
|
1163
|
-
} = create(ExtensionHostWorker);
|
|
1164
|
-
const ExtensionHost = {
|
|
1165
|
-
__proto__: null,
|
|
1166
|
-
invoke: invoke$7,
|
|
1167
|
-
set: set$7
|
|
1168
|
-
};
|
|
1169
|
-
const {
|
|
1170
|
-
invoke: invoke$2,
|
|
1171
|
-
invokeAndTransfer: invokeAndTransfer$2,
|
|
1172
|
-
set: set$2
|
|
1173
|
-
} = create(RendererWorker$1);
|
|
1174
|
-
const RendererWorker = {
|
|
1175
|
-
__proto__: null,
|
|
1176
|
-
invoke: invoke$2,
|
|
1177
|
-
invokeAndTransfer: invokeAndTransfer$2,
|
|
1178
|
-
set: set$2
|
|
1179
|
-
};
|
|
1180
|
-
|
|
1181
|
-
const {
|
|
1182
|
-
invoke: invoke$1,
|
|
1183
|
-
invokeAndTransfer,
|
|
1184
|
-
set: set$1
|
|
1185
|
-
} = RendererWorker;
|
|
1186
|
-
|
|
1187
1650
|
const activateByEvent = event => {
|
|
1188
|
-
return
|
|
1651
|
+
return activateByEvent$1(event);
|
|
1189
1652
|
};
|
|
1190
1653
|
|
|
1191
1654
|
const {
|
|
1192
|
-
invoke,
|
|
1193
|
-
set
|
|
1194
|
-
} = ExtensionHost;
|
|
1655
|
+
invoke: invoke$1,
|
|
1656
|
+
set} = ExtensionHost;
|
|
1195
1657
|
|
|
1196
1658
|
const executeProvider = async ({
|
|
1197
1659
|
event,
|
|
@@ -1200,7 +1662,7 @@ const executeProvider = async ({
|
|
|
1200
1662
|
}) => {
|
|
1201
1663
|
await activateByEvent(event);
|
|
1202
1664
|
// @ts-ignore
|
|
1203
|
-
const result = await invoke(method, ...params);
|
|
1665
|
+
const result = await invoke$1(method, ...params);
|
|
1204
1666
|
return result;
|
|
1205
1667
|
};
|
|
1206
1668
|
|
|
@@ -1325,8 +1787,11 @@ const getMissingIconRequests = (dirents, fileIconCache) => {
|
|
|
1325
1787
|
return missingRequests;
|
|
1326
1788
|
};
|
|
1327
1789
|
|
|
1790
|
+
const {
|
|
1791
|
+
invoke} = RendererWorker;
|
|
1792
|
+
|
|
1328
1793
|
const requestFileIcons = async requests => {
|
|
1329
|
-
const results = await invoke
|
|
1794
|
+
const results = await invoke('IconTheme.getIcons', requests);
|
|
1330
1795
|
return results;
|
|
1331
1796
|
};
|
|
1332
1797
|
|
|
@@ -1470,7 +1935,7 @@ const get = key => {
|
|
|
1470
1935
|
};
|
|
1471
1936
|
|
|
1472
1937
|
const getExtensions = async () => {
|
|
1473
|
-
return invoke('Extensions.getExtensions');
|
|
1938
|
+
return invoke$1('Extensions.getExtensions');
|
|
1474
1939
|
};
|
|
1475
1940
|
|
|
1476
1941
|
const requestSourceActions = async () => {
|
|
@@ -1688,12 +2153,20 @@ const handleClickDirectoryExpanded = async (state, item) => {
|
|
|
1688
2153
|
};
|
|
1689
2154
|
|
|
1690
2155
|
const readFile = async (uri, encoding = 'utf8') => {
|
|
1691
|
-
const content = await invoke
|
|
2156
|
+
const content = await invoke('FileSystem.readFile', uri);
|
|
1692
2157
|
return content;
|
|
1693
2158
|
};
|
|
1694
2159
|
|
|
1695
2160
|
const openUri = uri => {
|
|
1696
|
-
return invoke
|
|
2161
|
+
return invoke('Main.openUri', uri);
|
|
2162
|
+
};
|
|
2163
|
+
|
|
2164
|
+
const openDiffEditor = async (before, afterPath, width) => {
|
|
2165
|
+
// TODO handle error
|
|
2166
|
+
// TODO should only pass uris to diff editor, diff editor should then resolve file contents
|
|
2167
|
+
{
|
|
2168
|
+
await openUri(`inline-diff://data://${before}<->${afterPath}`);
|
|
2169
|
+
}
|
|
1697
2170
|
};
|
|
1698
2171
|
|
|
1699
2172
|
const handleClickFile = async (state, item) => {
|
|
@@ -1705,9 +2178,7 @@ const handleClickFile = async (state, item) => {
|
|
|
1705
2178
|
const absolutePath = `${root}/${item.file}`;
|
|
1706
2179
|
// TODO handle error
|
|
1707
2180
|
const [fileBefore] = await Promise.all([getFileBefore(providerId, item.file), readFile(absolutePath)]);
|
|
1708
|
-
|
|
1709
|
-
await openUri(`inline-diff://data://${fileBefore}<->${absolutePath}`);
|
|
1710
|
-
}
|
|
2181
|
+
await openDiffEditor(fileBefore, absolutePath);
|
|
1711
2182
|
return state;
|
|
1712
2183
|
};
|
|
1713
2184
|
|
|
@@ -1741,7 +2212,7 @@ const handleClickAt = async (state, eventX, eventY, name) => {
|
|
|
1741
2212
|
};
|
|
1742
2213
|
|
|
1743
2214
|
const show = async (x, y, id, ...args) => {
|
|
1744
|
-
return
|
|
2215
|
+
return showContextMenu(x, y, id, ...args);
|
|
1745
2216
|
};
|
|
1746
2217
|
|
|
1747
2218
|
const SourceControl$1 = 22;
|
|
@@ -1819,34 +2290,15 @@ const handleWheel = async (state, deltaMode, deltaY) => {
|
|
|
1819
2290
|
return setDeltaY(state, state.deltaY + deltaY);
|
|
1820
2291
|
};
|
|
1821
2292
|
|
|
1822
|
-
const getPortTuple = () => {
|
|
1823
|
-
const {
|
|
1824
|
-
port1,
|
|
1825
|
-
port2
|
|
1826
|
-
} = new MessageChannel();
|
|
1827
|
-
return {
|
|
1828
|
-
port1,
|
|
1829
|
-
port2
|
|
1830
|
-
};
|
|
1831
|
-
};
|
|
1832
|
-
|
|
1833
|
-
const SourceControlWorker = 66;
|
|
1834
|
-
|
|
1835
2293
|
const sendMessagePortToExtensionHostWorker = async port => {
|
|
1836
|
-
|
|
1837
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, SourceControlWorker);
|
|
2294
|
+
await sendMessagePortToExtensionHostWorker$1(port, SourceControlWorker);
|
|
1838
2295
|
};
|
|
1839
2296
|
|
|
1840
2297
|
const createExtensionHostRpc = async () => {
|
|
1841
2298
|
try {
|
|
1842
|
-
const {
|
|
1843
|
-
port1,
|
|
1844
|
-
port2
|
|
1845
|
-
} = getPortTuple();
|
|
1846
|
-
await sendMessagePortToExtensionHostWorker(port2);
|
|
1847
|
-
const rpc = await PlainMessagePortRpcParent.create({
|
|
2299
|
+
const rpc = await TransferMessagePortRpcParent.create({
|
|
1848
2300
|
commandMap: {},
|
|
1849
|
-
|
|
2301
|
+
send: sendMessagePortToExtensionHostWorker
|
|
1850
2302
|
});
|
|
1851
2303
|
return rpc;
|
|
1852
2304
|
} catch (error) {
|
|
@@ -1859,6 +2311,18 @@ const initialize = async () => {
|
|
|
1859
2311
|
set(extensionHostRpc);
|
|
1860
2312
|
};
|
|
1861
2313
|
|
|
2314
|
+
const mergeClassNames = (...classNames) => {
|
|
2315
|
+
return classNames.filter(Boolean).join(' ');
|
|
2316
|
+
};
|
|
2317
|
+
|
|
2318
|
+
const text = data => {
|
|
2319
|
+
return {
|
|
2320
|
+
type: Text,
|
|
2321
|
+
text: data,
|
|
2322
|
+
childCount: 0
|
|
2323
|
+
};
|
|
2324
|
+
};
|
|
2325
|
+
|
|
1862
2326
|
const Actions = 'Actions';
|
|
1863
2327
|
const SourceControlButtons = 'SourceControlButtons';
|
|
1864
2328
|
const Grow = 'Grow';
|
|
@@ -1885,7 +2349,7 @@ const SplitButtonDropDown = 'SplitButtonDropDown';
|
|
|
1885
2349
|
const SplitButtonDropDownDisabled = 'SplitButtonDropDownDisabled';
|
|
1886
2350
|
const SplitButtonSeparator = 'SplitButtonSeparator';
|
|
1887
2351
|
const StrikeThrough = 'StrikeThrough';
|
|
1888
|
-
const TreeItem
|
|
2352
|
+
const TreeItem = 'TreeItem';
|
|
1889
2353
|
const Viewlet = 'Viewlet';
|
|
1890
2354
|
|
|
1891
2355
|
const HandleClickAt = 'handleClickAt';
|
|
@@ -1922,12 +2386,6 @@ const sourceControlInput = () => {
|
|
|
1922
2386
|
return i18nString(SourceControlInput);
|
|
1923
2387
|
};
|
|
1924
2388
|
|
|
1925
|
-
const Button$1 = 1;
|
|
1926
|
-
const Div = 4;
|
|
1927
|
-
const Input = 6;
|
|
1928
|
-
const Span = 8;
|
|
1929
|
-
const Img = 17;
|
|
1930
|
-
|
|
1931
2389
|
const getSourceControlHeaderVirtualDom = () => {
|
|
1932
2390
|
return [{
|
|
1933
2391
|
type: Div,
|
|
@@ -1948,23 +2406,6 @@ const getSourceControlHeaderVirtualDom = () => {
|
|
|
1948
2406
|
}];
|
|
1949
2407
|
};
|
|
1950
2408
|
|
|
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
2409
|
const getBadgeVirtualDom = (className, count) => {
|
|
1969
2410
|
return [{
|
|
1970
2411
|
type: Div,
|
|
@@ -1988,7 +2429,7 @@ const getButtonVirtualDom = button => {
|
|
|
1988
2429
|
label
|
|
1989
2430
|
} = button;
|
|
1990
2431
|
return [{
|
|
1991
|
-
type: Button$
|
|
2432
|
+
type: Button$2,
|
|
1992
2433
|
className: SourceControlButton,
|
|
1993
2434
|
title: label,
|
|
1994
2435
|
ariaLabel: label,
|
|
@@ -2035,8 +2476,8 @@ const createItemDirectory = item => {
|
|
|
2035
2476
|
const hasButtons = buttons.length;
|
|
2036
2477
|
return [{
|
|
2037
2478
|
type: Div,
|
|
2038
|
-
className: TreeItem
|
|
2039
|
-
role: TreeItem,
|
|
2479
|
+
className: TreeItem,
|
|
2480
|
+
role: TreeItem$1,
|
|
2040
2481
|
ariaExpanded: type === DirectoryExpanded,
|
|
2041
2482
|
ariaPosInSet: posInSet,
|
|
2042
2483
|
ariaSetSize: setSize,
|
|
@@ -2095,8 +2536,8 @@ const createItemOther = item => {
|
|
|
2095
2536
|
const buttonsDom = getButtonsVirtualDom(buttons);
|
|
2096
2537
|
dom.push({
|
|
2097
2538
|
type: Div,
|
|
2098
|
-
className: TreeItem
|
|
2099
|
-
role: TreeItem,
|
|
2539
|
+
className: TreeItem,
|
|
2540
|
+
role: TreeItem$1,
|
|
2100
2541
|
ariaPosInSet: posInSet,
|
|
2101
2542
|
ariaSetSize: setSize,
|
|
2102
2543
|
title: file,
|
|
@@ -2198,7 +2639,7 @@ const getSourceControlVirtualDom = (items, splitButtonEnabled) => {
|
|
|
2198
2639
|
const renderItems = (oldState, newState) => {
|
|
2199
2640
|
const visible = newState.visibleItems;
|
|
2200
2641
|
const dom = getSourceControlVirtualDom(visible, newState.splitButtonEnabled);
|
|
2201
|
-
return [
|
|
2642
|
+
return [SetDom2, dom];
|
|
2202
2643
|
};
|
|
2203
2644
|
|
|
2204
2645
|
const getRenderer = diffType => {
|
|
@@ -2226,8 +2667,8 @@ const render2 = (uid, diffResult) => {
|
|
|
2226
2667
|
const {
|
|
2227
2668
|
oldState,
|
|
2228
2669
|
newState
|
|
2229
|
-
} = get$
|
|
2230
|
-
set$
|
|
2670
|
+
} = get$1(uid);
|
|
2671
|
+
set$1(uid, newState, newState);
|
|
2231
2672
|
const commands = applyRender(oldState, newState, diffResult);
|
|
2232
2673
|
return commands;
|
|
2233
2674
|
};
|
|
@@ -2241,7 +2682,7 @@ const getActionButtonVirtualDom = action => {
|
|
|
2241
2682
|
command
|
|
2242
2683
|
} = action;
|
|
2243
2684
|
return [{
|
|
2244
|
-
type: Button$
|
|
2685
|
+
type: Button$2,
|
|
2245
2686
|
className: IconButton,
|
|
2246
2687
|
title: id,
|
|
2247
2688
|
'data-command': command,
|
|
@@ -2276,40 +2717,40 @@ const renderActions = uid => {
|
|
|
2276
2717
|
const renderEventListeners = () => {
|
|
2277
2718
|
return [{
|
|
2278
2719
|
name: HandleWheel,
|
|
2279
|
-
params: ['handleWheel',
|
|
2720
|
+
params: ['handleWheel', DeltaMode, DeltaY],
|
|
2280
2721
|
passive: true
|
|
2281
2722
|
}, {
|
|
2282
2723
|
name: HandleFocus,
|
|
2283
2724
|
params: ['handleFocus']
|
|
2284
2725
|
}, {
|
|
2285
2726
|
name: HandleClickAt,
|
|
2286
|
-
params: ['handleClickAt',
|
|
2727
|
+
params: ['handleClickAt', ClientX, ClientY, TargetName]
|
|
2287
2728
|
}, {
|
|
2288
2729
|
name: HandleMouseOverAt,
|
|
2289
|
-
params: ['handleMouseOverAt',
|
|
2730
|
+
params: ['handleMouseOverAt', ClientX, ClientY]
|
|
2290
2731
|
}, {
|
|
2291
2732
|
name: HandleMouseOver,
|
|
2292
|
-
params: ['handleMouseOver',
|
|
2733
|
+
params: ['handleMouseOver', ClientX, ClientY]
|
|
2293
2734
|
}, {
|
|
2294
2735
|
name: HandleMouseOutAt,
|
|
2295
|
-
params: ['handleMouseOutAt',
|
|
2736
|
+
params: ['handleMouseOutAt', ClientX, ClientY]
|
|
2296
2737
|
}, {
|
|
2297
2738
|
name: HandleInput,
|
|
2298
|
-
params: ['handleInput',
|
|
2739
|
+
params: ['handleInput', TargetValue]
|
|
2299
2740
|
}, {
|
|
2300
2741
|
name: HandleContextMenu,
|
|
2301
|
-
params: ['handleContextMenu',
|
|
2742
|
+
params: ['handleContextMenu', Button$1, ClientX, ClientY],
|
|
2302
2743
|
preventDefault: true
|
|
2303
2744
|
}, {
|
|
2304
2745
|
name: HandleWheel,
|
|
2305
|
-
params: ['handleWheel',
|
|
2746
|
+
params: ['handleWheel', DeltaMode, DeltaY],
|
|
2306
2747
|
passive: true
|
|
2307
2748
|
}];
|
|
2308
2749
|
};
|
|
2309
2750
|
|
|
2310
2751
|
const saveState = uid => {
|
|
2311
2752
|
number(uid);
|
|
2312
|
-
const value = get$
|
|
2753
|
+
const value = get$1(uid);
|
|
2313
2754
|
const {
|
|
2314
2755
|
newState
|
|
2315
2756
|
} = value;
|
|
@@ -2327,10 +2768,6 @@ const saveState = uid => {
|
|
|
2327
2768
|
};
|
|
2328
2769
|
};
|
|
2329
2770
|
|
|
2330
|
-
const terminate = () => {
|
|
2331
|
-
globalThis.close();
|
|
2332
|
-
};
|
|
2333
|
-
|
|
2334
2771
|
const updateIcons = async state => {
|
|
2335
2772
|
const {
|
|
2336
2773
|
items,
|
|
@@ -2375,10 +2812,11 @@ const commandMap = {
|
|
|
2375
2812
|
};
|
|
2376
2813
|
|
|
2377
2814
|
const listen = async () => {
|
|
2815
|
+
registerCommands(commandMap);
|
|
2378
2816
|
const rpc = await WebWorkerRpcClient.create({
|
|
2379
2817
|
commandMap: commandMap
|
|
2380
2818
|
});
|
|
2381
|
-
set$
|
|
2819
|
+
set$2(rpc);
|
|
2382
2820
|
};
|
|
2383
2821
|
|
|
2384
2822
|
const main = async () => {
|