mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge VS Code 1.31.1 (#4283)
This commit is contained in:
@@ -12,7 +12,8 @@ import * as dom from 'vs/base/browser/dom';
|
||||
import * as mouse from 'vs/base/browser/mouseEvent';
|
||||
import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import * as _ from 'vs/base/parts/tree/browser/tree';
|
||||
import { KeyCode, KeyMod, Keybinding, createKeybinding, SimpleKeybinding, createSimpleKeybinding } from 'vs/base/common/keyCodes';
|
||||
import { IDragAndDropData } from 'vs/base/browser/dnd';
|
||||
import { KeyCode, KeyMod, Keybinding, SimpleKeybinding, createSimpleKeybinding } from 'vs/base/common/keyCodes';
|
||||
|
||||
export interface IKeyBindingCallback {
|
||||
(tree: _.ITree, event: IKeyboardEvent): void;
|
||||
@@ -70,14 +71,14 @@ export class KeybindingDispatcher {
|
||||
return false;
|
||||
}
|
||||
|
||||
public set(keybinding: KeyCode, callback: IKeyBindingCallback) {
|
||||
public set(keybinding: number, callback: IKeyBindingCallback) {
|
||||
this._arr.push({
|
||||
keybinding: createKeybinding(keybinding, platform.OS),
|
||||
keybinding: createSimpleKeybinding(keybinding, platform.OS),
|
||||
callback: callback
|
||||
});
|
||||
}
|
||||
|
||||
public dispatch(keybinding: SimpleKeybinding): IKeyBindingCallback {
|
||||
public dispatch(keybinding: SimpleKeybinding): IKeyBindingCallback | null {
|
||||
// Loop from the last to the first to handle overwrites
|
||||
for (let i = this._arr.length - 1; i >= 0; i--) {
|
||||
let item = this._arr[i];
|
||||
@@ -189,9 +190,9 @@ export class DefaultController implements _.IController {
|
||||
|
||||
if (this.shouldToggleExpansion(element, event, origin)) {
|
||||
if (tree.isExpanded(element)) {
|
||||
tree.collapse(element).then(null, errors.onUnexpectedError);
|
||||
tree.collapse(element).then(undefined, errors.onUnexpectedError);
|
||||
} else {
|
||||
tree.expand(element).then(null, errors.onUnexpectedError);
|
||||
tree.expand(element).then(undefined, errors.onUnexpectedError);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -225,7 +226,7 @@ export class DefaultController implements _.IController {
|
||||
return false;
|
||||
}
|
||||
|
||||
const twistieWidth = parseInt(twistieStyle.width) + parseInt(twistieStyle.paddingRight);
|
||||
const twistieWidth = parseInt(twistieStyle.width!) + parseInt(twistieStyle.paddingRight!);
|
||||
return event.browserEvent.offsetX <= twistieWidth;
|
||||
}
|
||||
|
||||
@@ -281,7 +282,7 @@ export class DefaultController implements _.IController {
|
||||
tree.clearHighlight(payload);
|
||||
} else {
|
||||
tree.focusPrevious(1, payload);
|
||||
tree.reveal(tree.getFocus()).then(null, errors.onUnexpectedError);
|
||||
tree.reveal(tree.getFocus()).then(undefined, errors.onUnexpectedError);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -293,7 +294,7 @@ export class DefaultController implements _.IController {
|
||||
tree.clearHighlight(payload);
|
||||
} else {
|
||||
tree.focusPreviousPage(payload);
|
||||
tree.reveal(tree.getFocus()).then(null, errors.onUnexpectedError);
|
||||
tree.reveal(tree.getFocus()).then(undefined, errors.onUnexpectedError);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -305,7 +306,7 @@ export class DefaultController implements _.IController {
|
||||
tree.clearHighlight(payload);
|
||||
} else {
|
||||
tree.focusNext(1, payload);
|
||||
tree.reveal(tree.getFocus()).then(null, errors.onUnexpectedError);
|
||||
tree.reveal(tree.getFocus()).then(undefined, errors.onUnexpectedError);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -317,7 +318,7 @@ export class DefaultController implements _.IController {
|
||||
tree.clearHighlight(payload);
|
||||
} else {
|
||||
tree.focusNextPage(payload);
|
||||
tree.reveal(tree.getFocus()).then(null, errors.onUnexpectedError);
|
||||
tree.reveal(tree.getFocus()).then(undefined, errors.onUnexpectedError);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -329,7 +330,7 @@ export class DefaultController implements _.IController {
|
||||
tree.clearHighlight(payload);
|
||||
} else {
|
||||
tree.focusFirst(payload);
|
||||
tree.reveal(tree.getFocus()).then(null, errors.onUnexpectedError);
|
||||
tree.reveal(tree.getFocus()).then(undefined, errors.onUnexpectedError);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -341,7 +342,7 @@ export class DefaultController implements _.IController {
|
||||
tree.clearHighlight(payload);
|
||||
} else {
|
||||
tree.focusLast(payload);
|
||||
tree.reveal(tree.getFocus()).then(null, errors.onUnexpectedError);
|
||||
tree.reveal(tree.getFocus()).then(undefined, errors.onUnexpectedError);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -359,7 +360,7 @@ export class DefaultController implements _.IController {
|
||||
return tree.reveal(tree.getFocus());
|
||||
}
|
||||
return undefined;
|
||||
}).then(null, errors.onUnexpectedError);
|
||||
}).then(undefined, errors.onUnexpectedError);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -377,7 +378,7 @@ export class DefaultController implements _.IController {
|
||||
return tree.reveal(tree.getFocus());
|
||||
}
|
||||
return undefined;
|
||||
}).then(null, errors.onUnexpectedError);
|
||||
}).then(undefined, errors.onUnexpectedError);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -430,24 +431,24 @@ export class DefaultController implements _.IController {
|
||||
|
||||
export class DefaultDragAndDrop implements _.IDragAndDrop {
|
||||
|
||||
public getDragURI(tree: _.ITree, element: any): string {
|
||||
public getDragURI(tree: _.ITree, element: any): string | null {
|
||||
return null;
|
||||
}
|
||||
|
||||
public onDragStart(tree: _.ITree, data: _.IDragAndDropData, originalEvent: mouse.DragMouseEvent): void {
|
||||
public onDragStart(tree: _.ITree, data: IDragAndDropData, originalEvent: mouse.DragMouseEvent): void {
|
||||
return;
|
||||
}
|
||||
|
||||
public onDragOver(tree: _.ITree, data: _.IDragAndDropData, targetElement: any, originalEvent: mouse.DragMouseEvent): _.IDragOverReaction {
|
||||
public onDragOver(tree: _.ITree, data: IDragAndDropData, targetElement: any, originalEvent: mouse.DragMouseEvent): _.IDragOverReaction | null {
|
||||
return null;
|
||||
}
|
||||
|
||||
public drop(tree: _.ITree, data: _.IDragAndDropData, targetElement: any, originalEvent: mouse.DragMouseEvent): void {
|
||||
public drop(tree: _.ITree, data: IDragAndDropData, targetElement: any, originalEvent: mouse.DragMouseEvent): void {
|
||||
return;
|
||||
}
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
public dropAbort(tree: _.ITree, data: _.IDragAndDropData): void { }
|
||||
public dropAbort(tree: _.ITree, data: IDragAndDropData): void { }
|
||||
}
|
||||
|
||||
export class DefaultFilter implements _.IFilter {
|
||||
@@ -466,7 +467,7 @@ export class DefaultSorter implements _.ISorter {
|
||||
|
||||
export class DefaultAccessibilityProvider implements _.IAccessibilityProvider {
|
||||
|
||||
getAriaLabel(tree: _.ITree, element: any): string {
|
||||
getAriaLabel(tree: _.ITree, element: any): string | null {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -558,7 +559,7 @@ export class CollapseAllAction extends Action {
|
||||
super('vs.tree.collapse', nls.localize('collapse', "Collapse"), 'monaco-tree-action collapse-all', enabled);
|
||||
}
|
||||
|
||||
public run(context?: any): Thenable<any> {
|
||||
public run(context?: any): Promise<any> {
|
||||
if (this.viewer.getHighlight()) {
|
||||
return Promise.resolve(); // Global action disabled if user is in edit mode from another action
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user