@lvce-editor/test-worker 1.5.0 → 1.7.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/testWorkerMain.js +31 -21
- package/package.json +8 -1
package/dist/testWorkerMain.js
CHANGED
|
@@ -368,14 +368,7 @@ const invoke$1 = async (ipc, method, ...params) => {
|
|
|
368
368
|
const result = unwrapJsonRpcResult(responseMessage);
|
|
369
369
|
return result;
|
|
370
370
|
};
|
|
371
|
-
|
|
372
|
-
// TODO deprecated old typings,
|
|
373
|
-
// always use automatic transferrable detection
|
|
374
|
-
const invokeAndTransfer$1 = async (ipc, handle, method, ...params) => {
|
|
375
|
-
if (typeof handle === 'string') {
|
|
376
|
-
params = [method, ...params];
|
|
377
|
-
method = handle;
|
|
378
|
-
}
|
|
371
|
+
const invokeAndTransfer$1 = async (ipc, method, ...params) => {
|
|
379
372
|
const {
|
|
380
373
|
message,
|
|
381
374
|
promise
|
|
@@ -990,9 +983,19 @@ const openSourceActions = async () => {
|
|
|
990
983
|
const sourceActionsSelectCurrent = async () => {
|
|
991
984
|
await invoke('EditorSourceActions.selectCurrent');
|
|
992
985
|
};
|
|
986
|
+
const openCompletionDetails = async () => {
|
|
987
|
+
await invoke('EditorCompletion.openDetails');
|
|
988
|
+
};
|
|
989
|
+
const closeCompletionDetails = async () => {
|
|
990
|
+
await invoke('EditorCompletion.closeDetails');
|
|
991
|
+
};
|
|
992
|
+
const toggleCompletionDetails = async () => {
|
|
993
|
+
await invoke('EditorCompletion.toggleDetails');
|
|
994
|
+
};
|
|
993
995
|
|
|
994
996
|
const TestFrameWorkComponentEditor = {
|
|
995
997
|
__proto__: null,
|
|
998
|
+
closeCompletionDetails,
|
|
996
999
|
copyLineDown,
|
|
997
1000
|
cursorCharacterLeft,
|
|
998
1001
|
cursorCharacterRight,
|
|
@@ -1010,6 +1013,7 @@ const TestFrameWorkComponentEditor = {
|
|
|
1010
1013
|
invokeBraceCompletion,
|
|
1011
1014
|
invokeTabCompletion,
|
|
1012
1015
|
openCompletion,
|
|
1016
|
+
openCompletionDetails,
|
|
1013
1017
|
openEditorContextMenu,
|
|
1014
1018
|
openFindWidget,
|
|
1015
1019
|
openHover,
|
|
@@ -1018,6 +1022,7 @@ const TestFrameWorkComponentEditor = {
|
|
|
1018
1022
|
setDeltaY,
|
|
1019
1023
|
setSelections,
|
|
1020
1024
|
sourceActionsSelectCurrent,
|
|
1025
|
+
toggleCompletionDetails,
|
|
1021
1026
|
type
|
|
1022
1027
|
};
|
|
1023
1028
|
|
|
@@ -1277,7 +1282,7 @@ const getIsFirefox = () => {
|
|
|
1277
1282
|
const isFirefox$1 = getIsFirefox();
|
|
1278
1283
|
|
|
1279
1284
|
const getNodePath$1 = () => {
|
|
1280
|
-
return invoke(
|
|
1285
|
+
return invoke(/* Platform.getNodePath */'Platform.getNodePath');
|
|
1281
1286
|
};
|
|
1282
1287
|
|
|
1283
1288
|
const getNodePath = () => {
|
|
@@ -1799,6 +1804,18 @@ const joinLines = lines => {
|
|
|
1799
1804
|
const splitLines = lines => {
|
|
1800
1805
|
return lines.split(NewLine$1);
|
|
1801
1806
|
};
|
|
1807
|
+
const isModuleNotFoundMessage = line => {
|
|
1808
|
+
return line.includes('[ERR_MODULE_NOT_FOUND]');
|
|
1809
|
+
};
|
|
1810
|
+
const getModuleNotFoundError = stderr => {
|
|
1811
|
+
const lines = splitLines(stderr);
|
|
1812
|
+
const messageIndex = lines.findIndex(isModuleNotFoundMessage);
|
|
1813
|
+
const message = lines[messageIndex];
|
|
1814
|
+
return {
|
|
1815
|
+
message,
|
|
1816
|
+
code: ERR_MODULE_NOT_FOUND
|
|
1817
|
+
};
|
|
1818
|
+
};
|
|
1802
1819
|
const RE_NATIVE_MODULE_ERROR = /^innerError Error: Cannot find module '.*.node'/;
|
|
1803
1820
|
const RE_NATIVE_MODULE_ERROR_2 = /was compiled against a different Node.js version/;
|
|
1804
1821
|
const RE_MESSAGE_CODE_BLOCK_START = /^Error: The module '.*'$/;
|
|
@@ -1847,18 +1864,6 @@ const isModuleNotFoundError = stderr => {
|
|
|
1847
1864
|
}
|
|
1848
1865
|
return stderr.includes('ERR_MODULE_NOT_FOUND');
|
|
1849
1866
|
};
|
|
1850
|
-
const isModuleNotFoundMessage = line => {
|
|
1851
|
-
return line.includes('ERR_MODULE_NOT_FOUND');
|
|
1852
|
-
};
|
|
1853
|
-
const getModuleNotFoundError = stderr => {
|
|
1854
|
-
const lines = splitLines(stderr);
|
|
1855
|
-
const messageIndex = lines.findIndex(isModuleNotFoundMessage);
|
|
1856
|
-
const message = lines[messageIndex];
|
|
1857
|
-
return {
|
|
1858
|
-
message,
|
|
1859
|
-
code: ERR_MODULE_NOT_FOUND
|
|
1860
|
-
};
|
|
1861
|
-
};
|
|
1862
1867
|
const isNormalStackLine = line => {
|
|
1863
1868
|
return RE_AT.test(line) && !RE_AT_PROMISE_INDEX.test(line);
|
|
1864
1869
|
};
|
|
@@ -2015,6 +2020,11 @@ const listen$3 = async () => {
|
|
|
2015
2020
|
}
|
|
2016
2021
|
const type = firstMessage.params[0];
|
|
2017
2022
|
if (type === 'message-port') {
|
|
2023
|
+
parentIpc.send({
|
|
2024
|
+
jsonrpc: '2.0',
|
|
2025
|
+
id: firstMessage.id,
|
|
2026
|
+
result: null
|
|
2027
|
+
});
|
|
2018
2028
|
parentIpc.dispose();
|
|
2019
2029
|
const port = firstMessage.params[1];
|
|
2020
2030
|
return port;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/test-worker",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/testWorkerMain.js",
|
|
6
6
|
"type": "module",
|
|
@@ -66,5 +66,12 @@
|
|
|
66
66
|
"ignores": [
|
|
67
67
|
"distmin"
|
|
68
68
|
]
|
|
69
|
+
},
|
|
70
|
+
"nodemonConfig": {
|
|
71
|
+
"watch": [
|
|
72
|
+
"src"
|
|
73
|
+
],
|
|
74
|
+
"ext": "ts,js",
|
|
75
|
+
"exec": "node scripts/build.js"
|
|
69
76
|
}
|
|
70
77
|
}
|