@lvce-editor/text-search-worker 3.14.0 → 3.16.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/textSearchWorkerMain.js +340 -343
- package/package.json +1 -1
|
@@ -6,17 +6,17 @@ const create$4$1 = (method, params) => {
|
|
|
6
6
|
params
|
|
7
7
|
};
|
|
8
8
|
};
|
|
9
|
-
const state$
|
|
9
|
+
const state$4 = {
|
|
10
10
|
callbacks: Object.create(null)
|
|
11
11
|
};
|
|
12
12
|
const set$1 = (id, fn) => {
|
|
13
|
-
state$
|
|
13
|
+
state$4.callbacks[id] = fn;
|
|
14
14
|
};
|
|
15
15
|
const get$1 = id => {
|
|
16
|
-
return state$
|
|
16
|
+
return state$4.callbacks[id];
|
|
17
17
|
};
|
|
18
18
|
const remove$1 = id => {
|
|
19
|
-
delete state$
|
|
19
|
+
delete state$4.callbacks[id];
|
|
20
20
|
};
|
|
21
21
|
let id = 0;
|
|
22
22
|
const create$3$1 = () => {
|
|
@@ -47,7 +47,7 @@ const resolve = (id, response) => {
|
|
|
47
47
|
fn(response);
|
|
48
48
|
remove$1(id);
|
|
49
49
|
};
|
|
50
|
-
const create$2$
|
|
50
|
+
const create$2$2 = (method, params) => {
|
|
51
51
|
const {
|
|
52
52
|
id,
|
|
53
53
|
promise
|
|
@@ -237,7 +237,7 @@ const getErrorResponse = (message, error, preparePrettyError, logError) => {
|
|
|
237
237
|
const errorProperty = getErrorProperty(error, prettyError);
|
|
238
238
|
return create$1$2(message, errorProperty);
|
|
239
239
|
};
|
|
240
|
-
const create$
|
|
240
|
+
const create$5 = (message, result) => {
|
|
241
241
|
return {
|
|
242
242
|
jsonrpc: Two,
|
|
243
243
|
id: message.id,
|
|
@@ -246,7 +246,7 @@ const create$6 = (message, result) => {
|
|
|
246
246
|
};
|
|
247
247
|
const getSuccessResponse = (message, result) => {
|
|
248
248
|
const resultProperty = result ?? null;
|
|
249
|
-
return create$
|
|
249
|
+
return create$5(message, resultProperty);
|
|
250
250
|
};
|
|
251
251
|
const getResponse = async (message, ipc, execute, preparePrettyError, logError, requiresSocket) => {
|
|
252
252
|
try {
|
|
@@ -326,7 +326,7 @@ const invokeHelper = async (ipc, method, params, useSendAndTransfer) => {
|
|
|
326
326
|
const {
|
|
327
327
|
message,
|
|
328
328
|
promise
|
|
329
|
-
} = create$2$
|
|
329
|
+
} = create$2$2(method, params);
|
|
330
330
|
if (useSendAndTransfer && ipc.sendAndTransfer) {
|
|
331
331
|
ipc.sendAndTransfer(message);
|
|
332
332
|
} else {
|
|
@@ -339,7 +339,7 @@ const send = (transport, method, ...params) => {
|
|
|
339
339
|
const message = create$4$1(method, params);
|
|
340
340
|
transport.send(message);
|
|
341
341
|
};
|
|
342
|
-
const invoke$
|
|
342
|
+
const invoke$3 = (ipc, method, ...params) => {
|
|
343
343
|
return invokeHelper(ipc, method, params, false);
|
|
344
344
|
};
|
|
345
345
|
const invokeAndTransfer$1 = (ipc, method, ...params) => {
|
|
@@ -639,7 +639,7 @@ let VError$1 = class VError extends Error {
|
|
|
639
639
|
}
|
|
640
640
|
}
|
|
641
641
|
};
|
|
642
|
-
|
|
642
|
+
class IpcError extends VError$1 {
|
|
643
643
|
// @ts-ignore
|
|
644
644
|
constructor(betterMessage, stdout = '', stderr = '') {
|
|
645
645
|
if (stdout || stderr) {
|
|
@@ -664,7 +664,7 @@ let IpcError$1 = class IpcError extends VError$1 {
|
|
|
664
664
|
// @ts-ignore
|
|
665
665
|
this.stderr = stderr;
|
|
666
666
|
}
|
|
667
|
-
}
|
|
667
|
+
}
|
|
668
668
|
const withResolvers = () => {
|
|
669
669
|
let _resolve;
|
|
670
670
|
const promise = new Promise(resolve => {
|
|
@@ -693,7 +693,7 @@ const listen$1$1 = async () => {
|
|
|
693
693
|
const parentIpc = wrap$5(parentIpcRaw);
|
|
694
694
|
const firstMessage = await waitForFirstMessage(parentIpc);
|
|
695
695
|
if (firstMessage.method !== 'initialize') {
|
|
696
|
-
throw new IpcError
|
|
696
|
+
throw new IpcError('unexpected first message');
|
|
697
697
|
}
|
|
698
698
|
const type = firstMessage.params[0];
|
|
699
699
|
if (type === 'message-port') {
|
|
@@ -743,6 +743,156 @@ const IpcChildWithModuleWorkerAndMessagePort$1 = {
|
|
|
743
743
|
listen: listen$1$1,
|
|
744
744
|
wrap: wrap$4
|
|
745
745
|
};
|
|
746
|
+
const Message$1 = 3;
|
|
747
|
+
const addListener = (emitter, type, callback) => {
|
|
748
|
+
if ('addEventListener' in emitter) {
|
|
749
|
+
emitter.addEventListener(type, callback);
|
|
750
|
+
} else {
|
|
751
|
+
emitter.on(type, callback);
|
|
752
|
+
}
|
|
753
|
+
};
|
|
754
|
+
const removeListener = (emitter, type, callback) => {
|
|
755
|
+
if ('removeEventListener' in emitter) {
|
|
756
|
+
emitter.removeEventListener(type, callback);
|
|
757
|
+
} else {
|
|
758
|
+
emitter.off(type, callback);
|
|
759
|
+
}
|
|
760
|
+
};
|
|
761
|
+
const getFirstEvent = (eventEmitter, eventMap) => {
|
|
762
|
+
const {
|
|
763
|
+
resolve,
|
|
764
|
+
promise
|
|
765
|
+
} = withResolvers();
|
|
766
|
+
const listenerMap = Object.create(null);
|
|
767
|
+
const cleanup = value => {
|
|
768
|
+
for (const event of Object.keys(eventMap)) {
|
|
769
|
+
removeListener(eventEmitter, event, listenerMap[event]);
|
|
770
|
+
}
|
|
771
|
+
resolve(value);
|
|
772
|
+
};
|
|
773
|
+
for (const [event, type] of Object.entries(eventMap)) {
|
|
774
|
+
const listener = event => {
|
|
775
|
+
cleanup({
|
|
776
|
+
type,
|
|
777
|
+
event
|
|
778
|
+
});
|
|
779
|
+
};
|
|
780
|
+
addListener(eventEmitter, event, listener);
|
|
781
|
+
listenerMap[event] = listener;
|
|
782
|
+
}
|
|
783
|
+
return promise;
|
|
784
|
+
};
|
|
785
|
+
const create$2$1 = async ({
|
|
786
|
+
messagePort,
|
|
787
|
+
isMessagePortOpen
|
|
788
|
+
}) => {
|
|
789
|
+
if (!isMessagePort(messagePort)) {
|
|
790
|
+
throw new IpcError('port must be of type MessagePort');
|
|
791
|
+
}
|
|
792
|
+
if (isMessagePortOpen) {
|
|
793
|
+
return messagePort;
|
|
794
|
+
}
|
|
795
|
+
const eventPromise = getFirstEvent(messagePort, {
|
|
796
|
+
message: Message$1
|
|
797
|
+
});
|
|
798
|
+
messagePort.start();
|
|
799
|
+
const event = await eventPromise;
|
|
800
|
+
// @ts-ignore
|
|
801
|
+
if (event.data !== readyMessage) {
|
|
802
|
+
throw new IpcError('unexpected first message');
|
|
803
|
+
}
|
|
804
|
+
return messagePort;
|
|
805
|
+
};
|
|
806
|
+
const signal = messagePort => {
|
|
807
|
+
messagePort.start();
|
|
808
|
+
};
|
|
809
|
+
class IpcParentWithMessagePort extends Ipc {
|
|
810
|
+
constructor(port) {
|
|
811
|
+
super(port);
|
|
812
|
+
}
|
|
813
|
+
getData = getData$1;
|
|
814
|
+
send(message) {
|
|
815
|
+
this._rawIpc.postMessage(message);
|
|
816
|
+
}
|
|
817
|
+
sendAndTransfer(message) {
|
|
818
|
+
throw new Error('not implemented');
|
|
819
|
+
}
|
|
820
|
+
dispose() {
|
|
821
|
+
this._rawIpc.close();
|
|
822
|
+
}
|
|
823
|
+
onMessage(callback) {
|
|
824
|
+
this._rawIpc.addEventListener('message', callback);
|
|
825
|
+
}
|
|
826
|
+
onClose(callback) {}
|
|
827
|
+
}
|
|
828
|
+
const wrap$2 = messagePort => {
|
|
829
|
+
return new IpcParentWithMessagePort(messagePort);
|
|
830
|
+
};
|
|
831
|
+
const IpcParentWithMessagePort$1 = {
|
|
832
|
+
__proto__: null,
|
|
833
|
+
create: create$2$1,
|
|
834
|
+
signal,
|
|
835
|
+
wrap: wrap$2
|
|
836
|
+
};
|
|
837
|
+
const Open = 1;
|
|
838
|
+
const Close = 2;
|
|
839
|
+
const stringifyCompact = value => {
|
|
840
|
+
return JSON.stringify(value);
|
|
841
|
+
};
|
|
842
|
+
const parse = content => {
|
|
843
|
+
if (content === 'undefined') {
|
|
844
|
+
return null;
|
|
845
|
+
}
|
|
846
|
+
try {
|
|
847
|
+
return JSON.parse(content);
|
|
848
|
+
} catch (error) {
|
|
849
|
+
throw new VError$1(error, 'failed to parse json');
|
|
850
|
+
}
|
|
851
|
+
};
|
|
852
|
+
const waitForWebSocketToBeOpen = webSocket => {
|
|
853
|
+
return getFirstEvent(webSocket, {
|
|
854
|
+
open: Open,
|
|
855
|
+
close: Close
|
|
856
|
+
});
|
|
857
|
+
};
|
|
858
|
+
const create$4 = async ({
|
|
859
|
+
webSocket
|
|
860
|
+
}) => {
|
|
861
|
+
const firstWebSocketEvent = await waitForWebSocketToBeOpen(webSocket);
|
|
862
|
+
// @ts-ignore
|
|
863
|
+
if (firstWebSocketEvent.type === Close) {
|
|
864
|
+
throw new IpcError('Websocket connection was immediately closed');
|
|
865
|
+
}
|
|
866
|
+
return webSocket;
|
|
867
|
+
};
|
|
868
|
+
class IpcParentWithWebSocket extends Ipc {
|
|
869
|
+
getData(event) {
|
|
870
|
+
return parse(event.data);
|
|
871
|
+
}
|
|
872
|
+
send(message) {
|
|
873
|
+
this._rawIpc.send(stringifyCompact(message));
|
|
874
|
+
}
|
|
875
|
+
sendAndTransfer(message) {
|
|
876
|
+
throw new Error('sendAndTransfer not supported');
|
|
877
|
+
}
|
|
878
|
+
dispose() {
|
|
879
|
+
this._rawIpc.close();
|
|
880
|
+
}
|
|
881
|
+
onClose(callback) {
|
|
882
|
+
this._rawIpc.addEventListener('close', callback);
|
|
883
|
+
}
|
|
884
|
+
onMessage(callback) {
|
|
885
|
+
this._rawIpc.addEventListener('message', callback);
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
const wrap$1 = webSocket => {
|
|
889
|
+
return new IpcParentWithWebSocket(webSocket);
|
|
890
|
+
};
|
|
891
|
+
const IpcParentWithWebSocket$1 = {
|
|
892
|
+
__proto__: null,
|
|
893
|
+
create: create$4,
|
|
894
|
+
wrap: wrap$1
|
|
895
|
+
};
|
|
746
896
|
|
|
747
897
|
const createRpc = ipc => {
|
|
748
898
|
const rpc = {
|
|
@@ -753,7 +903,7 @@ const createRpc = ipc => {
|
|
|
753
903
|
send(ipc, method, ...params);
|
|
754
904
|
},
|
|
755
905
|
invoke(method, ...params) {
|
|
756
|
-
return invoke$
|
|
906
|
+
return invoke$3(ipc, method, ...params);
|
|
757
907
|
},
|
|
758
908
|
invokeAndTransfer(method, ...params) {
|
|
759
909
|
return invokeAndTransfer$1(ipc, method, ...params);
|
|
@@ -776,6 +926,44 @@ const handleMessage = event => {
|
|
|
776
926
|
const handleIpc = ipc => {
|
|
777
927
|
ipc.addEventListener('message', handleMessage);
|
|
778
928
|
};
|
|
929
|
+
const create$2 = async ({
|
|
930
|
+
commandMap,
|
|
931
|
+
messagePort,
|
|
932
|
+
isMessagePortOpen
|
|
933
|
+
}) => {
|
|
934
|
+
// TODO create a commandMap per rpc instance
|
|
935
|
+
register(commandMap);
|
|
936
|
+
const rawIpc = await IpcParentWithMessagePort$1.create({
|
|
937
|
+
messagePort,
|
|
938
|
+
isMessagePortOpen
|
|
939
|
+
});
|
|
940
|
+
const ipc = IpcParentWithMessagePort$1.wrap(rawIpc);
|
|
941
|
+
handleIpc(ipc);
|
|
942
|
+
const rpc = createRpc(ipc);
|
|
943
|
+
return rpc;
|
|
944
|
+
};
|
|
945
|
+
const MessagePortRpcParent = {
|
|
946
|
+
__proto__: null,
|
|
947
|
+
create: create$2
|
|
948
|
+
};
|
|
949
|
+
const create$1$1 = async ({
|
|
950
|
+
commandMap,
|
|
951
|
+
webSocket
|
|
952
|
+
}) => {
|
|
953
|
+
// TODO create a commandMap per rpc instance
|
|
954
|
+
register(commandMap);
|
|
955
|
+
const rawIpc = await IpcParentWithWebSocket$1.create({
|
|
956
|
+
webSocket
|
|
957
|
+
});
|
|
958
|
+
const ipc = IpcParentWithWebSocket$1.wrap(rawIpc);
|
|
959
|
+
handleIpc(ipc);
|
|
960
|
+
const rpc = createRpc(ipc);
|
|
961
|
+
return rpc;
|
|
962
|
+
};
|
|
963
|
+
const WebSocketRpcParent = {
|
|
964
|
+
__proto__: null,
|
|
965
|
+
create: create$1$1
|
|
966
|
+
};
|
|
779
967
|
|
|
780
968
|
// @ts-ignore
|
|
781
969
|
const listen$1 = async () => {
|
|
@@ -784,7 +972,7 @@ const listen$1 = async () => {
|
|
|
784
972
|
const ipc = module.wrap(rawIpc);
|
|
785
973
|
return ipc;
|
|
786
974
|
};
|
|
787
|
-
const create$
|
|
975
|
+
const create$3 = async ({
|
|
788
976
|
commandMap
|
|
789
977
|
}) => {
|
|
790
978
|
// TODO create a commandMap per rpc instance
|
|
@@ -796,7 +984,7 @@ const create$1$1 = async ({
|
|
|
796
984
|
};
|
|
797
985
|
const WebWorkerRpcClient = {
|
|
798
986
|
__proto__: null,
|
|
799
|
-
create: create$
|
|
987
|
+
create: create$3
|
|
800
988
|
};
|
|
801
989
|
|
|
802
990
|
const Empty$1 = 0;
|
|
@@ -832,21 +1020,21 @@ const clearSearchResults$1 = state => {
|
|
|
832
1020
|
};
|
|
833
1021
|
};
|
|
834
1022
|
|
|
835
|
-
const state$
|
|
1023
|
+
const state$3 = {
|
|
836
1024
|
rpc: undefined
|
|
837
1025
|
};
|
|
838
|
-
const invoke$
|
|
839
|
-
const rpc = state$
|
|
1026
|
+
const invoke$2 = (method, ...params) => {
|
|
1027
|
+
const rpc = state$3.rpc;
|
|
840
1028
|
// @ts-ignore
|
|
841
1029
|
return rpc.invoke(method, ...params);
|
|
842
1030
|
};
|
|
843
1031
|
const invokeAndTransfer = (method, ...params) => {
|
|
844
|
-
const rpc = state$
|
|
1032
|
+
const rpc = state$3.rpc;
|
|
845
1033
|
// @ts-ignore
|
|
846
1034
|
return rpc.invokeAndTransfer(method, ...params);
|
|
847
1035
|
};
|
|
848
1036
|
const setRpc = rpc => {
|
|
849
|
-
state$
|
|
1037
|
+
state$3.rpc = rpc;
|
|
850
1038
|
};
|
|
851
1039
|
|
|
852
1040
|
const copy = async state => {
|
|
@@ -858,7 +1046,7 @@ const copy = async state => {
|
|
|
858
1046
|
return state;
|
|
859
1047
|
}
|
|
860
1048
|
const item = items[listFocusedIndex];
|
|
861
|
-
await invoke$
|
|
1049
|
+
await invoke$2('ClipBoard.writeText', item.text);
|
|
862
1050
|
return state;
|
|
863
1051
|
};
|
|
864
1052
|
|
|
@@ -875,7 +1063,7 @@ const set = (uid, oldState, newState) => {
|
|
|
875
1063
|
};
|
|
876
1064
|
};
|
|
877
1065
|
|
|
878
|
-
const create$
|
|
1066
|
+
const create$1 = ({
|
|
879
1067
|
itemHeight,
|
|
880
1068
|
headerHeight = 0,
|
|
881
1069
|
minimumSliderSize = 20
|
|
@@ -899,7 +1087,7 @@ const create$5 = ({
|
|
|
899
1087
|
};
|
|
900
1088
|
};
|
|
901
1089
|
|
|
902
|
-
const create
|
|
1090
|
+
const create = (uid, x, y, width, height, workspacePath, assetDir, itemHeight, value = '', replacement = '', platform) => {
|
|
903
1091
|
const state = {
|
|
904
1092
|
uid,
|
|
905
1093
|
searchResults: [],
|
|
@@ -912,7 +1100,7 @@ const create$4 = (uid, x, y, width, height, workspacePath, assetDir, itemHeight,
|
|
|
912
1100
|
y,
|
|
913
1101
|
width,
|
|
914
1102
|
height,
|
|
915
|
-
...create$
|
|
1103
|
+
...create$1({
|
|
916
1104
|
itemHeight: itemHeight || 22,
|
|
917
1105
|
minimumSliderSize: minimumSliderSize,
|
|
918
1106
|
headerHeight: 61 // TODO
|
|
@@ -938,7 +1126,8 @@ const create$4 = (uid, x, y, width, height, workspacePath, assetDir, itemHeight,
|
|
|
938
1126
|
focusedIndex: -1,
|
|
939
1127
|
handleOffset: 0,
|
|
940
1128
|
focusSource: User,
|
|
941
|
-
flags: 0
|
|
1129
|
+
flags: 0,
|
|
1130
|
+
platform
|
|
942
1131
|
};
|
|
943
1132
|
set(uid, state, state);
|
|
944
1133
|
return state;
|
|
@@ -2138,7 +2327,7 @@ const getFileIcons = async files => {
|
|
|
2138
2327
|
if (file.type === Match) {
|
|
2139
2328
|
continue;
|
|
2140
2329
|
}
|
|
2141
|
-
promises.push(invoke$
|
|
2330
|
+
promises.push(invoke$2('IconTheme.getFileIcon', {
|
|
2142
2331
|
name: file.text
|
|
2143
2332
|
}));
|
|
2144
2333
|
}
|
|
@@ -2266,7 +2455,7 @@ const string = value => {
|
|
|
2266
2455
|
};
|
|
2267
2456
|
|
|
2268
2457
|
const RE_PROTOCOL = /^([a-z-\d]+):\/\//;
|
|
2269
|
-
const getProtocol = uri => {
|
|
2458
|
+
const getProtocol$1 = uri => {
|
|
2270
2459
|
const protocolMatch = uri.match(RE_PROTOCOL);
|
|
2271
2460
|
if (protocolMatch) {
|
|
2272
2461
|
return protocolMatch[1];
|
|
@@ -2277,7 +2466,7 @@ const getProtocol = uri => {
|
|
|
2277
2466
|
const textSearch$5 = async (scheme, root, query) => {
|
|
2278
2467
|
string(scheme);
|
|
2279
2468
|
string(query);
|
|
2280
|
-
const result = await invoke$
|
|
2469
|
+
const result = await invoke$2('ExtensionHostTextSearch.executeTextSearchProvider', scheme, query);
|
|
2281
2470
|
return result;
|
|
2282
2471
|
};
|
|
2283
2472
|
|
|
@@ -2468,7 +2657,7 @@ function promisifyRequest(request) {
|
|
|
2468
2657
|
request.removeEventListener('error', error);
|
|
2469
2658
|
};
|
|
2470
2659
|
const success = () => {
|
|
2471
|
-
resolve(wrap
|
|
2660
|
+
resolve(wrap(request.result));
|
|
2472
2661
|
unlisten();
|
|
2473
2662
|
};
|
|
2474
2663
|
const error = () => {
|
|
@@ -2518,7 +2707,7 @@ let idbProxyTraps = {
|
|
|
2518
2707
|
}
|
|
2519
2708
|
}
|
|
2520
2709
|
// Else transform whatever we get back.
|
|
2521
|
-
return wrap
|
|
2710
|
+
return wrap(target[prop]);
|
|
2522
2711
|
},
|
|
2523
2712
|
set(target, prop, value) {
|
|
2524
2713
|
target[prop] = value;
|
|
@@ -2547,13 +2736,13 @@ function wrapFunction(func) {
|
|
|
2547
2736
|
// Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use
|
|
2548
2737
|
// the original object.
|
|
2549
2738
|
func.apply(unwrap(this), args);
|
|
2550
|
-
return wrap
|
|
2739
|
+
return wrap(this.request);
|
|
2551
2740
|
};
|
|
2552
2741
|
}
|
|
2553
2742
|
return function (...args) {
|
|
2554
2743
|
// Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use
|
|
2555
2744
|
// the original object.
|
|
2556
|
-
return wrap
|
|
2745
|
+
return wrap(func.apply(unwrap(this), args));
|
|
2557
2746
|
};
|
|
2558
2747
|
}
|
|
2559
2748
|
function transformCachableValue(value) {
|
|
@@ -2565,7 +2754,7 @@ function transformCachableValue(value) {
|
|
|
2565
2754
|
// Return the same value back if we're not going to transform it.
|
|
2566
2755
|
return value;
|
|
2567
2756
|
}
|
|
2568
|
-
function wrap
|
|
2757
|
+
function wrap(value) {
|
|
2569
2758
|
// We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because
|
|
2570
2759
|
// IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.
|
|
2571
2760
|
if (value instanceof IDBRequest) return promisifyRequest(value);
|
|
@@ -2597,10 +2786,10 @@ function openDB(name, version, {
|
|
|
2597
2786
|
terminated
|
|
2598
2787
|
} = {}) {
|
|
2599
2788
|
const request = indexedDB.open(name, version);
|
|
2600
|
-
const openPromise = wrap
|
|
2789
|
+
const openPromise = wrap(request);
|
|
2601
2790
|
if (upgrade) {
|
|
2602
2791
|
request.addEventListener('upgradeneeded', event => {
|
|
2603
|
-
upgrade(wrap
|
|
2792
|
+
upgrade(wrap(request.result), event.oldVersion, event.newVersion, wrap(request.transaction), event);
|
|
2604
2793
|
});
|
|
2605
2794
|
}
|
|
2606
2795
|
if (blocked) {
|
|
@@ -2701,7 +2890,7 @@ replaceTraps(oldTraps => ({
|
|
|
2701
2890
|
}
|
|
2702
2891
|
}));
|
|
2703
2892
|
|
|
2704
|
-
const state = {
|
|
2893
|
+
const state$2 = {
|
|
2705
2894
|
databases: Object.create(null),
|
|
2706
2895
|
eventId: 0,
|
|
2707
2896
|
dbVersion: 1,
|
|
@@ -2712,7 +2901,7 @@ const state = {
|
|
|
2712
2901
|
|
|
2713
2902
|
const getHandleDb = async () => {
|
|
2714
2903
|
// @ts-ignore
|
|
2715
|
-
const db = await openDB('handle', state.dbVersion, {
|
|
2904
|
+
const db = await openDB('handle', state$2.dbVersion, {
|
|
2716
2905
|
async upgrade(db) {
|
|
2717
2906
|
if (!db.objectStoreNames.contains('file-handles-store')) {
|
|
2718
2907
|
await db.createObjectStore('file-handles-store', {});
|
|
@@ -2830,11 +3019,101 @@ const getRipGrepArgs = ({
|
|
|
2830
3019
|
return ripGrepArgs;
|
|
2831
3020
|
};
|
|
2832
3021
|
|
|
2833
|
-
const
|
|
2834
|
-
|
|
3022
|
+
const Electron = 2;
|
|
3023
|
+
const Remote = 3;
|
|
3024
|
+
|
|
3025
|
+
const Https = 'https:';
|
|
3026
|
+
const Ws = 'ws:';
|
|
3027
|
+
const Wss = 'wss:';
|
|
3028
|
+
|
|
3029
|
+
const getWebSocketProtocol = locationProtocol => {
|
|
3030
|
+
return locationProtocol === Https ? Wss : Ws;
|
|
3031
|
+
};
|
|
3032
|
+
|
|
3033
|
+
const getWebSocketUrl = (type, host, locationProtocol) => {
|
|
3034
|
+
const wsProtocol = getWebSocketProtocol(locationProtocol);
|
|
3035
|
+
return `${wsProtocol}//${host}/websocket/${type}`;
|
|
3036
|
+
};
|
|
3037
|
+
|
|
3038
|
+
const getHost = () => {
|
|
3039
|
+
return location.host;
|
|
3040
|
+
};
|
|
3041
|
+
const getProtocol = () => {
|
|
3042
|
+
return location.protocol;
|
|
3043
|
+
};
|
|
3044
|
+
|
|
3045
|
+
const launchSearchProcess = async () => {
|
|
3046
|
+
const host = getHost();
|
|
3047
|
+
const protocol = getProtocol();
|
|
3048
|
+
const wsUrl = getWebSocketUrl('search-process', host, protocol);
|
|
3049
|
+
const webSocket = new WebSocket(wsUrl);
|
|
3050
|
+
const rpc = await WebSocketRpcParent.create({
|
|
3051
|
+
webSocket,
|
|
3052
|
+
commandMap: {}
|
|
3053
|
+
});
|
|
3054
|
+
return rpc;
|
|
3055
|
+
};
|
|
3056
|
+
|
|
3057
|
+
const state$1 = {
|
|
3058
|
+
rpc: undefined
|
|
3059
|
+
};
|
|
3060
|
+
const getOrCreate$1 = () => {
|
|
3061
|
+
if (!state$1.rpc) {
|
|
3062
|
+
// @ts-ignore
|
|
3063
|
+
state$1.rpc = launchSearchProcess();
|
|
3064
|
+
}
|
|
3065
|
+
return state$1.rpc;
|
|
3066
|
+
};
|
|
3067
|
+
|
|
3068
|
+
const invoke$1 = async (method, ...params) => {
|
|
3069
|
+
const rpc = await getOrCreate$1();
|
|
3070
|
+
return rpc.invoke(method, ...params);
|
|
3071
|
+
};
|
|
3072
|
+
|
|
3073
|
+
const getPortTuple = () => {
|
|
3074
|
+
const {
|
|
3075
|
+
port1,
|
|
3076
|
+
port2
|
|
3077
|
+
} = new MessageChannel();
|
|
3078
|
+
return {
|
|
3079
|
+
port1,
|
|
3080
|
+
port2
|
|
3081
|
+
};
|
|
3082
|
+
};
|
|
3083
|
+
|
|
3084
|
+
const launchSearchProcessElectron = async () => {
|
|
3085
|
+
const {
|
|
3086
|
+
port1,
|
|
3087
|
+
port2
|
|
3088
|
+
} = getPortTuple();
|
|
3089
|
+
const rpcPromise = MessagePortRpcParent.create({
|
|
3090
|
+
messagePort: port2,
|
|
3091
|
+
commandMap: {},
|
|
3092
|
+
isMessagePortOpen: true
|
|
3093
|
+
});
|
|
3094
|
+
await invokeAndTransfer('SendMessagePortToElectron.sendMessagePortToElectron', port1, 'HandleMessagePortForSearchProcess.handleMessagePortForSearchProcess');
|
|
3095
|
+
port2.start();
|
|
3096
|
+
const rpc = await rpcPromise;
|
|
3097
|
+
return rpc;
|
|
3098
|
+
};
|
|
3099
|
+
|
|
3100
|
+
const state = {
|
|
3101
|
+
rpc: undefined
|
|
3102
|
+
};
|
|
3103
|
+
const getOrCreate = () => {
|
|
3104
|
+
if (!state.rpc) {
|
|
3105
|
+
// @ts-ignore
|
|
3106
|
+
state.rpc = launchSearchProcessElectron();
|
|
3107
|
+
}
|
|
3108
|
+
return state.rpc;
|
|
3109
|
+
};
|
|
3110
|
+
|
|
3111
|
+
const invoke = async (method, ...params) => {
|
|
3112
|
+
const rpc = await getOrCreate();
|
|
3113
|
+
return rpc.invoke(method, ...params);
|
|
2835
3114
|
};
|
|
2836
3115
|
|
|
2837
|
-
const textSearch$2 = async (scheme, root, query, options) => {
|
|
3116
|
+
const textSearch$2 = async (scheme, root, query, options, assetDir, platform) => {
|
|
2838
3117
|
const ripGrepArgs = getRipGrepArgs({
|
|
2839
3118
|
...options,
|
|
2840
3119
|
searchString: query
|
|
@@ -2843,9 +3122,18 @@ const textSearch$2 = async (scheme, root, query, options) => {
|
|
|
2843
3122
|
ripGrepArgs,
|
|
2844
3123
|
searchDir: root
|
|
2845
3124
|
};
|
|
2846
|
-
|
|
3125
|
+
if (platform === Remote) {
|
|
3126
|
+
const result = await invoke$1('TextSearch.search', actualOptions);
|
|
3127
|
+
// TODO api is weird
|
|
3128
|
+
return result.results;
|
|
3129
|
+
}
|
|
3130
|
+
if (platform === Electron) {
|
|
3131
|
+
const result = await invoke('TextSearch.search', actualOptions);
|
|
3132
|
+
return result.results;
|
|
3133
|
+
}
|
|
3134
|
+
const results = await invoke$2('SearchProcess.invoke', 'TextSearch.search', actualOptions);
|
|
2847
3135
|
// TODO api is weird
|
|
2848
|
-
return
|
|
3136
|
+
return results.results;
|
|
2849
3137
|
};
|
|
2850
3138
|
|
|
2851
3139
|
const textSearch$1 = (scheme, root, query) => {
|
|
@@ -2879,12 +3167,12 @@ const getProvider = scheme => {
|
|
|
2879
3167
|
}
|
|
2880
3168
|
};
|
|
2881
3169
|
|
|
2882
|
-
const textSearch = async (root, query, options, assetDir) => {
|
|
3170
|
+
const textSearch = async (root, query, options, assetDir, platform) => {
|
|
2883
3171
|
string(root);
|
|
2884
3172
|
string(query);
|
|
2885
|
-
const scheme = getProtocol(root);
|
|
3173
|
+
const scheme = getProtocol$1(root);
|
|
2886
3174
|
const provider = getProvider(scheme);
|
|
2887
|
-
const results = await provider(scheme, root, query, options, assetDir);
|
|
3175
|
+
const results = await provider(scheme, root, query, options, assetDir, platform);
|
|
2888
3176
|
return results;
|
|
2889
3177
|
};
|
|
2890
3178
|
|
|
@@ -2921,7 +3209,7 @@ const handleUpdate = async (state, update) => {
|
|
|
2921
3209
|
threads,
|
|
2922
3210
|
isCaseSensitive: hasMatchCase(flags),
|
|
2923
3211
|
useRegularExpression: hasUseRegularExpression(flags)
|
|
2924
|
-
}, state.assetDir);
|
|
3212
|
+
}, state.assetDir, state.platform);
|
|
2925
3213
|
if (!Array.isArray(results)) {
|
|
2926
3214
|
throw new TypeError('results must be of type array');
|
|
2927
3215
|
}
|
|
@@ -3036,296 +3324,6 @@ const handleSharedInput = (state, name, value, inputSource = Script) => {
|
|
|
3036
3324
|
return fn(state, value, inputSource);
|
|
3037
3325
|
};
|
|
3038
3326
|
|
|
3039
|
-
const NodeAlternate = 8;
|
|
3040
|
-
|
|
3041
|
-
const getData = event => {
|
|
3042
|
-
const {
|
|
3043
|
-
data
|
|
3044
|
-
} = event;
|
|
3045
|
-
return data;
|
|
3046
|
-
};
|
|
3047
|
-
|
|
3048
|
-
const getPortTuple = () => {
|
|
3049
|
-
const {
|
|
3050
|
-
port1,
|
|
3051
|
-
port2
|
|
3052
|
-
} = new MessageChannel();
|
|
3053
|
-
return {
|
|
3054
|
-
port1,
|
|
3055
|
-
port2
|
|
3056
|
-
};
|
|
3057
|
-
};
|
|
3058
|
-
|
|
3059
|
-
const Open = 1;
|
|
3060
|
-
const Close = 2;
|
|
3061
|
-
|
|
3062
|
-
const Https = 'https:';
|
|
3063
|
-
const Ws = 'ws:';
|
|
3064
|
-
const Wss = 'wss:';
|
|
3065
|
-
|
|
3066
|
-
const getWebSocketProtocol = () => {
|
|
3067
|
-
return location.protocol === Https ? Wss : Ws;
|
|
3068
|
-
};
|
|
3069
|
-
|
|
3070
|
-
const getWebSocketUrl = (type, host) => {
|
|
3071
|
-
const wsProtocol = getWebSocketProtocol();
|
|
3072
|
-
return `${wsProtocol}//${host}/websocket/${type}`;
|
|
3073
|
-
};
|
|
3074
|
-
|
|
3075
|
-
class IpcError extends Error {
|
|
3076
|
-
constructor(message) {
|
|
3077
|
-
super(message);
|
|
3078
|
-
this.name = 'IpcError';
|
|
3079
|
-
}
|
|
3080
|
-
}
|
|
3081
|
-
|
|
3082
|
-
const stringifyCompact = value => {
|
|
3083
|
-
return JSON.stringify(value);
|
|
3084
|
-
};
|
|
3085
|
-
const parse = content => {
|
|
3086
|
-
if (content === 'undefined') {
|
|
3087
|
-
return null;
|
|
3088
|
-
}
|
|
3089
|
-
// TODO use better json parse to throw more helpful error messages if json is invalid
|
|
3090
|
-
try {
|
|
3091
|
-
return JSON.parse(content);
|
|
3092
|
-
} catch (error) {
|
|
3093
|
-
throw new VError(error, 'failed to parse json');
|
|
3094
|
-
}
|
|
3095
|
-
};
|
|
3096
|
-
|
|
3097
|
-
const create$3 = (url, args) => {
|
|
3098
|
-
const webSocket = new WebSocket(url, args);
|
|
3099
|
-
const reconnect = () => {
|
|
3100
|
-
const originalOnMessage = context.webSocket.onmessage;
|
|
3101
|
-
context.webSocket = new WebSocket(url, args);
|
|
3102
|
-
context.webSocket.onmessage = originalOnMessage;
|
|
3103
|
-
context.webSocket.onclose = handleClose;
|
|
3104
|
-
};
|
|
3105
|
-
const handleClose = () => {
|
|
3106
|
-
setTimeout(reconnect, 2000);
|
|
3107
|
-
};
|
|
3108
|
-
const context = {
|
|
3109
|
-
webSocket,
|
|
3110
|
-
get onmessage() {
|
|
3111
|
-
return this.webSocket.onmessage;
|
|
3112
|
-
},
|
|
3113
|
-
set onmessage(value) {
|
|
3114
|
-
this.webSocket.onmessage = value;
|
|
3115
|
-
},
|
|
3116
|
-
send(message) {
|
|
3117
|
-
this.webSocket.send(message);
|
|
3118
|
-
},
|
|
3119
|
-
addEventListener(type, listener) {
|
|
3120
|
-
this.webSocket.addEventListener(type, listener);
|
|
3121
|
-
},
|
|
3122
|
-
removeEventListener(type, listener) {
|
|
3123
|
-
this.webSocket.removeEventListener(type, listener);
|
|
3124
|
-
}
|
|
3125
|
-
};
|
|
3126
|
-
webSocket.onclose = handleClose;
|
|
3127
|
-
return context;
|
|
3128
|
-
};
|
|
3129
|
-
|
|
3130
|
-
const getFirstEvent = (eventTarget, eventMap) => {
|
|
3131
|
-
const {
|
|
3132
|
-
resolve,
|
|
3133
|
-
promise
|
|
3134
|
-
} = Promise.withResolvers();
|
|
3135
|
-
const listenerMap = Object.create(null);
|
|
3136
|
-
const cleanup = value => {
|
|
3137
|
-
for (const event of Object.keys(eventMap)) {
|
|
3138
|
-
eventTarget.removeEventListener(event, listenerMap[event]);
|
|
3139
|
-
}
|
|
3140
|
-
resolve(value);
|
|
3141
|
-
};
|
|
3142
|
-
for (const [event, type] of Object.entries(eventMap)) {
|
|
3143
|
-
const listener = event => {
|
|
3144
|
-
cleanup({
|
|
3145
|
-
type,
|
|
3146
|
-
event
|
|
3147
|
-
});
|
|
3148
|
-
};
|
|
3149
|
-
eventTarget.addEventListener(event, listener);
|
|
3150
|
-
listenerMap[event] = listener;
|
|
3151
|
-
}
|
|
3152
|
-
return promise;
|
|
3153
|
-
};
|
|
3154
|
-
|
|
3155
|
-
const waitForWebSocketToBeOpen = webSocket => {
|
|
3156
|
-
return getFirstEvent(webSocket, {
|
|
3157
|
-
open: Open,
|
|
3158
|
-
close: Close
|
|
3159
|
-
});
|
|
3160
|
-
};
|
|
3161
|
-
|
|
3162
|
-
const getHost = () => {
|
|
3163
|
-
return location.host;
|
|
3164
|
-
};
|
|
3165
|
-
|
|
3166
|
-
const create$2 = async ({
|
|
3167
|
-
type
|
|
3168
|
-
}) => {
|
|
3169
|
-
string(type);
|
|
3170
|
-
const host = getHost();
|
|
3171
|
-
const wsUrl = getWebSocketUrl(type, host);
|
|
3172
|
-
const webSocket = create$3(wsUrl);
|
|
3173
|
-
const firstWebSocketEvent = await waitForWebSocketToBeOpen(webSocket);
|
|
3174
|
-
if (firstWebSocketEvent.type === Close) {
|
|
3175
|
-
throw new IpcError('Websocket connection was immediately closed');
|
|
3176
|
-
}
|
|
3177
|
-
return webSocket;
|
|
3178
|
-
};
|
|
3179
|
-
const getMessage = event => {
|
|
3180
|
-
return parse(event.data);
|
|
3181
|
-
};
|
|
3182
|
-
const wrap$1 = webSocket => {
|
|
3183
|
-
return {
|
|
3184
|
-
webSocket,
|
|
3185
|
-
/**
|
|
3186
|
-
* @type {any}
|
|
3187
|
-
*/
|
|
3188
|
-
listener: undefined,
|
|
3189
|
-
get onmessage() {
|
|
3190
|
-
return this.listener;
|
|
3191
|
-
},
|
|
3192
|
-
set onmessage(listener) {
|
|
3193
|
-
this.listener = listener;
|
|
3194
|
-
const wrappedListener = event => {
|
|
3195
|
-
const message = getMessage(event);
|
|
3196
|
-
const syntheticEvent = {
|
|
3197
|
-
data: message,
|
|
3198
|
-
target: this
|
|
3199
|
-
};
|
|
3200
|
-
listener(syntheticEvent);
|
|
3201
|
-
};
|
|
3202
|
-
this.webSocket.onmessage = wrappedListener;
|
|
3203
|
-
},
|
|
3204
|
-
send(message) {
|
|
3205
|
-
const stringifiedMessage = stringifyCompact(message);
|
|
3206
|
-
this.webSocket.send(stringifiedMessage);
|
|
3207
|
-
}
|
|
3208
|
-
};
|
|
3209
|
-
};
|
|
3210
|
-
|
|
3211
|
-
const IpcParentWithWebSocket = {
|
|
3212
|
-
__proto__: null,
|
|
3213
|
-
create: create$2,
|
|
3214
|
-
wrap: wrap$1
|
|
3215
|
-
};
|
|
3216
|
-
|
|
3217
|
-
const Web = 1;
|
|
3218
|
-
const Electron = 2;
|
|
3219
|
-
const Remote = 3;
|
|
3220
|
-
|
|
3221
|
-
const sendMessagePortToElectron = async (port, initialCommand, ipcId) => {
|
|
3222
|
-
object(port);
|
|
3223
|
-
string(initialCommand);
|
|
3224
|
-
await invokeAndTransfer(initialCommand, port, ipcId);
|
|
3225
|
-
};
|
|
3226
|
-
|
|
3227
|
-
const create$1 = async options => {
|
|
3228
|
-
switch (options.platform) {
|
|
3229
|
-
case Web:
|
|
3230
|
-
case Remote:
|
|
3231
|
-
const module = IpcParentWithWebSocket;
|
|
3232
|
-
const rawIpc = await module.create(options);
|
|
3233
|
-
if (options.raw) {
|
|
3234
|
-
return rawIpc;
|
|
3235
|
-
}
|
|
3236
|
-
return {
|
|
3237
|
-
rawIpc,
|
|
3238
|
-
module
|
|
3239
|
-
};
|
|
3240
|
-
case Electron:
|
|
3241
|
-
const {
|
|
3242
|
-
port1,
|
|
3243
|
-
port2
|
|
3244
|
-
} = getPortTuple();
|
|
3245
|
-
await sendMessagePortToElectron(port2, options.initialCommand, options.ipcId);
|
|
3246
|
-
return port1;
|
|
3247
|
-
default:
|
|
3248
|
-
throw new Error('unsupported platform');
|
|
3249
|
-
}
|
|
3250
|
-
};
|
|
3251
|
-
const wrap = port => {
|
|
3252
|
-
if (!(port instanceof MessagePort)) {
|
|
3253
|
-
return port.module.wrap(port.rawIpc);
|
|
3254
|
-
}
|
|
3255
|
-
return {
|
|
3256
|
-
port,
|
|
3257
|
-
/**
|
|
3258
|
-
* @type {any}
|
|
3259
|
-
*/
|
|
3260
|
-
listener: undefined,
|
|
3261
|
-
get onmessage() {
|
|
3262
|
-
return this.listener;
|
|
3263
|
-
},
|
|
3264
|
-
set onmessage(listener) {
|
|
3265
|
-
this.listener = listener;
|
|
3266
|
-
const wrappedListener = event => {
|
|
3267
|
-
const data = getData(event);
|
|
3268
|
-
const syntheticEvent = {
|
|
3269
|
-
data,
|
|
3270
|
-
target: this
|
|
3271
|
-
};
|
|
3272
|
-
listener(syntheticEvent);
|
|
3273
|
-
};
|
|
3274
|
-
this.port.onmessage = wrappedListener;
|
|
3275
|
-
},
|
|
3276
|
-
send(message) {
|
|
3277
|
-
this.port.postMessage(message);
|
|
3278
|
-
},
|
|
3279
|
-
sendAndTransfer(message, transfer) {
|
|
3280
|
-
this.port.postMessage(message, transfer);
|
|
3281
|
-
}
|
|
3282
|
-
};
|
|
3283
|
-
};
|
|
3284
|
-
|
|
3285
|
-
const IpcParentWithNodeAlternate = {
|
|
3286
|
-
__proto__: null,
|
|
3287
|
-
create: create$1,
|
|
3288
|
-
wrap
|
|
3289
|
-
};
|
|
3290
|
-
|
|
3291
|
-
const getModule = method => {
|
|
3292
|
-
switch (method) {
|
|
3293
|
-
case NodeAlternate:
|
|
3294
|
-
return IpcParentWithNodeAlternate;
|
|
3295
|
-
default:
|
|
3296
|
-
throw new Error('unexpected ipc type');
|
|
3297
|
-
}
|
|
3298
|
-
};
|
|
3299
|
-
|
|
3300
|
-
const create = async ({
|
|
3301
|
-
method,
|
|
3302
|
-
...options
|
|
3303
|
-
}) => {
|
|
3304
|
-
const module = getModule(method);
|
|
3305
|
-
// @ts-ignore
|
|
3306
|
-
const rawIpc = await module.create(options);
|
|
3307
|
-
if (options.noReturn) {
|
|
3308
|
-
return undefined;
|
|
3309
|
-
}
|
|
3310
|
-
if (options.raw) {
|
|
3311
|
-
return rawIpc;
|
|
3312
|
-
}
|
|
3313
|
-
const ipc = module.wrap(rawIpc);
|
|
3314
|
-
return ipc;
|
|
3315
|
-
};
|
|
3316
|
-
|
|
3317
|
-
const launchSearchProcess = async () => {
|
|
3318
|
-
const ipc = await create({
|
|
3319
|
-
method: NodeAlternate,
|
|
3320
|
-
type: 'search-process',
|
|
3321
|
-
name: 'Search Process',
|
|
3322
|
-
initialCommand: 'HandleMessagePortForSearchProcess.handleMessagePortForSearchProcess'
|
|
3323
|
-
});
|
|
3324
|
-
// TODO
|
|
3325
|
-
// HandleIpc.handleIpc(ipc)
|
|
3326
|
-
return ipc;
|
|
3327
|
-
};
|
|
3328
|
-
|
|
3329
3327
|
const first = () => {
|
|
3330
3328
|
return 0;
|
|
3331
3329
|
};
|
|
@@ -3526,7 +3524,7 @@ const selectIndexFile = (state, searchResult, index) => {
|
|
|
3526
3524
|
};
|
|
3527
3525
|
|
|
3528
3526
|
const openUri = async (path, focus = true, props = {}) => {
|
|
3529
|
-
await invoke$
|
|
3527
|
+
await invoke$2(/* Main.openUri */'Main.openUri', /* uri */path, /* focus */focus, props);
|
|
3530
3528
|
};
|
|
3531
3529
|
|
|
3532
3530
|
const getFileIndex = (items, index) => {
|
|
@@ -3549,7 +3547,6 @@ const selectIndexPreview = async (state, searchResult, index) => {
|
|
|
3549
3547
|
const {
|
|
3550
3548
|
lineNumber
|
|
3551
3549
|
} = searchResult;
|
|
3552
|
-
// console.log({ searchResult })
|
|
3553
3550
|
const fileResult = items[fileIndex];
|
|
3554
3551
|
const path = getAbsolutePath(fileResult.text);
|
|
3555
3552
|
string(path);
|
|
@@ -3918,7 +3915,7 @@ const replaceAll = async state => {
|
|
|
3918
3915
|
files,
|
|
3919
3916
|
ranges
|
|
3920
3917
|
} = getBulkReplacementEdits(workspacePath, items);
|
|
3921
|
-
await invoke$
|
|
3918
|
+
await invoke$2('BulkReplacement.applyBulkReplacement', files, ranges, replacement);
|
|
3922
3919
|
return state;
|
|
3923
3920
|
};
|
|
3924
3921
|
|
|
@@ -3950,7 +3947,7 @@ const replaceAllAndPrompt = async (workspacePath, items, replacement, matchCount
|
|
|
3950
3947
|
const confirmTitle = replaceAll$1();
|
|
3951
3948
|
const confirmAccept = replace();
|
|
3952
3949
|
const confirmText = getReplaceAllConfirmText(matchCount, fileCount, replacement);
|
|
3953
|
-
const shouldReplace = await invoke$
|
|
3950
|
+
const shouldReplace = await invoke$2('ConfirmPrompt.prompt', confirmText, {
|
|
3954
3951
|
title: confirmTitle,
|
|
3955
3952
|
confirmMessage: confirmAccept
|
|
3956
3953
|
});
|
|
@@ -3991,7 +3988,7 @@ const focusElement = (state, focusKey) => {
|
|
|
3991
3988
|
};
|
|
3992
3989
|
|
|
3993
3990
|
const setFocus = async focusKey => {
|
|
3994
|
-
await invoke$
|
|
3991
|
+
await invoke$2('Focus.setFocus', focusKey);
|
|
3995
3992
|
};
|
|
3996
3993
|
|
|
3997
3994
|
const getSearchFocusKey = key => {
|
|
@@ -4150,7 +4147,7 @@ const show = async (x, y, id, ...args) => {
|
|
|
4150
4147
|
number(y);
|
|
4151
4148
|
number(id);
|
|
4152
4149
|
// TODO
|
|
4153
|
-
await invoke$
|
|
4150
|
+
await invoke$2('ContextMenu.show', x, y, id, ...args);
|
|
4154
4151
|
};
|
|
4155
4152
|
|
|
4156
4153
|
const Search = 18;
|
|
@@ -4246,7 +4243,7 @@ const commandMap = {
|
|
|
4246
4243
|
'TextSearch.toggleUseIgnoreFiles': wrapCommand(toggleUseIgnoreFiles),
|
|
4247
4244
|
'TextSearch.toggleUseRegularExpression': wrapCommand(toggleUseRegularExpression),
|
|
4248
4245
|
// not wrapped
|
|
4249
|
-
'TextSearch.create': create
|
|
4246
|
+
'TextSearch.create': create,
|
|
4250
4247
|
'TextSearch.getFlags': getFlags,
|
|
4251
4248
|
'TextSearch.getFocus': getFocus,
|
|
4252
4249
|
'TextSearch.getKeyBindings': getKeyBindings,
|