@lvce-editor/extension-host-worker 5.21.0 → 5.23.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.
@@ -1095,6 +1095,9 @@ const readFileExternal = async path => {
1095
1095
  const content = await invoke$2('FileSystem.readFile', path);
1096
1096
  return content;
1097
1097
  };
1098
+ const existsExternal = async uri => {
1099
+ return await invoke$2('FileSystem.exists', uri);
1100
+ };
1098
1101
  const readDirWithFileTypesExternal = async path => {
1099
1102
  // TODO when file is local,
1100
1103
  // don't ask renderer worker
@@ -2577,6 +2580,9 @@ const registerOutputChannel = provider => {
2577
2580
  }
2578
2581
  await append(uri, text + '\n');
2579
2582
  },
2583
+ async replace(text) {
2584
+ await writeFile$2(uri, text);
2585
+ },
2580
2586
  getUri() {
2581
2587
  return uri;
2582
2588
  }
@@ -3211,6 +3217,7 @@ const api = {
3211
3217
  registerFileSystemProvider: registerFileSystemProvider,
3212
3218
  readFile: readFileExternal,
3213
3219
  readDirWithFileTypes: readDirWithFileTypesExternal,
3220
+ exists: existsExternal,
3214
3221
  // Formatting
3215
3222
  registerFormattingProvider: registerFormattingProvider,
3216
3223
  executeFormattingProvider: executeFormattingProvider,
@@ -5075,6 +5082,13 @@ const readFile = uri => {
5075
5082
  }
5076
5083
  return dirent.content;
5077
5084
  };
5085
+ const exists = uri => {
5086
+ const dirent = getDirent(uri);
5087
+ if (!dirent) {
5088
+ return false;
5089
+ }
5090
+ return true;
5091
+ };
5078
5092
  const ensureParentDir = uri => {
5079
5093
  const startIndex = 0;
5080
5094
  let endIndex = uri.indexOf(Slash);
@@ -6029,6 +6043,7 @@ const commandMap = {
6029
6043
  'FileSystemFetch.remove': remove$2,
6030
6044
  'FileSystemFetch.writeFile': writeFile$1,
6031
6045
  'FileSystemMemory.chmod': chmod,
6046
+ 'FileSystemMemory.exists': exists,
6032
6047
  'FileSystemMemory.copy': copy,
6033
6048
  'FileSystemMemory.getBlob': getBlob,
6034
6049
  'FileSystemMemory.getBlobUrl': getBlobUrl,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/extension-host-worker",
3
- "version": "5.21.0",
3
+ "version": "5.23.0",
4
4
  "description": "Webworker for the extension host functionality in Lvce Editor.",
5
5
  "keywords": [
6
6
  "web-worker"