From da79ed6bb2fc70d038a7df0d95fca29dc74d93ff Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 11 Apr 2018 16:21:33 +0200 Subject: [PATCH] allow to return results async and sync, #47475 --- src/vs/vscode.proposed.d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index e20750ac7daae..392b4cf9ab972 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -266,7 +266,7 @@ declare module 'vscode' { */ // todo@remote // ! throw error (ENOENT) when the file doesn't exist - stat(uri: Uri, token: CancellationToken): Thenable; + stat(uri: Uri, token: CancellationToken): FileStat2 | Thenable; /** * Retrieve the meta data of all entries of a [directory](#FileType2.Directory) @@ -275,7 +275,7 @@ declare module 'vscode' { * @param token A cancellation token. * @return A thenable that resolves to an array of tuples of file names and files stats. */ - readDirectory(uri: Uri, token: CancellationToken): Thenable<[string, FileStat2][]>; + readDirectory(uri: Uri, token: CancellationToken): [string, FileStat2][] | Thenable<[string, FileStat2][]>; /** * Read the entire contents of a file. @@ -284,7 +284,7 @@ declare module 'vscode' { * @param token A cancellation token. * @return A thenable that resolves to an array of bytes. */ - readFile(uri: Uri, token: CancellationToken): Thenable; + readFile(uri: Uri, token: CancellationToken): Uint8Array | Thenable; /** * Write data to a file, replacing its entire contents. @@ -293,7 +293,7 @@ declare module 'vscode' { * @param content The new content of the file. * @param token A cancellation token. */ - writeFile(uri: Uri, content: Uint8Array, token: CancellationToken): Thenable; + writeFile(uri: Uri, content: Uint8Array, token: CancellationToken): void | Thenable; /** * Rename a file or folder. @@ -302,18 +302,18 @@ declare module 'vscode' { * @param newUri The target location * @param token A cancellation token. */ - rename(oldUri: Uri, newUri: Uri, token: CancellationToken): Thenable; + rename(oldUri: Uri, newUri: Uri, token: CancellationToken): FileStat2 | Thenable; // todo@remote // helps with performance bigly - // copy?(from: Uri, to: Uri): Thenable; + // copy?(from: Uri, to: Uri): FileStat2 | Thenable; // todo@remote // ? useTrash, expose trash - delete(uri: Uri, token: CancellationToken): Thenable; + delete(uri: Uri, token: CancellationToken): void | Thenable; // todo@remote - create(uri: Uri, options: { type: FileType2 }, token: CancellationToken): Thenable; + create(uri: Uri, options: { type: FileType2 }, token: CancellationToken): FileStat2 | Thenable; } export namespace workspace {