@lvce-editor/extension-host-worker 5.19.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.
|
@@ -2541,16 +2541,27 @@ const append = async (uri, content) => {
|
|
|
2541
2541
|
await rpc.invoke('FileSystem.appendFile', uri, content);
|
|
2542
2542
|
};
|
|
2543
2543
|
|
|
2544
|
-
const providers = Object.create(null);
|
|
2545
2544
|
const getOutputFilePath = id => {
|
|
2546
2545
|
const outputFolderPath = 'file:///tmp';
|
|
2547
2546
|
const uri = `${outputFolderPath}/${id}.txt`;
|
|
2548
2547
|
return uri;
|
|
2549
2548
|
};
|
|
2549
|
+
|
|
2550
|
+
const providers = Object.create(null);
|
|
2550
2551
|
const registerOutputChannel = provider => {
|
|
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
|
+
}
|
|
2551
2561
|
const uri = getOutputFilePath(provider.id);
|
|
2552
2562
|
providers[provider.id] = {
|
|
2553
|
-
...provider
|
|
2563
|
+
...provider,
|
|
2564
|
+
uri
|
|
2554
2565
|
};
|
|
2555
2566
|
return {
|
|
2556
2567
|
async append(text) {
|