mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-24 17:23:05 -05:00
Initial VS Code 1.19 source merge (#571)
* Initial 1.19 xcopy * Fix yarn build * Fix numerous build breaks * Next batch of build break fixes * More build break fixes * Runtime breaks * Additional post merge fixes * Fix windows setup file * Fix test failures. * Update license header blocks to refer to source eula
This commit is contained in:
@@ -119,7 +119,8 @@ export class Dropdown extends Disposable {
|
||||
|
||||
this._input = new InputBox(this.$input.getHTMLElement(), contextViewService, {
|
||||
validationOptions: {
|
||||
showMessage: false,
|
||||
// @SQLTODO
|
||||
//showMessage: false,
|
||||
validation: v => this._inputValidator(v)
|
||||
},
|
||||
placeholder: this._options.placeholder,
|
||||
|
||||
@@ -339,7 +339,7 @@ export abstract class Modal extends Disposable implements IThemable {
|
||||
let footerButton = $('div.footer-button');
|
||||
let button = new Button(footerButton);
|
||||
button.label = label;
|
||||
button.addListener('click', () => onSelect());
|
||||
button.onDidClick(() => onSelect());
|
||||
if (orientation === 'left') {
|
||||
footerButton.appendTo(this._leftFooter);
|
||||
} else {
|
||||
|
||||
@@ -104,7 +104,7 @@ export class OptionsDialog extends Modal {
|
||||
super.render();
|
||||
attachModalDialogStyler(this, this._themeService);
|
||||
if (this.backButton) {
|
||||
this.backButton.addListener('click', () => this.cancel());
|
||||
this.backButton.onDidClick(() => this.cancel());
|
||||
attachButtonStyler(this.backButton, this._themeService, { buttonBackground: SIDE_BAR_BACKGROUND, buttonHoverBackground: SIDE_BAR_BACKGROUND });
|
||||
}
|
||||
this._okButton = this.addFooterButton(this.okLabel, () => this.ok());
|
||||
|
||||
@@ -14,7 +14,7 @@ import { InputBox } from 'sql/base/browser/ui/inputBox/inputBox';
|
||||
import * as types from 'vs/base/common/types';
|
||||
import data = require('data');
|
||||
import { localize } from 'vs/nls';
|
||||
import { ServiceOptionType } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
import { ServiceOptionType, ServiceOptionTypeNames } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
|
||||
export interface IOptionElement {
|
||||
optionWidget: any;
|
||||
@@ -30,52 +30,51 @@ export function createOptionElement(option: data.ServiceOption, rowContainer: Bu
|
||||
let inputElement: HTMLElement;
|
||||
let missingErrorMessage = localize('missingRequireField', ' is required.');
|
||||
let invalidInputMessage = localize('invalidInput', 'Invalid input. Numeric value expected.');
|
||||
switch (option.valueType) {
|
||||
case ServiceOptionType.number:
|
||||
optionWidget = new InputBox(rowContainer.getHTMLElement(), contextViewService, {
|
||||
validationOptions: {
|
||||
validation: (value: string) => {
|
||||
if (!value && option.isRequired) {
|
||||
return { type: MessageType.ERROR, content: option.displayName + missingErrorMessage };
|
||||
} else if (!types.isNumber(Number(value))) {
|
||||
return { type: MessageType.ERROR, content: invalidInputMessage };
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
let typeName: string = option.valueType.toString();
|
||||
if (typeName === ServiceOptionTypeNames.number) {
|
||||
optionWidget = new InputBox(rowContainer.getHTMLElement(), contextViewService, {
|
||||
validationOptions: {
|
||||
validation: (value: string) => {
|
||||
if (!value && option.isRequired) {
|
||||
return { type: MessageType.ERROR, content: option.displayName + missingErrorMessage };
|
||||
} else if (!types.isNumber(Number(value))) {
|
||||
return { type: MessageType.ERROR, content: invalidInputMessage };
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
});
|
||||
optionWidget.value = optionValue;
|
||||
inputElement = this.findElement(rowContainer, 'input');
|
||||
break;
|
||||
case ServiceOptionType.category:
|
||||
case ServiceOptionType.boolean:
|
||||
optionWidget = new SelectBox(possibleInputs, optionValue.toString());
|
||||
DialogHelper.appendInputSelectBox(rowContainer, optionWidget);
|
||||
inputElement = this.findElement(rowContainer, 'select-box');
|
||||
break;
|
||||
case ServiceOptionType.string:
|
||||
case ServiceOptionType.password:
|
||||
optionWidget = new InputBox(rowContainer.getHTMLElement(), contextViewService, {
|
||||
validationOptions: {
|
||||
validation: (value: string) => (!value && option.isRequired) ? ({ type: MessageType.ERROR, content: option.displayName + missingErrorMessage }) : null
|
||||
}
|
||||
});
|
||||
optionWidget.value = optionValue;
|
||||
if (option.valueType === ServiceOptionType.password) {
|
||||
optionWidget.inputElement.type = 'password';
|
||||
}
|
||||
inputElement = this.findElement(rowContainer, 'input');
|
||||
});
|
||||
optionWidget.value = optionValue;
|
||||
inputElement = this.findElement(rowContainer, 'input');
|
||||
} else if (typeName === ServiceOptionTypeNames.category || typeName === ServiceOptionTypeNames.boolean) {
|
||||
optionWidget = new SelectBox(possibleInputs, optionValue.toString());
|
||||
DialogHelper.appendInputSelectBox(rowContainer, optionWidget);
|
||||
inputElement = this.findElement(rowContainer, 'select-box');
|
||||
} else if (typeName === ServiceOptionTypeNames.string || typeName === ServiceOptionTypeNames.password) {
|
||||
optionWidget = new InputBox(rowContainer.getHTMLElement(), contextViewService, {
|
||||
validationOptions: {
|
||||
validation: (value: string) => (!value && option.isRequired) ? ({ type: MessageType.ERROR, content: option.displayName + missingErrorMessage }) : null
|
||||
}
|
||||
});
|
||||
optionWidget.value = optionValue;
|
||||
if (option.valueType === ServiceOptionType.password) {
|
||||
optionWidget.inputElement.type = 'password';
|
||||
}
|
||||
inputElement = this.findElement(rowContainer, 'input');
|
||||
}
|
||||
optionsMap[option.name] = { optionWidget: optionWidget, option: option, optionValue: optionValue };
|
||||
inputElement.onfocus = () => onFocus(option.name);
|
||||
}
|
||||
|
||||
export function getOptionValueAndCategoryValues(option: data.ServiceOption, options: { [optionName: string]: any }, possibleInputs: string[]): any {
|
||||
|
||||
let valueTypeName:string = option.valueType.toString();
|
||||
var optionValue = option.defaultValue;
|
||||
if (options[option.name]) {
|
||||
// if the value type is boolean, the option value can be either boolean or string
|
||||
if (option.valueType === ServiceOptionType.boolean) {
|
||||
if (valueTypeName === ServiceOptionTypeNames.boolean) {
|
||||
if (options[option.name] === true || options[option.name] === this.trueInputValue) {
|
||||
optionValue = this.trueInputValue;
|
||||
} else {
|
||||
@@ -86,13 +85,13 @@ export function getOptionValueAndCategoryValues(option: data.ServiceOption, opti
|
||||
}
|
||||
}
|
||||
|
||||
if (option.valueType === ServiceOptionType.boolean || option.valueType === ServiceOptionType.category) {
|
||||
if (valueTypeName === ServiceOptionTypeNames.boolean || valueTypeName === ServiceOptionTypeNames.category) {
|
||||
// If the option is not required, the empty string should be add at the top of possible choices
|
||||
if (!option.isRequired) {
|
||||
possibleInputs.push('');
|
||||
}
|
||||
|
||||
if (option.valueType === ServiceOptionType.boolean) {
|
||||
if (valueTypeName === ServiceOptionTypeNames.boolean) {
|
||||
possibleInputs.push(this.trueInputValue, this.falseInputValue);
|
||||
} else {
|
||||
option.categoryValues.map(c => possibleInputs.push(c.name));
|
||||
@@ -112,9 +111,9 @@ export function validateInputs(optionsMap: { [optionName: string]: IOptionElemen
|
||||
for (var optionName in optionsMap) {
|
||||
var optionElement: IOptionElement = optionsMap[optionName];
|
||||
var widget = optionElement.optionWidget;
|
||||
var isInputBox = (optionElement.option.valueType === ServiceOptionType.string ||
|
||||
optionElement.option.valueType === ServiceOptionType.password ||
|
||||
optionElement.option.valueType === ServiceOptionType.number);
|
||||
var isInputBox = (optionElement.option.valueType.toString() === ServiceOptionTypeNames.string ||
|
||||
optionElement.option.valueType.toString() === ServiceOptionTypeNames.password ||
|
||||
optionElement.option.valueType.toString() === ServiceOptionTypeNames.number);
|
||||
|
||||
if (isInputBox) {
|
||||
if (!widget.validate()) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IThemable } from 'vs/platform/theme/common/styler';
|
||||
import * as objects from 'vs/base/common/objects';
|
||||
import * as objects from 'sql/base/common/objects';
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
import { Dimension, $, Builder } from 'vs/base/browser/builder';
|
||||
import { EventType } from 'vs/base/browser/dom';
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
import 'vs/css!./splitview';
|
||||
import lifecycle = require('vs/base/common/lifecycle');
|
||||
import ee = require('vs/base/common/eventEmitter');
|
||||
import ee = require('sql/base/common/eventEmitter');
|
||||
import types = require('vs/base/common/types');
|
||||
import dom = require('vs/base/browser/dom');
|
||||
import numbers = require('vs/base/common/numbers');
|
||||
@@ -347,11 +347,11 @@ export abstract class AbstractCollapsibleView extends HeaderView {
|
||||
// Track state of focus in header so that other components can adjust styles based on that
|
||||
// (for example show or hide actions based on the state of being focused or not)
|
||||
this.focusTracker = dom.trackFocus(this.header);
|
||||
this.focusTracker.addFocusListener(() => {
|
||||
this.focusTracker.onDidFocus(() => {
|
||||
dom.addClass(this.header, 'focused');
|
||||
});
|
||||
|
||||
this.focusTracker.addBlurListener(() => {
|
||||
this.focusTracker.onDidBlur(() => {
|
||||
dom.removeClass(this.header, 'focused');
|
||||
});
|
||||
}
|
||||
@@ -602,8 +602,8 @@ export class SplitView extends lifecycle.Disposable implements
|
||||
if (this.views.length > 2) {
|
||||
let s = new sash.Sash(this.el, this, { orientation: this.sashOrientation });
|
||||
this.sashes.splice(index - 1, 0, s);
|
||||
this.sashesListeners.push(s.addListener('start', e => this.onSashStart(s, this.eventWrapper(e))));
|
||||
this.sashesListeners.push(s.addListener('change', e => this.onSashChange(s, this.eventWrapper(e))));
|
||||
this.sashesListeners.push(s.onDidStart((e) => this.onSashStart(s, this.eventWrapper(e))));
|
||||
this.sashesListeners.push(s.onDidChange((e) => this.onSashChange(s, this.eventWrapper(e))));
|
||||
}
|
||||
|
||||
this.viewChangeListeners.splice(index, 0, view.addListener('change', size => this.onViewChange(view, size)));
|
||||
@@ -611,7 +611,7 @@ export class SplitView extends lifecycle.Disposable implements
|
||||
|
||||
let viewFocusTracker = dom.trackFocus(viewElement);
|
||||
this.viewFocusListeners.splice(index, 0, viewFocusTracker);
|
||||
viewFocusTracker.addFocusListener(() => this._onFocus.fire(view));
|
||||
viewFocusTracker.onDidFocus(() => this._onFocus.fire(view));
|
||||
|
||||
this.viewFocusPreviousListeners.splice(index, 0, view.addListener('focusPrevious', () => index > 0 && this.views[index - 1].focus()));
|
||||
this.viewFocusNextListeners.splice(index, 0, view.addListener('focusNext', () => index < this.views.length && this.views[index + 1].focus()));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Adapted from https://github.com/naresh-n/slickgrid-column-data-autosize/blob/master/src/slick.autocolumnsize.js
|
||||
|
||||
import { mixin, clone } from 'vs/base/common/objects';
|
||||
import { mixin, clone } from 'sql/base/common/objects';
|
||||
|
||||
export interface IAutoColumnSizeOptions extends Slick.PluginOptions {
|
||||
maxWidth?: number;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Drag select selection model gist taken from https://gist.github.com/skoon/5312536
|
||||
// heavily modified
|
||||
|
||||
import { clone } from 'vs/base/common/objects';
|
||||
import { clone } from 'sql/base/common/objects';
|
||||
|
||||
export class DragCellSelectionModel<T> implements Slick.SelectionModel<T, Array<Slick.Range>> {
|
||||
private readonly keyColResizeIncr = 5;
|
||||
|
||||
@@ -10,8 +10,7 @@ import 'vs/css!vs/base/browser/ui/actionbar/actionbar';
|
||||
import { Promise } from 'vs/base/common/winjs.base';
|
||||
import { Builder, $ } from 'vs/base/browser/builder';
|
||||
import { IAction, IActionRunner, ActionRunner } from 'vs/base/common/actions';
|
||||
import { EventType as CommonEventType } from 'vs/base/common/events';
|
||||
import { EventEmitter } from 'vs/base/common/eventEmitter';
|
||||
import { EventEmitter } from 'sql/base/common/eventEmitter';
|
||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
|
||||
import {
|
||||
@@ -32,7 +31,7 @@ let defaultOptions: IActionBarOptions = {
|
||||
* ActionBar vs/base/browser/ui/actionbar/actionbar. This class was needed because we
|
||||
* want the ability to display content other than Action icons in the QueryTaskbar.
|
||||
*/
|
||||
export class ActionBar extends EventEmitter implements IActionRunner {
|
||||
export class ActionBar extends ActionRunner implements IActionRunner {
|
||||
|
||||
private _options: IActionBarOptions;
|
||||
private _actionRunner: IActionRunner;
|
||||
@@ -60,7 +59,7 @@ export class ActionBar extends EventEmitter implements IActionRunner {
|
||||
this._toDispose.push(this._actionRunner);
|
||||
}
|
||||
|
||||
this._toDispose.push(this.addEmitter(this._actionRunner));
|
||||
//this._toDispose.push(this.addEmitter(this._actionRunner));
|
||||
|
||||
this._items = [];
|
||||
this._focusedItem = undefined;
|
||||
@@ -122,14 +121,16 @@ export class ActionBar extends EventEmitter implements IActionRunner {
|
||||
});
|
||||
|
||||
this._focusTracker = DOM.trackFocus(this._domNode);
|
||||
this._focusTracker.addBlurListener(() => {
|
||||
this._focusTracker.onDidBlur(() => {
|
||||
if (document.activeElement === this._domNode || !DOM.isAncestor(document.activeElement, this._domNode)) {
|
||||
this.emit(DOM.EventType.BLUR, {});
|
||||
|
||||
// @SQLTODO
|
||||
//this.emit(DOM.EventType.BLUR, {});
|
||||
this._focusedItem = undefined;
|
||||
}
|
||||
});
|
||||
|
||||
this._focusTracker.addFocusListener(() => this.updateFocusedItem());
|
||||
this._focusTracker.onDidFocus(() => this.updateFocusedItem());
|
||||
|
||||
this._actionsList = document.createElement('ul');
|
||||
this._actionsList.className = 'actions-container';
|
||||
@@ -226,7 +227,7 @@ export class ActionBar extends EventEmitter implements IActionRunner {
|
||||
|
||||
item.actionRunner = this._actionRunner;
|
||||
item.setActionContext(this.context);
|
||||
this.addEmitter(item);
|
||||
//this.addEmitter(item);
|
||||
item.render(actionItemElement);
|
||||
|
||||
if (index === null || index < 0 || index >= this._actionsList.children.length) {
|
||||
@@ -354,7 +355,7 @@ export class ActionBar extends EventEmitter implements IActionRunner {
|
||||
(<HTMLElement>document.activeElement).blur(); // remove focus from focussed action
|
||||
}
|
||||
|
||||
this.emit(CommonEventType.CANCEL);
|
||||
//this.emit('cancel');
|
||||
}
|
||||
|
||||
public run(action: IAction, context?: any): Promise {
|
||||
|
||||
299
src/sql/base/common/eventEmitter.ts
Normal file
299
src/sql/base/common/eventEmitter.ts
Normal file
@@ -0,0 +1,299 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 Errors = require('vs/base/common/errors');
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
|
||||
export class EmitterEvent {
|
||||
|
||||
public readonly type: string;
|
||||
public readonly data: any;
|
||||
|
||||
constructor(eventType: string = null, data: any = null) {
|
||||
this.type = eventType;
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
|
||||
export interface ListenerCallback {
|
||||
(value: any): void;
|
||||
}
|
||||
|
||||
export interface BulkListenerCallback {
|
||||
(value: EmitterEvent[]): void;
|
||||
}
|
||||
|
||||
export interface IBaseEventEmitter {
|
||||
addBulkListener(listener: BulkListenerCallback): IDisposable;
|
||||
}
|
||||
|
||||
export interface IEventEmitter extends IBaseEventEmitter, IDisposable {
|
||||
addListener(eventType: string, listener: ListenerCallback): IDisposable;
|
||||
addOneTimeListener(eventType: string, listener: ListenerCallback): IDisposable;
|
||||
addEmitter(eventEmitter: IEventEmitter): IDisposable;
|
||||
}
|
||||
|
||||
export interface IListenersMap {
|
||||
[key: string]: ListenerCallback[];
|
||||
}
|
||||
|
||||
export class EventEmitter implements IEventEmitter {
|
||||
|
||||
protected _listeners: IListenersMap;
|
||||
protected _bulkListeners: ListenerCallback[];
|
||||
private _collectedEvents: EmitterEvent[];
|
||||
private _deferredCnt: number;
|
||||
private _allowedEventTypes: { [eventType: string]: boolean; };
|
||||
|
||||
constructor(allowedEventTypes: string[] = null) {
|
||||
this._listeners = {};
|
||||
this._bulkListeners = [];
|
||||
this._collectedEvents = [];
|
||||
this._deferredCnt = 0;
|
||||
if (allowedEventTypes) {
|
||||
this._allowedEventTypes = {};
|
||||
for (let i = 0; i < allowedEventTypes.length; i++) {
|
||||
this._allowedEventTypes[allowedEventTypes[i]] = true;
|
||||
}
|
||||
} else {
|
||||
this._allowedEventTypes = null;
|
||||
}
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this._listeners = {};
|
||||
this._bulkListeners = [];
|
||||
this._collectedEvents = [];
|
||||
this._deferredCnt = 0;
|
||||
this._allowedEventTypes = null;
|
||||
}
|
||||
|
||||
public addListener(eventType: string, listener: ListenerCallback): IDisposable {
|
||||
if (eventType === '*') {
|
||||
throw new Error('Use addBulkListener(listener) to register your listener!');
|
||||
}
|
||||
|
||||
if (this._allowedEventTypes && !this._allowedEventTypes.hasOwnProperty(eventType)) {
|
||||
throw new Error('This object will never emit this event type!');
|
||||
}
|
||||
|
||||
if (this._listeners.hasOwnProperty(eventType)) {
|
||||
this._listeners[eventType].push(listener);
|
||||
} else {
|
||||
this._listeners[eventType] = [listener];
|
||||
}
|
||||
|
||||
let bound = this;
|
||||
return {
|
||||
dispose: () => {
|
||||
if (!bound) {
|
||||
// Already called
|
||||
return;
|
||||
}
|
||||
|
||||
bound._removeListener(eventType, listener);
|
||||
|
||||
// Prevent leakers from holding on to the event emitter
|
||||
bound = null;
|
||||
listener = null;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public addOneTimeListener(eventType: string, listener: ListenerCallback): IDisposable {
|
||||
const disposable = this.addListener(eventType, value => {
|
||||
disposable.dispose();
|
||||
listener(value);
|
||||
});
|
||||
|
||||
return disposable;
|
||||
}
|
||||
|
||||
public addBulkListener(listener: BulkListenerCallback): IDisposable {
|
||||
|
||||
this._bulkListeners.push(listener);
|
||||
|
||||
return {
|
||||
dispose: () => {
|
||||
this._removeBulkListener(listener);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public addEmitter(eventEmitter: IBaseEventEmitter): IDisposable {
|
||||
return eventEmitter.addBulkListener((events: EmitterEvent[]): void => {
|
||||
if (this._deferredCnt === 0) {
|
||||
this._emitEvents(events);
|
||||
} else {
|
||||
// Collect for later
|
||||
this._collectedEvents.push.apply(this._collectedEvents, events);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private _removeListener(eventType: string, listener: ListenerCallback): void {
|
||||
if (this._listeners.hasOwnProperty(eventType)) {
|
||||
let listeners = this._listeners[eventType];
|
||||
for (let i = 0, len = listeners.length; i < len; i++) {
|
||||
if (listeners[i] === listener) {
|
||||
listeners.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private _removeBulkListener(listener: BulkListenerCallback): void {
|
||||
for (let i = 0, len = this._bulkListeners.length; i < len; i++) {
|
||||
if (this._bulkListeners[i] === listener) {
|
||||
this._bulkListeners.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected _emitToSpecificTypeListeners(eventType: string, data: any): void {
|
||||
if (this._listeners.hasOwnProperty(eventType)) {
|
||||
const listeners = this._listeners[eventType].slice(0);
|
||||
for (let i = 0, len = listeners.length; i < len; i++) {
|
||||
safeInvoke1Arg(listeners[i], data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected _emitToBulkListeners(events: EmitterEvent[]): void {
|
||||
const bulkListeners = this._bulkListeners.slice(0);
|
||||
for (let i = 0, len = bulkListeners.length; i < len; i++) {
|
||||
safeInvoke1Arg(bulkListeners[i], events);
|
||||
}
|
||||
}
|
||||
|
||||
protected _emitEvents(events: EmitterEvent[]): void {
|
||||
if (this._bulkListeners.length > 0) {
|
||||
this._emitToBulkListeners(events);
|
||||
}
|
||||
for (let i = 0, len = events.length; i < len; i++) {
|
||||
const e = events[i];
|
||||
|
||||
this._emitToSpecificTypeListeners(e.type, e.data);
|
||||
}
|
||||
}
|
||||
|
||||
public emit(eventType: string, data: any = {}): void {
|
||||
if (this._allowedEventTypes && !this._allowedEventTypes.hasOwnProperty(eventType)) {
|
||||
throw new Error('Cannot emit this event type because it wasn\'t listed!');
|
||||
}
|
||||
// Early return if no listeners would get this
|
||||
if (!this._listeners.hasOwnProperty(eventType) && this._bulkListeners.length === 0) {
|
||||
return;
|
||||
}
|
||||
const emitterEvent = new EmitterEvent(eventType, data);
|
||||
|
||||
if (this._deferredCnt === 0) {
|
||||
this._emitEvents([emitterEvent]);
|
||||
} else {
|
||||
// Collect for later
|
||||
this._collectedEvents.push(emitterEvent);
|
||||
}
|
||||
}
|
||||
|
||||
public beginDeferredEmit(): void {
|
||||
this._deferredCnt = this._deferredCnt + 1;
|
||||
}
|
||||
|
||||
public endDeferredEmit(): void {
|
||||
this._deferredCnt = this._deferredCnt - 1;
|
||||
|
||||
if (this._deferredCnt === 0) {
|
||||
this._emitCollected();
|
||||
}
|
||||
}
|
||||
|
||||
public deferredEmit<T>(callback: () => T): T {
|
||||
this.beginDeferredEmit();
|
||||
|
||||
let result: T = safeInvokeNoArg<T>(callback);
|
||||
|
||||
this.endDeferredEmit();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private _emitCollected(): void {
|
||||
if (this._collectedEvents.length === 0) {
|
||||
return;
|
||||
}
|
||||
// Flush collected events
|
||||
const events = this._collectedEvents;
|
||||
this._collectedEvents = [];
|
||||
this._emitEvents(events);
|
||||
}
|
||||
}
|
||||
|
||||
class EmitQueueElement {
|
||||
public target: Function;
|
||||
public arg: any;
|
||||
|
||||
constructor(target: Function, arg: any) {
|
||||
this.target = target;
|
||||
this.arg = arg;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Same as EventEmitter, but guarantees events are delivered in order to each listener
|
||||
*/
|
||||
export class OrderGuaranteeEventEmitter extends EventEmitter {
|
||||
|
||||
private _emitQueue: EmitQueueElement[];
|
||||
|
||||
constructor() {
|
||||
super(null);
|
||||
this._emitQueue = [];
|
||||
}
|
||||
|
||||
protected _emitToSpecificTypeListeners(eventType: string, data: any): void {
|
||||
if (this._listeners.hasOwnProperty(eventType)) {
|
||||
let listeners = this._listeners[eventType];
|
||||
for (let i = 0, len = listeners.length; i < len; i++) {
|
||||
this._emitQueue.push(new EmitQueueElement(listeners[i], data));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected _emitToBulkListeners(events: EmitterEvent[]): void {
|
||||
let bulkListeners = this._bulkListeners;
|
||||
for (let i = 0, len = bulkListeners.length; i < len; i++) {
|
||||
this._emitQueue.push(new EmitQueueElement(bulkListeners[i], events));
|
||||
}
|
||||
}
|
||||
|
||||
protected _emitEvents(events: EmitterEvent[]): void {
|
||||
super._emitEvents(events);
|
||||
|
||||
while (this._emitQueue.length > 0) {
|
||||
let queueElement = this._emitQueue.shift();
|
||||
safeInvoke1Arg(queueElement.target, queueElement.arg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function safeInvokeNoArg<T>(func: Function): T {
|
||||
try {
|
||||
return func();
|
||||
} catch (e) {
|
||||
Errors.onUnexpectedError(e);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function safeInvoke1Arg(func: Function, arg1: any): any {
|
||||
try {
|
||||
return func(arg1);
|
||||
} catch (e) {
|
||||
Errors.onUnexpectedError(e);
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,25 @@
|
||||
'use strict';
|
||||
import * as Types from 'vs/base/common/types';
|
||||
|
||||
export function clone<T>(obj: T): T {
|
||||
if (!obj || typeof obj !== 'object') {
|
||||
return obj;
|
||||
}
|
||||
if (obj instanceof RegExp) {
|
||||
// See https://github.com/Microsoft/TypeScript/issues/10990
|
||||
return obj as any;
|
||||
}
|
||||
const result = (Array.isArray(obj)) ? <any>[] : <any>{};
|
||||
Object.keys(obj).forEach(key => {
|
||||
if (obj[key] && typeof obj[key] === 'object') {
|
||||
result[key] = clone(obj[key]);
|
||||
} else {
|
||||
result[key] = obj[key];
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* A copy of the vs mixin that accepts a custom behavior function
|
||||
*/
|
||||
|
||||
@@ -10,7 +10,7 @@ import 'vs/css!sql/parts/accountManagement/common/media/accountActions';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { SplitView } from 'sql/base/browser/ui/splitview/splitview';
|
||||
import { List } from 'vs/base/browser/ui/list/listWidget';
|
||||
import { IListService } from 'vs/platform/list/browser/listService';
|
||||
import { IListService, ListService } from 'vs/platform/list/browser/listService';
|
||||
import { IPartService } from 'vs/workbench/services/part/common/partService';
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
import { localize } from 'vs/nls';
|
||||
@@ -192,7 +192,9 @@ export class AccountDialog extends Modal {
|
||||
// Append the list view to the split view
|
||||
this._splitView.addView(providerView);
|
||||
this._register(attachListStyler(accountList, this._themeService));
|
||||
this._register(this._listService.register(accountList));
|
||||
|
||||
let listService = <ListService>this._listService;
|
||||
this._register(listService.register(accountList));
|
||||
this._splitView.layout(DOM.getContentHeight(this._container));
|
||||
|
||||
// Set the initial items of the list
|
||||
|
||||
@@ -64,7 +64,7 @@ export class AutoOAuthDialog extends Modal {
|
||||
public render() {
|
||||
super.render();
|
||||
attachModalDialogStyler(this, this._themeService);
|
||||
this.backButton.addListener('click', () => this.cancel());
|
||||
this.backButton.onDidClick(() => this.cancel());
|
||||
this._register(attachButtonStyler(this.backButton, this._themeService, { buttonBackground: SIDE_BAR_BACKGROUND, buttonHoverBackground: SIDE_BAR_BACKGROUND }));
|
||||
|
||||
this._copyAndOpenButton = this.addFooterButton(localize('copyAndOpen', 'Copy & Open'), () => this.addAccount());
|
||||
|
||||
@@ -97,26 +97,23 @@ export class RemoveAccountAction extends Action {
|
||||
type: 'question'
|
||||
};
|
||||
|
||||
let confirmPromise = this._messageService.confirm(confirm);
|
||||
|
||||
return confirmPromise.then(confirmation => {
|
||||
if (!confirmation.confirmed) {
|
||||
return TPromise.as(false);
|
||||
} else {
|
||||
return new TPromise((resolve, reject) => {
|
||||
self._accountManagementService.removeAccount(self._account.key)
|
||||
.then(
|
||||
(result) => { resolve(result); },
|
||||
(err) => {
|
||||
// Must handle here as this is an independent action
|
||||
self._errorMessageService.showDialog(Severity.Error,
|
||||
localize('removeAccountFailed', 'Failed to remove account'), err);
|
||||
resolve(false);
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
let confirmPromise: boolean = this._messageService.confirm(confirm);
|
||||
if (!confirmPromise) {
|
||||
return TPromise.as(false);
|
||||
} else {
|
||||
return new TPromise((resolve, reject) => {
|
||||
self._accountManagementService.removeAccount(self._account.key)
|
||||
.then(
|
||||
(result) => { resolve(result); },
|
||||
(err) => {
|
||||
// Must handle here as this is an independent action
|
||||
self._errorMessageService.showDialog(Severity.Error,
|
||||
localize('removeAccountFailed', 'Failed to remove account'), err);
|
||||
resolve(false);
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ export class FirewallRuleDialog extends Modal {
|
||||
public render() {
|
||||
super.render();
|
||||
attachModalDialogStyler(this, this._themeService);
|
||||
this.backButton.addListener('click', () => this.cancel());
|
||||
this.backButton.onDidClick(() => this.cancel());
|
||||
this._register(attachButtonStyler(this.backButton, this._themeService, { buttonBackground: SIDE_BAR_BACKGROUND, buttonHoverBackground: SIDE_BAR_BACKGROUND }));
|
||||
this._createButton = this.addFooterButton(localize('ok', 'OK'), () => this.createFirewallRule());
|
||||
this._closeButton = this.addFooterButton(localize('cancel', 'Cancel'), () => this.cancel());
|
||||
|
||||
@@ -68,9 +68,10 @@ export class ConnectionConfig implements IConnectionConfig {
|
||||
allGroups = allGroups.concat(userGroups);
|
||||
}
|
||||
allGroups = allGroups.map(g => {
|
||||
if (g.parentId === '' || !g.parentId) {
|
||||
g.parentId = undefined;
|
||||
}
|
||||
// @SQLTODO
|
||||
// if (g.parentId === '' || !g.parentId) {
|
||||
// g.parentId = undefined;
|
||||
// }
|
||||
return g;
|
||||
});
|
||||
return allGroups;
|
||||
|
||||
@@ -205,7 +205,7 @@ export class ConnectionManagementService implements IConnectionManagementService
|
||||
|
||||
if (this._providerCount === 1) {
|
||||
// show the Registered Server viewlet
|
||||
let startupConfig = this._workspaceConfigurationService.getConfiguration('startup');
|
||||
let startupConfig = this._workspaceConfigurationService.getValue('startup');
|
||||
if (startupConfig) {
|
||||
let showServerViewlet = <boolean>startupConfig['alwaysShowServersView'];
|
||||
if (showServerViewlet) {
|
||||
|
||||
@@ -11,6 +11,7 @@ import { ProviderConnectionInfo } from 'sql/parts/connection/common/providerConn
|
||||
import * as interfaces from 'sql/parts/connection/common/interfaces';
|
||||
import { equalsIgnoreCase } from 'vs/base/common/strings';
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
import * as objects from 'sql/base/common/objects';
|
||||
|
||||
// Concrete implementation of the IConnectionProfile interface
|
||||
|
||||
@@ -174,9 +175,9 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa
|
||||
connectionInfo.options = profile.options;
|
||||
|
||||
// append group ID and original display name to build unique OE session ID
|
||||
connectionInfo.options = profile.options;
|
||||
connectionInfo.options['groupId'] = connectionInfo.groupId;
|
||||
connectionInfo.options['databaseDisplayName'] = connectionInfo.databaseName;
|
||||
connectionInfo.options = objects.clone(profile.options);
|
||||
connectionInfo.options['groupId'] = connectionInfo.groupId;
|
||||
connectionInfo.options['databaseDisplayName'] = connectionInfo.databaseName;
|
||||
|
||||
connectionInfo.groupId = profile.groupId;
|
||||
connectionInfo.providerName = profile.providerName;
|
||||
|
||||
@@ -500,7 +500,7 @@ export class ConnectionStore {
|
||||
}
|
||||
|
||||
private getMaxRecentConnectionsCount(): number {
|
||||
let config = this._workspaceConfigurationService.getConfiguration(Constants.sqlConfigSectionName);
|
||||
let config = this._workspaceConfigurationService.getValue(Constants.sqlConfigSectionName);
|
||||
|
||||
let maxConnections: number = config[Constants.configMaxRecentConnections];
|
||||
if (typeof (maxConnections) !== 'number' || maxConnections <= 0) {
|
||||
|
||||
@@ -22,7 +22,7 @@ export interface IConnectionProfile extends data.ConnectionInfo {
|
||||
providerName: string;
|
||||
saveProfile: boolean;
|
||||
id: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface IConnectionProfileStore {
|
||||
options: {};
|
||||
@@ -30,5 +30,5 @@ export interface IConnectionProfileStore {
|
||||
providerName: string;
|
||||
savePassword: boolean;
|
||||
id: string;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -261,15 +261,35 @@ export class ConnectionDialogWidget extends Modal {
|
||||
type: 'question'
|
||||
};
|
||||
|
||||
return this._messageService.confirm(confirm).then(confirmation => {
|
||||
if (!confirmation.confirmed) {
|
||||
return TPromise.as(false);
|
||||
} else {
|
||||
// @SQLTODO
|
||||
return new TPromise<boolean>((resolve, reject) => {
|
||||
let confirmed: boolean = this._messageService.confirm(confirm);
|
||||
if (confirmed) {
|
||||
this._connectionManagementService.clearRecentConnectionsList();
|
||||
this.open(false);
|
||||
return TPromise.as(true);
|
||||
}
|
||||
resolve(confirmed);
|
||||
});
|
||||
|
||||
//this._messageService.confirm(confirm).then(confirmation => {
|
||||
// if (!confirmation.confirmed) {
|
||||
// return TPromise.as(false);
|
||||
// } else {
|
||||
// this._connectionManagementService.clearRecentConnectionsList();
|
||||
// this.open(false);
|
||||
// return TPromise.as(true);
|
||||
// }
|
||||
// });
|
||||
|
||||
// return this._messageService.confirm(confirm).then(confirmation => {
|
||||
// if (!confirmation.confirmed) {
|
||||
// return TPromise.as(false);
|
||||
// } else {
|
||||
// this._connectionManagementService.clearRecentConnectionsList();
|
||||
// this.open(false);
|
||||
// return TPromise.as(true);
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
private createRecentConnectionList(): void {
|
||||
|
||||
@@ -184,7 +184,7 @@ export class ConnectionWidget {
|
||||
cellContainer.div({ class: 'advanced-button' }, (divContainer) => {
|
||||
button = new Button(divContainer);
|
||||
button.label = title;
|
||||
button.addListener('click', () => {
|
||||
button.onDidClick(() => {
|
||||
//open advanced page
|
||||
this._callbacks.onAdvancedProperties();
|
||||
});
|
||||
|
||||
@@ -28,7 +28,7 @@ import { IColorTheme } from 'vs/workbench/services/themes/common/workbenchThemeS
|
||||
import * as colors from 'vs/platform/theme/common/colorRegistry';
|
||||
import * as themeColors from 'vs/workbench/common/theme';
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
import * as objects from 'vs/base/common/objects';
|
||||
import * as objects from 'sql/base/common/objects';
|
||||
import { ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
|
||||
|
||||
/**
|
||||
|
||||
@@ -75,7 +75,7 @@ export class DashboardEditor extends BaseEditor {
|
||||
return TPromise.wrap(input.initializedPromise.then(() => this.bootstrapAngular(input)));
|
||||
} else {
|
||||
this._dashboardContainer = DOM.append(parentElement, this.input.container);
|
||||
return TPromise.as<void>(null);
|
||||
return TPromise.wrap<void>(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import { mixin, clone } from 'vs/base/common/objects';
|
||||
import { mixin } from 'vs/base/common/objects';
|
||||
import { clone } from 'sql/base/common/objects';
|
||||
import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
||||
import * as nls from 'vs/nls';
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import { mixin, clone } from 'vs/base/common/objects';
|
||||
import { clone } from 'sql/base/common/objects';
|
||||
import { mixin } from 'vs/base/common/objects';
|
||||
import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
||||
import { registerInsight } from 'sql/platform/dashboard/common/insightRegistry';
|
||||
import { chartInsightSchema } from 'sql/parts/dashboard/widgets/insights/views/charts/chartInsight.contribution';
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import { mixin, clone } from 'vs/base/common/objects';
|
||||
import { clone } from 'sql/base/common/objects';
|
||||
import { mixin } from 'vs/base/common/objects';
|
||||
import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
||||
|
||||
import { registerInsight } from 'sql/platform/dashboard/common/insightRegistry';
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
import { ChartType, customMixin, defaultChartConfig, IDataSet, IPointDataSet } from 'sql/parts/dashboard/widgets/insights/views/charts/chartInsight.component';
|
||||
import BarChart, { IBarChartConfig } from './barChart.component';
|
||||
import { memoize, unmemoize } from 'sql/base/common/decorators';
|
||||
import { mixin } from 'sql/base/common/objects';
|
||||
import { clone } from 'vs/base/common/objects';
|
||||
import { mixin } from 'vs/base/common/objects';
|
||||
import { clone } from 'sql/base/common/objects';
|
||||
|
||||
export enum DataType {
|
||||
Number = 'number',
|
||||
@@ -93,6 +93,7 @@ export default class LineChart extends BarChart {
|
||||
}
|
||||
};
|
||||
|
||||
this.options = mixin(this.options, options, true, customMixin);
|
||||
// @SQLTODO
|
||||
this.options = mixin(this.options, options, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import { mixin, clone } from 'vs/base/common/objects';
|
||||
import { mixin } from 'vs/base/common/objects';
|
||||
import { clone } from 'sql/base/common/objects';
|
||||
import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
||||
import * as nls from 'vs/nls';
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import { mixin, clone } from 'vs/base/common/objects';
|
||||
import { mixin } from 'vs/base/common/objects';
|
||||
import { clone } from 'sql/base/common/objects';
|
||||
import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
||||
import { registerInsight } from 'sql/platform/dashboard/common/insightRegistry';
|
||||
import { chartInsightSchema } from 'sql/parts/dashboard/widgets/insights/views/charts/chartInsight.contribution';
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
import { ChartType, defaultChartConfig } from 'sql/parts/dashboard/widgets/insights/views/charts/chartInsight.component';
|
||||
import LineChart, { ILineConfig } from './lineChart.component';
|
||||
|
||||
import { mixin, clone } from 'vs/base/common/objects';
|
||||
import { mixin } from 'vs/base/common/objects';
|
||||
import { clone } from 'sql/base/common/objects';
|
||||
|
||||
const defaultScatterConfig = mixin(clone(defaultChartConfig), { dataType: 'point', dataDirection: 'horizontal' }) as ILineConfig;
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import { mixin, clone } from 'vs/base/common/objects';
|
||||
import { mixin } from 'vs/base/common/objects';
|
||||
import { clone } from 'sql/base/common/objects';
|
||||
import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
||||
|
||||
import { registerInsight } from 'sql/platform/dashboard/common/insightRegistry';
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
import { defaultChartConfig, IPointDataSet, ChartType } from 'sql/parts/dashboard/widgets/insights/views/charts/chartInsight.component';
|
||||
import LineChart, { ILineConfig } from './lineChart.component';
|
||||
|
||||
import { mixin, clone } from 'vs/base/common/objects';
|
||||
import { mixin } from 'vs/base/common/objects';
|
||||
import { clone } from 'sql/base/common/objects';
|
||||
import { Color } from 'vs/base/common/color';
|
||||
|
||||
const defaultTimeSeriesConfig = mixin(clone(defaultChartConfig), { dataType: 'point', dataDirection: 'horizontal' }) as ILineConfig;
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import { mixin, clone } from 'vs/base/common/objects';
|
||||
import { mixin } from 'vs/base/common/objects';
|
||||
import { clone } from 'sql/base/common/objects';
|
||||
import { IJSONSchema } from 'vs/base/common/jsonSchema';
|
||||
|
||||
import { registerInsight } from 'sql/platform/dashboard/common/insightRegistry';
|
||||
|
||||
@@ -525,20 +525,11 @@ export class BackupComponent {
|
||||
|
||||
private addButtonClickHandler(button: Button, handler: () => void) {
|
||||
if (button && handler) {
|
||||
button.addListener(DOM.EventType.CLICK, () => {
|
||||
button.onDidClick(() => {
|
||||
if (button.enabled) {
|
||||
handler();
|
||||
}
|
||||
});
|
||||
|
||||
button.addListener(DOM.EventType.KEY_DOWN, (e: KeyboardEvent) => {
|
||||
var event = new StandardKeyboardEvent(e);
|
||||
if (button.enabled && event.keyCode === KeyCode.Enter) {
|
||||
handler();
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -607,19 +607,10 @@ export class RestoreDialog extends Modal {
|
||||
this.onFilePathLoseFocus(params);
|
||||
}));
|
||||
|
||||
this._browseFileButton.addListener(DOM.EventType.CLICK, () => {
|
||||
this._browseFileButton.onDidClick(() => {
|
||||
this.onFileBrowserRequested();
|
||||
});
|
||||
|
||||
this._browseFileButton.addListener(DOM.EventType.KEY_DOWN, (e: KeyboardEvent) => {
|
||||
var event = new StandardKeyboardEvent(e);
|
||||
if (event.keyCode === KeyCode.Enter) {
|
||||
this.onFileBrowserRequested();
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
|
||||
this._register(this._sourceDatabaseSelectBox.onDidSelect(selectedDatabase => {
|
||||
this.onSourceDatabaseChanged(selectedDatabase.selected);
|
||||
}));
|
||||
|
||||
@@ -349,7 +349,7 @@ export class EditDataEditor extends BaseEditor {
|
||||
params,
|
||||
this.editDataInput);
|
||||
}
|
||||
return TPromise.as<void>(null);
|
||||
return TPromise.wrap<void>(null);
|
||||
}
|
||||
|
||||
private _setTableViewVisible(): void {
|
||||
|
||||
@@ -8,7 +8,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { IQueryModelService } from 'sql/parts/query/execution/queryModel';
|
||||
import { SelectBox } from 'vs/base/browser/ui/selectBox/selectBox';
|
||||
import { EventEmitter } from 'vs/base/common/eventEmitter';
|
||||
import { EventEmitter } from 'sql/base/common/eventEmitter';
|
||||
import { IConnectionManagementService } from 'sql/parts/connection/common/connectionManagement';
|
||||
import { EditDataEditor } from 'sql/parts/editData/editor/editDataEditor';
|
||||
import { IMessageService, Severity } from 'vs/platform/message/common/message';
|
||||
|
||||
@@ -79,19 +79,10 @@ export class FileBrowserDialog extends Modal {
|
||||
|
||||
if (this.backButton) {
|
||||
|
||||
this.backButton.addListener(DOM.EventType.CLICK, () => {
|
||||
this.backButton.onDidClick(() => {
|
||||
this.close();
|
||||
});
|
||||
|
||||
this.backButton.addListener(DOM.EventType.KEY_DOWN, (e: KeyboardEvent) => {
|
||||
var event = new StandardKeyboardEvent(e);
|
||||
if (event.keyCode === KeyCode.Enter) {
|
||||
this.close();
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
|
||||
this._register(attachButtonStyler(this.backButton, this._themeService, { buttonBackground: SIDE_BAR_BACKGROUND, buttonHoverBackground: SIDE_BAR_BACKGROUND }));
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import { FileKind } from 'vs/platform/files/common/files';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { FileLabel } from 'vs/workbench/browser/labels';
|
||||
import { IFileTemplateData } from 'vs/workbench/parts/files/browser/views/explorerViewer';
|
||||
import { IFileTemplateData } from 'vs/workbench/parts/files/electron-browser/views/explorerViewer';
|
||||
|
||||
/**
|
||||
* Renders the tree items.
|
||||
|
||||
@@ -42,7 +42,7 @@ export class FileBrowserTreeView {
|
||||
if (!this._tree) {
|
||||
DOM.addClass(container, 'show-file-icons');
|
||||
this._tree = this.createFileBrowserTree(container, this._instantiationService);
|
||||
this._toDispose.push(this._tree.addListener('selection', (event) => this.onSelected(event)));
|
||||
this._toDispose.push(this._tree.onDidChangeSelection((event) => this.onSelected(event)));
|
||||
this._toDispose.push(this._fileBrowserService.onExpandFolder(fileNode => this._tree.refresh(fileNode)));
|
||||
this._toDispose.push(attachListStyler(this._tree, this._themeService));
|
||||
this._tree.DOMFocus();
|
||||
|
||||
@@ -21,8 +21,7 @@ import { EditDataComponentParams } from 'sql/services/bootstrap/bootstrapParams'
|
||||
import { GridParentComponent } from 'sql/parts/grid/views/gridParentComponent';
|
||||
import { EditDataGridActionProvider } from 'sql/parts/grid/views/editData/editDataGridActions';
|
||||
import { error } from 'sql/base/common/log';
|
||||
|
||||
import { clone } from 'vs/base/common/objects';
|
||||
import { clone } from 'sql/base/common/objects';
|
||||
|
||||
export const EDITDATA_SELECTOR: string = 'editdata-component';
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ export abstract class GridParentComponent {
|
||||
const self = this;
|
||||
this.initShortcutsBase();
|
||||
if (this._bootstrapService.configurationService) {
|
||||
let sqlConfig = this._bootstrapService.configurationService.getConfiguration('sql');
|
||||
let sqlConfig = this._bootstrapService.configurationService.getValue('sql');
|
||||
if (sqlConfig) {
|
||||
this._messageActive = sqlConfig['messagesDefaultOpen'];
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import { error } from 'sql/base/common/log';
|
||||
import { TabChild } from 'sql/base/browser/ui/panel/tab.component';
|
||||
|
||||
import * as strings from 'vs/base/common/strings';
|
||||
import { clone } from 'vs/base/common/objects';
|
||||
import { clone } from 'sql/base/common/objects';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
|
||||
export const QUERY_SELECTOR: string = 'query-component';
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import 'vs/css!vs/editor/contrib/find/browser/findWidget';
|
||||
import 'vs/css!vs/editor/contrib/find/findWidget';
|
||||
|
||||
import * as nls from 'vs/nls';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
|
||||
@@ -21,10 +22,9 @@ import { Widget } from 'vs/base/browser/ui/widget';
|
||||
import { Sash, IHorizontalSashLayoutProvider, ISashEvent, Orientation } from 'vs/base/browser/ui/sash/sash';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { IOverlayWidget, IOverlayWidgetPosition, OverlayWidgetPositionPreference } from 'vs/editor/browser/editorBrowser';
|
||||
import { FIND_IDS, MATCHES_LIMIT } from 'vs/editor/contrib/find/common/findModel';
|
||||
import { FindReplaceState, FindReplaceStateChangedEvent } from 'vs/editor/contrib/find/common/findState';
|
||||
import { FIND_IDS, MATCHES_LIMIT, CONTEXT_FIND_INPUT_FOCUSED } from 'vs/editor/contrib/find/findModel';
|
||||
import { FindReplaceState, FindReplaceStateChangedEvent } from 'vs/editor/contrib/find/findState';
|
||||
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { CONTEXT_FIND_INPUT_FOCUSED } from 'vs/editor/contrib/find/common/findController';
|
||||
import { ITheme, registerThemingParticipant, IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { Color } from 'vs/base/common/color';
|
||||
import { editorFindRangeHighlight, editorFindMatch, editorFindMatchHighlight, activeContrastBorder, contrastBorder, inputBackground, editorWidgetBackground, inputActiveOptionBorder, widgetShadow, inputForeground, inputBorder, inputValidationInfoBackground, inputValidationInfoBorder, inputValidationWarningBackground, inputValidationWarningBorder, inputValidationErrorBackground, inputValidationErrorBorder, errorForeground } from 'vs/platform/theme/common/colorRegistry';
|
||||
@@ -102,7 +102,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
|
||||
|
||||
this._isVisible = false;
|
||||
|
||||
this._register(this._state.addChangeListener((e) => this._onStateChanged(e)));
|
||||
this._register(this._state.onFindReplaceStateChange((e) => this._onStateChanged(e)));
|
||||
this._buildDomNode();
|
||||
this._updateButtons();
|
||||
|
||||
@@ -148,10 +148,10 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
|
||||
|
||||
this._findInputFocussed = CONTEXT_FIND_INPUT_FOCUSED.bindTo(contextKeyService);
|
||||
this._focusTracker = this._register(dom.trackFocus(this._findInput.inputBox.inputElement));
|
||||
this._focusTracker.addFocusListener(() => {
|
||||
this._focusTracker.onDidFocus(() => {
|
||||
this._findInputFocussed.set(true);
|
||||
});
|
||||
this._focusTracker.addBlurListener(() => {
|
||||
this._focusTracker.onDidBlur(() => {
|
||||
this._findInputFocussed.set(false);
|
||||
});
|
||||
|
||||
@@ -480,11 +480,11 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
|
||||
this._resizeSash = new Sash(this._domNode, this, { orientation: Orientation.VERTICAL });
|
||||
let originalWidth = FIND_WIDGET_INITIAL_WIDTH;
|
||||
|
||||
this._register(this._resizeSash.addListener('start', (e: ISashEvent) => {
|
||||
this._register(this._resizeSash.onDidStart((e: ISashEvent) => {
|
||||
originalWidth = dom.getTotalWidth(this._domNode);
|
||||
}));
|
||||
|
||||
this._register(this._resizeSash.addListener('change', (evt: ISashEvent) => {
|
||||
this._register(this._resizeSash.onDidChange((evt: ISashEvent) => {
|
||||
let width = originalWidth + evt.startX - evt.currentX;
|
||||
|
||||
if (width < FIND_WIDGET_INITIAL_WIDTH) {
|
||||
|
||||
@@ -20,7 +20,7 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { IEditorAction } from 'vs/editor/common/editorCommon';
|
||||
import { IOverlayWidget } from 'vs/editor/browser/editorBrowser';
|
||||
import { FindReplaceState, FindReplaceStateChangedEvent } from 'vs/editor/contrib/find/common/findState';
|
||||
import { FindReplaceState, FindReplaceStateChangedEvent } from 'vs/editor/contrib/find/findState';
|
||||
import { Dimension, Builder } from 'vs/base/browser/builder';
|
||||
import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
@@ -70,7 +70,7 @@ export class ProfilerTableEditor extends BaseEditor implements IProfilerControll
|
||||
attachTableStyler(this._profilerTable, this._themeService);
|
||||
|
||||
this._findState = new FindReplaceState();
|
||||
this._findState.addChangeListener(e => this._onFindStateChange(e));
|
||||
this._findState.onFindReplaceStateChange(e => this._onFindStateChange(e));
|
||||
|
||||
this._finder = new FindWidget(
|
||||
this,
|
||||
|
||||
@@ -28,19 +28,20 @@ import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiati
|
||||
import { ProfilerResourceEditor } from './profilerResourceEditor';
|
||||
import { SplitView, View, Orientation, IViewOptions } from 'sql/base/browser/ui/splitview/splitview';
|
||||
import { IContextMenuService, IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { IModel, ICommonCodeEditor } from 'vs/editor/common/editorCommon';
|
||||
import { IModel } from 'vs/editor/common/editorCommon';
|
||||
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import { UNTITLED_SCHEMA } from 'vs/workbench/services/untitled/common/untitledEditorService';
|
||||
import * as nls from 'vs/nls';
|
||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { Command } from 'vs/editor/common/editorCommonExtensions';
|
||||
import { Command } from 'vs/editor/browser/editorExtensions';
|
||||
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { ContextKeyExpr, IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
|
||||
import { CommonFindController, FindStartFocusAction } from 'vs/editor/contrib/find/common/findController';
|
||||
import { CommonFindController, FindStartFocusAction } from 'vs/editor/contrib/find/findController';
|
||||
import * as types from 'vs/base/common/types';
|
||||
import { attachSelectBoxStyler } from 'vs/platform/theme/common/styler';
|
||||
|
||||
@@ -354,11 +355,12 @@ export class ProfilerEditor extends BaseEditor {
|
||||
|
||||
public toggleSearch(): void {
|
||||
if (this._editor.getControl().isFocused()) {
|
||||
let editor = this._editor.getControl() as ICommonCodeEditor;
|
||||
let editor = this._editor.getControl() as ICodeEditor;
|
||||
let controller = CommonFindController.get(editor);
|
||||
if (controller) {
|
||||
controller.start({
|
||||
forceRevealReplace: false,
|
||||
seedSearchStringFromGlobalClipboard: false,
|
||||
seedSearchStringFromSelection: (controller.getState().searchString.length === 0),
|
||||
shouldFocus: FindStartFocusAction.FocusFindInput,
|
||||
shouldAnimate: true
|
||||
|
||||
@@ -22,8 +22,8 @@ import { ITextFileService } from 'vs/workbench/services/textfile/common/textfile
|
||||
import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService';
|
||||
import { EditorOptions } from 'vs/workbench/common/editor';
|
||||
import { CodeEditor } from 'vs/editor/browser/codeEditor';
|
||||
import { IEditorContributionCtor } from 'vs/editor/browser/editorBrowser';
|
||||
import { FoldingController } from 'vs/editor/contrib/folding/browser/folding';
|
||||
import { IEditorContributionCtor } from 'vs/editor/browser/editorExtensions';
|
||||
import { FoldingController } from 'vs/editor/contrib/folding/folding';
|
||||
|
||||
class ProfilerResourceCodeEditor extends CodeEditor {
|
||||
|
||||
@@ -53,7 +53,7 @@ export class ProfilerResourceEditor extends BaseTextEditor {
|
||||
@IEditorGroupService editorGroupService: IEditorGroupService
|
||||
|
||||
) {
|
||||
super(ProfilerResourceEditor.ID, telemetryService, instantiationService, storageService, configurationService, themeService, modeService, textFileService, editorGroupService);
|
||||
super(ProfilerResourceEditor.ID, telemetryService, instantiationService, storageService, configurationService, themeService, textFileService, editorGroupService);
|
||||
}
|
||||
|
||||
public createEditorControl(parent: Builder, configuration: IEditorOptions): editorCommon.IEditor {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import { EventEmitter } from 'vs/base/common/eventEmitter';
|
||||
import { EventEmitter } from 'sql/base/common/eventEmitter';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
|
||||
export interface IProfilerStateChangedEvent {
|
||||
|
||||
@@ -118,7 +118,7 @@ export class ProfilerService implements IProfilerService {
|
||||
}
|
||||
|
||||
public getSessionTemplates(provider?: string): Array<IProfilerSessionTemplate> {
|
||||
let config = <IProfilerSettings>this._configurationService.getConfiguration(PROFILER_SETTINGS);
|
||||
let config = <IProfilerSettings>this._configurationService.getValue(PROFILER_SETTINGS);
|
||||
|
||||
if (provider) {
|
||||
return config.sessionTemplates;
|
||||
|
||||
@@ -16,7 +16,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import errors = require('vs/base/common/errors');
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { getCodeEditor as getEditorWidget } from 'vs/editor/common/services/codeEditorService';
|
||||
import { getCodeEditor as getEditorWidget } from 'vs/editor/browser/services/codeEditorService';
|
||||
import nls = require('vs/nls');
|
||||
|
||||
import { IConnectionManagementService } from 'sql/parts/connection/common/connectionManagement';
|
||||
|
||||
@@ -49,7 +49,7 @@ export class QueryResultsEditor extends BaseEditor {
|
||||
if (!input.hasBootstrapped) {
|
||||
this._bootstrapAngular();
|
||||
}
|
||||
return TPromise.as<void>(null);
|
||||
return TPromise.wrap<void>(null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,7 @@ import * as nls from 'vs/nls';
|
||||
import { Builder, $ } from 'vs/base/browser/builder';
|
||||
import { Dropdown } from 'sql/base/browser/ui/editableDropdown/dropdown';
|
||||
import { Action, IActionItem, IActionRunner } from 'vs/base/common/actions';
|
||||
import { EventEmitter } from 'vs/base/common/eventEmitter';
|
||||
import { EventEmitter } from 'sql/base/common/eventEmitter';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
|
||||
@@ -19,7 +19,7 @@ import { IWorkspaceConfigurationService } from 'vs/workbench/services/configurat
|
||||
import * as nls from 'vs/nls';
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import * as types from 'vs/base/common/types';
|
||||
import { EventEmitter } from 'vs/base/common/eventEmitter';
|
||||
import { EventEmitter } from 'sql/base/common/eventEmitter';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
|
||||
export interface IEditSessionReadyEvent {
|
||||
@@ -446,7 +446,7 @@ export default class QueryRunner {
|
||||
}
|
||||
|
||||
private getEolString(): string {
|
||||
const { eol } = this._workspaceConfigurationService.getConfiguration<{ eol: string }>('files');
|
||||
const { eol } = this._workspaceConfigurationService.getValue<{ eol: string }>('files');
|
||||
return eol;
|
||||
}
|
||||
|
||||
|
||||
@@ -354,10 +354,13 @@ export class QueryEditorService implements IQueryEditorService {
|
||||
let group: IEditorGroup = QueryEditorService.editorGroupService.getStacksModel().groupAt(position);
|
||||
if (isPinned) {
|
||||
QueryEditorService.editorGroupService.pinEditor(group, editor.input);
|
||||
} else {
|
||||
QueryEditorService.editorGroupService.unpinEditor(group, editor.input);
|
||||
}
|
||||
|
||||
// @SQLTODO do we need the below
|
||||
// else {
|
||||
// QueryEditorService.editorGroupService.p .unpinEditor(group, editor.input);
|
||||
// }
|
||||
|
||||
// Grab and returns the IModel that will be used to resolve the sqlLanguageModeCheck promise.
|
||||
let control = editor.getControl();
|
||||
let codeEditor: CodeEditor = <CodeEditor> control;
|
||||
|
||||
@@ -65,10 +65,10 @@ export class VerticalFlexibleSash extends Disposable implements IVerticalSashLay
|
||||
this.top = 0;
|
||||
this.sash = new Sash(container, this);
|
||||
|
||||
this._register(this.sash.addListener('start', () => this.onSashDragStart()));
|
||||
this._register(this.sash.addListener('change', (e: ISashEvent) => this.onSashDrag(e)));
|
||||
this._register(this.sash.addListener('end', () => this.onSashDragEnd()));
|
||||
this._register(this.sash.addListener('reset', () => this.onSashReset()));
|
||||
this._register(this.sash.onDidStart(() => this.onSashDragStart()));
|
||||
this._register(this.sash.onDidChange((e: ISashEvent) => this.onSashDrag(e)));
|
||||
this._register(this.sash.onDidEnd(() => this.onSashDragEnd()));
|
||||
this._register(this.sash.onDidReset(() => this.onSashReset()));
|
||||
}
|
||||
|
||||
public getSplitPoint(): number {
|
||||
@@ -178,10 +178,10 @@ export class HorizontalFlexibleSash extends Disposable implements IHorizontalSas
|
||||
this.left = 0;
|
||||
this.sash = new Sash(container, this, { orientation: Orientation.HORIZONTAL });
|
||||
|
||||
this._register(this.sash.addListener('start', () => this.onSashDragStart()));
|
||||
this._register(this.sash.addListener('change', (e: ISashEvent) => this.onSashDrag(e)));
|
||||
this._register(this.sash.addListener('end', () => this.onSashDragEnd()));
|
||||
this._register(this.sash.addListener('reset', () => this.onSashReset()));
|
||||
this._register(this.sash.onDidStart(() => this.onSashDragStart()));
|
||||
this._register(this.sash.onDidChange((e: ISashEvent) => this.onSashDrag(e)));
|
||||
this._register(this.sash.onDidEnd(() => this.onSashDragEnd()));
|
||||
this._register(this.sash.onDidReset(() => this.onSashReset()));
|
||||
}
|
||||
|
||||
public getSplitPoint(): number {
|
||||
|
||||
@@ -82,7 +82,7 @@ export class ServerGroupController implements IServerGroupController {
|
||||
public showCreateGroupDialog(connectionManagementService: IConnectionManagementService, callbacks?: IServerGroupDialogCallbacks): TPromise<void> {
|
||||
this._connectionManagementService = connectionManagementService;
|
||||
this._group = null;
|
||||
this._viewModel = new ServerGroupViewModel(undefined, this._configurationService.getConfiguration(SERVER_GROUP_CONFIG)[SERVER_GROUP_COLORS_CONFIG]);
|
||||
this._viewModel = new ServerGroupViewModel(undefined, this._configurationService.getValue(SERVER_GROUP_CONFIG)[SERVER_GROUP_COLORS_CONFIG]);
|
||||
this._callbacks = callbacks ? callbacks : undefined;
|
||||
return this.openServerGroupDialog();
|
||||
}
|
||||
@@ -90,7 +90,7 @@ export class ServerGroupController implements IServerGroupController {
|
||||
public showEditGroupDialog(connectionManagementService: IConnectionManagementService, group: ConnectionProfileGroup): TPromise<void> {
|
||||
this._connectionManagementService = connectionManagementService;
|
||||
this._group = group;
|
||||
this._viewModel = new ServerGroupViewModel(group, this._configurationService.getConfiguration(SERVER_GROUP_CONFIG)[SERVER_GROUP_COLORS_CONFIG]);
|
||||
this._viewModel = new ServerGroupViewModel(group, this._configurationService.getValue(SERVER_GROUP_CONFIG)[SERVER_GROUP_COLORS_CONFIG]);
|
||||
return this.openServerGroupDialog();
|
||||
}
|
||||
|
||||
|
||||
@@ -90,16 +90,16 @@ export class ServerTreeView {
|
||||
var connectButton = new Button(this._buttonSection);
|
||||
connectButton.label = localize('addConnection', 'Add Connection');
|
||||
this._toDispose.push(attachButtonStyler(connectButton, this._themeService));
|
||||
this._toDispose.push(connectButton.addListener('click', () => {
|
||||
this._toDispose.push(connectButton.onDidClick(() => {
|
||||
this._connectionManagementService.showConnectionDialog();
|
||||
}));
|
||||
}
|
||||
|
||||
this._tree = TreeCreationUtils.createRegisteredServersTree(container, this._instantiationService);
|
||||
//this._tree.setInput(undefined);
|
||||
this._toDispose.push(this._tree.addListener('selection', (event) => this.onSelected(event)));
|
||||
this._toDispose.push(this._tree.onDOMBlur(() => this._onSelectionOrFocusChange.fire()));
|
||||
this._toDispose.push(this._tree.onDOMFocus(() => this._onSelectionOrFocusChange.fire()));
|
||||
this._toDispose.push(this._tree.onDidChangeSelection((event) => this.onSelected(event)));
|
||||
this._toDispose.push(this._tree.onDidBlur(() => this._onSelectionOrFocusChange.fire()));
|
||||
this._toDispose.push(this._tree.onDidChangeFocus(() => this._onSelectionOrFocusChange.fire()));
|
||||
|
||||
// Theme styler
|
||||
this._toDispose.push(attachListStyler(this._tree, this._themeService));
|
||||
|
||||
@@ -20,6 +20,7 @@ import lifecycle = require('vs/base/common/lifecycle');
|
||||
import ext = require('vs/workbench/common/contributions');
|
||||
import { ITaskService } from 'sql/parts/taskHistory/common/taskService';
|
||||
import { IActivityService, NumberBadge } from 'vs/workbench/services/activity/common/activity';
|
||||
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
|
||||
export class StatusUpdater implements ext.IWorkbenchContribution {
|
||||
static ID = 'data.taskhistory.statusUpdater';
|
||||
@@ -97,7 +98,7 @@ const viewletDescriptor = new ViewletDescriptor(
|
||||
Registry.as<ViewletRegistry>(ViewletExtensions.Viewlets).registerViewlet(viewletDescriptor);
|
||||
|
||||
// Register StatusUpdater
|
||||
(<ext.IWorkbenchContributionsRegistry>Registry.as(ext.Extensions.Workbench)).registerWorkbenchContribution(StatusUpdater);
|
||||
(<ext.IWorkbenchContributionsRegistry>Registry.as(ext.Extensions.Workbench)).registerWorkbenchContribution(StatusUpdater, LifecyclePhase.Running);
|
||||
|
||||
const registry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions);
|
||||
registry.registerWorkbenchAction(
|
||||
|
||||
@@ -59,7 +59,7 @@ export class TaskHistoryView {
|
||||
$('span').text(noTaskMessage).appendTo(this._messages);
|
||||
|
||||
this._tree = this.createTaskHistoryTree(container, this._instantiationService);
|
||||
this._toDispose.push(this._tree.addListener('selection', (event) => this.onSelected(event)));
|
||||
this._toDispose.push(this._tree.onDidChangeSelection((event) => this.onSelected(event)));
|
||||
|
||||
// Theme styler
|
||||
this._toDispose.push(attachListStyler(this._tree, this._themeService));
|
||||
|
||||
@@ -27,4 +27,24 @@ export class ClipboardService implements IClipboardService {
|
||||
writeText(text: string): void {
|
||||
this._vsClipboardService.writeText(text);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads the content of the clipboard in plain text
|
||||
*/
|
||||
readText(): string {
|
||||
return this._vsClipboardService.readText();
|
||||
}
|
||||
/**
|
||||
* Reads text from the system find pasteboard.
|
||||
*/
|
||||
readFindText(): string {
|
||||
return this._vsClipboardService.readFindText();
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes text to the system find pasteboard.
|
||||
*/
|
||||
writeFindText(text: string): void {
|
||||
this._vsClipboardService.writeFindText(text);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,14 +99,34 @@ export class CapabilitiesService implements ICapabilitiesService {
|
||||
// Get extensions and filter where the category has 'Data Provider' in it
|
||||
this.extensionManagementService.getInstalled(LocalExtensionType.User).then((extensions: ILocalExtension[]) => {
|
||||
let dataProviderExtensions = extensions.filter(extension =>
|
||||
extension.manifest.categories.indexOf(CapabilitiesService.DATA_PROVIDER_CATEGORY) > -1)
|
||||
extension.manifest.categories.indexOf(CapabilitiesService.DATA_PROVIDER_CATEGORY) > -1);
|
||||
|
||||
if(dataProviderExtensions.length > 0) {
|
||||
if (dataProviderExtensions.length > 0) {
|
||||
// Scrape out disabled extensions
|
||||
const disabledExtensions = this.extensionEnablementService.getGloballyDisabledExtensions()
|
||||
.map(disabledExtension => disabledExtension.id);
|
||||
dataProviderExtensions = dataProviderExtensions.filter(extension =>
|
||||
disabledExtensions.indexOf(getGalleryExtensionId(extension.manifest.publisher, extension.manifest.name)) < 0)
|
||||
|
||||
// @SQLTODO reenable this code
|
||||
// this.extensionEnablementService.getDisabledExtensions()
|
||||
// .then(disabledExtensions => {
|
||||
|
||||
// let disabledExtensionsId = disabledExtensions.map(disabledExtension => disabledExtension.id);
|
||||
// dataProviderExtensions = dataProviderExtensions.filter(extension =>
|
||||
// disabledExtensions.indexOf(getGalleryExtensionId(extension.manifest.publisher, extension.manifest.name)) < 0);
|
||||
|
||||
|
||||
// // return extensions.map(extension => {
|
||||
// // return {
|
||||
// // identifier: { id: adoptToGalleryExtensionId(stripVersion(extension.identifier.id)), uuid: extension.identifier.uuid },
|
||||
// // local: extension,
|
||||
// // globallyEnabled: disabledExtensions.every(disabled => !areSameExtensions(disabled, extension.identifier))
|
||||
// // };
|
||||
// // });
|
||||
// });
|
||||
|
||||
|
||||
// const disabledExtensions = this.extensionEnablementService.getGloballyDisabledExtensions()
|
||||
// .map(disabledExtension => disabledExtension.id);
|
||||
// dataProviderExtensions = dataProviderExtensions.filter(extension =>
|
||||
// disabledExtensions.indexOf(getGalleryExtensionId(extension.manifest.publisher, extension.manifest.name)) < 0);
|
||||
}
|
||||
|
||||
this._expectedCapabilitiesCount += dataProviderExtensions.length;
|
||||
|
||||
@@ -15,6 +15,17 @@ export enum ServiceOptionType {
|
||||
object = 6
|
||||
}
|
||||
|
||||
// SQL added extension host types
|
||||
export enum ServiceOptionTypeNames {
|
||||
string = 'string',
|
||||
multistring = 'multistring',
|
||||
password = 'password',
|
||||
number = 'number',
|
||||
category = 'category',
|
||||
boolean = 'boolean',
|
||||
object = 'object'
|
||||
}
|
||||
|
||||
export enum ConnectionOptionSpecialType {
|
||||
serverName = 'serverName',
|
||||
databaseName = 'databaseName',
|
||||
|
||||
@@ -17,9 +17,8 @@ import {
|
||||
import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
|
||||
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
|
||||
|
||||
|
||||
@extHostNamedCustomer(SqlMainContext.MainThreadAccountManagement)
|
||||
export class MainThreadAccountManagement extends MainThreadAccountManagementShape {
|
||||
export class MainThreadAccountManagement implements MainThreadAccountManagementShape {
|
||||
private _providerMetadata: { [handle: number]: data.AccountProviderMetadata };
|
||||
private _proxy: ExtHostAccountManagementShape;
|
||||
private _toDispose: IDisposable[];
|
||||
@@ -28,7 +27,6 @@ export class MainThreadAccountManagement extends MainThreadAccountManagementShap
|
||||
extHostContext: IExtHostContext,
|
||||
@IAccountManagementService private _accountManagementService: IAccountManagementService
|
||||
) {
|
||||
super();
|
||||
this._providerMetadata = {};
|
||||
if (extHostContext) {
|
||||
this._proxy = extHostContext.get(SqlExtHostContext.ExtHostAccountManagement);
|
||||
|
||||
@@ -15,7 +15,7 @@ import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
|
||||
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
|
||||
|
||||
@extHostNamedCustomer(SqlMainContext.MainThreadCredentialManagement)
|
||||
export class MainThreadCredentialManagement extends MainThreadCredentialManagementShape {
|
||||
export class MainThreadCredentialManagement implements MainThreadCredentialManagementShape {
|
||||
|
||||
private _proxy: ExtHostCredentialManagementShape;
|
||||
|
||||
@@ -27,7 +27,6 @@ export class MainThreadCredentialManagement extends MainThreadCredentialManageme
|
||||
extHostContext: IExtHostContext,
|
||||
@ICredentialsService private credentialService: ICredentialsService
|
||||
) {
|
||||
super();
|
||||
if (extHostContext) {
|
||||
this._proxy = extHostContext.get(SqlExtHostContext.ExtHostCredentialManagement);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostC
|
||||
* Main thread class for handling data protocol management registration.
|
||||
*/
|
||||
@extHostNamedCustomer(SqlMainContext.MainThreadDataProtocol)
|
||||
export class MainThreadDataProtocol extends MainThreadDataProtocolShape {
|
||||
export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
|
||||
|
||||
private _proxy: ExtHostDataProtocolShape;
|
||||
|
||||
@@ -55,7 +55,6 @@ export class MainThreadDataProtocol extends MainThreadDataProtocolShape {
|
||||
@ISerializationService private _serializationService: ISerializationService,
|
||||
@IFileBrowserService private _fileBrowserService: IFileBrowserService
|
||||
) {
|
||||
super();
|
||||
if (extHostContext) {
|
||||
this._proxy = extHostContext.get(SqlExtHostContext.ExtHostDataProtocol);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostC
|
||||
|
||||
|
||||
@extHostNamedCustomer(SqlMainContext.MainThreadResourceProvider)
|
||||
export class MainThreadResourceProvider extends MainThreadResourceProviderShape {
|
||||
export class MainThreadResourceProvider implements MainThreadResourceProviderShape {
|
||||
private _providerMetadata: {[handle: number]: data.AccountProviderMetadata};
|
||||
private _proxy: ExtHostResourceProviderShape;
|
||||
private _toDispose: IDisposable[];
|
||||
@@ -28,7 +28,6 @@ export class MainThreadResourceProvider extends MainThreadResourceProviderShape
|
||||
extHostContext: IExtHostContext,
|
||||
@IResourceProviderService private _resourceProviderService: IResourceProviderService
|
||||
) {
|
||||
super();
|
||||
this._providerMetadata = {};
|
||||
if (extHostContext) {
|
||||
this._proxy = extHostContext.get(SqlExtHostContext.ExtHostResourceProvider);
|
||||
|
||||
@@ -16,7 +16,7 @@ import { IExtHostContext } from 'vs/workbench/api/node/extHost.protocol';
|
||||
import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers';
|
||||
|
||||
@extHostNamedCustomer(SqlMainContext.MainThreadSerializationProvider)
|
||||
export class MainThreadSerializationProvider extends MainThreadSerializationProviderShape {
|
||||
export class MainThreadSerializationProvider implements MainThreadSerializationProviderShape {
|
||||
|
||||
private _proxy: ExtHostSerializationProviderShape;
|
||||
|
||||
@@ -29,7 +29,6 @@ export class MainThreadSerializationProvider extends MainThreadSerializationProv
|
||||
@ISerializationService private serializationService: ISerializationService
|
||||
|
||||
) {
|
||||
super();
|
||||
if (extHostContext) {
|
||||
this._proxy = extHostContext.get(SqlExtHostContext.ExtHostSerializationProvider);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@ import { ExtHostThreadService } from 'vs/workbench/services/thread/node/extHostT
|
||||
import * as sqlExtHostTypes from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
import { ExtHostWorkspace } from 'vs/workbench/api/node/extHostWorkspace';
|
||||
import { ExtHostConfiguration } from 'vs/workbench/api/node/extHostConfiguration';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IExtensionApiFactory } from 'vs/workbench/api/node/extHost.api.impl';
|
||||
|
||||
export interface ISqlExtensionApiFactory {
|
||||
vsCodeFactory(extension: IExtensionDescription): typeof vscode;
|
||||
@@ -32,18 +34,17 @@ export interface ISqlExtensionApiFactory {
|
||||
}
|
||||
|
||||
/**
|
||||
* This method instantiates and returns the extension API surface. This overrides the default ApiFactory by extending it to add Carbon-related functions
|
||||
* This method instantiates and returns the extension API surface
|
||||
*/
|
||||
export function createApiFactory(
|
||||
initData: IInitData,
|
||||
threadService: ExtHostThreadService,
|
||||
extHostWorkspace: ExtHostWorkspace,
|
||||
extHostConfiguration: ExtHostConfiguration,
|
||||
extensionService: ExtHostExtensionService
|
||||
|
||||
|
||||
extensionService: ExtHostExtensionService,
|
||||
logService: ILogService
|
||||
): ISqlExtensionApiFactory {
|
||||
let vsCodeFactory = extHostApi.createApiFactory(initData, threadService, extHostWorkspace, extHostConfiguration, extensionService);
|
||||
let vsCodeFactory = extHostApi.createApiFactory(initData, threadService, extHostWorkspace, extHostConfiguration, extensionService, logService);
|
||||
|
||||
// Addressable instances
|
||||
const extHostAccountManagement = threadService.set(SqlExtHostContext.ExtHostAccountManagement, new ExtHostAccountManagement(threadService));
|
||||
|
||||
@@ -15,6 +15,7 @@ import 'sql/workbench/api/node/mainThreadDataProtocol';
|
||||
import 'sql/workbench/api/node/mainThreadSerializationProvider';
|
||||
import 'sql/workbench/api/node/mainThreadResourceProvider';
|
||||
import './mainThreadAccountManagement';
|
||||
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
|
||||
export class SqlExtHostContribution implements IWorkbenchContribution {
|
||||
|
||||
@@ -30,5 +31,6 @@ export class SqlExtHostContribution implements IWorkbenchContribution {
|
||||
|
||||
// Register File Tracker
|
||||
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(
|
||||
SqlExtHostContribution
|
||||
SqlExtHostContribution,
|
||||
LifecyclePhase.Running
|
||||
);
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
import * as data from 'data';
|
||||
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
export abstract class ExtHostAccountManagementShape {
|
||||
$autoOAuthCancelled(handle: number): Thenable<void> { throw ni(); }
|
||||
$clear(handle: number, accountKey: data.AccountKey): Thenable<void> { throw ni(); }
|
||||
@@ -336,104 +336,69 @@ export abstract class ExtHostSerializationProviderShape {
|
||||
$saveAs(saveFormat: string, savePath: string, results: string, appendToFile: boolean): Thenable<data.SaveResultRequestResult> { throw ni(); }
|
||||
}
|
||||
|
||||
export abstract class MainThreadAccountManagementShape {
|
||||
$registerAccountProvider(providerMetadata: data.AccountProviderMetadata, handle: number): Thenable<any> { throw ni(); }
|
||||
$unregisterAccountProvider(handle: number): Thenable<any> { throw ni(); }
|
||||
export interface MainThreadAccountManagementShape extends IDisposable {
|
||||
$registerAccountProvider(providerMetadata: data.AccountProviderMetadata, handle: number): Thenable<any>;
|
||||
$unregisterAccountProvider(handle: number): Thenable<any>;
|
||||
|
||||
$beginAutoOAuthDeviceCode(providerId: string, title: string, message: string, userCode: string, uri: string): Thenable<void> { throw ni(); }
|
||||
$endAutoOAuthDeviceCode(): void { throw ni(); }
|
||||
$beginAutoOAuthDeviceCode(providerId: string, title: string, message: string, userCode: string, uri: string): Thenable<void>;
|
||||
$endAutoOAuthDeviceCode(): void;
|
||||
|
||||
$accountUpdated(updatedAccount: data.Account): void { throw ni(); }
|
||||
$accountUpdated(updatedAccount: data.Account): void;
|
||||
}
|
||||
|
||||
export abstract class MainThreadResourceProviderShape {
|
||||
$registerResourceProvider(providerMetadata: data.ResourceProviderMetadata, handle: number): Thenable<any> { throw ni(); }
|
||||
$unregisterResourceProvider(handle: number): Thenable<any> { throw ni(); }
|
||||
export interface MainThreadResourceProviderShape extends IDisposable {
|
||||
$registerResourceProvider(providerMetadata: data.ResourceProviderMetadata, handle: number): Thenable<any>;
|
||||
$unregisterResourceProvider(handle: number): Thenable<any>;
|
||||
}
|
||||
|
||||
export abstract class MainThreadDataProtocolShape {
|
||||
$registerConnectionProvider(providerId: string, handle: number): TPromise<any> { throw ni(); }
|
||||
$registerBackupProvider(providerId: string, handle: number): TPromise<any> { throw ni(); }
|
||||
$registerRestoreProvider(providerId: string, handle: number): TPromise<any> { throw ni(); }
|
||||
$registerScriptingProvider(providerId: string, handle: number): TPromise<any> { throw ni(); }
|
||||
$registerQueryProvider(providerId: string, handle: number): TPromise<any> { throw ni(); }
|
||||
$registerProfilerProvider(providerId: string, handle: number): TPromise<any> { throw ni(); }
|
||||
$registerObjectExplorerProvider(providerId: string, handle: number): TPromise<any> { throw ni(); }
|
||||
$registerMetadataProvider(providerId: string, handle: number): TPromise<any> { throw ni(); }
|
||||
$registerTaskServicesProvider(providerId: string, handle: number): TPromise<any> { throw ni(); }
|
||||
$registerFileBrowserProvider(providerId: string, handle: number): TPromise<any> { throw ni(); }
|
||||
$registerCapabilitiesServiceProvider(providerId: string, handle: number): TPromise<any> { throw ni(); }
|
||||
$registerAdminServicesProvider(providerId: string, handle: number): TPromise<any> { throw ni(); }
|
||||
$unregisterProvider(handle: number): TPromise<any> { throw ni(); }
|
||||
$onConnectionComplete(handle: number, connectionInfoSummary: data.ConnectionInfoSummary): void { throw ni(); }
|
||||
$onIntelliSenseCacheComplete(handle: number, connectionUri: string): void { throw ni(); }
|
||||
$onConnectionChangeNotification(handle: number, changedConnInfo: data.ChangedConnectionInfo): void { throw ni(); }
|
||||
$onQueryComplete(handle: number, result: data.QueryExecuteCompleteNotificationResult): void { throw ni(); }
|
||||
$onBatchStart(handle: number, batchInfo: data.QueryExecuteBatchNotificationParams): void { throw ni(); }
|
||||
$onBatchComplete(handle: number, batchInfo: data.QueryExecuteBatchNotificationParams): void { throw ni(); }
|
||||
$onResultSetComplete(handle: number, resultSetInfo: data.QueryExecuteResultSetCompleteNotificationParams): void { throw ni(); }
|
||||
$onQueryMessage(handle: number, message: data.QueryExecuteMessageParams): void { throw ni(); }
|
||||
$onObjectExplorerSessionCreated(handle: number, message: data.ObjectExplorerSession): void { throw ni(); }
|
||||
$onObjectExplorerNodeExpanded(handle: number, message: data.ObjectExplorerExpandInfo): void { throw ni(); }
|
||||
$onTaskCreated(handle: number, sessionResponse: data.TaskInfo): void { throw ni(); }
|
||||
$onTaskStatusChanged(handle: number, sessionResponse: data.TaskProgressInfo): void { throw ni(); }
|
||||
$onFileBrowserOpened(handle: number, response: data.FileBrowserOpenedParams): void { throw ni(); }
|
||||
$onFolderNodeExpanded(handle: number, response: data.FileBrowserExpandedParams): void { throw ni(); }
|
||||
$onFilePathsValidated(handle: number, response: data.FileBrowserValidatedParams): void { throw ni(); }
|
||||
$onScriptingComplete(handle: number, message: data.ScriptingCompleteResult): void { throw ni(); }
|
||||
$onSessionEventsAvailable(handle: number, response: data.ProfilerSessionEvents): void { throw ni(); }
|
||||
export interface MainThreadDataProtocolShape extends IDisposable {
|
||||
$registerConnectionProvider(providerId: string, handle: number): TPromise<any>;
|
||||
$registerBackupProvider(providerId: string, handle: number): TPromise<any>;
|
||||
$registerRestoreProvider(providerId: string, handle: number): TPromise<any>;
|
||||
$registerScriptingProvider(providerId: string, handle: number): TPromise<any>;
|
||||
$registerQueryProvider(providerId: string, handle: number): TPromise<any>;
|
||||
$registerProfilerProvider(providerId: string, handle: number): TPromise<any>;
|
||||
$registerObjectExplorerProvider(providerId: string, handle: number): TPromise<any>;
|
||||
$registerMetadataProvider(providerId: string, handle: number): TPromise<any>;
|
||||
$registerTaskServicesProvider(providerId: string, handle: number): TPromise<any>;
|
||||
$registerFileBrowserProvider(providerId: string, handle: number): TPromise<any>;
|
||||
$registerCapabilitiesServiceProvider(providerId: string, handle: number): TPromise<any>;
|
||||
$registerAdminServicesProvider(providerId: string, handle: number): TPromise<any>;
|
||||
$unregisterProvider(handle: number): TPromise<any>;
|
||||
$onConnectionComplete(handle: number, connectionInfoSummary: data.ConnectionInfoSummary): void;
|
||||
$onIntelliSenseCacheComplete(handle: number, connectionUri: string): void;
|
||||
$onConnectionChangeNotification(handle: number, changedConnInfo: data.ChangedConnectionInfo): void;
|
||||
$onQueryComplete(handle: number, result: data.QueryExecuteCompleteNotificationResult): void;
|
||||
$onBatchStart(handle: number, batchInfo: data.QueryExecuteBatchNotificationParams): void;
|
||||
$onBatchComplete(handle: number, batchInfo: data.QueryExecuteBatchNotificationParams): void;
|
||||
$onResultSetComplete(handle: number, resultSetInfo: data.QueryExecuteResultSetCompleteNotificationParams): void;
|
||||
$onQueryMessage(handle: number, message: data.QueryExecuteMessageParams): void;
|
||||
$onObjectExplorerSessionCreated(handle: number, message: data.ObjectExplorerSession): void;
|
||||
$onObjectExplorerNodeExpanded(handle: number, message: data.ObjectExplorerExpandInfo): void;
|
||||
$onTaskCreated(handle: number, sessionResponse: data.TaskInfo): void;
|
||||
$onTaskStatusChanged(handle: number, sessionResponse: data.TaskProgressInfo): void;
|
||||
$onFileBrowserOpened(handle: number, response: data.FileBrowserOpenedParams): void;
|
||||
$onFolderNodeExpanded(handle: number, response: data.FileBrowserExpandedParams): void;
|
||||
$onFilePathsValidated(handle: number, response: data.FileBrowserValidatedParams): void;
|
||||
$onScriptingComplete(handle: number, message: data.ScriptingCompleteResult): void;
|
||||
$onSessionEventsAvailable(handle: number, response: data.ProfilerSessionEvents): void;
|
||||
|
||||
/**
|
||||
* Callback when a session has completed initialization
|
||||
*/
|
||||
$onEditSessionReady(handle: number, ownerUri: string, success: boolean, message: string) { throw ni(); }
|
||||
$onEditSessionReady(handle: number, ownerUri: string, success: boolean, message: string);
|
||||
}
|
||||
|
||||
export abstract class MainThreadCredentialManagementShape {
|
||||
$registerCredentialProvider(handle: number): TPromise<any> { throw ni(); }
|
||||
$unregisterCredentialProvider(handle: number): TPromise<any> { throw ni(); }
|
||||
export interface MainThreadCredentialManagementShape extends IDisposable {
|
||||
$registerCredentialProvider(handle: number): TPromise<any>;
|
||||
$unregisterCredentialProvider(handle: number): TPromise<any>;
|
||||
}
|
||||
|
||||
export abstract class MainThreadSerializationProviderShape {
|
||||
$registerSerializationProvider(handle: number): TPromise<any> { throw ni(); }
|
||||
$unregisterSerializationProvider(handle: number): TPromise<any> { throw ni(); }
|
||||
export interface MainThreadSerializationProviderShape extends IDisposable {
|
||||
$registerSerializationProvider(handle: number): TPromise<any>;
|
||||
$unregisterSerializationProvider(handle: number): TPromise<any>;
|
||||
}
|
||||
|
||||
// export class SqlInstanceCollection {
|
||||
// private _items: { [id: string]: any; };
|
||||
|
||||
// constructor() {
|
||||
// this._items = Object.create(null);
|
||||
// }
|
||||
|
||||
// public define<T>(id: ProxyIdentifier<T>): InstanceSetter<T> {
|
||||
// let that = this;
|
||||
// return new class {
|
||||
// set<R extends T>(value: T): R {
|
||||
// that._set(id, value);
|
||||
// return <R>value;
|
||||
// }
|
||||
// };
|
||||
// }
|
||||
|
||||
// _set<T>(id: ProxyIdentifier<T>, value: T): void {
|
||||
// this._items[id.id] = value;
|
||||
// }
|
||||
|
||||
// public finish(isMain: boolean, threadService: IThreadService): void {
|
||||
// let expected = (isMain ? SqlMainContext : SqlExtHostContext);
|
||||
// Object.keys(expected).forEach((key) => {
|
||||
// let id = expected[key];
|
||||
// let value = this._items[id.id];
|
||||
|
||||
// if (!value) {
|
||||
// throw new Error(`Missing actor ${key} (isMain: ${id.isMain}, id: ${id.id})`);
|
||||
// }
|
||||
// threadService.set<any>(id, value);
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
function ni() { return new Error('Not implemented'); }
|
||||
|
||||
// --- proxy identifiers
|
||||
|
||||
@@ -13,6 +13,7 @@ import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions';
|
||||
import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions';
|
||||
import { ShowCurrentReleaseNotesAction, ProductContribution } from 'sql/workbench/update/releaseNotes';
|
||||
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
|
||||
const backupSchema: IJSONSchema = {
|
||||
description: nls.localize('carbon.actions.back', 'Open up backup dialog'),
|
||||
@@ -46,7 +47,7 @@ registerTask('configure-dashboard', '', configureDashboardSchema, Actions.Config
|
||||
|
||||
// add product update and release notes contributions
|
||||
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench)
|
||||
.registerWorkbenchContribution(ProductContribution);
|
||||
.registerWorkbenchContribution(ProductContribution, LifecyclePhase.Running);
|
||||
|
||||
Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions)
|
||||
.registerWorkbenchAction(new SyncActionDescriptor(ShowCurrentReleaseNotesAction, ShowCurrentReleaseNotesAction.ID, ShowCurrentReleaseNotesAction.LABEL), 'Show Getting Started');
|
||||
|
||||
@@ -21,12 +21,12 @@ import URI from 'vs/base/common/uri';
|
||||
* @returns {*}
|
||||
*/
|
||||
export function getSqlConfigSection(workspaceConfigService: IConfigurationService, sectionName: string): any {
|
||||
let config = workspaceConfigService.getConfiguration(ConnectionConstants.sqlConfigSectionName);
|
||||
let config = workspaceConfigService.getValue(ConnectionConstants.sqlConfigSectionName);
|
||||
return config ? config[sectionName] : {};
|
||||
}
|
||||
|
||||
export function getSqlConfigValue<T>(workspaceConfigService: IConfigurationService, configName: string): T {
|
||||
let config = workspaceConfigService.getConfiguration(ConnectionConstants.sqlConfigSectionName);
|
||||
let config = workspaceConfigService.getValue(ConnectionConstants.sqlConfigSectionName);
|
||||
return config[configName];
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ export class ShowCurrentReleaseNotesAction extends AbstractShowReleaseNotesActio
|
||||
@IWorkbenchEditorService editorService: IWorkbenchEditorService,
|
||||
@IInstantiationService instantiationService: IInstantiationService
|
||||
) {
|
||||
super(id, label, true, pkg.version, editorService, instantiationService);
|
||||
super(id, label, pkg.version, editorService, instantiationService);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user