Skip to content

Commit e6a2ba5

Browse files
newapi -> vscfs
1 parent 7675554 commit e6a2ba5

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/client/common/platform/fileSystem.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export class TempFileSystem {
135135
// This is the parts of the vscode.workspace.fs API that we use here.
136136
// See: https://code.visualstudio.com/api/references/vscode-api#FileSystem
137137
// Note that we have used all the API functions *except* "rename()".
138-
interface INewAPI {
138+
interface IVSCodeFileSystemAPI {
139139
copy(source: vscode.Uri, target: vscode.Uri, options?: {overwrite: boolean}): Thenable<void>;
140140
createDirectory(uri: vscode.Uri): Thenable<void>;
141141
delete(uri: vscode.Uri, options?: {recursive: boolean; useTrash: boolean}): Thenable<void>;
@@ -172,7 +172,7 @@ interface IRawPath {
172172
export class RawFileSystem implements IRawFileSystem {
173173
constructor(
174174
protected readonly path: IRawPath,
175-
protected readonly newapi: INewAPI,
175+
protected readonly vscfs: IVSCodeFileSystemAPI,
176176
protected readonly nodefs: IRawFS,
177177
protected readonly fsExtra: IRawFSExtra
178178
) { }
@@ -193,14 +193,14 @@ export class RawFileSystem implements IRawFileSystem {
193193
public async readText(filename: string): Promise<string> {
194194
const uri = vscode.Uri.file(filename);
195195
const data = Buffer.from(
196-
await this.newapi.readFile(uri));
196+
await this.vscfs.readFile(uri));
197197
return data.toString(ENCODING);
198198
}
199199

200200
public async writeText(filename: string, text: string): Promise<void> {
201201
const uri = vscode.Uri.file(filename);
202202
const data = Buffer.from(text);
203-
await this.newapi.writeFile(uri, data);
203+
await this.vscfs.writeFile(uri, data);
204204
}
205205

206206
public async rmtree(dirname: string): Promise<void> {
@@ -209,29 +209,29 @@ export class RawFileSystem implements IRawFileSystem {
209209
// The docs say "throws - FileNotFound when uri doesn't exist".
210210
// However, it happily does nothing (at least for remote-over-SSH).
211211
// So we have to manually stat, just to be sure.
212-
await this.newapi.stat(uri);
213-
return this.newapi.delete(uri, {
212+
await this.vscfs.stat(uri);
213+
return this.vscfs.delete(uri, {
214214
recursive: true,
215215
useTrash: false
216216
});
217217
}
218218

219219
public async rmfile(filename: string): Promise<void> {
220220
const uri = vscode.Uri.file(filename);
221-
return this.newapi.delete(uri, {
221+
return this.vscfs.delete(uri, {
222222
recursive: false,
223223
useTrash: false
224224
});
225225
}
226226

227227
public async stat(filename: string): Promise<FileStat> {
228228
const uri = vscode.Uri.file(filename);
229-
return this.newapi.stat(uri);
229+
return this.vscfs.stat(uri);
230230
}
231231

232232
public async listdir(dirname: string): Promise<[string, FileType][]> {
233233
const uri = vscode.Uri.file(dirname);
234-
return this.newapi.readDirectory(uri);
234+
return this.vscfs.readDirectory(uri);
235235
}
236236

237237
public async mkdirp(dirname: string): Promise<void> {
@@ -243,7 +243,7 @@ export class RawFileSystem implements IRawFileSystem {
243243
const current = stack.pop() || '';
244244
const uri = vscode.Uri.file(current);
245245
try {
246-
await this.newapi.createDirectory(uri);
246+
await this.vscfs.createDirectory(uri);
247247
} catch (err) {
248248
if (isFileExistsError(err)) {
249249
// already done!
@@ -276,8 +276,8 @@ export class RawFileSystem implements IRawFileSystem {
276276
// destination doesn't exist". However, it happily creates
277277
// the parent directory (at least for remote-over-SSH).
278278
// So we have to manually stat, just to be sure.
279-
await this.newapi.stat(vscode.Uri.file(this.path.dirname(dest)));
280-
await this.newapi.copy(srcURI, destURI, {
279+
await this.vscfs.stat(vscode.Uri.file(this.path.dirname(dest)));
280+
await this.vscfs.copy(srcURI, destURI, {
281281
overwrite: true
282282
});
283283
}

0 commit comments

Comments
 (0)