mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-30 01:25:38 -05:00
Merge from master
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
import 'vs/css!./media/accountPicker';
|
||||
import { Builder } from 'vs/base/browser/builder';
|
||||
import { Builder } from 'sql/base/browser/builder';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { List } from 'vs/base/browser/ui/list/listWidget';
|
||||
|
||||
@@ -17,7 +17,7 @@ import { IAction } from 'vs/base/common/actions';
|
||||
import { Memento } from 'vs/workbench/common/memento';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IExtensionManagementService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
||||
@@ -94,7 +94,7 @@ export interface ICapabilitiesService {
|
||||
export class CapabilitiesService extends Disposable implements ICapabilitiesService {
|
||||
_serviceBrand: any;
|
||||
|
||||
private _momento = new Memento('capabilities');
|
||||
private _momento: Memento;
|
||||
private _providers = new Map<string, ProviderFeatures>();
|
||||
private _featureUpdateEvents = new Map<string, Emitter<ProviderFeatures>>();
|
||||
private _legacyProviders = new Map<string, sqlops.DataProtocolServerCapabilities>();
|
||||
@@ -109,6 +109,8 @@ export class CapabilitiesService extends Disposable implements ICapabilitiesServ
|
||||
) {
|
||||
super();
|
||||
|
||||
this._momento = new Memento('capabilities', this._storageService);
|
||||
|
||||
if (!this.capabilities.connectionProviderCache) {
|
||||
this.capabilities.connectionProviderCache = {};
|
||||
}
|
||||
@@ -186,7 +188,7 @@ export class CapabilitiesService extends Disposable implements ICapabilitiesServ
|
||||
}
|
||||
|
||||
private get capabilities(): CapabilitiesMomento {
|
||||
return this._momento.getMemento(this._storageService) as CapabilitiesMomento;
|
||||
return this._momento.getMemento(StorageScope.GLOBAL) as CapabilitiesMomento;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import { IClipboardService } from 'sql/platform/clipboard/common/clipboardService';
|
||||
import { IClipboardService as vsIClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { clipboard, nativeImage } from 'electron';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
|
||||
export class ClipboardService implements IClipboardService {
|
||||
_serviceBrand: any;
|
||||
|
||||
@@ -273,6 +273,7 @@ export interface IConnectionManagementService {
|
||||
*/
|
||||
buildConnectionInfo(connectionString: string, provider?: string): Thenable<sqlops.ConnectionInfo>;
|
||||
|
||||
providerRegistered(providerId: string): boolean;
|
||||
/**
|
||||
* Get connection profile by id
|
||||
*/
|
||||
|
||||
@@ -50,12 +50,12 @@ import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { ConnectionProfileGroup, IConnectionProfileGroup } from 'sql/platform/connection/common/connectionProfileGroup';
|
||||
import { ConfigurationEditingService } from 'vs/workbench/services/configuration/node/configurationEditingService';
|
||||
import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration';
|
||||
import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService';
|
||||
import { EditorPart } from 'vs/workbench/browser/parts/editor/editorPart';
|
||||
import * as statusbar from 'vs/workbench/browser/parts/statusbar/statusbar';
|
||||
import { IStatusbarService } from 'vs/platform/statusbar/common/statusbar';
|
||||
import { IStatusbarService, StatusbarAlignment } from 'vs/platform/statusbar/common/statusbar';
|
||||
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
|
||||
import { IConnectionDialogService } from 'sql/workbench/services/connection/common/connectionDialogService';
|
||||
|
||||
export class ConnectionManagementService extends Disposable implements IConnectionManagementService {
|
||||
@@ -91,7 +91,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
||||
@IWorkspaceConfigurationService private _workspaceConfigurationService: IWorkspaceConfigurationService,
|
||||
@ICredentialsService private _credentialsService: ICredentialsService,
|
||||
@ICapabilitiesService private _capabilitiesService: ICapabilitiesService,
|
||||
@IQuickOpenService private _quickOpenService: IQuickOpenService,
|
||||
@IQuickInputService private _quickInputService: IQuickInputService,
|
||||
@IEditorGroupsService private _editorGroupService: IEditorGroupsService,
|
||||
@IStatusbarService private _statusBarService: IStatusbarService,
|
||||
@IResourceProviderService private _resourceProviderService: IResourceProviderService,
|
||||
@@ -105,7 +105,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
||||
|
||||
// _connectionMemento and _connectionStore are in constructor to enable this class to be more testable
|
||||
if (!this._connectionMemento) {
|
||||
this._connectionMemento = new Memento('ConnectionManagement');
|
||||
this._connectionMemento = new Memento('ConnectionManagement', _storageService);
|
||||
}
|
||||
if (!this._connectionStore) {
|
||||
this._connectionStore = new ConnectionStore(_storageService, this._connectionMemento,
|
||||
@@ -115,7 +115,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
||||
// Register Statusbar item
|
||||
(<statusbar.IStatusbarRegistry>platform.Registry.as(statusbar.Extensions.Statusbar)).registerStatusbarItem(new statusbar.StatusbarItemDescriptor(
|
||||
ConnectionStatusbarItem,
|
||||
statusbar.StatusbarAlignment.RIGHT,
|
||||
StatusbarAlignment.RIGHT,
|
||||
100 /* High Priority */
|
||||
));
|
||||
|
||||
@@ -143,6 +143,10 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
||||
this.onDisconnect(() => this.refreshEditorTitles());
|
||||
}
|
||||
|
||||
public providerRegistered(providerId: string): boolean {
|
||||
return !!this._providers.get(providerId);
|
||||
}
|
||||
|
||||
// Event Emitters
|
||||
public get onAddConnectionProfile(): Event<IConnectionProfile> {
|
||||
return this._onAddConnectionProfile.event;
|
||||
@@ -587,7 +591,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
||||
if (DashboardInput.profileMatches(profile, editor.connectionProfile)) {
|
||||
editor.connectionProfile.databaseName = profile.databaseName;
|
||||
this._editorService.openEditor(editor)
|
||||
.done(() => {
|
||||
.then(() => {
|
||||
if (!profile.databaseName || Utils.isMaster(profile)) {
|
||||
this._angularEventing.sendAngularEvent(editor.uri, AngularEventType.NAV_SERVER);
|
||||
} else {
|
||||
@@ -1046,7 +1050,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
||||
{ key: nls.localize('connectionService.no', 'No'), value: false }
|
||||
];
|
||||
|
||||
self._quickOpenService.pick(choices.map(x => x.key), { placeHolder: nls.localize('cancelConnectionConfirmation', 'Are you sure you want to cancel this connection?'), ignoreFocusLost: true }).then((choice) => {
|
||||
self._quickInputService.pick(choices.map(x => x.key), { placeHolder: nls.localize('cancelConnectionConfirmation', 'Are you sure you want to cancel this connection?'), ignoreFocusLost: true }).then((choice) => {
|
||||
let confirm = choices.find(x => x.key === choice);
|
||||
resolve(confirm && confirm.value);
|
||||
});
|
||||
|
||||
@@ -12,15 +12,12 @@ import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
|
||||
import { ICredentialsService } from 'sql/platform/credentials/common/credentialsService';
|
||||
import { IConnectionConfig } from './iconnectionConfig';
|
||||
import { ConnectionConfig } from './connectionConfig';
|
||||
import { Memento, Scope as MementoScope } from 'vs/workbench/common/memento';
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { Memento } from 'vs/workbench/common/memento';
|
||||
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
|
||||
import { ConnectionProfileGroup, IConnectionProfileGroup } from './connectionProfileGroup';
|
||||
import { ConfigurationEditingService } from 'vs/workbench/services/configuration/node/configurationEditingService';
|
||||
import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration';
|
||||
import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService';
|
||||
import { ConnectionOptionSpecialType } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
const MAX_CONNECTIONS_DEFAULT = 25;
|
||||
|
||||
@@ -45,7 +42,7 @@ export class ConnectionStore {
|
||||
private _connectionConfig?: IConnectionConfig
|
||||
) {
|
||||
if (_context) {
|
||||
this._memento = this._context.getMemento(this._storageService, MementoScope.GLOBAL);
|
||||
this._memento = this._context.getMemento(StorageScope.GLOBAL);
|
||||
}
|
||||
this._groupIdToFullNameMap = {};
|
||||
this._groupFullNameToIdMap = {};
|
||||
|
||||
@@ -11,7 +11,7 @@ import { attachModalDialogStyler } from 'sql/platform/theme/common/styler';
|
||||
import { Dialog, DialogButton } from 'sql/platform/dialog/dialogTypes';
|
||||
import { DialogPane } from 'sql/platform/dialog/dialogPane';
|
||||
|
||||
import { Builder } from 'vs/base/browser/builder';
|
||||
import { Builder } from 'sql/base/browser/builder';
|
||||
import { IPartService } from 'vs/workbench/services/part/common/partService';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
|
||||
@@ -17,7 +17,7 @@ import { DialogModule } from 'sql/platform/dialog/dialog.module';
|
||||
import { DialogComponentParams, LayoutRequestParams } from 'sql/platform/dialog/dialogContainer.component';
|
||||
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { Builder } from 'vs/base/browser/builder';
|
||||
import { Builder } from 'sql/base/browser/builder';
|
||||
import { IThemable } from 'vs/platform/theme/common/styler';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
@@ -15,7 +15,7 @@ import { DialogMessage } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
import { DialogModule } from 'sql/platform/dialog/dialog.module';
|
||||
import { Button } from 'vs/base/browser/ui/button/button';
|
||||
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
import { Builder } from 'vs/base/browser/builder';
|
||||
import { Builder } from 'sql/base/browser/builder';
|
||||
import { IPartService } from 'vs/workbench/services/part/common/partService';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
|
||||
@@ -187,7 +187,7 @@ export class DeleteJobAction extends Action {
|
||||
let job = actionInfo.targetObject as sqlops.AgentJobInfo;
|
||||
self._notificationService.prompt(
|
||||
Severity.Info,
|
||||
nls.localize('jobaction.deleteJobConfirm,', "Are you sure you'd like to delete the job '{0}'?", job.name),
|
||||
nls.localize('jobaction.deleteJobConfirm', "Are you sure you'd like to delete the job '{0}'?", job.name),
|
||||
[{
|
||||
label: DeleteJobAction.LABEL,
|
||||
run: () => {
|
||||
@@ -254,7 +254,7 @@ export class DeleteStepAction extends Action {
|
||||
let refreshAction = this.instantationService.createInstance(JobsRefreshAction);
|
||||
self._notificationService.prompt(
|
||||
Severity.Info,
|
||||
nls.localize('jobaction.deleteStepConfirm,', "Are you sure you'd like to delete the step '{0}'?", step.stepName),
|
||||
nls.localize('jobaction.deleteStepConfirm', "Are you sure you'd like to delete the step '{0}'?", step.stepName),
|
||||
[{
|
||||
label: DeleteStepAction.LABEL,
|
||||
run: () => {
|
||||
@@ -342,7 +342,7 @@ export class DeleteAlertAction extends Action {
|
||||
let alert = actionInfo.targetObject as sqlops.AgentAlertInfo;
|
||||
self._notificationService.prompt(
|
||||
Severity.Info,
|
||||
nls.localize('jobaction.deleteAlertConfirm,', "Are you sure you'd like to delete the alert '{0}'?", alert.name),
|
||||
nls.localize('jobaction.deleteAlertConfirm', "Are you sure you'd like to delete the alert '{0}'?", alert.name),
|
||||
[{
|
||||
label: DeleteAlertAction.LABEL,
|
||||
run: () => {
|
||||
@@ -427,7 +427,7 @@ export class DeleteOperatorAction extends Action {
|
||||
let operator = actionInfo.targetObject as sqlops.AgentOperatorInfo;
|
||||
self._notificationService.prompt(
|
||||
Severity.Info,
|
||||
nls.localize('jobaction.deleteOperatorConfirm,', "Are you sure you'd like to delete the operator '{0}'?", operator.name),
|
||||
nls.localize('jobaction.deleteOperatorConfirm', "Are you sure you'd like to delete the operator '{0}'?", operator.name),
|
||||
[{
|
||||
label: DeleteOperatorAction.LABEL,
|
||||
run: () => {
|
||||
@@ -513,7 +513,7 @@ export class DeleteProxyAction extends Action {
|
||||
let proxy = actionInfo.targetObject as sqlops.AgentProxyInfo;
|
||||
self._notificationService.prompt(
|
||||
Severity.Info,
|
||||
nls.localize('jobaction.deleteProxyConfirm,', "Are you sure you'd like to delete the proxy '{0}'?", proxy.accountName),
|
||||
nls.localize('jobaction.deleteProxyConfirm', "Are you sure you'd like to delete the proxy '{0}'?", proxy.accountName),
|
||||
[{
|
||||
label: DeleteProxyAction.LABEL,
|
||||
run: () => {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import * as path from 'vs/base/common/paths';
|
||||
import * as os from 'os';
|
||||
|
||||
import URI from 'vs/base/common/uri';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import { IWorkspaceConfigurationService } from 'vs/workbench/services/configurat
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { IWindowsService, IWindowService, FileFilter } from 'vs/platform/windows/common/windows';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import * as paths from 'vs/base/common/paths';
|
||||
@@ -127,7 +127,11 @@ export class ResultSerializer {
|
||||
|
||||
private ensureOutputChannelExists(): void {
|
||||
Registry.as<IOutputChannelRegistry>(OutputExtensions.OutputChannels)
|
||||
.registerChannel(ConnectionConstants.outputChannelName, ConnectionConstants.outputChannelName);
|
||||
.registerChannel({
|
||||
id: ConnectionConstants.outputChannelName,
|
||||
label: ConnectionConstants.outputChannelName,
|
||||
log: true
|
||||
});
|
||||
}
|
||||
|
||||
private get outputChannel(): IOutputChannel {
|
||||
|
||||
@@ -28,6 +28,7 @@ import * as strings from 'vs/base/common/strings';
|
||||
import * as types from 'vs/base/common/types';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import { StatusbarAlignment } from 'vs/platform/statusbar/common/statusbar';
|
||||
|
||||
const selectionSnippetMaxLen = 100;
|
||||
|
||||
@@ -89,24 +90,24 @@ export class QueryModelService implements IQueryModelService {
|
||||
|
||||
(<statusbar.IStatusbarRegistry>platform.Registry.as(statusbar.Extensions.Statusbar)).registerStatusbarItem(new statusbar.StatusbarItemDescriptor(
|
||||
TimeElapsedStatusBarItem,
|
||||
statusbar.StatusbarAlignment.RIGHT,
|
||||
StatusbarAlignment.RIGHT,
|
||||
100 /* Should appear to the right of the SQL editor status */
|
||||
));
|
||||
|
||||
(<statusbar.IStatusbarRegistry>platform.Registry.as(statusbar.Extensions.Statusbar)).registerStatusbarItem(new statusbar.StatusbarItemDescriptor(
|
||||
RowCountStatusBarItem,
|
||||
statusbar.StatusbarAlignment.RIGHT,
|
||||
StatusbarAlignment.RIGHT,
|
||||
100 /* Should appear to the right of the SQL editor status */
|
||||
));
|
||||
|
||||
(<statusbar.IStatusbarRegistry>platform.Registry.as(statusbar.Extensions.Statusbar)).registerStatusbarItem(new statusbar.StatusbarItemDescriptor(
|
||||
QueryStatusbarItem,
|
||||
statusbar.StatusbarAlignment.RIGHT,
|
||||
StatusbarAlignment.RIGHT,
|
||||
100 /* High Priority */
|
||||
));
|
||||
(<statusbar.IStatusbarRegistry>platform.Registry.as(statusbar.Extensions.Statusbar)).registerStatusbarItem(new statusbar.StatusbarItemDescriptor(
|
||||
SqlFlavorStatusbarItem,
|
||||
statusbar.StatusbarAlignment.RIGHT,
|
||||
StatusbarAlignment.RIGHT,
|
||||
90 /* Should appear to the right of the SQL editor status */
|
||||
));
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ export class TaskService implements ITaskService {
|
||||
this._onTaskComplete = new Emitter<TaskNode>();
|
||||
this._onAddNewTask = new Emitter<TaskNode>();
|
||||
|
||||
lifecycleService.onWillShutdown(event => event.veto(this.beforeShutdown()));
|
||||
lifecycleService.onBeforeShutdown(event => event.veto(this.beforeShutdown()));
|
||||
|
||||
}
|
||||
|
||||
@@ -161,23 +161,23 @@ export class TaskService implements ITaskService {
|
||||
return new TPromise<boolean>((resolve, reject) => {
|
||||
let numOfInprogressTasks = this.getNumberOfInProgressTasks();
|
||||
if (numOfInprogressTasks > 0) {
|
||||
this.dialogService.show(Severity.Warning, message, options).done(choice => {
|
||||
this.dialogService.show(Severity.Warning, message, options).then(choice => {
|
||||
switch (choice) {
|
||||
case 0:
|
||||
let timeoutId: number;
|
||||
let timeout: NodeJS.Timer;
|
||||
let isTimeout = false;
|
||||
this.cancelAllTasks().then(() => {
|
||||
clearTimeout(timeoutId);
|
||||
clearTimeout(timeout);
|
||||
if (!isTimeout) {
|
||||
resolve(false);
|
||||
}
|
||||
}, error => {
|
||||
clearTimeout(timeoutId);
|
||||
clearTimeout(timeout);
|
||||
if (!isTimeout) {
|
||||
resolve(false);
|
||||
}
|
||||
});
|
||||
timeoutId = setTimeout(function () {
|
||||
timeout = setTimeout(function () {
|
||||
isTimeout = true;
|
||||
resolve(false);
|
||||
}, 2000);
|
||||
|
||||
@@ -12,7 +12,7 @@ import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IdGenerator } from 'vs/base/common/idGenerator';
|
||||
import { createCSSRule } from 'vs/base/browser/dom';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { CommandsRegistry } from 'vs/platform/commands/common/commands';
|
||||
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
@@ -36,8 +36,8 @@ export abstract class Task {
|
||||
this.id = opts.id;
|
||||
this.title = opts.title;
|
||||
this.iconPath = {
|
||||
dark: URI.parse(opts.iconPath.dark),
|
||||
light: URI.parse(opts.iconPath.light),
|
||||
dark: opts.iconPath ? URI.parse(opts.iconPath.dark) : undefined,
|
||||
light: opts.iconPath ? URI.parse(opts.iconPath.light) : undefined,
|
||||
};
|
||||
this._iconClass = opts.iconClass;
|
||||
this._description = opts.description;
|
||||
|
||||
Reference in New Issue
Block a user