@lvce-editor/source-control-worker 1.14.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 +590 -119
- 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
|
};
|
|
@@ -344,22 +352,11 @@ class IpcChildWithModuleWorker extends Ipc {
|
|
|
344
352
|
const wrap$f = global => {
|
|
345
353
|
return new IpcChildWithModuleWorker(global);
|
|
346
354
|
};
|
|
347
|
-
const withResolvers = () => {
|
|
348
|
-
let _resolve;
|
|
349
|
-
const promise = new Promise(resolve => {
|
|
350
|
-
_resolve = resolve;
|
|
351
|
-
});
|
|
352
|
-
return {
|
|
353
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
354
|
-
resolve: _resolve,
|
|
355
|
-
promise
|
|
356
|
-
};
|
|
357
|
-
};
|
|
358
355
|
const waitForFirstMessage = async port => {
|
|
359
356
|
const {
|
|
360
357
|
resolve,
|
|
361
358
|
promise
|
|
362
|
-
} = withResolvers();
|
|
359
|
+
} = Promise.withResolvers();
|
|
363
360
|
port.addEventListener('message', resolve, {
|
|
364
361
|
once: true
|
|
365
362
|
});
|
|
@@ -438,7 +435,7 @@ const getFirstEvent = (eventEmitter, eventMap) => {
|
|
|
438
435
|
const {
|
|
439
436
|
resolve,
|
|
440
437
|
promise
|
|
441
|
-
} = withResolvers();
|
|
438
|
+
} = Promise.withResolvers();
|
|
442
439
|
const listenerMap = Object.create(null);
|
|
443
440
|
const cleanup = value => {
|
|
444
441
|
for (const event of Object.keys(eventMap)) {
|
|
@@ -516,7 +513,7 @@ const IpcParentWithMessagePort$1 = {
|
|
|
516
513
|
};
|
|
517
514
|
|
|
518
515
|
const Two = '2.0';
|
|
519
|
-
const create$4 = (method, params) => {
|
|
516
|
+
const create$4$1 = (method, params) => {
|
|
520
517
|
return {
|
|
521
518
|
jsonrpc: Two,
|
|
522
519
|
method,
|
|
@@ -524,7 +521,7 @@ const create$4 = (method, params) => {
|
|
|
524
521
|
};
|
|
525
522
|
};
|
|
526
523
|
const callbacks = Object.create(null);
|
|
527
|
-
const set$
|
|
524
|
+
const set$6 = (id, fn) => {
|
|
528
525
|
callbacks[id] = fn;
|
|
529
526
|
};
|
|
530
527
|
const get$3 = id => {
|
|
@@ -543,7 +540,7 @@ const registerPromise = () => {
|
|
|
543
540
|
resolve,
|
|
544
541
|
promise
|
|
545
542
|
} = Promise.withResolvers();
|
|
546
|
-
set$
|
|
543
|
+
set$6(id, resolve);
|
|
547
544
|
return {
|
|
548
545
|
id,
|
|
549
546
|
promise
|
|
@@ -616,6 +613,17 @@ const constructError = (message, type, name) => {
|
|
|
616
613
|
}
|
|
617
614
|
return new ErrorConstructor(message);
|
|
618
615
|
};
|
|
616
|
+
const joinLines = lines => {
|
|
617
|
+
return lines.join(NewLine);
|
|
618
|
+
};
|
|
619
|
+
const splitLines = lines => {
|
|
620
|
+
return lines.split(NewLine);
|
|
621
|
+
};
|
|
622
|
+
const getCurrentStack = () => {
|
|
623
|
+
const stackLinesToSkip = 3;
|
|
624
|
+
const currentStack = joinLines(splitLines(new Error().stack || '').slice(stackLinesToSkip));
|
|
625
|
+
return currentStack;
|
|
626
|
+
};
|
|
619
627
|
const getNewLineIndex = (string, startIndex = undefined) => {
|
|
620
628
|
return string.indexOf(NewLine, startIndex);
|
|
621
629
|
};
|
|
@@ -626,19 +634,16 @@ const getParentStack = error => {
|
|
|
626
634
|
}
|
|
627
635
|
return parentStack;
|
|
628
636
|
};
|
|
629
|
-
const joinLines = lines => {
|
|
630
|
-
return lines.join(NewLine);
|
|
631
|
-
};
|
|
632
637
|
const MethodNotFound = -32601;
|
|
633
638
|
const Custom = -32001;
|
|
634
|
-
const splitLines = lines => {
|
|
635
|
-
return lines.split(NewLine);
|
|
636
|
-
};
|
|
637
639
|
const restoreJsonRpcError = error => {
|
|
640
|
+
const currentStack = getCurrentStack();
|
|
638
641
|
if (error && error instanceof Error) {
|
|
642
|
+
if (typeof error.stack === 'string') {
|
|
643
|
+
error.stack = error.stack + NewLine + currentStack;
|
|
644
|
+
}
|
|
639
645
|
return error;
|
|
640
646
|
}
|
|
641
|
-
const currentStack = joinLines(splitLines(new Error().stack || '').slice(1));
|
|
642
647
|
if (error && error.code && error.code === MethodNotFound) {
|
|
643
648
|
const restoredError = new JsonRpcError(error.message);
|
|
644
649
|
const parentStack = getParentStack(error);
|
|
@@ -719,6 +724,17 @@ const getErrorType = prettyError => {
|
|
|
719
724
|
}
|
|
720
725
|
return undefined;
|
|
721
726
|
};
|
|
727
|
+
const isAlreadyStack = line => {
|
|
728
|
+
return line.trim().startsWith('at ');
|
|
729
|
+
};
|
|
730
|
+
const getStack = prettyError => {
|
|
731
|
+
const stackString = prettyError.stack || '';
|
|
732
|
+
const newLineIndex = stackString.indexOf('\n');
|
|
733
|
+
if (newLineIndex !== -1 && !isAlreadyStack(stackString.slice(0, newLineIndex))) {
|
|
734
|
+
return stackString.slice(newLineIndex + 1);
|
|
735
|
+
}
|
|
736
|
+
return stackString;
|
|
737
|
+
};
|
|
722
738
|
const getErrorProperty = (error, prettyError) => {
|
|
723
739
|
if (error && error.code === E_COMMAND_NOT_FOUND) {
|
|
724
740
|
return {
|
|
@@ -731,7 +747,7 @@ const getErrorProperty = (error, prettyError) => {
|
|
|
731
747
|
code: Custom,
|
|
732
748
|
message: prettyError.message,
|
|
733
749
|
data: {
|
|
734
|
-
stack: prettyError
|
|
750
|
+
stack: getStack(prettyError),
|
|
735
751
|
codeFrame: prettyError.codeFrame,
|
|
736
752
|
type: getErrorType(prettyError),
|
|
737
753
|
code: prettyError.code,
|
|
@@ -739,20 +755,20 @@ const getErrorProperty = (error, prettyError) => {
|
|
|
739
755
|
}
|
|
740
756
|
};
|
|
741
757
|
};
|
|
742
|
-
const create$1$1 = (
|
|
758
|
+
const create$1$1 = (id, error) => {
|
|
743
759
|
return {
|
|
744
760
|
jsonrpc: Two,
|
|
745
|
-
id
|
|
761
|
+
id,
|
|
746
762
|
error
|
|
747
763
|
};
|
|
748
764
|
};
|
|
749
|
-
const getErrorResponse = (
|
|
765
|
+
const getErrorResponse = (id, error, preparePrettyError, logError) => {
|
|
750
766
|
const prettyError = preparePrettyError(error);
|
|
751
767
|
logError(error, prettyError);
|
|
752
768
|
const errorProperty = getErrorProperty(error, prettyError);
|
|
753
|
-
return create$1$1(
|
|
769
|
+
return create$1$1(id, errorProperty);
|
|
754
770
|
};
|
|
755
|
-
const create$
|
|
771
|
+
const create$6 = (message, result) => {
|
|
756
772
|
return {
|
|
757
773
|
jsonrpc: Two,
|
|
758
774
|
id: message.id,
|
|
@@ -761,14 +777,29 @@ const create$5 = (message, result) => {
|
|
|
761
777
|
};
|
|
762
778
|
const getSuccessResponse = (message, result) => {
|
|
763
779
|
const resultProperty = result ?? null;
|
|
764
|
-
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
|
+
};
|
|
765
793
|
};
|
|
766
794
|
const getResponse = async (message, ipc, execute, preparePrettyError, logError, requiresSocket) => {
|
|
767
795
|
try {
|
|
768
796
|
const result = requiresSocket(message.method) ? await execute(message.method, ipc, ...message.params) : await execute(message.method, ...message.params);
|
|
769
797
|
return getSuccessResponse(message, result);
|
|
770
798
|
} catch (error) {
|
|
771
|
-
|
|
799
|
+
if (ipc.canUseSimpleErrorResponse) {
|
|
800
|
+
return getErrorResponseSimple(message.id, error);
|
|
801
|
+
}
|
|
802
|
+
return getErrorResponse(message.id, error, preparePrettyError, logError);
|
|
772
803
|
}
|
|
773
804
|
};
|
|
774
805
|
const defaultPreparePrettyError = error => {
|
|
@@ -823,7 +854,7 @@ const handleJsonRpcMessage = async (...args) => {
|
|
|
823
854
|
try {
|
|
824
855
|
ipc.send(response);
|
|
825
856
|
} catch (error) {
|
|
826
|
-
const errorResponse = getErrorResponse(message, error, preparePrettyError, logError);
|
|
857
|
+
const errorResponse = getErrorResponse(message.id, error, preparePrettyError, logError);
|
|
827
858
|
ipc.send(errorResponse);
|
|
828
859
|
}
|
|
829
860
|
return;
|
|
@@ -851,16 +882,22 @@ const invokeHelper = async (ipc, method, params, useSendAndTransfer) => {
|
|
|
851
882
|
return unwrapJsonRpcResult(responseMessage);
|
|
852
883
|
};
|
|
853
884
|
const send = (transport, method, ...params) => {
|
|
854
|
-
const message = create$4(method, params);
|
|
885
|
+
const message = create$4$1(method, params);
|
|
855
886
|
transport.send(message);
|
|
856
887
|
};
|
|
857
|
-
const invoke$
|
|
888
|
+
const invoke$4 = (ipc, method, ...params) => {
|
|
858
889
|
return invokeHelper(ipc, method, params, false);
|
|
859
890
|
};
|
|
860
|
-
const invokeAndTransfer$
|
|
891
|
+
const invokeAndTransfer$3 = (ipc, method, ...params) => {
|
|
861
892
|
return invokeHelper(ipc, method, params, true);
|
|
862
893
|
};
|
|
863
894
|
|
|
895
|
+
class CommandNotFoundError extends Error {
|
|
896
|
+
constructor(command) {
|
|
897
|
+
super(`Command not found ${command}`);
|
|
898
|
+
this.name = 'CommandNotFoundError';
|
|
899
|
+
}
|
|
900
|
+
}
|
|
864
901
|
const commands = Object.create(null);
|
|
865
902
|
const register = commandMap => {
|
|
866
903
|
Object.assign(commands, commandMap);
|
|
@@ -871,7 +908,7 @@ const getCommand = key => {
|
|
|
871
908
|
const execute = (command, ...args) => {
|
|
872
909
|
const fn = getCommand(command);
|
|
873
910
|
if (!fn) {
|
|
874
|
-
throw new
|
|
911
|
+
throw new CommandNotFoundError(command);
|
|
875
912
|
}
|
|
876
913
|
return fn(...args);
|
|
877
914
|
};
|
|
@@ -887,10 +924,10 @@ const createRpc = ipc => {
|
|
|
887
924
|
send(ipc, method, ...params);
|
|
888
925
|
},
|
|
889
926
|
invoke(method, ...params) {
|
|
890
|
-
return invoke$
|
|
927
|
+
return invoke$4(ipc, method, ...params);
|
|
891
928
|
},
|
|
892
929
|
invokeAndTransfer(method, ...params) {
|
|
893
|
-
return invokeAndTransfer$
|
|
930
|
+
return invokeAndTransfer$3(ipc, method, ...params);
|
|
894
931
|
},
|
|
895
932
|
async dispose() {
|
|
896
933
|
await ipc?.dispose();
|
|
@@ -928,7 +965,7 @@ const listen$1 = async (module, options) => {
|
|
|
928
965
|
const ipc = module.wrap(rawIpc);
|
|
929
966
|
return ipc;
|
|
930
967
|
};
|
|
931
|
-
const create$
|
|
968
|
+
const create$5 = async ({
|
|
932
969
|
commandMap,
|
|
933
970
|
messagePort
|
|
934
971
|
}) => {
|
|
@@ -944,11 +981,20 @@ const create$2 = async ({
|
|
|
944
981
|
messagePort.start();
|
|
945
982
|
return rpc;
|
|
946
983
|
};
|
|
984
|
+
const create$4 = async ({
|
|
985
|
+
commandMap,
|
|
986
|
+
messagePort
|
|
987
|
+
}) => {
|
|
988
|
+
return create$5({
|
|
989
|
+
commandMap,
|
|
990
|
+
messagePort
|
|
991
|
+
});
|
|
992
|
+
};
|
|
947
993
|
const PlainMessagePortRpcParent = {
|
|
948
994
|
__proto__: null,
|
|
949
|
-
create: create$
|
|
995
|
+
create: create$4
|
|
950
996
|
};
|
|
951
|
-
const create$
|
|
997
|
+
const create$2 = async ({
|
|
952
998
|
commandMap
|
|
953
999
|
}) => {
|
|
954
1000
|
// TODO create a commandMap per rpc instance
|
|
@@ -960,11 +1006,35 @@ const create$1 = async ({
|
|
|
960
1006
|
};
|
|
961
1007
|
const WebWorkerRpcClient = {
|
|
962
1008
|
__proto__: null,
|
|
963
|
-
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;
|
|
964
1029
|
};
|
|
965
1030
|
|
|
966
|
-
const
|
|
1031
|
+
const toCommandId = key => {
|
|
1032
|
+
const dotIndex = key.indexOf('.');
|
|
1033
|
+
return key.slice(dotIndex + 1);
|
|
1034
|
+
};
|
|
1035
|
+
const create$1 = () => {
|
|
967
1036
|
const states = Object.create(null);
|
|
1037
|
+
const commandMapRef = {};
|
|
968
1038
|
return {
|
|
969
1039
|
get(uid) {
|
|
970
1040
|
return states[uid];
|
|
@@ -1005,6 +1075,15 @@ const create = () => {
|
|
|
1005
1075
|
};
|
|
1006
1076
|
return wrapped;
|
|
1007
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
|
+
},
|
|
1008
1087
|
diff(uid, modules, numbers) {
|
|
1009
1088
|
const {
|
|
1010
1089
|
oldState,
|
|
@@ -1018,15 +1097,25 @@ const create = () => {
|
|
|
1018
1097
|
}
|
|
1019
1098
|
}
|
|
1020
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);
|
|
1021
1108
|
}
|
|
1022
1109
|
};
|
|
1023
1110
|
};
|
|
1024
1111
|
|
|
1025
1112
|
const {
|
|
1026
1113
|
get: get$2,
|
|
1027
|
-
set: set$
|
|
1028
|
-
wrapCommand
|
|
1029
|
-
|
|
1114
|
+
set: set$5,
|
|
1115
|
+
wrapCommand,
|
|
1116
|
+
getCommandIds,
|
|
1117
|
+
registerCommands
|
|
1118
|
+
} = create$1();
|
|
1030
1119
|
|
|
1031
1120
|
const create2 = (id, uri, x, y, width, height, workspacePath) => {
|
|
1032
1121
|
const state = {
|
|
@@ -1064,7 +1153,7 @@ const create2 = (id, uri, x, y, width, height, workspacePath) => {
|
|
|
1064
1153
|
x,
|
|
1065
1154
|
y
|
|
1066
1155
|
};
|
|
1067
|
-
set$
|
|
1156
|
+
set$5(id, state, state);
|
|
1068
1157
|
};
|
|
1069
1158
|
|
|
1070
1159
|
const RenderItems = 4;
|
|
@@ -1097,59 +1186,453 @@ const diff2 = uid => {
|
|
|
1097
1186
|
return result;
|
|
1098
1187
|
};
|
|
1099
1188
|
|
|
1100
|
-
const
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1189
|
+
const getInfo = uid => {
|
|
1190
|
+
const {
|
|
1191
|
+
newState
|
|
1192
|
+
} = get$2(uid);
|
|
1193
|
+
return newState.allGroups;
|
|
1104
1194
|
};
|
|
1105
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
|
+
|
|
1106
1213
|
const rpcs = Object.create(null);
|
|
1107
|
-
const set$
|
|
1214
|
+
const set$4 = (id, rpc) => {
|
|
1108
1215
|
rpcs[id] = rpc;
|
|
1109
1216
|
};
|
|
1110
1217
|
const get$1 = id => {
|
|
1111
1218
|
return rpcs[id];
|
|
1112
1219
|
};
|
|
1113
|
-
|
|
1114
|
-
const
|
|
1115
|
-
|
|
1116
|
-
|
|
1220
|
+
|
|
1221
|
+
const create = rpcId => {
|
|
1222
|
+
return {
|
|
1223
|
+
// @ts-ignore
|
|
1224
|
+
invoke(method, ...params) {
|
|
1225
|
+
const rpc = get$1(rpcId);
|
|
1226
|
+
// @ts-ignore
|
|
1227
|
+
return rpc.invoke(method, ...params);
|
|
1228
|
+
},
|
|
1229
|
+
// @ts-ignore
|
|
1230
|
+
invokeAndTransfer(method, ...params) {
|
|
1231
|
+
const rpc = get$1(rpcId);
|
|
1232
|
+
// @ts-ignore
|
|
1233
|
+
return rpc.invokeAndTransfer(method, ...params);
|
|
1234
|
+
},
|
|
1235
|
+
set(rpc) {
|
|
1236
|
+
set$4(rpcId, rpc);
|
|
1237
|
+
},
|
|
1238
|
+
async dispose() {
|
|
1239
|
+
const rpc = get$1(rpcId);
|
|
1240
|
+
await rpc.dispose();
|
|
1241
|
+
}
|
|
1242
|
+
};
|
|
1243
|
+
};
|
|
1244
|
+
|
|
1245
|
+
const {
|
|
1246
|
+
invoke: invoke$3,
|
|
1247
|
+
invokeAndTransfer: invokeAndTransfer$2,
|
|
1248
|
+
set: set$3,
|
|
1249
|
+
dispose: dispose$1
|
|
1250
|
+
} = create(ExtensionHostWorker);
|
|
1251
|
+
const executeReferenceProvider = async (id, offset) => {
|
|
1117
1252
|
// @ts-ignore
|
|
1118
|
-
return
|
|
1253
|
+
return invoke$3('ExtensionHostReference.executeReferenceProvider', id, offset);
|
|
1119
1254
|
};
|
|
1120
|
-
const
|
|
1121
|
-
const rpc = get$1(RendererWorker$1);
|
|
1255
|
+
const executeFileReferenceProvider = async id => {
|
|
1122
1256
|
// @ts-ignore
|
|
1123
|
-
return
|
|
1257
|
+
return invoke$3('ExtensionHostReference.executeFileReferenceProvider', id);
|
|
1124
1258
|
};
|
|
1125
|
-
const
|
|
1126
|
-
|
|
1259
|
+
const getRuntimeStatus = async extensionId => {
|
|
1260
|
+
// @ts-ignore
|
|
1261
|
+
return invoke$3('ExtensionHost.getRuntimeStatus', extensionId);
|
|
1127
1262
|
};
|
|
1128
|
-
const
|
|
1263
|
+
const registerMockRpc$1 = commandMap => {
|
|
1264
|
+
const mockRpc = createMockRpc({
|
|
1265
|
+
commandMap
|
|
1266
|
+
});
|
|
1267
|
+
set$3(mockRpc);
|
|
1268
|
+
return mockRpc;
|
|
1269
|
+
};
|
|
1270
|
+
|
|
1271
|
+
const ExtensionHost = {
|
|
1129
1272
|
__proto__: null,
|
|
1130
|
-
|
|
1273
|
+
dispose: dispose$1,
|
|
1274
|
+
executeFileReferenceProvider,
|
|
1275
|
+
executeReferenceProvider,
|
|
1276
|
+
getRuntimeStatus,
|
|
1277
|
+
invoke: invoke$3,
|
|
1131
1278
|
invokeAndTransfer: invokeAndTransfer$2,
|
|
1132
|
-
|
|
1279
|
+
registerMockRpc: registerMockRpc$1,
|
|
1280
|
+
set: set$3
|
|
1281
|
+
};
|
|
1282
|
+
|
|
1283
|
+
const {
|
|
1284
|
+
invoke: invoke$2,
|
|
1285
|
+
invokeAndTransfer: invokeAndTransfer$1,
|
|
1286
|
+
set: set$2,
|
|
1287
|
+
dispose
|
|
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);
|
|
1133
1294
|
};
|
|
1134
|
-
const
|
|
1135
|
-
|
|
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 => {
|
|
1136
1305
|
// @ts-ignore
|
|
1137
|
-
return
|
|
1306
|
+
return invoke$2(/* ColorTheme.setColorTheme */'ColorTheme.setColorTheme', /* colorThemeId */id);
|
|
1138
1307
|
};
|
|
1139
|
-
const
|
|
1140
|
-
|
|
1308
|
+
const getNodeVersion = async () => {
|
|
1309
|
+
return invoke$2('Process.getNodeVersion');
|
|
1141
1310
|
};
|
|
1142
|
-
const
|
|
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
|
+
|
|
1552
|
+
const RendererWorker = {
|
|
1143
1553
|
__proto__: null,
|
|
1144
|
-
|
|
1145
|
-
|
|
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,
|
|
1591
|
+
invoke: invoke$2,
|
|
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
|
|
1146
1630
|
};
|
|
1147
1631
|
|
|
1148
1632
|
const {
|
|
1149
1633
|
invoke: invoke$1,
|
|
1150
1634
|
invokeAndTransfer,
|
|
1151
|
-
set: set$1
|
|
1152
|
-
} = RendererWorker;
|
|
1635
|
+
set: set$1} = RendererWorker;
|
|
1153
1636
|
|
|
1154
1637
|
const activateByEvent = event => {
|
|
1155
1638
|
return invoke$1('ExtensionHostManagement.activateByEvent', event);
|
|
@@ -1157,8 +1640,7 @@ const activateByEvent = event => {
|
|
|
1157
1640
|
|
|
1158
1641
|
const {
|
|
1159
1642
|
invoke,
|
|
1160
|
-
set
|
|
1161
|
-
} = ExtensionHost;
|
|
1643
|
+
set} = ExtensionHost;
|
|
1162
1644
|
|
|
1163
1645
|
const executeProvider = async ({
|
|
1164
1646
|
event,
|
|
@@ -1797,8 +2279,6 @@ const getPortTuple = () => {
|
|
|
1797
2279
|
};
|
|
1798
2280
|
};
|
|
1799
2281
|
|
|
1800
|
-
const SourceControlWorker = 66;
|
|
1801
|
-
|
|
1802
2282
|
const sendMessagePortToExtensionHostWorker = async port => {
|
|
1803
2283
|
const command = 'HandleMessagePort.handleMessagePort2';
|
|
1804
2284
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker', port, command, SourceControlWorker);
|
|
@@ -1826,6 +2306,18 @@ const initialize = async () => {
|
|
|
1826
2306
|
set(extensionHostRpc);
|
|
1827
2307
|
};
|
|
1828
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
|
+
|
|
1829
2321
|
const Actions = 'Actions';
|
|
1830
2322
|
const SourceControlButtons = 'SourceControlButtons';
|
|
1831
2323
|
const Grow = 'Grow';
|
|
@@ -1852,7 +2344,7 @@ const SplitButtonDropDown = 'SplitButtonDropDown';
|
|
|
1852
2344
|
const SplitButtonDropDownDisabled = 'SplitButtonDropDownDisabled';
|
|
1853
2345
|
const SplitButtonSeparator = 'SplitButtonSeparator';
|
|
1854
2346
|
const StrikeThrough = 'StrikeThrough';
|
|
1855
|
-
const TreeItem
|
|
2347
|
+
const TreeItem = 'TreeItem';
|
|
1856
2348
|
const Viewlet = 'Viewlet';
|
|
1857
2349
|
|
|
1858
2350
|
const HandleClickAt = 'handleClickAt';
|
|
@@ -1889,12 +2381,6 @@ const sourceControlInput = () => {
|
|
|
1889
2381
|
return i18nString(SourceControlInput);
|
|
1890
2382
|
};
|
|
1891
2383
|
|
|
1892
|
-
const Button$1 = 1;
|
|
1893
|
-
const Div = 4;
|
|
1894
|
-
const Input = 6;
|
|
1895
|
-
const Span = 8;
|
|
1896
|
-
const Img = 17;
|
|
1897
|
-
|
|
1898
2384
|
const getSourceControlHeaderVirtualDom = () => {
|
|
1899
2385
|
return [{
|
|
1900
2386
|
type: Div,
|
|
@@ -1915,23 +2401,6 @@ const getSourceControlHeaderVirtualDom = () => {
|
|
|
1915
2401
|
}];
|
|
1916
2402
|
};
|
|
1917
2403
|
|
|
1918
|
-
const None = 'none';
|
|
1919
|
-
const ToolBar = 'toolbar';
|
|
1920
|
-
const Tree = 'tree';
|
|
1921
|
-
const TreeItem = 'treeitem';
|
|
1922
|
-
|
|
1923
|
-
const mergeClassNames = (...classNames) => {
|
|
1924
|
-
return classNames.filter(Boolean).join(' ');
|
|
1925
|
-
};
|
|
1926
|
-
const Text = 12;
|
|
1927
|
-
const text = data => {
|
|
1928
|
-
return {
|
|
1929
|
-
type: Text,
|
|
1930
|
-
text: data,
|
|
1931
|
-
childCount: 0
|
|
1932
|
-
};
|
|
1933
|
-
};
|
|
1934
|
-
|
|
1935
2404
|
const getBadgeVirtualDom = (className, count) => {
|
|
1936
2405
|
return [{
|
|
1937
2406
|
type: Div,
|
|
@@ -2002,8 +2471,8 @@ const createItemDirectory = item => {
|
|
|
2002
2471
|
const hasButtons = buttons.length;
|
|
2003
2472
|
return [{
|
|
2004
2473
|
type: Div,
|
|
2005
|
-
className: TreeItem
|
|
2006
|
-
role: TreeItem,
|
|
2474
|
+
className: TreeItem,
|
|
2475
|
+
role: TreeItem$1,
|
|
2007
2476
|
ariaExpanded: type === DirectoryExpanded,
|
|
2008
2477
|
ariaPosInSet: posInSet,
|
|
2009
2478
|
ariaSetSize: setSize,
|
|
@@ -2062,8 +2531,8 @@ const createItemOther = item => {
|
|
|
2062
2531
|
const buttonsDom = getButtonsVirtualDom(buttons);
|
|
2063
2532
|
dom.push({
|
|
2064
2533
|
type: Div,
|
|
2065
|
-
className: TreeItem
|
|
2066
|
-
role: TreeItem,
|
|
2534
|
+
className: TreeItem,
|
|
2535
|
+
role: TreeItem$1,
|
|
2067
2536
|
ariaPosInSet: posInSet,
|
|
2068
2537
|
ariaSetSize: setSize,
|
|
2069
2538
|
title: file,
|
|
@@ -2194,7 +2663,7 @@ const render2 = (uid, diffResult) => {
|
|
|
2194
2663
|
oldState,
|
|
2195
2664
|
newState
|
|
2196
2665
|
} = get$2(uid);
|
|
2197
|
-
set$
|
|
2666
|
+
set$5(uid, newState, newState);
|
|
2198
2667
|
const commands = applyRender(oldState, newState, diffResult);
|
|
2199
2668
|
return commands;
|
|
2200
2669
|
};
|
|
@@ -2337,10 +2806,12 @@ const commandMap = {
|
|
|
2337
2806
|
'SourceControl.selectIndex': wrapCommand(selectIndex),
|
|
2338
2807
|
'SourceControl.setDeltaY': wrapCommand(setDeltaY),
|
|
2339
2808
|
'SourceControl.terminate': terminate,
|
|
2340
|
-
'SourceControl.updateIcons': wrapCommand(updateIcons)
|
|
2809
|
+
'SourceControl.updateIcons': wrapCommand(updateIcons),
|
|
2810
|
+
'SourceControl.getInfo': getInfo
|
|
2341
2811
|
};
|
|
2342
2812
|
|
|
2343
2813
|
const listen = async () => {
|
|
2814
|
+
registerCommands(commandMap);
|
|
2344
2815
|
const rpc = await WebWorkerRpcClient.create({
|
|
2345
2816
|
commandMap: commandMap
|
|
2346
2817
|
});
|