@lvce-editor/extension-host-worker 5.20.0 → 5.22.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.
@@ -1113,7 +1113,7 @@ const rename$1 = async (protocol, oldUri, newUri) => {
1113
1113
  throw new VError(error, 'Failed to execute file system provider');
1114
1114
  }
1115
1115
  };
1116
- const writeFile$2 = async (protocol, uri, content) => {
1116
+ const writeFile$3 = async (protocol, uri, content) => {
1117
1117
  try {
1118
1118
  const provider = get$a(protocol);
1119
1119
  return await provider.writeFile(uri, content);
@@ -2540,6 +2540,10 @@ const append = async (uri, content) => {
2540
2540
  const rpc = await getOrCreateRpc$1();
2541
2541
  await rpc.invoke('FileSystem.appendFile', uri, content);
2542
2542
  };
2543
+ const writeFile$2 = async (uri, content) => {
2544
+ const rpc = await getOrCreateRpc$1();
2545
+ await rpc.invoke('FileSystem.writeFile', uri, content);
2546
+ };
2543
2547
 
2544
2548
  const getOutputFilePath = id => {
2545
2549
  const outputFolderPath = 'file:///tmp';
@@ -2563,9 +2567,18 @@ const registerOutputChannel = provider => {
2563
2567
  ...provider,
2564
2568
  uri
2565
2569
  };
2570
+ let isFirst = true;
2566
2571
  return {
2567
2572
  async append(text) {
2568
- await append(uri, text);
2573
+ // TODO race condition?
2574
+ if (isFirst) {
2575
+ isFirst = false;
2576
+ await writeFile$2(uri, '');
2577
+ }
2578
+ await append(uri, text + '\n');
2579
+ },
2580
+ async replace(text) {
2581
+ await writeFile$2(uri, text);
2569
2582
  },
2570
2583
  getUri() {
2571
2584
  return uri;
@@ -6072,7 +6085,7 @@ const commandMap = {
6072
6085
  [FileSystemReadDirWithFileTypes]: readDirWithFileTypes$2,
6073
6086
  [FileSystemReadFile]: readFile$2,
6074
6087
  [FileSystemRename]: rename$1,
6075
- [FileSystemWriteFile]: writeFile$2,
6088
+ [FileSystemWriteFile]: writeFile$3,
6076
6089
  [FormattingExecuteFormmattingProvider]: executeFormattingProvider,
6077
6090
  [HoverExecute]: executeHoverProvider,
6078
6091
  [ImplementationExecuteImplementationProvider]: executeImplementationProvider,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-host-worker",
3
- "version": "5.20.0",
3
+ "version": "5.22.0",
4
4
  "description": "Webworker for the extension host functionality in Lvce Editor.",
5
5
  "keywords": [
6
6
  "web-worker"