@codingame/monaco-vscode-files-service-override 4.3.0 → 4.3.2
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/files.js +10 -9
- package/package.json +2 -2
package/files.js
CHANGED
|
@@ -283,7 +283,7 @@ class OverlayFileSystemProvider {
|
|
|
283
283
|
}
|
|
284
284
|
throw firstError;
|
|
285
285
|
}
|
|
286
|
-
async writeToDelegates(
|
|
286
|
+
async writeToDelegates(caller) {
|
|
287
287
|
for (const provider of this.delegates) {
|
|
288
288
|
if (((provider.capabilities & 2048) ) > 0) {
|
|
289
289
|
continue;
|
|
@@ -332,26 +332,27 @@ class OverlayFileSystemProvider {
|
|
|
332
332
|
return store;
|
|
333
333
|
}
|
|
334
334
|
async writeFile(resource, content, opts) {
|
|
335
|
-
await this.writeToDelegates(
|
|
335
|
+
await this.writeToDelegates(async (delegate) => {
|
|
336
|
+
let stats;
|
|
336
337
|
try {
|
|
337
|
-
|
|
338
|
-
if (((stats.permissions ?? 0) & FilePermission.Readonly) > 0) {
|
|
339
|
-
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions);
|
|
340
|
-
}
|
|
338
|
+
stats = await delegate.stat(resource);
|
|
341
339
|
}
|
|
342
340
|
catch (err) {
|
|
343
341
|
}
|
|
342
|
+
if (stats != null && ((stats.permissions ?? 0) & FilePermission.Readonly) > 0) {
|
|
343
|
+
throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions);
|
|
344
|
+
}
|
|
344
345
|
return delegate.writeFile(resource, content, opts);
|
|
345
346
|
});
|
|
346
347
|
}
|
|
347
348
|
async mkdir(resource) {
|
|
348
|
-
await this.writeToDelegates(
|
|
349
|
+
await this.writeToDelegates(delegate => delegate.mkdir(resource));
|
|
349
350
|
}
|
|
350
351
|
async delete(resource, opts) {
|
|
351
|
-
await this.writeToDelegates(
|
|
352
|
+
await this.writeToDelegates(delegate => delegate.delete(resource, opts));
|
|
352
353
|
}
|
|
353
354
|
async rename(from, to, opts) {
|
|
354
|
-
await this.writeToDelegates(
|
|
355
|
+
await this.writeToDelegates(delegate => delegate.rename(from, to, opts));
|
|
355
356
|
}
|
|
356
357
|
}
|
|
357
358
|
function resourceForError(resource) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-files-service-override",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.2",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,6 +18,6 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@4.3.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@4.3.2"
|
|
22
22
|
}
|
|
23
23
|
}
|