Skip to content

Commit

Permalink
remove promise.cancel from treeView
Browse files Browse the repository at this point in the history
related to #56137
  • Loading branch information
joaomoreno committed Aug 10, 2018
1 parent 8daf1f2 commit e34098d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/vs/base/parts/tree/browser/treeView.ts
Expand Up @@ -25,7 +25,7 @@ import { KeyCode } from 'vs/base/common/keyCodes';
import { Event, Emitter } from 'vs/base/common/event';
import { DataTransfers } from 'vs/base/browser/dnd';
import { DefaultTreestyler } from './treeDefaults';
import { Delayer } from 'vs/base/common/async';
import { Delayer, CancelablePromise, createCancelablePromise, wireCancellationToken } from 'vs/base/common/async';

export interface IRow {
element: HTMLElement;
Expand Down Expand Up @@ -429,7 +429,7 @@ export class TreeView extends HeightMap {
private currentDropTarget: ViewItem;
private shouldInvalidateDropReaction: boolean;
private currentDropTargets: ViewItem[];
private currentDropPromise: WinJS.Promise;
private currentDropPromise: CancelablePromise<any>;
private dragAndDropScrollInterval: number;
private dragAndDropScrollTimeout: number;
private dragAndDropMouseY: number;
Expand Down Expand Up @@ -1530,9 +1530,11 @@ export class TreeView extends HeightMap {
}

if (reaction.autoExpand) {
this.currentDropPromise = WinJS.TPromise.timeout(500)
const promise = WinJS.TPromise.timeout(500)
.then(() => this.context.tree.expand(this.currentDropElement))
.then(() => this.shouldInvalidateDropReaction = true);

this.currentDropPromise = createCancelablePromise(token => wireCancellationToken(token, promise));
}
}
}
Expand Down

0 comments on commit e34098d

Please sign in to comment.