File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
providers/FileSystemProvider Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,9 @@ export async function checkChangedOnServer(file: CurrentTextFile | CurrentBinary
69
69
? false
70
70
: ( content as string [ ] ) . every ( ( line , index ) => line . trim ( ) == ( fileContent [ index ] || "" ) . trim ( ) ) ;
71
71
} else {
72
- sameContent = force ? false : Buffer . compare ( content as Buffer , file . content ) === 0 ;
72
+ sameContent = force
73
+ ? false
74
+ : Buffer . compare ( content as unknown as Uint8Array , file . content as unknown as Uint8Array ) === 0 ;
73
75
}
74
76
const mtime =
75
77
force || sameContent ? serverTime : Math . max ( ( await vscode . workspace . fs . stat ( file . uri ) ) . mtime , serverTime ) ;
@@ -243,7 +245,7 @@ export async function loadChanges(files: (CurrentTextFile | CurrentBinaryFile)[]
243
245
const content = await api . getDoc ( file . name ) . then ( ( data ) => data . result . content ) ;
244
246
await vscode . workspace . fs . writeFile (
245
247
file . uri ,
246
- Buffer . isBuffer ( content ) ? content : new TextEncoder ( ) . encode ( content . join ( "\n" ) )
248
+ Buffer . isBuffer ( content ) ? ( content as unknown as Uint8Array ) : new TextEncoder ( ) . encode ( content . join ( "\n" ) )
247
249
) ;
248
250
} else if ( filesystemSchemas . includes ( file . uri . scheme ) ) {
249
251
fileSystemProvider . fireFileChanged ( file . uri ) ;
Original file line number Diff line number Diff line change @@ -398,7 +398,7 @@ export class FileSystemProvider implements vscode.FileSystemProvider {
398
398
399
399
public writeFile (
400
400
uri : vscode . Uri ,
401
- content : Buffer ,
401
+ content : Uint8Array ,
402
402
options : {
403
403
create : boolean ;
404
404
overwrite : boolean ;
@@ -452,7 +452,7 @@ export class FileSystemProvider implements vscode.FileSystemProvider {
452
452
}
453
453
// File doesn't exist on the server, and we are allowed to create it.
454
454
// Create content (typically a stub, unless the write-phase of a copy operation).
455
- const newContent = generateFileContent ( uri , fileName , content ) ;
455
+ const newContent = generateFileContent ( uri , fileName , content as unknown as Buffer ) ;
456
456
457
457
// Write it to the server
458
458
return api
You can’t perform that action at this time.
0 commit comments