mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 19:18:59 +01:00
debt - remove TPromise from ExtHostFileSystemEventServiceShape#$onWillRename
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user