@lvce-editor/extension-host-worker 4.5.0 → 4.6.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 +29 -25
- package/package.json +1 -1
|
@@ -89,7 +89,7 @@ const fn = value => {
|
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
91
|
|
|
92
|
-
const state$
|
|
92
|
+
const state$e = {
|
|
93
93
|
/** @type{any[]} */
|
|
94
94
|
onDidOpenEditorListeners: [],
|
|
95
95
|
/** @type{any[]} */
|
|
@@ -101,19 +101,19 @@ const state$f = {
|
|
|
101
101
|
textDocuments: Object.create(null)
|
|
102
102
|
};
|
|
103
103
|
const setDocument = (textDocumentId, textDocument) => {
|
|
104
|
-
state$
|
|
104
|
+
state$e.textDocuments[textDocumentId] = textDocument;
|
|
105
105
|
};
|
|
106
106
|
const getDidOpenListeners = () => {
|
|
107
|
-
return state$
|
|
107
|
+
return state$e.onDidSaveTextDocumentListeners;
|
|
108
108
|
};
|
|
109
109
|
const getWillChangeListeners = () => {
|
|
110
|
-
return state$
|
|
110
|
+
return state$e.onWillChangeEditorListeners;
|
|
111
111
|
};
|
|
112
112
|
const getDidChangeListeners = () => {
|
|
113
|
-
return state$
|
|
113
|
+
return state$e.onDidChangeTextDocumentListeners;
|
|
114
114
|
};
|
|
115
115
|
const getDocument = textDocumentId => {
|
|
116
|
-
return state$
|
|
116
|
+
return state$e.textDocuments[textDocumentId];
|
|
117
117
|
};
|
|
118
118
|
|
|
119
119
|
const getOffset$1 = (textDocument, position) => {
|
|
@@ -303,7 +303,7 @@ const syncIncremental = (textDocumentId, changes) => {
|
|
|
303
303
|
textDocument.text = before + syntheticChange.inserted + after;
|
|
304
304
|
runListenersSafe(getDidChangeListeners(), textDocument, syntheticChanges);
|
|
305
305
|
};
|
|
306
|
-
const get$
|
|
306
|
+
const get$b = textDocumentId => {
|
|
307
307
|
const textDocument = getDocument(textDocumentId);
|
|
308
308
|
return textDocument;
|
|
309
309
|
};
|
|
@@ -535,7 +535,7 @@ const registerMethod = ({
|
|
|
535
535
|
}) => {
|
|
536
536
|
context[`execute${name}Provider`] = async function (textDocumentId, ...params) {
|
|
537
537
|
try {
|
|
538
|
-
const textDocument = get$
|
|
538
|
+
const textDocument = get$b(textDocumentId);
|
|
539
539
|
if (!textDocument) {
|
|
540
540
|
throw new Error(`textDocument with id ${textDocumentId} not found`);
|
|
541
541
|
}
|
|
@@ -670,12 +670,12 @@ const executeOrganizeImports = async uid => {
|
|
|
670
670
|
if (!organizeImportsAction) {
|
|
671
671
|
return [];
|
|
672
672
|
}
|
|
673
|
-
const textDocument = get$
|
|
673
|
+
const textDocument = get$b(uid);
|
|
674
674
|
const edits = await organizeImportsAction.execute(textDocument);
|
|
675
675
|
return edits;
|
|
676
676
|
};
|
|
677
677
|
|
|
678
|
-
const state$
|
|
678
|
+
const state$d = {
|
|
679
679
|
commands: Object.create(null)
|
|
680
680
|
};
|
|
681
681
|
const getCommandDisplay = command => {
|
|
@@ -698,10 +698,10 @@ const registerCommand = command => {
|
|
|
698
698
|
if (!command.execute) {
|
|
699
699
|
throw new Error('command is missing execute function');
|
|
700
700
|
}
|
|
701
|
-
if (command.id in state$
|
|
701
|
+
if (command.id in state$d.commands) {
|
|
702
702
|
throw new Error(`command cannot be registered multiple times`);
|
|
703
703
|
}
|
|
704
|
-
state$
|
|
704
|
+
state$d.commands[command.id] = command;
|
|
705
705
|
} catch (error) {
|
|
706
706
|
const commandDisplayId = getCommandDisplay(command);
|
|
707
707
|
throw new VError(error, `Failed to register command${commandDisplayId}`);
|
|
@@ -709,7 +709,7 @@ const registerCommand = command => {
|
|
|
709
709
|
};
|
|
710
710
|
const executeCommand = async (id, ...args) => {
|
|
711
711
|
try {
|
|
712
|
-
const command = state$
|
|
712
|
+
const command = state$d.commands[id];
|
|
713
713
|
if (!command) {
|
|
714
714
|
throw new Error(`command ${id} not found`);
|
|
715
715
|
}
|
|
@@ -748,34 +748,38 @@ const {
|
|
|
748
748
|
}]
|
|
749
749
|
});
|
|
750
750
|
|
|
751
|
-
const state$
|
|
751
|
+
const state$c = {
|
|
752
752
|
configuration: Object.create(null)
|
|
753
753
|
};
|
|
754
754
|
const getConfiguration = key => {
|
|
755
|
-
return state$
|
|
755
|
+
return state$c.configuration[key] ?? '';
|
|
756
756
|
};
|
|
757
757
|
const setConfigurations = preferences => {
|
|
758
|
-
state$
|
|
758
|
+
state$c.configuration = preferences;
|
|
759
759
|
};
|
|
760
760
|
|
|
761
|
-
const
|
|
762
|
-
|
|
761
|
+
const RendererWorker = 1;
|
|
762
|
+
|
|
763
|
+
const rpcs$2 = Object.create(null);
|
|
764
|
+
const set$9 = (id, rpc) => {
|
|
765
|
+
rpcs$2[id] = rpc;
|
|
766
|
+
};
|
|
767
|
+
const get$a = id => {
|
|
768
|
+
return rpcs$2[id];
|
|
763
769
|
};
|
|
770
|
+
|
|
764
771
|
const invoke$2 = (method, ...params) => {
|
|
765
|
-
const rpc =
|
|
772
|
+
const rpc = get$a(RendererWorker);
|
|
766
773
|
return rpc.invoke(method, ...params);
|
|
767
774
|
};
|
|
768
775
|
const send$1 = (method, ...params) => {
|
|
769
|
-
const rpc =
|
|
776
|
+
const rpc = get$a(RendererWorker);
|
|
770
777
|
return rpc.send(method, ...params);
|
|
771
778
|
};
|
|
772
779
|
const invokeAndTransfer$1 = (method, ...params) => {
|
|
773
|
-
const rpc =
|
|
780
|
+
const rpc = get$a(RendererWorker);
|
|
774
781
|
return rpc.invokeAndTransfer(method, ...params);
|
|
775
782
|
};
|
|
776
|
-
const setRpc = rpc => {
|
|
777
|
-
state$c.rpc = rpc;
|
|
778
|
-
};
|
|
779
783
|
|
|
780
784
|
const state$b = {
|
|
781
785
|
debugProviderMap: Object.create(null)
|
|
@@ -5498,7 +5502,7 @@ const listen = async () => {
|
|
|
5498
5502
|
const rpc = await WebWorkerRpcClient.create({
|
|
5499
5503
|
commandMap: commandMap
|
|
5500
5504
|
});
|
|
5501
|
-
|
|
5505
|
+
set$9(RendererWorker, rpc);
|
|
5502
5506
|
};
|
|
5503
5507
|
|
|
5504
5508
|
const main = async () => {
|
package/package.json
CHANGED