Merge from master

This commit is contained in:
Raj Musuku
2019-02-21 17:56:04 -08:00
parent 5a146e34fa
commit 666ae11639
11482 changed files with 119352 additions and 255574 deletions

View File

@@ -2,10 +2,8 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as nls from 'vs/nls';
import { TPromise } from 'vs/base/common/winjs.base';
import { Action } from 'vs/base/common/actions';
import * as platform from 'vs/base/common/platform';
import * as touch from 'vs/base/browser/touch';
@@ -25,7 +23,7 @@ export interface ICancelableEvent {
stopPropagation(): void;
}
export enum ClickBehavior {
export const enum ClickBehavior {
/**
* Handle the click when the mouse button is pressed but not released yet.
@@ -38,7 +36,7 @@ export enum ClickBehavior {
ON_MOUSE_UP
}
export enum OpenMode {
export const enum OpenMode {
SINGLE_CLICK,
DOUBLE_CLICK
}
@@ -191,9 +189,9 @@ export class DefaultController implements _.IController {
if (this.shouldToggleExpansion(element, event, origin)) {
if (tree.isExpanded(element)) {
tree.collapse(element).done(null, errors.onUnexpectedError);
tree.collapse(element).then(null, errors.onUnexpectedError);
} else {
tree.expand(element).done(null, errors.onUnexpectedError);
tree.expand(element).then(null, errors.onUnexpectedError);
}
}
}
@@ -264,8 +262,9 @@ export class DefaultController implements _.IController {
}
private onKey(bindings: KeybindingDispatcher, tree: _.ITree, event: IKeyboardEvent): boolean {
const handler = bindings.dispatch(event.toKeybinding());
const handler: any = bindings.dispatch(event.toKeybinding());
if (handler) {
// TODO: TS 3.1 upgrade. Why are we checking against void?
if (handler(tree, event)) {
event.preventDefault();
event.stopPropagation();
@@ -282,7 +281,7 @@ export class DefaultController implements _.IController {
tree.clearHighlight(payload);
} else {
tree.focusPrevious(1, payload);
tree.reveal(tree.getFocus()).done(null, errors.onUnexpectedError);
tree.reveal(tree.getFocus()).then(null, errors.onUnexpectedError);
}
return true;
}
@@ -294,7 +293,7 @@ export class DefaultController implements _.IController {
tree.clearHighlight(payload);
} else {
tree.focusPreviousPage(payload);
tree.reveal(tree.getFocus()).done(null, errors.onUnexpectedError);
tree.reveal(tree.getFocus()).then(null, errors.onUnexpectedError);
}
return true;
}
@@ -306,7 +305,7 @@ export class DefaultController implements _.IController {
tree.clearHighlight(payload);
} else {
tree.focusNext(1, payload);
tree.reveal(tree.getFocus()).done(null, errors.onUnexpectedError);
tree.reveal(tree.getFocus()).then(null, errors.onUnexpectedError);
}
return true;
}
@@ -318,7 +317,7 @@ export class DefaultController implements _.IController {
tree.clearHighlight(payload);
} else {
tree.focusNextPage(payload);
tree.reveal(tree.getFocus()).done(null, errors.onUnexpectedError);
tree.reveal(tree.getFocus()).then(null, errors.onUnexpectedError);
}
return true;
}
@@ -330,7 +329,7 @@ export class DefaultController implements _.IController {
tree.clearHighlight(payload);
} else {
tree.focusFirst(payload);
tree.reveal(tree.getFocus()).done(null, errors.onUnexpectedError);
tree.reveal(tree.getFocus()).then(null, errors.onUnexpectedError);
}
return true;
}
@@ -342,7 +341,7 @@ export class DefaultController implements _.IController {
tree.clearHighlight(payload);
} else {
tree.focusLast(payload);
tree.reveal(tree.getFocus()).done(null, errors.onUnexpectedError);
tree.reveal(tree.getFocus()).then(null, errors.onUnexpectedError);
}
return true;
}
@@ -360,7 +359,7 @@ export class DefaultController implements _.IController {
return tree.reveal(tree.getFocus());
}
return undefined;
}).done(null, errors.onUnexpectedError);
}).then(null, errors.onUnexpectedError);
}
return true;
}
@@ -378,7 +377,7 @@ export class DefaultController implements _.IController {
return tree.reveal(tree.getFocus());
}
return undefined;
}).done(null, errors.onUnexpectedError);
}).then(null, errors.onUnexpectedError);
}
return true;
}
@@ -559,9 +558,9 @@ export class CollapseAllAction extends Action {
super('vs.tree.collapse', nls.localize('collapse', "Collapse"), 'monaco-tree-action collapse-all', enabled);
}
public run(context?: any): TPromise<any> {
public run(context?: any): Thenable<any> {
if (this.viewer.getHighlight()) {
return TPromise.as(null); // Global action disabled if user is in edit mode from another action
return Promise.resolve(); // Global action disabled if user is in edit mode from another action
}
this.viewer.collapseAll();
@@ -570,6 +569,6 @@ export class CollapseAllAction extends Action {
this.viewer.domFocus();
this.viewer.focusFirst();
return TPromise.as(null);
return Promise.resolve();
}
}