@lvce-editor/extension-host-worker 1.12.0 → 1.13.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/extensionHostWorkerMain.js +491 -119
- package/package.json +1 -1
|
@@ -90,6 +90,8 @@ const fn = value => {
|
|
|
90
90
|
};
|
|
91
91
|
|
|
92
92
|
const state$9 = {
|
|
93
|
+
/** @type{any[]} */
|
|
94
|
+
onDidOpenEditorListeners: [],
|
|
93
95
|
/** @type{any[]} */
|
|
94
96
|
onWillChangeEditorListeners: [],
|
|
95
97
|
/** @type{any[]} */
|
|
@@ -619,7 +621,9 @@ const String = 'string';
|
|
|
619
621
|
|
|
620
622
|
const {
|
|
621
623
|
registerBraceCompletionProvider,
|
|
622
|
-
executeBraceCompletionProvider
|
|
624
|
+
executeBraceCompletionProvider,
|
|
625
|
+
reset: reset$9
|
|
626
|
+
} = create$9({
|
|
623
627
|
name: 'BraceCompletion',
|
|
624
628
|
resultShape: {
|
|
625
629
|
type: Boolean
|
|
@@ -762,17 +766,15 @@ const create$4$1 = (method, params) => {
|
|
|
762
766
|
params
|
|
763
767
|
};
|
|
764
768
|
};
|
|
765
|
-
const
|
|
766
|
-
callbacks: Object.create(null)
|
|
767
|
-
};
|
|
769
|
+
const callbacks = Object.create(null);
|
|
768
770
|
const set$4 = (id, fn) => {
|
|
769
|
-
|
|
771
|
+
callbacks[id] = fn;
|
|
770
772
|
};
|
|
771
773
|
const get$4 = id => {
|
|
772
|
-
return
|
|
774
|
+
return callbacks[id];
|
|
773
775
|
};
|
|
774
776
|
const remove = id => {
|
|
775
|
-
delete
|
|
777
|
+
delete callbacks[id];
|
|
776
778
|
};
|
|
777
779
|
let id = 0;
|
|
778
780
|
const create$3$1 = () => {
|
|
@@ -1134,17 +1136,17 @@ const handleIpc = ipc => {
|
|
|
1134
1136
|
ipc.addEventListener('message', handleMessage);
|
|
1135
1137
|
};
|
|
1136
1138
|
|
|
1137
|
-
const state$
|
|
1139
|
+
const state$6 = {
|
|
1138
1140
|
/**
|
|
1139
1141
|
* @type {any}
|
|
1140
1142
|
*/
|
|
1141
1143
|
ipc: undefined
|
|
1142
1144
|
};
|
|
1143
1145
|
const get$3 = () => {
|
|
1144
|
-
return state$
|
|
1146
|
+
return state$6.ipc;
|
|
1145
1147
|
};
|
|
1146
1148
|
const set$3 = ipc => {
|
|
1147
|
-
state$
|
|
1149
|
+
state$6.ipc = ipc;
|
|
1148
1150
|
};
|
|
1149
1151
|
|
|
1150
1152
|
const send = (method, ...params) => {
|
|
@@ -1159,16 +1161,16 @@ const invokeAndTransfer = (method, ...params) => {
|
|
|
1159
1161
|
const ipc = get$3();
|
|
1160
1162
|
return invokeAndTransfer$1(ipc, method, ...params);
|
|
1161
1163
|
};
|
|
1162
|
-
const listen$
|
|
1164
|
+
const listen$4 = ipc => {
|
|
1163
1165
|
handleIpc(ipc);
|
|
1164
1166
|
set$3(ipc);
|
|
1165
1167
|
};
|
|
1166
1168
|
|
|
1167
|
-
const state$
|
|
1169
|
+
const state$5 = {
|
|
1168
1170
|
debugProviderMap: Object.create(null)
|
|
1169
1171
|
};
|
|
1170
1172
|
const getDebugProvider = id => {
|
|
1171
|
-
const provider = state$
|
|
1173
|
+
const provider = state$5.debugProviderMap[id];
|
|
1172
1174
|
if (!provider) {
|
|
1173
1175
|
// @ts-ignore
|
|
1174
1176
|
throw new VError$1(`no debug provider "${id}" found`);
|
|
@@ -1179,7 +1181,7 @@ const registerDebugProvider = debugProvider => {
|
|
|
1179
1181
|
if (!debugProvider.id) {
|
|
1180
1182
|
throw new Error('Failed to register debug system provider: missing id');
|
|
1181
1183
|
}
|
|
1182
|
-
state$
|
|
1184
|
+
state$5.debugProviderMap[debugProvider.id] = debugProvider;
|
|
1183
1185
|
};
|
|
1184
1186
|
const start = async (protocol, path) => {
|
|
1185
1187
|
try {
|
|
@@ -1288,7 +1290,9 @@ const setPauseOnExceptions = async (protocol, value) => {
|
|
|
1288
1290
|
|
|
1289
1291
|
const {
|
|
1290
1292
|
registerDefinitionProvider,
|
|
1291
|
-
executeDefinitionProvider
|
|
1293
|
+
executeDefinitionProvider,
|
|
1294
|
+
reset: reset$8
|
|
1295
|
+
} = create$9({
|
|
1292
1296
|
name: 'Definition',
|
|
1293
1297
|
resultShape: {
|
|
1294
1298
|
allowUndefined: true,
|
|
@@ -1409,7 +1413,9 @@ const getPathSeparator = protocol => {
|
|
|
1409
1413
|
|
|
1410
1414
|
const {
|
|
1411
1415
|
registerFormattingProvider,
|
|
1412
|
-
executeFormattingProvider
|
|
1416
|
+
executeFormattingProvider,
|
|
1417
|
+
reset: reset$7
|
|
1418
|
+
} = create$9({
|
|
1413
1419
|
name: 'Formatting',
|
|
1414
1420
|
executeKey: 'format',
|
|
1415
1421
|
resultShape: {
|
|
@@ -1469,7 +1475,9 @@ const getPosition = (textDocument, offset) => {
|
|
|
1469
1475
|
|
|
1470
1476
|
const {
|
|
1471
1477
|
registerHoverProvider,
|
|
1472
|
-
executeHoverProvider
|
|
1478
|
+
executeHoverProvider,
|
|
1479
|
+
reset: reset$6
|
|
1480
|
+
} = create$9({
|
|
1473
1481
|
name: 'Hover',
|
|
1474
1482
|
resultShape: {
|
|
1475
1483
|
allowUndefined: true,
|
|
@@ -1480,7 +1488,9 @@ const {
|
|
|
1480
1488
|
|
|
1481
1489
|
const {
|
|
1482
1490
|
registerImplementationProvider,
|
|
1483
|
-
executeImplementationProvider
|
|
1491
|
+
executeImplementationProvider,
|
|
1492
|
+
reset: reset$5
|
|
1493
|
+
} = create$9({
|
|
1484
1494
|
name: 'Implementation',
|
|
1485
1495
|
resultShape: {
|
|
1486
1496
|
type: Array$1,
|
|
@@ -1592,7 +1602,9 @@ const showQuickPick = async ({
|
|
|
1592
1602
|
const {
|
|
1593
1603
|
registerReferenceProvider,
|
|
1594
1604
|
executeReferenceProvider,
|
|
1595
|
-
executefileReferenceProvider
|
|
1605
|
+
executefileReferenceProvider,
|
|
1606
|
+
reset: reset$4
|
|
1607
|
+
} = create$9({
|
|
1596
1608
|
name: 'Reference',
|
|
1597
1609
|
resultShape: {
|
|
1598
1610
|
type: Array$1,
|
|
@@ -1617,7 +1629,9 @@ const {
|
|
|
1617
1629
|
const {
|
|
1618
1630
|
registerRenameProvider,
|
|
1619
1631
|
executeRenameProvider,
|
|
1620
|
-
executeprepareRenameProvider
|
|
1632
|
+
executeprepareRenameProvider,
|
|
1633
|
+
reset: reset$3
|
|
1634
|
+
} = create$9({
|
|
1621
1635
|
name: 'Rename',
|
|
1622
1636
|
resultShape: {
|
|
1623
1637
|
type: Object$1,
|
|
@@ -1774,7 +1788,9 @@ const createRpc = ({
|
|
|
1774
1788
|
|
|
1775
1789
|
const {
|
|
1776
1790
|
registerSelectionProvider,
|
|
1777
|
-
executeSelectionProvider
|
|
1791
|
+
executeSelectionProvider,
|
|
1792
|
+
reset: reset$2
|
|
1793
|
+
} = create$9({
|
|
1778
1794
|
name: 'Selection',
|
|
1779
1795
|
resultShape: {
|
|
1780
1796
|
allowUndefined: true,
|
|
@@ -1785,17 +1801,17 @@ const {
|
|
|
1785
1801
|
}
|
|
1786
1802
|
});
|
|
1787
1803
|
|
|
1788
|
-
const state$
|
|
1804
|
+
const state$4 = {
|
|
1789
1805
|
providers: Object.create(null)
|
|
1790
1806
|
};
|
|
1791
1807
|
const registerSourceControlProvider = provider => {
|
|
1792
|
-
state$
|
|
1808
|
+
state$4.providers[provider.id] = provider;
|
|
1793
1809
|
};
|
|
1794
1810
|
const getFilesFromProvider = provider => {
|
|
1795
1811
|
return provider.getChangedFiles();
|
|
1796
1812
|
};
|
|
1797
1813
|
const getChangedFiles = async providerId => {
|
|
1798
|
-
const provider = state$
|
|
1814
|
+
const provider = state$4.providers[providerId];
|
|
1799
1815
|
if (!provider) {
|
|
1800
1816
|
throw new Error('no source control provider found');
|
|
1801
1817
|
}
|
|
@@ -1806,7 +1822,7 @@ const getChangedFiles = async providerId => {
|
|
|
1806
1822
|
const getFileBefore = async (providerId, uri) => {
|
|
1807
1823
|
string(providerId);
|
|
1808
1824
|
string(uri);
|
|
1809
|
-
const provider = state$
|
|
1825
|
+
const provider = state$4.providers[providerId];
|
|
1810
1826
|
if (!provider) {
|
|
1811
1827
|
throw new Error('no source control provider found');
|
|
1812
1828
|
}
|
|
@@ -1828,7 +1844,7 @@ const getGroupsFromProvider = async (provider, cwd) => {
|
|
|
1828
1844
|
throw new Error('source control provider is missing required function getGroups');
|
|
1829
1845
|
};
|
|
1830
1846
|
const getGroups = async (providerId, cwd) => {
|
|
1831
|
-
const provider = state$
|
|
1847
|
+
const provider = state$4.providers[providerId];
|
|
1832
1848
|
if (!provider) {
|
|
1833
1849
|
throw new Error('no source control provider found');
|
|
1834
1850
|
}
|
|
@@ -1836,14 +1852,14 @@ const getGroups = async (providerId, cwd) => {
|
|
|
1836
1852
|
return groups;
|
|
1837
1853
|
};
|
|
1838
1854
|
const acceptInput = async (providerId, value) => {
|
|
1839
|
-
const provider = state$
|
|
1855
|
+
const provider = state$4.providers[providerId];
|
|
1840
1856
|
if (!provider) {
|
|
1841
1857
|
throw new Error('no source control provider found');
|
|
1842
1858
|
}
|
|
1843
1859
|
await provider.acceptInput(value);
|
|
1844
1860
|
};
|
|
1845
1861
|
const add = async path => {
|
|
1846
|
-
const provider = Object.values(state$
|
|
1862
|
+
const provider = Object.values(state$4.providers)[0];
|
|
1847
1863
|
if (!provider) {
|
|
1848
1864
|
return;
|
|
1849
1865
|
}
|
|
@@ -1851,7 +1867,7 @@ const add = async path => {
|
|
|
1851
1867
|
await provider.add(path);
|
|
1852
1868
|
};
|
|
1853
1869
|
const discard = async path => {
|
|
1854
|
-
const provider = Object.values(state$
|
|
1870
|
+
const provider = Object.values(state$4.providers)[0];
|
|
1855
1871
|
if (!provider) {
|
|
1856
1872
|
return;
|
|
1857
1873
|
}
|
|
@@ -1861,7 +1877,7 @@ const discard = async path => {
|
|
|
1861
1877
|
const getEnabledProviderIds = async (scheme, root) => {
|
|
1862
1878
|
string(scheme);
|
|
1863
1879
|
string(root);
|
|
1864
|
-
const providers = Object.values(state$
|
|
1880
|
+
const providers = Object.values(state$4.providers);
|
|
1865
1881
|
const enabledIds = [];
|
|
1866
1882
|
for (const provider of providers) {
|
|
1867
1883
|
// @ts-ignore
|
|
@@ -1880,7 +1896,9 @@ const getEnabledProviderIds = async (scheme, root) => {
|
|
|
1880
1896
|
|
|
1881
1897
|
const {
|
|
1882
1898
|
registerTabCompletionProvider,
|
|
1883
|
-
executeTabCompletionProvider
|
|
1899
|
+
executeTabCompletionProvider,
|
|
1900
|
+
reset: reset$1
|
|
1901
|
+
} = create$9({
|
|
1884
1902
|
name: 'TabCompletion',
|
|
1885
1903
|
resultShape: {
|
|
1886
1904
|
type: Object$1,
|
|
@@ -1888,7 +1906,7 @@ const {
|
|
|
1888
1906
|
}
|
|
1889
1907
|
});
|
|
1890
1908
|
|
|
1891
|
-
const state$
|
|
1909
|
+
const state$3 = {
|
|
1892
1910
|
textSearchProviders: Object.create(null)
|
|
1893
1911
|
};
|
|
1894
1912
|
const registerTextSearchProvider = textSearchProvider => {
|
|
@@ -1899,14 +1917,14 @@ const registerTextSearchProvider = textSearchProvider => {
|
|
|
1899
1917
|
if (!textSearchProvider.scheme) {
|
|
1900
1918
|
throw new Error('textSearchProvider is missing scheme');
|
|
1901
1919
|
}
|
|
1902
|
-
state$
|
|
1920
|
+
state$3.textSearchProviders[textSearchProvider.scheme] = textSearchProvider;
|
|
1903
1921
|
} catch (error) {
|
|
1904
1922
|
throw new VError$1(error, 'Failed to register text search provider');
|
|
1905
1923
|
}
|
|
1906
1924
|
};
|
|
1907
1925
|
const executeTextSearchProvider = async (scheme, query) => {
|
|
1908
1926
|
try {
|
|
1909
|
-
const textSearchProvider = state$
|
|
1927
|
+
const textSearchProvider = state$3.textSearchProviders[scheme];
|
|
1910
1928
|
if (!textSearchProvider) {
|
|
1911
1929
|
throw new Error(`No text search provider for ${scheme} found`);
|
|
1912
1930
|
}
|
|
@@ -1919,7 +1937,9 @@ const executeTextSearchProvider = async (scheme, query) => {
|
|
|
1919
1937
|
|
|
1920
1938
|
const {
|
|
1921
1939
|
registerTypeDefinitionProvider,
|
|
1922
|
-
executeTypeDefinitionProvider
|
|
1940
|
+
executeTypeDefinitionProvider,
|
|
1941
|
+
reset
|
|
1942
|
+
} = create$9({
|
|
1923
1943
|
name: 'TypeDefinition',
|
|
1924
1944
|
resultShape: {
|
|
1925
1945
|
allowUndefined: true,
|
|
@@ -2161,14 +2181,14 @@ const createWorker = async ({
|
|
|
2161
2181
|
return ipc;
|
|
2162
2182
|
};
|
|
2163
2183
|
|
|
2164
|
-
const state$
|
|
2184
|
+
const state$2 = {
|
|
2165
2185
|
workspacePath: ''
|
|
2166
2186
|
};
|
|
2167
2187
|
const setWorkspacePath = path => {
|
|
2168
|
-
state$
|
|
2188
|
+
state$2.workspacePath = path;
|
|
2169
2189
|
};
|
|
2170
2190
|
const getWorkspaceFolder = path => {
|
|
2171
|
-
return state$
|
|
2191
|
+
return state$2.workspacePath;
|
|
2172
2192
|
};
|
|
2173
2193
|
|
|
2174
2194
|
class FormattingError extends Error {
|
|
@@ -2398,7 +2418,7 @@ class ContentSecurityPolicyError extends Error {
|
|
|
2398
2418
|
}
|
|
2399
2419
|
}
|
|
2400
2420
|
|
|
2401
|
-
const state = {
|
|
2421
|
+
const state$1 = {
|
|
2402
2422
|
/**
|
|
2403
2423
|
* @type {any[]}
|
|
2404
2424
|
*/
|
|
@@ -2406,13 +2426,13 @@ const state = {
|
|
|
2406
2426
|
};
|
|
2407
2427
|
const addError = error => {
|
|
2408
2428
|
// @ts-ignore
|
|
2409
|
-
state.errors.push(error);
|
|
2429
|
+
state$1.errors.push(error);
|
|
2410
2430
|
};
|
|
2411
2431
|
const hasRecentErrors = () => {
|
|
2412
|
-
return state.errors.length > 0;
|
|
2432
|
+
return state$1.errors.length > 0;
|
|
2413
2433
|
};
|
|
2414
2434
|
const getRecentError = () => {
|
|
2415
|
-
return state.errors.at(-1);
|
|
2435
|
+
return state$1.errors.at(-1);
|
|
2416
2436
|
};
|
|
2417
2437
|
|
|
2418
2438
|
const isImportErrorChrome = error => {
|
|
@@ -2838,7 +2858,7 @@ const mockRpc = () => {
|
|
|
2838
2858
|
};
|
|
2839
2859
|
|
|
2840
2860
|
const getStatusBarItems = async () => {
|
|
2841
|
-
const providers = Object.values(state$
|
|
2861
|
+
const providers = Object.values(state$4.providers);
|
|
2842
2862
|
const statusBarItems = [];
|
|
2843
2863
|
for (const provider of providers) {
|
|
2844
2864
|
// @ts-ignore
|
|
@@ -2872,6 +2892,27 @@ const Auto = () => {
|
|
|
2872
2892
|
const getData$1 = event => {
|
|
2873
2893
|
return event.data;
|
|
2874
2894
|
};
|
|
2895
|
+
const attachEvents = that => {
|
|
2896
|
+
const handleMessage = (...args) => {
|
|
2897
|
+
const data = that.getData(...args);
|
|
2898
|
+
that.dispatchEvent(new MessageEvent('message', {
|
|
2899
|
+
data
|
|
2900
|
+
}));
|
|
2901
|
+
};
|
|
2902
|
+
that.onMessage(handleMessage);
|
|
2903
|
+
const handleClose = event => {
|
|
2904
|
+
that.dispatchEvent(new Event('close'));
|
|
2905
|
+
};
|
|
2906
|
+
that.onClose(handleClose);
|
|
2907
|
+
};
|
|
2908
|
+
class Ipc extends EventTarget {
|
|
2909
|
+
constructor(rawIpc) {
|
|
2910
|
+
super();
|
|
2911
|
+
this._rawIpc = rawIpc;
|
|
2912
|
+
attachEvents(this);
|
|
2913
|
+
}
|
|
2914
|
+
}
|
|
2915
|
+
const readyMessage = 'ready';
|
|
2875
2916
|
const walkValue = (value, transferrables, isTransferrable) => {
|
|
2876
2917
|
if (!value) {
|
|
2877
2918
|
return;
|
|
@@ -2922,35 +2963,56 @@ const getTransferrables = value => {
|
|
|
2922
2963
|
walkValue(value, transferrables, isTransferrable);
|
|
2923
2964
|
return transferrables;
|
|
2924
2965
|
};
|
|
2925
|
-
const
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
data
|
|
2930
|
-
}));
|
|
2931
|
-
};
|
|
2932
|
-
that.onMessage(handleMessage);
|
|
2933
|
-
const handleClose = event => {
|
|
2934
|
-
that.dispatchEvent(new Event('close'));
|
|
2935
|
-
};
|
|
2936
|
-
that.onClose(handleClose);
|
|
2966
|
+
const listen$3 = ({
|
|
2967
|
+
port
|
|
2968
|
+
}) => {
|
|
2969
|
+
return port;
|
|
2937
2970
|
};
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2971
|
+
const signal$3 = port => {
|
|
2972
|
+
port.postMessage(readyMessage);
|
|
2973
|
+
};
|
|
2974
|
+
class IpcChildWithMessagePort extends Ipc {
|
|
2975
|
+
constructor(port) {
|
|
2976
|
+
super(port);
|
|
2977
|
+
}
|
|
2978
|
+
getData(event) {
|
|
2979
|
+
return getData$1(event);
|
|
2980
|
+
}
|
|
2981
|
+
send(message) {
|
|
2982
|
+
this._rawIpc.postMessage(message);
|
|
2983
|
+
}
|
|
2984
|
+
sendAndTransfer(message) {
|
|
2985
|
+
const transfer = getTransferrables(message);
|
|
2986
|
+
this._rawIpc.postMessage(message, transfer);
|
|
2987
|
+
}
|
|
2988
|
+
dispose() {
|
|
2989
|
+
// ignore
|
|
2990
|
+
}
|
|
2991
|
+
onClose(callback) {
|
|
2992
|
+
// ignore
|
|
2993
|
+
}
|
|
2994
|
+
onMessage(callback) {
|
|
2995
|
+
this._rawIpc.addEventListener('message', callback);
|
|
2996
|
+
this._rawIpc.start();
|
|
2943
2997
|
}
|
|
2944
2998
|
}
|
|
2945
|
-
const
|
|
2946
|
-
|
|
2999
|
+
const wrap$6 = port => {
|
|
3000
|
+
return new IpcChildWithMessagePort(port);
|
|
3001
|
+
};
|
|
3002
|
+
const IpcChildWithMessagePort$1 = {
|
|
3003
|
+
__proto__: null,
|
|
3004
|
+
listen: listen$3,
|
|
3005
|
+
signal: signal$3,
|
|
3006
|
+
wrap: wrap$6
|
|
3007
|
+
};
|
|
3008
|
+
const listen$2 = () => {
|
|
2947
3009
|
// @ts-ignore
|
|
2948
3010
|
if (typeof WorkerGlobalScope === 'undefined') {
|
|
2949
3011
|
throw new TypeError('module is not in web worker scope');
|
|
2950
3012
|
}
|
|
2951
3013
|
return globalThis;
|
|
2952
3014
|
};
|
|
2953
|
-
const signal$
|
|
3015
|
+
const signal$2 = global => {
|
|
2954
3016
|
global.postMessage(readyMessage);
|
|
2955
3017
|
};
|
|
2956
3018
|
class IpcChildWithModuleWorker extends Ipc {
|
|
@@ -2976,14 +3038,14 @@ class IpcChildWithModuleWorker extends Ipc {
|
|
|
2976
3038
|
this._rawIpc.addEventListener('message', callback);
|
|
2977
3039
|
}
|
|
2978
3040
|
}
|
|
2979
|
-
const wrap$
|
|
3041
|
+
const wrap$5 = global => {
|
|
2980
3042
|
return new IpcChildWithModuleWorker(global);
|
|
2981
3043
|
};
|
|
2982
3044
|
const IpcChildWithModuleWorker$1 = {
|
|
2983
3045
|
__proto__: null,
|
|
2984
|
-
listen: listen$
|
|
2985
|
-
signal: signal$
|
|
2986
|
-
wrap: wrap$
|
|
3046
|
+
listen: listen$2,
|
|
3047
|
+
signal: signal$2,
|
|
3048
|
+
wrap: wrap$5
|
|
2987
3049
|
};
|
|
2988
3050
|
const E_INCOMPATIBLE_NATIVE_MODULE = 'E_INCOMPATIBLE_NATIVE_MODULE';
|
|
2989
3051
|
const E_MODULES_NOT_SUPPORTED_IN_ELECTRON = 'E_MODULES_NOT_SUPPORTED_IN_ELECTRON';
|
|
@@ -3100,10 +3162,10 @@ const getHelpfulChildProcessError = (stdout, stderr) => {
|
|
|
3100
3162
|
};
|
|
3101
3163
|
const normalizeLine = line => {
|
|
3102
3164
|
if (line.startsWith('Error: ')) {
|
|
3103
|
-
return line.slice(
|
|
3165
|
+
return line.slice('Error: '.length);
|
|
3104
3166
|
}
|
|
3105
3167
|
if (line.startsWith('VError: ')) {
|
|
3106
|
-
return line.slice(
|
|
3168
|
+
return line.slice('VError: '.length);
|
|
3107
3169
|
}
|
|
3108
3170
|
return line;
|
|
3109
3171
|
};
|
|
@@ -3201,10 +3263,10 @@ const waitForFirstMessage = async port => {
|
|
|
3201
3263
|
// @ts-ignore
|
|
3202
3264
|
return event.data;
|
|
3203
3265
|
};
|
|
3204
|
-
const listen$
|
|
3205
|
-
const parentIpcRaw = listen$
|
|
3206
|
-
signal$
|
|
3207
|
-
const parentIpc = wrap$
|
|
3266
|
+
const listen$1 = async () => {
|
|
3267
|
+
const parentIpcRaw = listen$2();
|
|
3268
|
+
signal$2(parentIpcRaw);
|
|
3269
|
+
const parentIpc = wrap$5(parentIpcRaw);
|
|
3208
3270
|
const firstMessage = await waitForFirstMessage(parentIpc);
|
|
3209
3271
|
if (firstMessage.method !== 'initialize') {
|
|
3210
3272
|
throw new IpcError$1('unexpected first message');
|
|
@@ -3249,55 +3311,13 @@ class IpcChildWithModuleWorkerAndMessagePort extends Ipc {
|
|
|
3249
3311
|
this._rawIpc.start();
|
|
3250
3312
|
}
|
|
3251
3313
|
}
|
|
3252
|
-
const wrap$
|
|
3314
|
+
const wrap$4$1 = port => {
|
|
3253
3315
|
return new IpcChildWithModuleWorkerAndMessagePort(port);
|
|
3254
3316
|
};
|
|
3255
3317
|
const IpcChildWithModuleWorkerAndMessagePort$1 = {
|
|
3256
|
-
__proto__: null,
|
|
3257
|
-
listen: listen$3,
|
|
3258
|
-
wrap: wrap$5
|
|
3259
|
-
};
|
|
3260
|
-
const listen$1 = ({
|
|
3261
|
-
port
|
|
3262
|
-
}) => {
|
|
3263
|
-
return port;
|
|
3264
|
-
};
|
|
3265
|
-
const signal = port => {
|
|
3266
|
-
port.postMessage(readyMessage);
|
|
3267
|
-
};
|
|
3268
|
-
class IpcChildWithMessagePort extends Ipc {
|
|
3269
|
-
constructor(port) {
|
|
3270
|
-
super(port);
|
|
3271
|
-
}
|
|
3272
|
-
getData(event) {
|
|
3273
|
-
return getData$1(event);
|
|
3274
|
-
}
|
|
3275
|
-
send(message) {
|
|
3276
|
-
this._rawIpc.postMessage(message);
|
|
3277
|
-
}
|
|
3278
|
-
sendAndTransfer(message) {
|
|
3279
|
-
const transfer = getTransferrables(message);
|
|
3280
|
-
this._rawIpc.postMessage(message, transfer);
|
|
3281
|
-
}
|
|
3282
|
-
dispose() {
|
|
3283
|
-
// ignore
|
|
3284
|
-
}
|
|
3285
|
-
onClose(callback) {
|
|
3286
|
-
// ignore
|
|
3287
|
-
}
|
|
3288
|
-
onMessage(callback) {
|
|
3289
|
-
this._rawIpc.addEventListener('message', callback);
|
|
3290
|
-
this._rawIpc.start();
|
|
3291
|
-
}
|
|
3292
|
-
}
|
|
3293
|
-
const wrap$2$1 = port => {
|
|
3294
|
-
return new IpcChildWithMessagePort(port);
|
|
3295
|
-
};
|
|
3296
|
-
const IpcChildWithMessagePort$1 = {
|
|
3297
3318
|
__proto__: null,
|
|
3298
3319
|
listen: listen$1,
|
|
3299
|
-
|
|
3300
|
-
wrap: wrap$2$1
|
|
3320
|
+
wrap: wrap$4$1
|
|
3301
3321
|
};
|
|
3302
3322
|
|
|
3303
3323
|
const getModule$1 = method => {
|
|
@@ -3349,9 +3369,361 @@ const saveState = async () => {
|
|
|
3349
3369
|
return serialized;
|
|
3350
3370
|
};
|
|
3351
3371
|
|
|
3372
|
+
const instanceOfAny = (object, constructors) => constructors.some(c => object instanceof c);
|
|
3373
|
+
let idbProxyableTypes;
|
|
3374
|
+
let cursorAdvanceMethods;
|
|
3375
|
+
// This is a function to prevent it throwing up in node environments.
|
|
3376
|
+
function getIdbProxyableTypes() {
|
|
3377
|
+
return idbProxyableTypes || (idbProxyableTypes = [IDBDatabase, IDBObjectStore, IDBIndex, IDBCursor, IDBTransaction]);
|
|
3378
|
+
}
|
|
3379
|
+
// This is a function to prevent it throwing up in node environments.
|
|
3380
|
+
function getCursorAdvanceMethods() {
|
|
3381
|
+
return cursorAdvanceMethods || (cursorAdvanceMethods = [IDBCursor.prototype.advance, IDBCursor.prototype.continue, IDBCursor.prototype.continuePrimaryKey]);
|
|
3382
|
+
}
|
|
3383
|
+
const transactionDoneMap = new WeakMap();
|
|
3384
|
+
const transformCache = new WeakMap();
|
|
3385
|
+
const reverseTransformCache = new WeakMap();
|
|
3386
|
+
function promisifyRequest(request) {
|
|
3387
|
+
const promise = new Promise((resolve, reject) => {
|
|
3388
|
+
const unlisten = () => {
|
|
3389
|
+
request.removeEventListener('success', success);
|
|
3390
|
+
request.removeEventListener('error', error);
|
|
3391
|
+
};
|
|
3392
|
+
const success = () => {
|
|
3393
|
+
resolve(wrap$4(request.result));
|
|
3394
|
+
unlisten();
|
|
3395
|
+
};
|
|
3396
|
+
const error = () => {
|
|
3397
|
+
reject(request.error);
|
|
3398
|
+
unlisten();
|
|
3399
|
+
};
|
|
3400
|
+
request.addEventListener('success', success);
|
|
3401
|
+
request.addEventListener('error', error);
|
|
3402
|
+
});
|
|
3403
|
+
// This mapping exists in reverseTransformCache but doesn't doesn't exist in transformCache. This
|
|
3404
|
+
// is because we create many promises from a single IDBRequest.
|
|
3405
|
+
reverseTransformCache.set(promise, request);
|
|
3406
|
+
return promise;
|
|
3407
|
+
}
|
|
3408
|
+
function cacheDonePromiseForTransaction(tx) {
|
|
3409
|
+
// Early bail if we've already created a done promise for this transaction.
|
|
3410
|
+
if (transactionDoneMap.has(tx)) return;
|
|
3411
|
+
const done = new Promise((resolve, reject) => {
|
|
3412
|
+
const unlisten = () => {
|
|
3413
|
+
tx.removeEventListener('complete', complete);
|
|
3414
|
+
tx.removeEventListener('error', error);
|
|
3415
|
+
tx.removeEventListener('abort', error);
|
|
3416
|
+
};
|
|
3417
|
+
const complete = () => {
|
|
3418
|
+
resolve();
|
|
3419
|
+
unlisten();
|
|
3420
|
+
};
|
|
3421
|
+
const error = () => {
|
|
3422
|
+
reject(tx.error || new DOMException('AbortError', 'AbortError'));
|
|
3423
|
+
unlisten();
|
|
3424
|
+
};
|
|
3425
|
+
tx.addEventListener('complete', complete);
|
|
3426
|
+
tx.addEventListener('error', error);
|
|
3427
|
+
tx.addEventListener('abort', error);
|
|
3428
|
+
});
|
|
3429
|
+
// Cache it for later retrieval.
|
|
3430
|
+
transactionDoneMap.set(tx, done);
|
|
3431
|
+
}
|
|
3432
|
+
let idbProxyTraps = {
|
|
3433
|
+
get(target, prop, receiver) {
|
|
3434
|
+
if (target instanceof IDBTransaction) {
|
|
3435
|
+
// Special handling for transaction.done.
|
|
3436
|
+
if (prop === 'done') return transactionDoneMap.get(target);
|
|
3437
|
+
// Make tx.store return the only store in the transaction, or undefined if there are many.
|
|
3438
|
+
if (prop === 'store') {
|
|
3439
|
+
return receiver.objectStoreNames[1] ? undefined : receiver.objectStore(receiver.objectStoreNames[0]);
|
|
3440
|
+
}
|
|
3441
|
+
}
|
|
3442
|
+
// Else transform whatever we get back.
|
|
3443
|
+
return wrap$4(target[prop]);
|
|
3444
|
+
},
|
|
3445
|
+
set(target, prop, value) {
|
|
3446
|
+
target[prop] = value;
|
|
3447
|
+
return true;
|
|
3448
|
+
},
|
|
3449
|
+
has(target, prop) {
|
|
3450
|
+
if (target instanceof IDBTransaction && (prop === 'done' || prop === 'store')) {
|
|
3451
|
+
return true;
|
|
3452
|
+
}
|
|
3453
|
+
return prop in target;
|
|
3454
|
+
}
|
|
3455
|
+
};
|
|
3456
|
+
function replaceTraps(callback) {
|
|
3457
|
+
idbProxyTraps = callback(idbProxyTraps);
|
|
3458
|
+
}
|
|
3459
|
+
function wrapFunction(func) {
|
|
3460
|
+
// Due to expected object equality (which is enforced by the caching in `wrap`), we
|
|
3461
|
+
// only create one new func per func.
|
|
3462
|
+
// Cursor methods are special, as the behaviour is a little more different to standard IDB. In
|
|
3463
|
+
// IDB, you advance the cursor and wait for a new 'success' on the IDBRequest that gave you the
|
|
3464
|
+
// cursor. It's kinda like a promise that can resolve with many values. That doesn't make sense
|
|
3465
|
+
// with real promises, so each advance methods returns a new promise for the cursor object, or
|
|
3466
|
+
// undefined if the end of the cursor has been reached.
|
|
3467
|
+
if (getCursorAdvanceMethods().includes(func)) {
|
|
3468
|
+
return function (...args) {
|
|
3469
|
+
// Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use
|
|
3470
|
+
// the original object.
|
|
3471
|
+
func.apply(unwrap(this), args);
|
|
3472
|
+
return wrap$4(this.request);
|
|
3473
|
+
};
|
|
3474
|
+
}
|
|
3475
|
+
return function (...args) {
|
|
3476
|
+
// Calling the original function with the proxy as 'this' causes ILLEGAL INVOCATION, so we use
|
|
3477
|
+
// the original object.
|
|
3478
|
+
return wrap$4(func.apply(unwrap(this), args));
|
|
3479
|
+
};
|
|
3480
|
+
}
|
|
3481
|
+
function transformCachableValue(value) {
|
|
3482
|
+
if (typeof value === 'function') return wrapFunction(value);
|
|
3483
|
+
// This doesn't return, it just creates a 'done' promise for the transaction,
|
|
3484
|
+
// which is later returned for transaction.done (see idbObjectHandler).
|
|
3485
|
+
if (value instanceof IDBTransaction) cacheDonePromiseForTransaction(value);
|
|
3486
|
+
if (instanceOfAny(value, getIdbProxyableTypes())) return new Proxy(value, idbProxyTraps);
|
|
3487
|
+
// Return the same value back if we're not going to transform it.
|
|
3488
|
+
return value;
|
|
3489
|
+
}
|
|
3490
|
+
function wrap$4(value) {
|
|
3491
|
+
// We sometimes generate multiple promises from a single IDBRequest (eg when cursoring), because
|
|
3492
|
+
// IDB is weird and a single IDBRequest can yield many responses, so these can't be cached.
|
|
3493
|
+
if (value instanceof IDBRequest) return promisifyRequest(value);
|
|
3494
|
+
// If we've already transformed this value before, reuse the transformed value.
|
|
3495
|
+
// This is faster, but it also provides object equality.
|
|
3496
|
+
if (transformCache.has(value)) return transformCache.get(value);
|
|
3497
|
+
const newValue = transformCachableValue(value);
|
|
3498
|
+
// Not all types are transformed.
|
|
3499
|
+
// These may be primitive types, so they can't be WeakMap keys.
|
|
3500
|
+
if (newValue !== value) {
|
|
3501
|
+
transformCache.set(value, newValue);
|
|
3502
|
+
reverseTransformCache.set(newValue, value);
|
|
3503
|
+
}
|
|
3504
|
+
return newValue;
|
|
3505
|
+
}
|
|
3506
|
+
const unwrap = value => reverseTransformCache.get(value);
|
|
3507
|
+
|
|
3508
|
+
/**
|
|
3509
|
+
* Open a database.
|
|
3510
|
+
*
|
|
3511
|
+
* @param name Name of the database.
|
|
3512
|
+
* @param version Schema version.
|
|
3513
|
+
* @param callbacks Additional callbacks.
|
|
3514
|
+
*/
|
|
3515
|
+
function openDB(name, version, {
|
|
3516
|
+
blocked,
|
|
3517
|
+
upgrade,
|
|
3518
|
+
blocking,
|
|
3519
|
+
terminated
|
|
3520
|
+
} = {}) {
|
|
3521
|
+
const request = indexedDB.open(name, version);
|
|
3522
|
+
const openPromise = wrap$4(request);
|
|
3523
|
+
if (upgrade) {
|
|
3524
|
+
request.addEventListener('upgradeneeded', event => {
|
|
3525
|
+
upgrade(wrap$4(request.result), event.oldVersion, event.newVersion, wrap$4(request.transaction), event);
|
|
3526
|
+
});
|
|
3527
|
+
}
|
|
3528
|
+
if (blocked) {
|
|
3529
|
+
request.addEventListener('blocked', event => blocked(
|
|
3530
|
+
// Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405
|
|
3531
|
+
event.oldVersion, event.newVersion, event));
|
|
3532
|
+
}
|
|
3533
|
+
openPromise.then(db => {
|
|
3534
|
+
if (terminated) db.addEventListener('close', () => terminated());
|
|
3535
|
+
if (blocking) {
|
|
3536
|
+
db.addEventListener('versionchange', event => blocking(event.oldVersion, event.newVersion, event));
|
|
3537
|
+
}
|
|
3538
|
+
}).catch(() => {});
|
|
3539
|
+
return openPromise;
|
|
3540
|
+
}
|
|
3541
|
+
const readMethods = ['get', 'getKey', 'getAll', 'getAllKeys', 'count'];
|
|
3542
|
+
const writeMethods = ['put', 'add', 'delete', 'clear'];
|
|
3543
|
+
const cachedMethods = new Map();
|
|
3544
|
+
function getMethod(target, prop) {
|
|
3545
|
+
if (!(target instanceof IDBDatabase && !(prop in target) && typeof prop === 'string')) {
|
|
3546
|
+
return;
|
|
3547
|
+
}
|
|
3548
|
+
if (cachedMethods.get(prop)) return cachedMethods.get(prop);
|
|
3549
|
+
const targetFuncName = prop.replace(/FromIndex$/, '');
|
|
3550
|
+
const useIndex = prop !== targetFuncName;
|
|
3551
|
+
const isWrite = writeMethods.includes(targetFuncName);
|
|
3552
|
+
if (
|
|
3553
|
+
// Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.
|
|
3554
|
+
!(targetFuncName in (useIndex ? IDBIndex : IDBObjectStore).prototype) || !(isWrite || readMethods.includes(targetFuncName))) {
|
|
3555
|
+
return;
|
|
3556
|
+
}
|
|
3557
|
+
const method = async function (storeName, ...args) {
|
|
3558
|
+
// isWrite ? 'readwrite' : undefined gzipps better, but fails in Edge :(
|
|
3559
|
+
const tx = this.transaction(storeName, isWrite ? 'readwrite' : 'readonly');
|
|
3560
|
+
let target = tx.store;
|
|
3561
|
+
if (useIndex) target = target.index(args.shift());
|
|
3562
|
+
// Must reject if op rejects.
|
|
3563
|
+
// If it's a write operation, must reject if tx.done rejects.
|
|
3564
|
+
// Must reject with op rejection first.
|
|
3565
|
+
// Must resolve with op value.
|
|
3566
|
+
// Must handle both promises (no unhandled rejections)
|
|
3567
|
+
return (await Promise.all([target[targetFuncName](...args), isWrite && tx.done]))[0];
|
|
3568
|
+
};
|
|
3569
|
+
cachedMethods.set(prop, method);
|
|
3570
|
+
return method;
|
|
3571
|
+
}
|
|
3572
|
+
replaceTraps(oldTraps => ({
|
|
3573
|
+
...oldTraps,
|
|
3574
|
+
get: (target, prop, receiver) => getMethod(target, prop) || oldTraps.get(target, prop, receiver),
|
|
3575
|
+
has: (target, prop) => !!getMethod(target, prop) || oldTraps.has(target, prop)
|
|
3576
|
+
}));
|
|
3577
|
+
const advanceMethodProps = ['continue', 'continuePrimaryKey', 'advance'];
|
|
3578
|
+
const methodMap = {};
|
|
3579
|
+
const advanceResults = new WeakMap();
|
|
3580
|
+
const ittrProxiedCursorToOriginalProxy = new WeakMap();
|
|
3581
|
+
const cursorIteratorTraps = {
|
|
3582
|
+
get(target, prop) {
|
|
3583
|
+
if (!advanceMethodProps.includes(prop)) return target[prop];
|
|
3584
|
+
let cachedFunc = methodMap[prop];
|
|
3585
|
+
if (!cachedFunc) {
|
|
3586
|
+
cachedFunc = methodMap[prop] = function (...args) {
|
|
3587
|
+
advanceResults.set(this, ittrProxiedCursorToOriginalProxy.get(this)[prop](...args));
|
|
3588
|
+
};
|
|
3589
|
+
}
|
|
3590
|
+
return cachedFunc;
|
|
3591
|
+
}
|
|
3592
|
+
};
|
|
3593
|
+
async function* iterate(...args) {
|
|
3594
|
+
// tslint:disable-next-line:no-this-assignment
|
|
3595
|
+
let cursor = this;
|
|
3596
|
+
if (!(cursor instanceof IDBCursor)) {
|
|
3597
|
+
cursor = await cursor.openCursor(...args);
|
|
3598
|
+
}
|
|
3599
|
+
if (!cursor) return;
|
|
3600
|
+
cursor = cursor;
|
|
3601
|
+
const proxiedCursor = new Proxy(cursor, cursorIteratorTraps);
|
|
3602
|
+
ittrProxiedCursorToOriginalProxy.set(proxiedCursor, cursor);
|
|
3603
|
+
// Map this double-proxy back to the original, so other cursor methods work.
|
|
3604
|
+
reverseTransformCache.set(proxiedCursor, unwrap(cursor));
|
|
3605
|
+
while (cursor) {
|
|
3606
|
+
yield proxiedCursor;
|
|
3607
|
+
// If one of the advancing methods was not called, call continue().
|
|
3608
|
+
cursor = await (advanceResults.get(proxiedCursor) || cursor.continue());
|
|
3609
|
+
advanceResults.delete(proxiedCursor);
|
|
3610
|
+
}
|
|
3611
|
+
}
|
|
3612
|
+
function isIteratorProp(target, prop) {
|
|
3613
|
+
return prop === Symbol.asyncIterator && instanceOfAny(target, [IDBIndex, IDBObjectStore, IDBCursor]) || prop === 'iterate' && instanceOfAny(target, [IDBIndex, IDBObjectStore]);
|
|
3614
|
+
}
|
|
3615
|
+
replaceTraps(oldTraps => ({
|
|
3616
|
+
...oldTraps,
|
|
3617
|
+
get(target, prop, receiver) {
|
|
3618
|
+
if (isIteratorProp(target, prop)) return iterate;
|
|
3619
|
+
return oldTraps.get(target, prop, receiver);
|
|
3620
|
+
},
|
|
3621
|
+
has(target, prop) {
|
|
3622
|
+
return isIteratorProp(target, prop) || oldTraps.has(target, prop);
|
|
3623
|
+
}
|
|
3624
|
+
}));
|
|
3625
|
+
|
|
3626
|
+
const state = {
|
|
3627
|
+
databases: Object.create(null),
|
|
3628
|
+
eventId: 0,
|
|
3629
|
+
dbVersion: 1,
|
|
3630
|
+
/**
|
|
3631
|
+
* @type {any}
|
|
3632
|
+
*/
|
|
3633
|
+
cachedDb: undefined
|
|
3634
|
+
};
|
|
3635
|
+
|
|
3636
|
+
const isDataCloneError = error => {
|
|
3637
|
+
return error && error.name === 'DataCloneError';
|
|
3638
|
+
};
|
|
3639
|
+
|
|
3640
|
+
// TODO high memory usage in idb because of transactionDoneMap
|
|
3641
|
+
|
|
3642
|
+
const getDb = async () => {
|
|
3643
|
+
// @ts-ignore
|
|
3644
|
+
const db = await openDB('session', state.dbVersion, {
|
|
3645
|
+
async upgrade(db, oldVersion) {
|
|
3646
|
+
if (!db.objectStoreNames.contains('session')) {
|
|
3647
|
+
const objectStore = await db.createObjectStore('session', {
|
|
3648
|
+
autoIncrement: true
|
|
3649
|
+
});
|
|
3650
|
+
objectStore.createIndex('sessionId', 'sessionId', {
|
|
3651
|
+
unique: false
|
|
3652
|
+
});
|
|
3653
|
+
}
|
|
3654
|
+
}
|
|
3655
|
+
});
|
|
3656
|
+
return db;
|
|
3657
|
+
};
|
|
3658
|
+
const getDbMemoized = async () => {
|
|
3659
|
+
state.cachedDb ||= await getDb();
|
|
3660
|
+
return state.cachedDb;
|
|
3661
|
+
};
|
|
3662
|
+
const saveValue = async (storeId, value) => {
|
|
3663
|
+
try {
|
|
3664
|
+
const db = await getDbMemoized();
|
|
3665
|
+
await db.add('session', value);
|
|
3666
|
+
} catch (error) {
|
|
3667
|
+
if (isDataCloneError(error)) {
|
|
3668
|
+
// TODO
|
|
3669
|
+
return;
|
|
3670
|
+
}
|
|
3671
|
+
throw new VError$1(error, 'Failed to save value to indexed db');
|
|
3672
|
+
}
|
|
3673
|
+
};
|
|
3674
|
+
const getValues = async storeId => {
|
|
3675
|
+
try {
|
|
3676
|
+
const db = await getDbMemoized();
|
|
3677
|
+
const tx = db.transaction(storeId, 'readwrite');
|
|
3678
|
+
const [objects] = await Promise.all([tx.store.getAll(), tx.done]);
|
|
3679
|
+
console.log({
|
|
3680
|
+
objects
|
|
3681
|
+
});
|
|
3682
|
+
return objects;
|
|
3683
|
+
} catch (error) {
|
|
3684
|
+
throw new VError$1(error, 'Failed to get values from indexed db');
|
|
3685
|
+
}
|
|
3686
|
+
};
|
|
3687
|
+
const getValuesByIndexName = async (storeId, indexName, only) => {
|
|
3688
|
+
const db = await getDbMemoized();
|
|
3689
|
+
const transaction = db.transaction(storeId);
|
|
3690
|
+
const index = transaction.store.index(indexName);
|
|
3691
|
+
const iterator = index.iterate(only);
|
|
3692
|
+
const objects = [];
|
|
3693
|
+
for await (const cursor of iterator) {
|
|
3694
|
+
objects.push(cursor.value);
|
|
3695
|
+
}
|
|
3696
|
+
return objects;
|
|
3697
|
+
};
|
|
3698
|
+
const getHandleDb = async () => {
|
|
3699
|
+
const db = await openDB('handle', state.dbVersion, {
|
|
3700
|
+
async upgrade(db, oldVersion) {
|
|
3701
|
+
if (!db.objectStoreNames.contains('file-handles-store')) {
|
|
3702
|
+
// @ts-ignore
|
|
3703
|
+
await db.createObjectStore('file-handles-store', {});
|
|
3704
|
+
}
|
|
3705
|
+
}
|
|
3706
|
+
});
|
|
3707
|
+
return db;
|
|
3708
|
+
};
|
|
3709
|
+
const addHandle = async (uri, handle) => {
|
|
3710
|
+
const handleDb = await getHandleDb();
|
|
3711
|
+
await handleDb.put('file-handles-store', handle, uri);
|
|
3712
|
+
};
|
|
3713
|
+
const getHandle = async uri => {
|
|
3714
|
+
const handleDb = await getHandleDb();
|
|
3715
|
+
const handle = await handleDb.get('file-handles-store', uri);
|
|
3716
|
+
return handle;
|
|
3717
|
+
};
|
|
3718
|
+
|
|
3352
3719
|
const commandMap = {
|
|
3353
|
-
'ExtensionHostRename.executeRenameProvider': executeRenameProvider,
|
|
3354
3720
|
'ExtensionHostRename.executeprepareRenameProvider': executeprepareRenameProvider,
|
|
3721
|
+
'ExtensionHostRename.executeRenameProvider': executeRenameProvider,
|
|
3722
|
+
'IndexedDb.addHandle': addHandle,
|
|
3723
|
+
'IndexedDb.getHandle': getHandle,
|
|
3724
|
+
'IndexedDb.getValues': getValues,
|
|
3725
|
+
'IndexedDb.getValuesByIndexName': getValuesByIndexName,
|
|
3726
|
+
'IndexedDb.saveValue': saveValue,
|
|
3355
3727
|
['ExtensionHostDebug.evaluate']: evaluate,
|
|
3356
3728
|
['ExtensionHostDebug.getProperties']: getProperties,
|
|
3357
3729
|
['ExtensionHostDebug.listProcesses']: listProcesses,
|
|
@@ -3484,7 +3856,7 @@ const main = async () => {
|
|
|
3484
3856
|
const ipc = await listen({
|
|
3485
3857
|
method: Auto()
|
|
3486
3858
|
});
|
|
3487
|
-
listen$
|
|
3859
|
+
listen$4(ipc);
|
|
3488
3860
|
};
|
|
3489
3861
|
|
|
3490
3862
|
main();
|
package/package.json
CHANGED