@lvce-editor/extension-host-worker 5.18.0 → 5.20.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.
|
@@ -2518,7 +2518,8 @@ const createNodeRpc = async ({
|
|
|
2518
2518
|
};
|
|
2519
2519
|
|
|
2520
2520
|
const send = async port => {
|
|
2521
|
-
|
|
2521
|
+
const initialCommand = 'FileSystem.handleMessagePort';
|
|
2522
|
+
await invokeAndTransfer$2('SendMessagePortToExtensionHostWorker.sendMessagePortToFileSystemWorker', port, initialCommand);
|
|
2522
2523
|
};
|
|
2523
2524
|
const launchFileSystemProcess = async () => {
|
|
2524
2525
|
const rpc = await TransferMessagePortRpcParent.create({
|
|
@@ -2540,10 +2541,28 @@ const append = async (uri, content) => {
|
|
|
2540
2541
|
await rpc.invoke('FileSystem.appendFile', uri, content);
|
|
2541
2542
|
};
|
|
2542
2543
|
|
|
2544
|
+
const getOutputFilePath = id => {
|
|
2545
|
+
const outputFolderPath = 'file:///tmp';
|
|
2546
|
+
const uri = `${outputFolderPath}/${id}.txt`;
|
|
2547
|
+
return uri;
|
|
2548
|
+
};
|
|
2549
|
+
|
|
2543
2550
|
const providers = Object.create(null);
|
|
2544
2551
|
const registerOutputChannel = provider => {
|
|
2545
|
-
|
|
2546
|
-
|
|
2552
|
+
if (!provider) {
|
|
2553
|
+
throw new Error(`provider is required`);
|
|
2554
|
+
}
|
|
2555
|
+
if (!provider.id) {
|
|
2556
|
+
throw new Error('provider.id is required');
|
|
2557
|
+
}
|
|
2558
|
+
if (!provider.label) {
|
|
2559
|
+
throw new Error('provider.label is required');
|
|
2560
|
+
}
|
|
2561
|
+
const uri = getOutputFilePath(provider.id);
|
|
2562
|
+
providers[provider.id] = {
|
|
2563
|
+
...provider,
|
|
2564
|
+
uri
|
|
2565
|
+
};
|
|
2547
2566
|
return {
|
|
2548
2567
|
async append(text) {
|
|
2549
2568
|
await append(uri, text);
|
|
@@ -2559,7 +2578,8 @@ const getEnabledProviders = () => {
|
|
|
2559
2578
|
for (const provider of values) {
|
|
2560
2579
|
enabledProviders.push({
|
|
2561
2580
|
id: provider.id,
|
|
2562
|
-
label: provider.label
|
|
2581
|
+
label: provider.label,
|
|
2582
|
+
uri: provider.uri
|
|
2563
2583
|
});
|
|
2564
2584
|
}
|
|
2565
2585
|
return enabledProviders;
|