Skip to content

Commit 6e160c8

Browse files
committed
add more docstring'
1 parent c19eba9 commit 6e160c8

File tree

1 file changed

+18
-2
lines changed
  • packages/core/src/shared/fs

1 file changed

+18
-2
lines changed

packages/core/src/shared/fs/fs.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,12 @@ export class FileSystem {
153153

154154
return this.writeFile(path, finalContent)
155155
}
156-
156+
/**
157+
* Checks if file or folder exists.
158+
* @param path path to check.
159+
* @param fileType optional assert that path contains certain filetype.
160+
* @returns if path exists and matches filetype.
161+
*/
157162
async exists(path: Uri | string, fileType?: vscode.FileType): Promise<boolean> {
158163
if (path === undefined || path === '') {
159164
return false
@@ -301,6 +306,12 @@ export class FileSystem {
301306
await write(uri)
302307
}
303308

309+
/**
310+
* Rename a file or folder.
311+
* @param oldPath
312+
* @param newPath
313+
* @returns
314+
*/
304315
async rename(oldPath: vscode.Uri | string, newPath: vscode.Uri | string) {
305316
const oldUri = toUri(oldPath)
306317
const newUri = toUri(newPath)
@@ -465,7 +476,12 @@ export class FileSystem {
465476

466477
return await vfs.readDirectory(path)
467478
}
468-
479+
/**
480+
* Copy target file or directory
481+
* @param source
482+
* @param target
483+
* @returns
484+
*/
469485
async copy(source: vscode.Uri | string, target: vscode.Uri | string): Promise<void> {
470486
const sourcePath = toUri(source)
471487
const targetPath = toUri(target)

0 commit comments

Comments
 (0)