diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index 1dfbc7cdaec..cfc2483856f 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -5007,54 +5007,48 @@ declare module 'vscode' { * in case the file does not exist. * * @param uri The uri of the file to retrieve meta data about. - * @param token A cancellation token. * @return The file metadata about the file. */ - stat(uri: Uri, options: { /*future: followSymlinks*/ }, token: CancellationToken): FileStat | Thenable; + stat(uri: Uri, options: { /*future: followSymlinks*/ }): FileStat | Thenable; /** * Retrieve the meta data of all entries of a [directory](#FileStat.isDirectory) * * @param uri The uri of the folder. - * @param token A cancellation token. * @return A thenable that resolves to an array of tuples of file names and files stats. */ - readDirectory(uri: Uri, options: { /*future: onlyType?*/ }, token: CancellationToken): [string, FileType][] | Thenable<[string, FileType][]>; + readDirectory(uri: Uri, options: { /*future: onlyType?*/ }): [string, FileType][] | Thenable<[string, FileType][]>; /** * Create a new directory. *Note* that new files are created via `write`-calls. * * @param uri The uri of the *new* folder. - * @param token A cancellation token. */ - createDirectory(uri: Uri, options: { /*future: permissions?*/ }, token: CancellationToken): FileStat | Thenable; + createDirectory(uri: Uri, options: { /*future: permissions?*/ }): FileStat | Thenable; /** * Read the entire contents of a file. * * @param uri The uri of the file. - * @param token A cancellation token. * @return A thenable that resolves to an array of bytes. */ - readFile(uri: Uri, options: FileOptions, token: CancellationToken): Uint8Array | Thenable; + readFile(uri: Uri, options: FileOptions): Uint8Array | Thenable; /** * Write data to a file, replacing its entire contents. * * @param uri The uri of the file. * @param content The new content of the file. - * @param token A cancellation token. */ - writeFile(uri: Uri, content: Uint8Array, options: FileOptions, token: CancellationToken): void | Thenable; + writeFile(uri: Uri, content: Uint8Array, options: FileOptions): void | Thenable; /** * Delete a file. * * @param uri The resource that is to be deleted * @param options Options bag for future use - * @param token A cancellation token. */ - delete(uri: Uri, options: { /*future: useTrash?, followSymlinks?*/ }, token: CancellationToken): void | Thenable; + delete(uri: Uri, options: { /*future: useTrash?, followSymlinks?*/ }): void | Thenable; /** * Rename a file or folder. @@ -5062,11 +5056,10 @@ declare module 'vscode' { * @param oldUri The existing file or folder. * @param newUri The target location. * @param options Defines if existing files should be overwriten. - * @param token A cancellation token. * @throws [`FileNotFound`](FileSystemError.FileNotFound) when `oldUri` doesn't exist * @throws [`FileExists`](FileSystemError.FileExists) when `newUri` exists and when the `overwrite` option is not `true`. */ - rename(oldUri: Uri, newUri: Uri, options: { overwrite: boolean }, token: CancellationToken): FileStat | Thenable; + rename(oldUri: Uri, newUri: Uri, options: { overwrite: boolean }): FileStat | Thenable; /** * Copy files or folders. Implementing this function is optional but it will speedup @@ -5075,11 +5068,10 @@ declare module 'vscode' { * @param source The existing file or folder. * @param destination The destination location. * @param options Defines if existing files should be overwriten. - * @param token A cancellation token. * @throws [`FileNotFound`](FileSystemError.FileNotFound) when `source` doesn't exist * @throws [`FileExists`](FileSystemError.FileExists) when `destination` exists and when the `overwrite` option is not `true`. */ - copy?(source: Uri, destination: Uri, options: { overwrite: boolean }, token: CancellationToken): FileStat | Thenable; + copy?(source: Uri, destination: Uri, options: { overwrite: boolean }): FileStat | Thenable; } /** diff --git a/src/vs/workbench/api/node/extHostFileSystem.ts b/src/vs/workbench/api/node/extHostFileSystem.ts index 52b295f30c9..954ce34c00b 100644 --- a/src/vs/workbench/api/node/extHostFileSystem.ts +++ b/src/vs/workbench/api/node/extHostFileSystem.ts @@ -249,39 +249,39 @@ export class ExtHostFileSystem implements ExtHostFileSystemShape { } $stat(handle: number, resource: UriComponents): TPromise { - return asWinJsPromise(token => this._fsProvider.get(handle).stat(URI.revive(resource), {}, token)).then(ExtHostFileSystem._asIStat); + return asWinJsPromise(token => this._fsProvider.get(handle).stat(URI.revive(resource), {})).then(ExtHostFileSystem._asIStat); } $readdir(handle: number, resource: UriComponents): TPromise<[string, files.FileType][], any> { - return asWinJsPromise(token => this._fsProvider.get(handle).readDirectory(URI.revive(resource), {}, token)); + return asWinJsPromise(token => this._fsProvider.get(handle).readDirectory(URI.revive(resource), {})); } $readFile(handle: number, resource: UriComponents, opts: files.FileOptions): TPromise { return asWinJsPromise(token => { - return this._fsProvider.get(handle).readFile(URI.revive(resource), opts, token); + return this._fsProvider.get(handle).readFile(URI.revive(resource), opts); }).then(data => { return Buffer.isBuffer(data) ? data.toString('base64') : Buffer.from(data.buffer, data.byteOffset, data.byteLength).toString('base64'); }); } $writeFile(handle: number, resource: UriComponents, base64Content: string, opts: files.FileOptions): TPromise { - return asWinJsPromise(token => this._fsProvider.get(handle).writeFile(URI.revive(resource), Buffer.from(base64Content, 'base64'), opts, token)); + return asWinJsPromise(token => this._fsProvider.get(handle).writeFile(URI.revive(resource), Buffer.from(base64Content, 'base64'), opts)); } $delete(handle: number, resource: UriComponents): TPromise { - return asWinJsPromise(token => this._fsProvider.get(handle).delete(URI.revive(resource), {}, token)); + return asWinJsPromise(token => this._fsProvider.get(handle).delete(URI.revive(resource), {})); } $rename(handle: number, oldUri: UriComponents, newUri: UriComponents, opts: files.FileOverwriteOptions): TPromise { - return asWinJsPromise(token => this._fsProvider.get(handle).rename(URI.revive(oldUri), URI.revive(newUri), opts, token)).then(ExtHostFileSystem._asIStat); + return asWinJsPromise(token => this._fsProvider.get(handle).rename(URI.revive(oldUri), URI.revive(newUri), opts)).then(ExtHostFileSystem._asIStat); } $copy(handle: number, oldUri: UriComponents, newUri: UriComponents, opts: files.FileOverwriteOptions): TPromise { - return asWinJsPromise(token => this._fsProvider.get(handle).copy(URI.revive(oldUri), URI.revive(newUri), opts, token)).then(ExtHostFileSystem._asIStat); + return asWinJsPromise(token => this._fsProvider.get(handle).copy(URI.revive(oldUri), URI.revive(newUri), opts)).then(ExtHostFileSystem._asIStat); } $mkdir(handle: number, resource: UriComponents): TPromise { - return asWinJsPromise(token => this._fsProvider.get(handle).createDirectory(URI.revive(resource), {}, token)).then(ExtHostFileSystem._asIStat); + return asWinJsPromise(token => this._fsProvider.get(handle).createDirectory(URI.revive(resource), {})).then(ExtHostFileSystem._asIStat); } $watch(handle: number, session: number, resource: UriComponents, opts: files.IWatchOptions): void {