@lvce-editor/editor-worker 7.12.0 → 7.14.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/editorWorkerMain.js +25 -5
- package/package.json +1 -1
package/dist/editorWorkerMain.js
CHANGED
|
@@ -785,7 +785,7 @@ const getErrorResponse = (id, error, preparePrettyError, logError) => {
|
|
|
785
785
|
const errorProperty = getErrorProperty(error, prettyError);
|
|
786
786
|
return create$1$1(id, errorProperty);
|
|
787
787
|
};
|
|
788
|
-
const create$
|
|
788
|
+
const create$b = (message, result) => {
|
|
789
789
|
return {
|
|
790
790
|
jsonrpc: Two,
|
|
791
791
|
id: message.id,
|
|
@@ -794,7 +794,7 @@ const create$c = (message, result) => {
|
|
|
794
794
|
};
|
|
795
795
|
const getSuccessResponse = (message, result) => {
|
|
796
796
|
const resultProperty = result ?? null;
|
|
797
|
-
return create$
|
|
797
|
+
return create$b(message, resultProperty);
|
|
798
798
|
};
|
|
799
799
|
const getErrorResponseSimple = (id, error) => {
|
|
800
800
|
return {
|
|
@@ -976,7 +976,7 @@ const listen$1 = async (module, options) => {
|
|
|
976
976
|
const ipc = module.wrap(rawIpc);
|
|
977
977
|
return ipc;
|
|
978
978
|
};
|
|
979
|
-
const create$
|
|
979
|
+
const create$d = async ({
|
|
980
980
|
commandMap,
|
|
981
981
|
messagePort,
|
|
982
982
|
isMessagePortOpen
|
|
@@ -994,7 +994,7 @@ const create$b = async ({
|
|
|
994
994
|
};
|
|
995
995
|
const MessagePortRpcParent = {
|
|
996
996
|
__proto__: null,
|
|
997
|
-
create: create$
|
|
997
|
+
create: create$d
|
|
998
998
|
};
|
|
999
999
|
const create$5$1 = async ({
|
|
1000
1000
|
commandMap,
|
|
@@ -8549,6 +8549,24 @@ const getKeyBindings = () => {
|
|
|
8549
8549
|
}];
|
|
8550
8550
|
};
|
|
8551
8551
|
|
|
8552
|
+
const getDiagnostics = editor => {
|
|
8553
|
+
return executeDiagnosticProvider(editor);
|
|
8554
|
+
};
|
|
8555
|
+
const getProblems = async () => {
|
|
8556
|
+
// TODO maybe combine querying diagnostics for problems view with diagnostics for editor
|
|
8557
|
+
// or query the diagnostics for the problems view directtly from the extension host worker
|
|
8558
|
+
const keys = getKeys();
|
|
8559
|
+
const editors = keys.map(key => {
|
|
8560
|
+
const numericKey = parseInt(key);
|
|
8561
|
+
const editor = get$4(numericKey);
|
|
8562
|
+
return editor;
|
|
8563
|
+
});
|
|
8564
|
+
const newEditors = editors.map(editor => editor.newState);
|
|
8565
|
+
const diagnostics = await Promise.all(newEditors.map(getDiagnostics));
|
|
8566
|
+
const flatDiagnostics = diagnostics.flat();
|
|
8567
|
+
return flatDiagnostics;
|
|
8568
|
+
};
|
|
8569
|
+
|
|
8552
8570
|
const getQuickPickMenuEntries = () => {
|
|
8553
8571
|
return [{
|
|
8554
8572
|
id: 'Editor.format',
|
|
@@ -8682,6 +8700,7 @@ const createExtensionHostRpc = async () => {
|
|
|
8682
8700
|
port2
|
|
8683
8701
|
} = getPortTuple();
|
|
8684
8702
|
const initialCommand = 'HandleMessagePort.handleMessagePort2';
|
|
8703
|
+
// TODO use transfer rpc
|
|
8685
8704
|
await sendMessagePortToExtensionHostWorker2(port2, initialCommand, RpcId.EditorWorker);
|
|
8686
8705
|
const rpc = await PlainMessagePortRpcParent.create({
|
|
8687
8706
|
commandMap: {},
|
|
@@ -9733,7 +9752,7 @@ const editorDiagnosticEffect = {
|
|
|
9733
9752
|
}
|
|
9734
9753
|
};
|
|
9735
9754
|
|
|
9736
|
-
const keep = ['ActivateByEvent.activateByEvent', 'Editor.applyEdit2', 'Editor.applyEdits2', 'Editor.closeFind2', 'Editor.closeWidget2', 'Editor.create', 'Editor.getKeyBindings', 'Editor.getLines2', 'Editor.getPositionAtCursor', 'Editor.getOffsetAtCursor', 'Editor.getQuickPickMenuEntries', 'Editor.getSelections', 'Editor.getSelections2', 'Editor.getText', 'Editor.getWordAt', 'Editor.getWordAt2', 'Editor.getWordAtOffset2', 'Editor.getUri', 'Editor.getWordBefore', 'Editor.getWordBefore2', 'Editor.offsetAt', 'Editor.render', 'Editor.setSelections2', 'Editor.updateDebugInfo', 'Editor.getLanguageId', 'Font.ensure', 'HandleMessagePort.handleMessagePort', 'Hover.getHoverInfo', 'Hover.handleSashPointerDown', 'Hover.handleSashPointerMove', 'Hover.handleSashPointerUp', 'Hover.loadContent', 'Hover.render', 'Initialize.initialize', 'SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker'
|
|
9755
|
+
const keep = ['ActivateByEvent.activateByEvent', 'Editor.applyEdit2', 'Editor.applyEdits2', 'Editor.closeFind2', 'Editor.closeWidget2', 'Editor.create', 'Editor.getKeyBindings', 'Editor.getLines2', 'Editor.getPositionAtCursor', 'Editor.getOffsetAtCursor', 'Editor.getQuickPickMenuEntries', 'Editor.getSelections', 'Editor.getSelections2', 'Editor.getText', 'Editor.getWordAt', 'Editor.getWordAt2', 'Editor.getWordAtOffset2', 'Editor.getUri', 'Editor.getWordBefore', 'Editor.getWordBefore2', 'Editor.offsetAt', 'Editor.render', 'Editor.setSelections2', 'Editor.updateDebugInfo', 'Editor.getLanguageId', 'Editor.getProblems', 'Font.ensure', 'HandleMessagePort.handleMessagePort', 'Hover.getHoverInfo', 'Hover.handleSashPointerDown', 'Hover.handleSashPointerMove', 'Hover.handleSashPointerUp', 'Hover.loadContent', 'Hover.render', 'Initialize.initialize', 'SendMessagePortToExtensionHostWorker.sendMessagePortToExtensionHostWorker'
|
|
9737
9756
|
// 'ColorPicker.handleSliderPointerDown',
|
|
9738
9757
|
// 'ColorPicker.handleSliderPointerMove',
|
|
9739
9758
|
// 'ColorPicker.loadContent',
|
|
@@ -9934,6 +9953,7 @@ const commandMap = {
|
|
|
9934
9953
|
'Editor.paste': paste,
|
|
9935
9954
|
'Editor.pasteText': pasteText,
|
|
9936
9955
|
'Editor.render': renderEditor,
|
|
9956
|
+
'Editor.getProblems': getProblems,
|
|
9937
9957
|
'Editor.renderEventListeners': renderEventListeners,
|
|
9938
9958
|
'Editor.replaceRange': replaceRange,
|
|
9939
9959
|
'Editor.rerender': rerender,
|