Skip to content

Commit

Permalink
more cancellation token, #47475
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Apr 9, 2018
1 parent efcca1c commit 2afd736
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/vs/vscode.proposed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ declare module 'vscode' {

readonly onDidChange?: Event<FileChange[]>;

stat(resource: Uri): Thenable<FileStat>;
stat(resource: Uri, token: CancellationToken): Thenable<FileStat>;

readdir(resource: Uri, token: CancellationToken): Thenable<[Uri, FileStat][]>;

readFile(resource: Uri, token: CancellationToken): Thenable<Uint8Array>;

Expand All @@ -246,9 +248,6 @@ declare module 'vscode' {
// helps with performance bigly
// copy?(from: Uri, to: Uri): Thenable<void>;


readdir(resource: Uri): Thenable<[Uri, FileStat][]>;

// todo@remote
// ? useTrash, expose trash
delete(resource: Uri, options: { recursive?: boolean; }): Thenable<void>;
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/api/node/extHostFileSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@ export class ExtHostFileSystem implements ExtHostFileSystemShape {
}

$stat(handle: number, resource: UriComponents): TPromise<IStat, any> {
return asWinJsPromise(token => this._fsProvider.get(handle).stat(URI.revive(resource)));
return asWinJsPromise(token => this._fsProvider.get(handle).stat(URI.revive(resource), token));
}
$readdir(handle: number, resource: UriComponents): TPromise<[UriComponents, IStat][], any> {
return asWinJsPromise(token => this._fsProvider.get(handle).readdir(URI.revive(resource)));
return asWinJsPromise(token => this._fsProvider.get(handle).readdir(URI.revive(resource), token));
}
$readFile(handle: number, resource: UriComponents): TPromise<string> {
return asWinJsPromise(token => {
Expand Down

0 comments on commit 2afd736

Please sign in to comment.