debt - remove TPromise from ExtHostFileSystemEventServiceShape#$onWillRename
This commit is contained in:
parent
77c9ffa5b8
commit
8ba421c56a
4 changed files with 6 additions and 7 deletions
|
@ -713,7 +713,7 @@ export interface FileSystemEvents {
|
|||
export interface ExtHostFileSystemEventServiceShape {
|
||||
$onFileEvent(events: FileSystemEvents): void;
|
||||
$onFileRename(oldUri: UriComponents, newUri: UriComponents): void;
|
||||
$onWillRename(oldUri: UriComponents, newUri: UriComponents): TPromise<any>;
|
||||
$onWillRename(oldUri: UriComponents, newUri: UriComponents): Thenable<any>;
|
||||
}
|
||||
|
||||
export interface ObjectIdentifier {
|
||||
|
|
|
@ -8,7 +8,6 @@ import { flatten } from 'vs/base/common/arrays';
|
|||
import { AsyncEmitter, Emitter, Event } from 'vs/base/common/event';
|
||||
import { IRelativePattern, parse } from 'vs/base/common/glob';
|
||||
import { URI, UriComponents } from 'vs/base/common/uri';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/node/extHostDocumentsAndEditors';
|
||||
import { IExtensionDescription } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import * as vscode from 'vscode';
|
||||
|
@ -141,12 +140,12 @@ export class ExtHostFileSystemEventService implements ExtHostFileSystemEventServ
|
|||
};
|
||||
}
|
||||
|
||||
$onWillRename(oldUriDto: UriComponents, newUriDto: UriComponents): TPromise<any> {
|
||||
$onWillRename(oldUriDto: UriComponents, newUriDto: UriComponents): Thenable<any> {
|
||||
const oldUri = URI.revive(oldUriDto);
|
||||
const newUri = URI.revive(newUriDto);
|
||||
|
||||
const edits: WorkspaceEdit[] = [];
|
||||
return TPromise.wrap(this._onWillRenameFile.fireAsync((bucket, listener) => {
|
||||
return Promise.resolve(this._onWillRenameFile.fireAsync((bucket, _listener) => {
|
||||
return {
|
||||
oldUri,
|
||||
newUri,
|
||||
|
@ -155,7 +154,7 @@ export class ExtHostFileSystemEventService implements ExtHostFileSystemEventServ
|
|||
throw new TypeError('waitUntil cannot be called async');
|
||||
}
|
||||
const index = bucket.length;
|
||||
const wrappedThenable = TPromise.as(thenable).then(result => {
|
||||
const wrappedThenable = Promise.resolve(thenable).then(result => {
|
||||
// ignore all results except for WorkspaceEdits. Those
|
||||
// are stored in a spare array
|
||||
if (result instanceof WorkspaceEdit) {
|
||||
|
|
|
@ -721,7 +721,7 @@ export abstract class TextFileService extends Disposable implements ITextFileSer
|
|||
this._onWillMove.fire({
|
||||
oldResource: source,
|
||||
newResource: target,
|
||||
waitUntil(p: TPromise<any>) {
|
||||
waitUntil(p: Thenable<any>) {
|
||||
waitForPromises.push(TPromise.wrap(p).then(undefined, errors.onUnexpectedError));
|
||||
}
|
||||
});
|
||||
|
|
|
@ -261,7 +261,7 @@ export interface ITextFileEditorModel extends ITextEditorModel, IEncodingSupport
|
|||
export interface IWillMoveEvent {
|
||||
oldResource: URI;
|
||||
newResource: URI;
|
||||
waitUntil(p: TPromise<any>): void;
|
||||
waitUntil(p: Thenable<any>): void;
|
||||
}
|
||||
|
||||
export interface ITextFileService extends IDisposable {
|
||||
|
|
Loading…
Reference in a new issue