Vscode merge (#4582)

* Merge from vscode 37cb23d3dd4f9433d56d4ba5ea3203580719a0bd

* fix issues with merges

* bump node version in azpipe

* replace license headers

* remove duplicate launch task

* fix build errors

* fix build errors

* fix tslint issues

* working through package and linux build issues

* more work

* wip

* fix packaged builds

* working through linux build errors

* wip

* wip

* wip

* fix mac and linux file limits

* iterate linux pipeline

* disable editor typing

* revert series to parallel

* remove optimize vscode from linux

* fix linting issues

* revert testing change

* add work round for new node

* readd packaging for extensions

* fix issue with angular not resolving decorator dependencies
This commit is contained in:
Anthony Dresser
2019-03-19 17:44:35 -07:00
committed by GitHub
parent 833d197412
commit 87765e8673
1879 changed files with 54505 additions and 38058 deletions

View File

@@ -5,7 +5,6 @@
// This is the place for API experiments and proposal.
import * as core from 'azdata';
import * as vscode from 'vscode';
declare module 'azdata' {
@@ -216,6 +215,44 @@ declare module 'azdata' {
options: { [name: string]: any };
}
// Object Explorer interfaces -----------------------------------------------------------------------
export interface ObjectExplorerSession {
success: boolean;
sessionId: string;
rootNode: NodeInfo;
errorMessage: string;
}
/**
* A NodeInfo object represents an element in the Object Explorer tree under
* a connection.
*/
export interface NodeInfo {
nodePath: string;
nodeType: string;
nodeSubType: string;
nodeStatus: string;
label: string;
isLeaf: boolean;
metadata: ObjectMetadata;
errorMessage: string;
/**
* Optional iconType for the object in the tree. Currently this only supports
* an icon name or SqlThemeIcon name, rather than a path to an icon.
* If not defined, the nodeType + nodeStatus / nodeSubType values
* will be used instead.
*/
iconType?: string | SqlThemeIcon;
/**
* Informs who provides the children to a node, used by data explorer tree view api
*/
childProvider?: string;
/**
* Holds the connection profile for nodes, used by data explorer tree view api
*/
payload?: any;
}
export interface IConnectionProfile extends ConnectionInfo {
connectionName: string;
serverName: string;
@@ -1011,36 +1048,6 @@ declare module 'azdata' {
subset: EditRow[];
}
/**
* A NodeInfo object represents an element in the Object Explorer tree under
* a connection.
*/
export interface NodeInfo {
nodePath: string;
nodeType: string;
nodeSubType: string;
nodeStatus: string;
label: string;
isLeaf: boolean;
metadata: ObjectMetadata;
errorMessage: string;
/**
* Optional iconType for the object in the tree. Currently this only supports
* an icon name or SqlThemeIcon name, rather than a path to an icon.
* If not defined, the nodeType + nodeStatus / nodeSubType values
* will be used instead.
*/
iconType?: string | SqlThemeIcon;
/**
* Informs who provides the children to a node, used by data explorer tree view api
*/
childProvider?: string;
/**
* Holds the connection profile for nodes, used by data explorer tree view api
*/
payload?: any;
}
/**
* A reference to a named icon. Currently only a subset of the SQL icons are available.
* Using a theme icon is preferred over a custom icon as it gives theme authors the possibility to change the icons.
@@ -1144,14 +1151,6 @@ declare module 'azdata' {
public readonly id: string;
}
// Object Explorer interfaces -----------------------------------------------------------------------
export interface ObjectExplorerSession {
success: boolean;
sessionId: string;
rootNode: NodeInfo;
errorMessage: string;
}
export interface ObjectExplorerSessionResponse {
sessionId: string;
}

View File

@@ -5,7 +5,6 @@
// This is the place for APIs used for testing
import * as core from 'azdata';
import * as vscode from 'vscode';
declare module 'azdata' {

View File

@@ -1377,7 +1377,7 @@ export const $: QuickBuilder = function (arg?: any): Builder {
if (arg[0] === '<') {
let element: Node;
let container = document.createElement('div');
container.innerHTML = strings.format.apply(strings, arguments);
container.innerHTML = strings.format.apply(strings, <[string, ...any[]]>(<any>arguments));
if (container.children.length === 0) {
throw new Error('Bad use of $');
@@ -1426,10 +1426,10 @@ export const $: QuickBuilder = function (arg?: any): Builder {
// Use the arguments as the arguments to Builder#element(...)
else {
let result = offDOM();
result.element.apply(result, arguments);
result.element.apply(result, <[string, any?, ((builder: Builder) => void)?]>(<any>arguments));
return result;
}
} else {
throw new Error('Bad use of $');
}
};
};

View File

@@ -199,11 +199,6 @@ export class TabbedPanel extends Disposable implements IThemable {
this.showTab(lastTab);
}
}
// this shouldn't happen but just in case
if (this._shownTab === undefined && this._tabMap.size > 0) {
this.showTab(this._tabMap.keys().next().value);
}
}
if (!this.options.showHeaderWhenSingleView && this._tabMap.size === 1 && this._headerVisible) {

View File

@@ -53,9 +53,9 @@ export function mixin(destination: any, source: any, overwrite: boolean = true,
}
export function entries<T>(o: { [key: string]: T }): [string, T][] {
return Object.entries(o);
return Object.keys(o).map(k => [k, o[k]] as [string, T]);
}
export function values<T>(o: { [key: string]: T }): T[] {
return Object.values(o);
return Object.keys(o).map(k => o[k]);
}

View File

@@ -9,7 +9,6 @@ import 'vs/css!./media/accountDialog';
import 'vs/css!sql/parts/accountManagement/common/media/accountActions';
import * as DOM from 'vs/base/browser/dom';
import { List } from 'vs/base/browser/ui/list/listWidget';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { Event, Emitter } from 'vs/base/common/event';
import { localize } from 'vs/nls';
import { IThemeService } from 'vs/platform/theme/common/themeService';
@@ -36,6 +35,7 @@ import { AccountListRenderer, AccountListDelegate } from 'sql/parts/accountManag
import { AccountProviderAddedEventParams, UpdateAccountListEventParams } from 'sql/platform/accountManagement/common/eventTypes';
import { IClipboardService } from 'sql/platform/clipboard/common/clipboardService';
import * as TelemetryKeys from 'sql/common/telemetryKeys';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
class AccountPanel extends ViewletPanel {
public index: number;
@@ -115,7 +115,7 @@ export class AccountDialog extends Modal {
public get onCloseEvent(): Event<void> { return this._onCloseEmitter.event; }
constructor(
@IPartService partService: IPartService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@IThemeService themeService: IThemeService,
@IInstantiationService private _instantiationService: IInstantiationService,
@IContextMenuService private _contextMenuService: IContextMenuService,
@@ -128,8 +128,8 @@ export class AccountDialog extends Modal {
super(
localize('linkedAccounts', 'Linked accounts'),
TelemetryKeys.Accounts,
partService,
telemetryService,
layoutService,
clipboardService,
themeService,
contextKeyService,

View File

@@ -8,7 +8,6 @@ import 'vs/css!./media/autoOAuthDialog';
import { Builder, $ } from 'sql/base/browser/builder';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { attachInputBoxStyler } from 'vs/platform/theme/common/styler';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { Event, Emitter } from 'vs/base/common/event';
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { localize } from 'vs/nls';
@@ -22,6 +21,7 @@ import { attachModalDialogStyler, attachButtonStyler } from 'sql/platform/theme/
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import * as TelemetryKeys from 'sql/common/telemetryKeys';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
export class AutoOAuthDialog extends Modal {
private _copyAndOpenButton: Button;
@@ -42,7 +42,7 @@ export class AutoOAuthDialog extends Modal {
public get onCloseEvent(): Event<void> { return this._onCloseEvent.event; }
constructor(
@IPartService partService: IPartService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@IThemeService themeService: IThemeService,
@IContextViewService private _contextViewService: IContextViewService,
@ITelemetryService telemetryService: ITelemetryService,
@@ -52,8 +52,8 @@ export class AutoOAuthDialog extends Modal {
super(
'',
TelemetryKeys.AutoOAuth,
partService,
telemetryService,
layoutService,
clipboardService,
themeService,
contextKeyService,

View File

@@ -8,7 +8,6 @@
import 'vs/css!./media/firewallRuleDialog';
import { Builder, $ } from 'sql/base/browser/builder';
import * as DOM from 'vs/base/browser/dom';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { Event, Emitter } from 'vs/base/common/event';
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { localize } from 'vs/nls';
@@ -30,6 +29,7 @@ import { attachModalDialogStyler, attachButtonStyler } from 'sql/platform/theme/
import { InputBox } from 'sql/base/browser/ui/inputBox/inputBox';
import { IAccountPickerService } from 'sql/platform/accountManagement/common/accountPicker';
import * as TelemetryKeys from 'sql/common/telemetryKeys';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
// TODO: Make the help link 1) extensible (01/08/2018, https://github.com/Microsoft/azuredatastudio/issues/450)
// in case that other non-Azure sign in is to be used
@@ -64,7 +64,7 @@ export class FirewallRuleDialog extends Modal {
constructor(
@IAccountPickerService private _accountPickerService: IAccountPickerService,
@IPartService partService: IPartService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@IThemeService themeService: IThemeService,
@IInstantiationService private _instantiationService: IInstantiationService,
@IContextViewService private _contextViewService: IContextViewService,
@@ -76,8 +76,8 @@ export class FirewallRuleDialog extends Modal {
super(
localize('createNewFirewallRule', 'Create new firewall rule'),
TelemetryKeys.FireWallRule,
partService,
telemetryService,
layoutService,
clipboardService,
themeService,
contextKeyService,

View File

@@ -6,7 +6,6 @@
import { EditorInput, IEditorInput } from 'vs/workbench/common/editor';
import { IInstantiationService, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import { FileEditorInput } from 'vs/workbench/parts/files/common/editors/fileEditorInput';
import { URI } from 'vs/base/common/uri';
import { QueryResultsInput } from 'sql/parts/query/common/queryResultsInput';
@@ -17,6 +16,7 @@ import { NotebookInput } from 'sql/parts/notebook/notebookInput';
import { INotebookService } from 'sql/workbench/services/notebook/common/notebookService';
import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput';
import { notebookModeId } from 'sql/common/constants';
import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput';
const fs = require('fs');

View File

@@ -5,7 +5,6 @@
import { IExtensionGalleryService, IExtensionTipsService } from 'vs/platform/extensionManagement/common/extensionManagement';
import { EditorDescriptor, IEditorRegistry, Extensions as EditorExtensions } from 'vs/workbench/browser/editor';
import { IExtensionsWorkbenchService } from 'vs/workbench/parts/extensions/common/extensions';
import { IConfigurationRegistry, Extensions as ConfigExtensions } from 'vs/platform/configuration/common/configurationRegistry';
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
@@ -16,11 +15,12 @@ import { AddServerGroupAction, AddServerAction } from 'sql/parts/objectExplorer/
import { ClearRecentConnectionsAction, GetCurrentConnectionStringAction } from 'sql/parts/connection/common/connectionActions';
import { ExtensionGalleryService } from 'vs/platform/extensionManagement/node/extensionGalleryService';
import { ExtensionTipsService } from 'vs/workbench/parts/extensions/electron-browser/extensionTipsService';
import { ExtensionsWorkbenchService } from 'vs/workbench/parts/extensions/node/extensionsWorkbenchService';
import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actions';
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
import { localize } from 'vs/nls';
import { IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions';
import { ExtensionTipsService } from 'vs/workbench/contrib/extensions/electron-browser/extensionTipsService';
import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/node/extensionsWorkbenchService';
// Singletons
registerSingleton(IExtensionGalleryService, ExtensionGalleryService);

View File

@@ -6,7 +6,6 @@ import { $, append, show, hide } from 'vs/base/browser/dom';
import { IDisposable, combinedDisposable } from 'vs/base/common/lifecycle';
import { IStatusbarItem } from 'vs/workbench/browser/parts/statusbar/statusbar';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService';
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService';
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';

View File

@@ -7,14 +7,12 @@ import 'vs/css!./webviewContent';
import { Component, forwardRef, Input, OnInit, Inject, ElementRef } from '@angular/core';
import { Event, Emitter } from 'vs/base/common/event';
import { Parts, IPartService } from 'vs/workbench/services/part/common/partService';
import { IDisposable } from 'vs/base/common/lifecycle';
import { addDisposableListener, EventType } from 'vs/base/browser/dom';
import { memoize } from 'vs/base/common/decorators';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { WebviewElement } from 'vs/workbench/parts/webview/electron-browser/webviewElement';
import { DashboardServiceInterface } from 'sql/parts/dashboard/services/dashboardServiceInterface.service';
import { CommonServiceInterface } from 'sql/services/common/commonServiceInterface.service';
import { IDashboardWebview, IDashboardViewService } from 'sql/platform/dashboard/common/dashboardViewService';
@@ -23,6 +21,8 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import * as azdata from 'azdata';
import { IContextKey } from 'vs/platform/contextkey/common/contextkey';
import { WebviewElement } from 'vs/workbench/contrib/webview/electron-browser/webviewElement';
import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService';
@Component({
template: '',
@@ -45,7 +45,7 @@ export class WebviewContent extends AngularDisposable implements OnInit, IDashbo
@Inject(forwardRef(() => ElementRef)) private _el: ElementRef,
@Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService,
@Inject(IDashboardViewService) private dashboardViewService: IDashboardViewService,
@Inject(IPartService) private partService: IPartService,
@Inject(IWorkbenchLayoutService) private layoutService: IWorkbenchLayoutService,
@Inject(IInstantiationService) private instantiationService: IInstantiationService
) {
super();
@@ -107,9 +107,9 @@ export class WebviewContent extends AngularDisposable implements OnInit, IDashbo
}
this._webview = this.instantiationService.createInstance(WebviewElement,
this.partService.getContainer(Parts.EDITOR_PART),
this.layoutService.getContainer(Parts.EDITOR_PART),
{},
{
enableWrappedPostMessage: true,
allowScripts: true
});

View File

@@ -9,7 +9,7 @@ import { BrowserModule } from '@angular/platform-browser';
import { RouterModule, Routes, UrlSerializer, Router, NavigationEnd } from '@angular/router';
import { FormsModule } from '@angular/forms';
import { NgGridModule } from 'angular2-grid';
import { ChartsModule } from 'ng2-charts/ng2-charts';
import { ChartsModule } from 'ng2-charts';
import CustomUrlSerializer from 'sql/base/node/urlSerializer';
import { Extensions, IInsightRegistry } from 'sql/platform/dashboard/common/insightRegistry';

View File

@@ -35,7 +35,7 @@ export class ServerDashboardPage extends DashboardPage implements OnInit {
};
protected readonly context = 'server';
private _letDashboardPromise: Thenable<boolean>;
private _letDashboardPromise: Promise<void>;
constructor(
@Inject(forwardRef(() => IBreadcrumbService)) private breadcrumbService: IBreadcrumbService,
@@ -53,7 +53,7 @@ export class ServerDashboardPage extends DashboardPage implements OnInit {
let connInfo = this.dashboardService.connectionManagementService.connectionInfo;
if (connInfo && connInfo.providerId === 'MSSQL') {
// revert back to default database
this._letDashboardPromise = this.dashboardService.connectionManagementService.changeDatabase('master');
this._letDashboardPromise = this.dashboardService.connectionManagementService.changeDatabase('master').then();
} else {
this._letDashboardPromise = Promise.resolve();
}

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import {
Component, Inject, ViewContainerRef, forwardRef, AfterContentInit,
ComponentFactoryResolver, ViewChild, ChangeDetectorRef
ComponentFactoryResolver, ViewChild, ChangeDetectorRef, Injector
} from '@angular/core';
import { Observable } from 'rxjs/Observable';
@@ -68,8 +68,8 @@ export class InsightsWidget extends DashboardWidget implements IDashboardWidget,
@Inject(forwardRef(() => ComponentFactoryResolver)) private _componentFactoryResolver: ComponentFactoryResolver,
@Inject(forwardRef(() => CommonServiceInterface)) private dashboardService: CommonServiceInterface,
@Inject(WIDGET_CONFIG) protected _config: WidgetConfig,
@Inject(forwardRef(() => ViewContainerRef)) private viewContainerRef: ViewContainerRef,
@Inject(forwardRef(() => ChangeDetectorRef)) private _cd: ChangeDetectorRef,
@Inject(forwardRef(() => Injector)) private _injector: Injector,
@Inject(IInstantiationService) private instantiationService: IInstantiationService,
@Inject(IStorageService) private storageService: IStorageService,
@Inject(IWorkspaceContextService) private workspaceContextService: IWorkspaceContextService,
@@ -233,8 +233,9 @@ export class InsightsWidget extends DashboardWidget implements IDashboardWidget,
let componentFactory = this._componentFactoryResolver.resolveComponentFactory<IInsightsView>(insightRegistry.getCtorFromId(this._typeKey));
let componentRef = this.componentHost.viewContainerRef.createComponent(componentFactory);
let componentRef = this.componentHost.viewContainerRef.createComponent(componentFactory, 0, this._injector);
let componentInstance = componentRef.instance;
// check if the setter is defined
if (componentInstance.setConfig) {
componentInstance.setConfig(this.insightConfig.type[this._typeKey]);

View File

@@ -3,7 +3,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Component, Input, Inject, ChangeDetectorRef, forwardRef, ElementRef, ViewChild } from '@angular/core';
import { BaseChartDirective } from 'ng2-charts/ng2-charts';
import { BaseChartDirective } from 'ng2-charts';
import * as TelemetryKeys from 'sql/common/telemetryKeys';
import * as TelemetryUtils from 'sql/common/telemetryUtilities';
@@ -297,4 +297,4 @@ Chart.pluginService.register({
ctx.fillRect(0, 0, chart.chart.width, chart.chart.height);
}
}
});
});

View File

@@ -7,9 +7,11 @@ import { ChartInsight } from 'sql/parts/dashboard/widgets/insights/views/charts/
import { mixin } from 'sql/base/common/objects';
import { ChartType, IChartConfig, customMixin } from 'sql/parts/dashboard/widgets/insights/views/charts/interfaces';
import { IColorTheme } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { IColorTheme, IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import * as colors from 'vs/platform/theme/common/colorRegistry';
import { editorLineNumbers } from 'vs/editor/common/view/editorColorRegistry';
import { ChangeDetectorRef, Inject, ElementRef, forwardRef } from '@angular/core';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
export interface IBarChartConfig extends IChartConfig {
yAxisMin: number;
@@ -23,6 +25,15 @@ export interface IBarChartConfig extends IChartConfig {
export default class BarChart extends ChartInsight {
protected readonly chartType: ChartType = ChartType.Bar;
constructor(
@Inject(forwardRef(() => ChangeDetectorRef)) _changeRef: ChangeDetectorRef,
@Inject(forwardRef(() => ElementRef)) _el: ElementRef,
@Inject(IWorkbenchThemeService) themeService: IWorkbenchThemeService,
@Inject(ITelemetryService) telemetryService: ITelemetryService
) {
super(_changeRef, _el, themeService, telemetryService);
}
public setConfig(config: IBarChartConfig): void {
let options = {};
if (config.xAxisMax) {

View File

@@ -5,7 +5,19 @@
import PieChart from './pieChart.component';
import { ChartType } from 'sql/parts/dashboard/widgets/insights/views/charts/interfaces';
import { ChangeDetectorRef, Inject, forwardRef, ElementRef } from '@angular/core';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
export default class DoughnutChart extends PieChart {
protected readonly chartType: ChartType = ChartType.Doughnut;
constructor(
@Inject(forwardRef(() => ChangeDetectorRef)) _changeRef: ChangeDetectorRef,
@Inject(forwardRef(() => ElementRef)) _el: ElementRef,
@Inject(IWorkbenchThemeService) themeService: IWorkbenchThemeService,
@Inject(ITelemetryService) telemetryService: ITelemetryService
) {
super(_changeRef, _el, themeService, telemetryService);
}
}

View File

@@ -5,7 +5,19 @@
import BarChart from './barChart.component';
import { ChartType } from 'sql/parts/dashboard/widgets/insights/views/charts/interfaces';
import { forwardRef, Inject, ChangeDetectorRef, ElementRef } from '@angular/core';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
export default class HorizontalBarChart extends BarChart {
protected readonly chartType: ChartType = ChartType.HorizontalBar;
constructor(
@Inject(forwardRef(() => ChangeDetectorRef)) _changeRef: ChangeDetectorRef,
@Inject(forwardRef(() => ElementRef)) _el: ElementRef,
@Inject(IWorkbenchThemeService) themeService: IWorkbenchThemeService,
@Inject(ITelemetryService) telemetryService: ITelemetryService
) {
super(_changeRef, _el, themeService, telemetryService);
}
}

View File

@@ -9,6 +9,9 @@ import BarChart, { IBarChartConfig } from './barChart.component';
import { memoize, unmemoize } from 'sql/base/common/decorators';
import { clone } from 'sql/base/common/objects';
import { ChartType, DataType, defaultChartConfig, IDataSet, IPointDataSet } from 'sql/parts/dashboard/widgets/insights/views/charts/interfaces';
import { ChangeDetectorRef, Inject, forwardRef, ElementRef } from '@angular/core';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
export interface ILineConfig extends IBarChartConfig {
dataType?: DataType;
@@ -21,6 +24,15 @@ export default class LineChart extends BarChart {
protected _config: ILineConfig;
protected _defaultConfig = defaultLineConfig;
constructor(
@Inject(forwardRef(() => ChangeDetectorRef)) _changeRef: ChangeDetectorRef,
@Inject(forwardRef(() => ElementRef)) _el: ElementRef,
@Inject(IWorkbenchThemeService) themeService: IWorkbenchThemeService,
@Inject(ITelemetryService) telemetryService: ITelemetryService
) {
super(_changeRef, _el, themeService, telemetryService);
}
public init() {
if (this._config.dataType === DataType.Point) {
this.addAxisLabels();

View File

@@ -5,7 +5,19 @@
import { ChartInsight } from 'sql/parts/dashboard/widgets/insights/views/charts/chartInsight.component';
import { ChartType } from 'sql/parts/dashboard/widgets/insights/views/charts/interfaces';
import { ChangeDetectorRef, Inject, forwardRef, ElementRef } from '@angular/core';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
export default class PieChart extends ChartInsight {
protected readonly chartType: ChartType = ChartType.Pie;
constructor(
@Inject(forwardRef(() => ChangeDetectorRef)) _changeRef: ChangeDetectorRef,
@Inject(forwardRef(() => ElementRef)) _el: ElementRef,
@Inject(IWorkbenchThemeService) themeService: IWorkbenchThemeService,
@Inject(ITelemetryService) telemetryService: ITelemetryService
) {
super(_changeRef, _el, themeService, telemetryService);
}
}

View File

@@ -8,10 +8,22 @@ import { clone } from 'sql/base/common/objects';
import { ChartType, defaultChartConfig } from 'sql/parts/dashboard/widgets/insights/views/charts/interfaces';
import { mixin } from 'vs/base/common/objects';
import { ChangeDetectorRef, Inject, forwardRef, ElementRef } from '@angular/core';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
const defaultScatterConfig = mixin(clone(defaultChartConfig), { dataType: 'point', dataDirection: 'horizontal' }) as ILineConfig;
export default class ScatterChart extends LineChart {
protected readonly chartType: ChartType = ChartType.Scatter;
protected _defaultConfig = defaultScatterConfig;
constructor(
@Inject(forwardRef(() => ChangeDetectorRef)) _changeRef: ChangeDetectorRef,
@Inject(forwardRef(() => ElementRef)) _el: ElementRef,
@Inject(IWorkbenchThemeService) themeService: IWorkbenchThemeService,
@Inject(ITelemetryService) telemetryService: ITelemetryService
) {
super(_changeRef, _el, themeService, telemetryService);
}
}

View File

@@ -9,12 +9,24 @@ import { ChartType, defaultChartConfig, IPointDataSet } from 'sql/parts/dashboar
import { mixin } from 'vs/base/common/objects';
import { Color } from 'vs/base/common/color';
import { ChangeDetectorRef, Inject, forwardRef, ElementRef } from '@angular/core';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
const defaultTimeSeriesConfig = mixin(clone(defaultChartConfig), { dataType: 'point', dataDirection: 'horizontal' }) as ILineConfig;
export default class TimeSeriesChart extends LineChart {
protected _defaultConfig = defaultTimeSeriesConfig;
constructor(
@Inject(forwardRef(() => ChangeDetectorRef)) _changeRef: ChangeDetectorRef,
@Inject(forwardRef(() => ElementRef)) _el: ElementRef,
@Inject(IWorkbenchThemeService) themeService: IWorkbenchThemeService,
@Inject(ITelemetryService) telemetryService: ITelemetryService
) {
super(_changeRef, _el, themeService, telemetryService);
}
protected addAxisLabels(): void {
let xLabel = this._config.xAxisLabel || this.getLabels()[1] || 'x';
let yLabel = this._config.yAxisLabel || this.getLabels()[2] || 'y';

View File

@@ -74,6 +74,6 @@ export default class ImageInsight implements IInsightsView, OnInit {
hexVal = hexVal.slice(2);
}
// should be able to be replaced with new Buffer(hexVal, 'hex').toString('base64')
return btoa(String.fromCharCode.apply(null, hexVal.replace(/\r|\n/g, '').replace(/([\da-fA-F]{2}) ?/g, '0x$1 ').replace(/ +$/, '').split(' ')));
return btoa(String.fromCharCode.apply(null, hexVal.replace(/\r|\n/g, '').replace(/([\da-fA-F]{2}) ?/g, '0x$1 ').replace(/ +$/, '').split(' ').map(v => Number(v))));
}
}

View File

@@ -5,7 +5,6 @@
import { Component, Inject, forwardRef, ChangeDetectorRef, OnInit, ViewChild, ElementRef } from '@angular/core';
import { Parts, IPartService } from 'vs/workbench/services/part/common/partService';
import { Event, Emitter } from 'vs/base/common/event';
import { IDisposable } from 'vs/base/common/lifecycle';
import { memoize } from 'vs/base/common/decorators';
@@ -17,12 +16,9 @@ import { IDashboardWebview, IDashboardViewService } from 'sql/platform/dashboard
import * as azdata from 'azdata';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { WebviewElement } from 'vs/workbench/parts/webview/electron-browser/webviewElement';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { truncate } from 'fs';
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
import { WebviewElement } from 'vs/workbench/contrib/webview/electron-browser/webviewElement';
import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService';
interface IWebviewWidgetConfig {
id: string;
@@ -47,9 +43,9 @@ export class WebviewWidget extends DashboardWidget implements IDashboardWidget,
@Inject(forwardRef(() => CommonServiceInterface)) private _dashboardService: DashboardServiceInterface,
@Inject(WIDGET_CONFIG) protected _config: WidgetConfig,
@Inject(forwardRef(() => ElementRef)) private _el: ElementRef,
@Inject(IWorkbenchLayoutService) private layoutService: IWorkbenchLayoutService,
@Inject(IWorkbenchThemeService) private themeService: IWorkbenchThemeService,
@Inject(IDashboardViewService) private dashboardViewService: IDashboardViewService,
@Inject(IPartService) private partService: IPartService,
@Inject(IInstantiationService) private instantiationService: IInstantiationService,
) {
super();
@@ -108,10 +104,10 @@ export class WebviewWidget extends DashboardWidget implements IDashboardWidget,
}
this._webview = this.instantiationService.createInstance(WebviewElement,
this.partService.getContainer(Parts.EDITOR_PART),
this.layoutService.getContainer(Parts.EDITOR_PART),
{},
{
allowScripts: true,
enableWrappedPostMessage: true
});
this._webview.mountTo(this._el.nativeElement);

View File

@@ -17,7 +17,7 @@ import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
import { ToggleViewletAction } from 'vs/workbench/browser/parts/activitybar/activitybarActions';
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
// Viewlet Action
export class OpenDataExplorerViewletAction extends ToggleViewletAction {
@@ -28,9 +28,9 @@ export class OpenDataExplorerViewletAction extends ToggleViewletAction {
id: string,
label: string,
@IViewletService viewletService: IViewletService,
@IPartService partService: IPartService
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService
) {
super(viewletDescriptor, partService, viewletService);
super(viewletDescriptor, layoutService, viewletService);
}
}
@@ -88,4 +88,4 @@ if (process.env.NODE_ENV === 'development') {
}
}
});
}
}

View File

@@ -7,7 +7,7 @@ import { localize } from 'vs/nls';
import { forEach } from 'vs/base/common/collections';
import { IJSONSchema } from 'vs/base/common/jsonSchema';
import { Registry } from 'vs/platform/registry/common/platform';
import { IViewContainersRegistry, ViewContainer, Extensions as ViewContainerExtensions, ViewsRegistry, ITreeViewDescriptor } from 'vs/workbench/common/views';
import { IViewContainersRegistry, ViewContainer, Extensions as ViewContainerExtensions, ITreeViewDescriptor, IViewsRegistry } from 'vs/workbench/common/views';
import { IExtensionPoint, ExtensionsRegistry, ExtensionMessageCollector } from 'vs/workbench/services/extensions/common/extensionsRegistry';
import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions, IWorkbenchContribution } from 'vs/workbench/common/contributions';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
@@ -102,7 +102,7 @@ class DataExplorerContainerExtensionHandler implements IWorkbenchContribution {
collector.warn(localize('ViewsContainerDoesnotExist', "View container '{0}' does not exist and all views registered to it will be added to 'Data Explorer'.", entry.key));
container = this.viewContainersRegistry.get(VIEWLET_ID);
}
const registeredViews = ViewsRegistry.getViews(container);
const registeredViews = Registry.as<IViewsRegistry>(ViewContainerExtensions.ViewsRegistry).getViews(container);
const viewIds = [];
const viewDescriptors = coalesce(entry.value.map(item => {
// validate
@@ -118,7 +118,7 @@ class DataExplorerContainerExtensionHandler implements IWorkbenchContribution {
const viewDescriptor = <ITreeViewDescriptor>{
id: item.id,
name: item.name,
ctor: CustomTreeViewPanel,
ctorDescriptor: { ctor: CustomTreeViewPanel },
when: ContextKeyExpr.deserialize(item.when),
canToggleVisibility: true,
collapsed: this.showCollapsed(container),
@@ -128,7 +128,7 @@ class DataExplorerContainerExtensionHandler implements IWorkbenchContribution {
viewIds.push(viewDescriptor.id);
return viewDescriptor;
}));
ViewsRegistry.registerViews(viewDescriptors, container);
Registry.as<IViewsRegistry>(ViewContainerExtensions.ViewsRegistry).registerViews(viewDescriptors, container);
});
}
});

View File

@@ -11,7 +11,6 @@ import { IExtensionTipsService, IExtensionManagementServerService } from 'vs/pla
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IExtensionsWorkbenchService } from 'vs/workbench/parts/extensions/common/extensions';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { attachInputBoxStyler } from 'vs/platform/theme/common/styler';
import { IViewletViewOptions } from 'vs/workbench/browser/parts/views/viewsViewlet';
@@ -26,6 +25,7 @@ import { ServerTreeView } from 'sql/parts/objectExplorer/viewlet/serverTreeView'
import { ClearSearchAction, ActiveConnectionsFilterAction,
AddServerAction, AddServerGroupAction } from 'sql/parts/objectExplorer/viewlet/connectionTreeAction';
import { IObjectExplorerService } from 'sql/workbench/services/objectExplorer/common/objectExplorerService';
import { IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions';
export class ConnectionViewletPanel extends ViewletPanel {

View File

@@ -20,13 +20,14 @@ import { ViewContainerViewlet, IViewletViewOptions } from 'vs/workbench/browser/
import { IStorageService } from 'vs/platform/storage/common/storage';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { IAddedViewDescriptorRef } from 'vs/workbench/browser/parts/views/views';
import { ViewletPanel } from 'vs/workbench/browser/parts/views/panelViewlet';
import { VIEWLET_ID, VIEW_CONTAINER } from 'sql/parts/dataExplorer/common/dataExplorerExtensionPoint';
import { ConnectionViewletPanel } from 'sql/parts/dataExplorer/objectExplorer/connectionViewlet/connectionViewletPanel';
import { Extensions as ViewContainerExtensions, ViewsRegistry, IViewDescriptor } from 'vs/workbench/common/views';
import { Extensions as ViewContainerExtensions, IViewDescriptor, IViewsRegistry } from 'vs/workbench/common/views';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
import { Registry } from 'vs/platform/registry/common/platform';
export class DataExplorerViewletViewsContribution implements IWorkbenchContribution {
@@ -39,14 +40,14 @@ export class DataExplorerViewletViewsContribution implements IWorkbenchContribut
private registerViews(): void {
let viewDescriptors = [];
viewDescriptors.push(this.createObjectExplorerViewDescriptor());
ViewsRegistry.registerViews(viewDescriptors, VIEW_CONTAINER);
Registry.as<IViewsRegistry>(ViewContainerExtensions.ViewsRegistry).registerViews(viewDescriptors, VIEW_CONTAINER);
}
private createObjectExplorerViewDescriptor(): IViewDescriptor {
return {
id: 'dataExplorer.servers',
name: localize('dataExplorer.servers', "Servers"),
ctor: ConnectionViewletPanel,
ctorDescriptor: { ctor: ConnectionViewletPanel },
weight: 100,
canToggleVisibility: true,
order: 0
@@ -62,7 +63,7 @@ export class DataExplorerViewlet extends ViewContainerViewlet {
private disposables: IDisposable[] = [];
constructor(
@IPartService partService: IPartService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@ITelemetryService telemetryService: ITelemetryService,
@IInstantiationService instantiationService: IInstantiationService,
@IViewletService private viewletService: IViewletService,
@@ -73,7 +74,7 @@ export class DataExplorerViewlet extends ViewContainerViewlet {
@IExtensionService extensionService: IExtensionService,
@IConfigurationService configurationService: IConfigurationService
) {
super(VIEWLET_ID, `${VIEWLET_ID}.state`, true, configurationService, partService, telemetryService, storageService, instantiationService, themeService, contextMenuService, extensionService, contextService);
super(VIEWLET_ID, `${VIEWLET_ID}.state`, true, configurationService, layoutService, telemetryService, storageService, instantiationService, themeService, contextMenuService, extensionService, contextService);
this.disposables.push(this.viewletService.onDidViewletOpen(this.onViewletOpen, this, this.disposables));
}
@@ -120,7 +121,7 @@ export class DataExplorerViewlet extends ViewContainerViewlet {
}
protected createView(viewDescriptor: IViewDescriptor, options: IViewletViewOptions): ViewletPanel {
return this.instantiationService.createInstance(viewDescriptor.ctor, options) as ViewletPanel;
return this.instantiationService.createInstance(viewDescriptor.ctorDescriptor.ctor, options) as ViewletPanel;
}
private onViewletOpen(viewlet: IViewlet): void {
@@ -133,4 +134,4 @@ export class DataExplorerViewlet extends ViewContainerViewlet {
this.disposables = dispose(this.disposables);
super.dispose();
}
}
}

View File

@@ -13,12 +13,12 @@ import * as TelemetryKeys from 'sql/common/telemetryKeys';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { Builder } from 'sql/base/browser/builder';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { bootstrapAngular } from 'sql/services/bootstrap/bootstrapService';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
export class BackupDialog extends Modal {
private _bodyBuilder: Builder;
@@ -28,14 +28,14 @@ export class BackupDialog extends Modal {
constructor(
@IThemeService themeService: IThemeService,
@IPartService partService: IPartService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService,
@ITelemetryService telemetryService: ITelemetryService,
@IContextKeyService contextKeyService: IContextKeyService,
@IInstantiationService private _instantiationService: IInstantiationService,
@IClipboardService clipboardService: IClipboardService
) {
super('', TelemetryKeys.Backup, partService, telemetryService, clipboardService, themeService, contextKeyService, { isAngular: true, hasErrors: true });
super('', TelemetryKeys.Backup, telemetryService, layoutService, clipboardService, themeService, contextKeyService, { isAngular: true, hasErrors: true });
}
protected renderBody(container: HTMLElement) {
@@ -105,4 +105,4 @@ export class BackupDialog extends Modal {
// Nothing currently laid out in this class
}
}
}

View File

@@ -14,7 +14,6 @@ import { MessageType, IInputOptions } from 'vs/base/browser/ui/inputbox/inputBox
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { localize } from 'vs/nls';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { mixin } from 'vs/base/common/objects';
@@ -42,6 +41,7 @@ import { TabbedPanel, PanelTabIdentifier } from 'sql/base/browser/ui/panel/panel
import { ServiceOptionType } from 'sql/workbench/api/common/sqlExtHostTypes';
import { IClipboardService } from 'sql/platform/clipboard/common/clipboardService';
import { IFileBrowserDialogController } from 'sql/workbench/services/fileBrowser/common/fileBrowserDialogController';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
interface FileListElement {
logicalFileName: string;
@@ -128,7 +128,7 @@ export class RestoreDialog extends Modal {
constructor(
optionsMetadata: azdata.ServiceOption[],
@IPartService partService: IPartService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@IThemeService themeService: IThemeService,
@IContextViewService private _contextViewService: IContextViewService,
@ITelemetryService telemetryService: ITelemetryService,
@@ -136,7 +136,7 @@ export class RestoreDialog extends Modal {
@IFileBrowserDialogController private fileBrowserDialogService: IFileBrowserDialogController,
@IClipboardService clipboardService: IClipboardService
) {
super(localize('RestoreDialogTitle', 'Restore database'), TelemetryKeys.Restore, partService, telemetryService, clipboardService, themeService, contextKeyService, { hasErrors: true, isWide: true, hasSpinner: true });
super(localize('RestoreDialogTitle', 'Restore database'), TelemetryKeys.Restore, telemetryService, layoutService, clipboardService, themeService, contextKeyService, { hasErrors: true, isWide: true, hasSpinner: true });
this._restoreTitle = localize('restoreDialog.restoreTitle', 'Restore database');
this._databaseTitle = localize('restoreDialog.database', 'Database');
this._backupFileTitle = localize('restoreDialog.backupFile', 'Backup file');

View File

@@ -33,12 +33,12 @@ import { TextResourceEditor } from 'vs/workbench/browser/parts/editor/textResour
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import { IEditorGroup } from 'vs/workbench/services/group/common/editorGroupsService';
import { IFlexibleSash, HorizontalFlexibleSash } from 'sql/parts/query/views/flexibleSash';
import { EditDataResultsEditor } from 'sql/parts/editData/editor/editDataResultsEditor';
import { EditDataResultsInput } from 'sql/parts/editData/common/editDataResultsInput';
import { CancellationToken } from 'vs/base/common/cancellation';
import { IStorageService } from 'vs/platform/storage/common/storage';
import { IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService';
/**
* Editor that hosts an action bar and a resultSetInput for an edit data session

View File

@@ -5,9 +5,6 @@
'use strict';
import 'vs/css!vs/workbench/parts/extensions/electron-browser/media/extensionEditor';
import { append, $ } from 'vs/base/browser/dom';
import { IInsightTypeContrib } from 'sql/parts/dashboard/widgets/insights/interfaces';
import { IDashboardTabContrib } from 'sql/parts/dashboard/common/dashboardTab.contribution';
@@ -106,4 +103,3 @@ function renderDashboardInsights(onDetailsToggle: Function, contributionReader:
append(container, details);
return true;
}

View File

@@ -9,10 +9,10 @@ import { IEditorModel } from 'vs/platform/editor/common/editor';
import { EditorInput, EditorModel, ConfirmResult } from 'vs/workbench/common/editor';
import * as DOM from 'vs/base/browser/dom';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IPartService, Parts } from 'vs/workbench/services/part/common/partService';
import { DialogPane } from 'sql/platform/dialog/dialogPane';
import { Emitter, Event } from 'vs/base/common/event';
import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService';
export type ModeViewSaveHandler = (handle: number) => Thenable<boolean>;
@@ -56,13 +56,13 @@ export class ModelViewInput extends EditorInput {
constructor(private _title: string, private _model: ModelViewInputModel,
private _options: azdata.ModelViewEditorOptions,
@IInstantiationService private _instantiationService: IInstantiationService,
@IPartService private readonly _partService: IPartService
@IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService
) {
super();
this._model.onDidChangeDirty(() => this._onDidChangeDirty.fire());
this._container = document.createElement('div');
this._container.id = `modelView-${_model.modelViewId}`;
this._partService.getContainer(Parts.EDITOR_PART).appendChild(this._container);
this.layoutService.getContainer(Parts.EDITOR_PART).appendChild(this._container);
}

View File

@@ -11,6 +11,7 @@ import * as azdata from 'azdata';
import { IModelStore, IComponentDescriptor, IComponent } from './interfaces';
import { Extensions, IComponentRegistry } from 'sql/platform/dashboard/common/modelComponentRegistry';
import { Deferred } from 'sql/base/common/promise';
import { entries } from 'sql/base/common/objects';
const componentRegistry = <IComponentRegistry>Registry.as(Extensions.ComponentContribution);
@@ -73,7 +74,7 @@ export class ModelStore implements IModelStore {
}
validate(component: IComponent): Thenable<boolean> {
let componentId = Object.entries(this._componentMappings).find(([id, mappedComponent]) => component === mappedComponent)[0];
let componentId = entries(this._componentMappings).find(([id, mappedComponent]) => component === mappedComponent)[0];
return Promise.all(this._validationCallbacks.map(callback => callback(componentId))).then(validations => validations.every(validation => validation === true));
}

View File

@@ -17,7 +17,6 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
import { IStorageService } from 'vs/platform/storage/common/storage';
import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration';
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService';
import { EditorOptions } from 'vs/workbench/common/editor';
import { StandaloneCodeEditor } from 'vs/editor/standalone/browser/standaloneCodeEditor';
import { CancellationToken } from 'vs/base/common/cancellation';
@@ -25,7 +24,9 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { Configuration } from 'vs/editor/browser/config/configuration';
import { IWindowService } from 'vs/platform/windows/common/windows';
import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration';
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
/**
* Extension of TextResourceEditor that is always readonly rather than only with non UntitledInputs
@@ -52,7 +53,8 @@ export class QueryTextEditor extends BaseTextEditor {
@IEditorGroupsService editorGroupService: IEditorGroupsService,
@IEditorService protected editorService: IEditorService,
@IWindowService windowService: IWindowService,
@IWorkspaceConfigurationService private workspaceConfigurationService: IWorkspaceConfigurationService
@IConfigurationService private workspaceConfigurationService: IConfigurationService,
@IAccessibilityService private accessibilityService: IAccessibilityService
) {
super(
@@ -131,7 +133,7 @@ export class QueryTextEditor extends BaseTextEditor {
public setHeightToScrollHeight(configChanged?: boolean): void {
let editorWidget = this.getControl() as ICodeEditor;
if (!this._config) {
this._config = new Configuration(undefined, editorWidget.getDomNode());
this._config = new Configuration(undefined, editorWidget.getDomNode(), this.accessibilityService);
this._scrollbarHeight = this._config.editor.viewInfo.scrollbar.horizontalScrollbarSize;
}
let editorWidgetModel = editorWidget.getModel();

View File

@@ -11,12 +11,10 @@ import {
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import { addDisposableListener, EventType } from 'vs/base/browser/dom';
import { Parts, IPartService } from 'vs/workbench/services/part/common/partService';
import { CommonServiceInterface } from 'sql/services/common/commonServiceInterface.service';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { WebviewElement, WebviewOptions } from 'vs/workbench/parts/webview/electron-browser/webviewElement';
import { URI, UriComponents } from 'vs/base/common/uri';
import { IOpenerService } from 'vs/platform/opener/common/opener';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
@@ -25,6 +23,8 @@ import { ComponentBase } from 'sql/parts/modelComponents/componentBase';
import { IComponent, IComponentDescriptor, IModelStore, ComponentEventType } from 'sql/parts/modelComponents/interfaces';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
import { WebviewElement, WebviewOptions, WebviewContentOptions } from 'vs/workbench/contrib/webview/electron-browser/webviewElement';
import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService';
function reviveWebviewOptions(options: vscode.WebviewOptions): vscode.WebviewOptions {
return {
@@ -54,7 +54,7 @@ export default class WebViewComponent extends ComponentBase implements IComponen
@Inject(forwardRef(() => CommonServiceInterface)) private _commonService: CommonServiceInterface,
@Inject(forwardRef(() => ChangeDetectorRef)) changeRef: ChangeDetectorRef,
@Inject(forwardRef(() => ElementRef)) el: ElementRef,
@Inject(IPartService) private partService: IPartService,
@Inject(IWorkbenchLayoutService) private layoutService: IWorkbenchLayoutService,
@Inject(IThemeService) private themeService: IThemeService,
@Inject(IEnvironmentService) private environmentService: IEnvironmentService,
@Inject(IContextViewService) private contextViewService: IContextViewService,
@@ -76,10 +76,12 @@ export default class WebViewComponent extends ComponentBase implements IComponen
private _createWebview(): void {
this._webview = this.instantiationService.createInstance(WebviewElement,
this.partService.getContainer(Parts.EDITOR_PART),
this.layoutService.getContainer(Parts.EDITOR_PART),
{
allowScripts: true,
enableWrappedPostMessage: true
allowSvgs: true
},
{
allowScripts: true
});
this._webview.mountTo(this._el.nativeElement);
@@ -195,14 +197,11 @@ export default class WebViewComponent extends ComponentBase implements IComponen
return this._extensionLocationUri;
}
private getExtendedOptions(): WebviewOptions {
private getExtendedOptions(): WebviewContentOptions {
let options = this.options || { enableScripts: true };
options = reviveWebviewOptions(options);
return {
allowScripts: options.enableScripts,
allowSvgs: true,
enableWrappedPostMessage: true,
useSameOriginForRoot: false,
localResourceRoots: options!.localResourceRoots || this.getDefaultLocalResourceRoots()
};
}

View File

@@ -23,6 +23,7 @@ import { URI } from 'vs/base/common/uri';
import { ISingleNotebookEditOperation } from 'sql/workbench/api/common/sqlExtHostTypes';
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
import { uriPrefixes } from 'sql/platform/connection/common/utils';
import { keys } from 'vs/base/common/map';
/*
* Used to control whether a message in a dialog/wizard is displayed as an error,
@@ -205,7 +206,7 @@ export class NotebookModel extends Disposable implements INotebookModel {
}
public standardKernelsDisplayName(): string[] {
return Array.from(this._kernelDisplayNameToNotebookProviderIds.keys());
return Array.from(keys(this._kernelDisplayNameToNotebookProviderIds));
}
public get inErrorState(): boolean {

View File

@@ -19,7 +19,6 @@ import { IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { fillInActions, LabeledMenuItemActionItem } from 'vs/platform/actions/browser/menuItemActionItem';
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { VIEWLET_ID, IExtensionsViewlet } from 'vs/workbench/parts/extensions/common/extensions';
import { CommonServiceInterface } from 'sql/services/common/commonServiceInterface.service';
import { AngularDisposable } from 'sql/base/node/lifecycle';
@@ -41,6 +40,7 @@ import { ISingleNotebookEditOperation } from 'sql/workbench/api/common/sqlExtHos
import { IConnectionDialogService } from 'sql/workbench/services/connection/common/connectionDialogService';
import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService';
import { CellMagicMapper } from 'sql/parts/notebook/models/cellMagicMapper';
import { IExtensionsViewlet, VIEWLET_ID } from 'vs/workbench/contrib/extensions/common/extensions';
export const NOTEBOOK_SELECTOR: string = 'notebook-component';

View File

@@ -10,9 +10,9 @@ import { nb } from 'azdata';
import * as os from 'os';
import * as pfs from 'vs/base/node/pfs';
import { localize } from 'vs/nls';
import { IOutputChannel } from 'vs/workbench/parts/output/common/output';
import { DEFAULT_NOTEBOOK_PROVIDER, DEFAULT_NOTEBOOK_FILETYPE, INotebookService } from 'sql/workbench/services/notebook/common/notebookService';
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
import { IOutputChannel } from 'vs/workbench/contrib/output/common/output';
/**
@@ -122,4 +122,4 @@ export async function asyncForEach(array: any, callback: any): Promise<any> {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array);
}
}
}

View File

@@ -16,9 +16,8 @@ import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/co
import { VIEWLET_ID } from 'sql/platform/connection/common/connectionManagement';
import { ConnectionViewlet } from 'sql/workbench/parts/connection/electron-browser/connectionViewlet';
import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService';
import { ToggleViewletAction } from 'vs/workbench/browser/parts/activitybar/activitybarActions';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
// Viewlet Action
export class OpenConnectionsViewletAction extends ToggleViewletAction {
@@ -29,9 +28,9 @@ export class OpenConnectionsViewletAction extends ToggleViewletAction {
id: string,
label: string,
@IViewletService viewletService: IViewletService,
@IPartService partService: IPartService
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService
) {
super(viewletDescriptor, partService, viewletService);
super(viewletDescriptor, layoutService, viewletService);
}
}
@@ -98,4 +97,4 @@ MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
title: localize({ key: 'miViewRegisteredServers', comment: ['&& denotes a mnemonic'] }, "&&Servers")
},
order: 1
});
});

View File

@@ -7,7 +7,7 @@
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
import { NodeType, SqlThemeIcon } from 'sql/parts/objectExplorer/common/nodeType';
import * as azdata from 'azdata';
import * as azdata from 'sqlops';
import * as UUID from 'vs/base/common/uuid';

View File

@@ -13,7 +13,6 @@ import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { attachInputBoxStyler, attachCheckboxStyler } from 'vs/platform/theme/common/styler';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { Event, Emitter } from 'vs/base/common/event';
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { localize } from 'vs/nls';
@@ -27,6 +26,7 @@ import { attachButtonStyler, attachModalDialogStyler } from 'sql/platform/theme/
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import * as TelemetryKeys from 'sql/common/telemetryKeys';
import { IClipboardService } from 'sql/platform/clipboard/common/clipboardService';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
export class ServerGroupDialog extends Modal {
private _bodyBuilder: Builder;
@@ -50,14 +50,14 @@ export class ServerGroupDialog extends Modal {
public onCloseEvent: Event<void> = this._onCloseEvent.event;
constructor(
@IPartService partService: IPartService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@IThemeService themeService: IThemeService,
@IContextViewService private _contextViewService: IContextViewService,
@ITelemetryService telemetryService: ITelemetryService,
@IContextKeyService contextKeyService: IContextKeyService,
@IClipboardService clipboardService: IClipboardService
) {
super(localize('ServerGroupsDialogTitle', 'Server Groups'), TelemetryKeys.ServerGroups, partService, telemetryService, clipboardService, themeService, contextKeyService);
super(localize('ServerGroupsDialogTitle', 'Server Groups'), TelemetryKeys.ServerGroups, telemetryService, layoutService, clipboardService, themeService, contextKeyService);
}
public render() {
@@ -361,4 +361,4 @@ export class ServerGroupDialog extends Modal {
this.show();
this._groupNameInputBox.focus();
}
}
}

View File

@@ -11,7 +11,6 @@ import { ProfilerInput } from 'sql/parts/profiler/editor/profilerInput';
import * as TelemetryKeys from 'sql/common/telemetryKeys';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import * as nls from 'vs/nls';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { Builder } from 'sql/base/browser/builder';
@@ -26,6 +25,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { IClipboardService } from 'sql/platform/clipboard/common/clipboardService';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
class EventItem {
@@ -312,14 +312,14 @@ export class ProfilerColumnEditorDialog extends Modal {
private _treeContainer: HTMLElement;
constructor(
@IPartService _partService: IPartService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@IThemeService themeService: IThemeService,
@ITelemetryService telemetryService: ITelemetryService,
@IContextKeyService contextKeyService: IContextKeyService,
@IContextViewService private _contextViewService: IContextViewService,
@IClipboardService clipboardService: IClipboardService
) {
super(nls.localize('profilerColumnDialog.profiler', 'Profiler'), TelemetryKeys.Profiler, _partService, telemetryService, clipboardService, themeService, contextKeyService);
super(nls.localize('profilerColumnDialog.profiler', 'Profiler'), TelemetryKeys.Profiler, telemetryService, layoutService, clipboardService, themeService, contextKeyService);
}
public render(): void {

View File

@@ -13,7 +13,6 @@ import { attachButtonStyler, attachModalDialogStyler, attachInputBoxStyler } fro
import { KeyCode } from 'vs/base/common/keyCodes';
import { Builder } from 'sql/base/browser/builder';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
@@ -27,6 +26,7 @@ import { generateUuid } from 'vs/base/common/uuid';
import * as DOM from 'vs/base/browser/dom';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { ProfilerFilter, ProfilerFilterClause, ProfilerFilterClauseOperator } from 'sql/workbench/services/profiler/common/interfaces';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
const ClearText: string = localize('profilerFilterDialog.clear', 'Clear All');
@@ -73,12 +73,12 @@ export class ProfilerFilterDialog extends Modal {
constructor(
@IThemeService themeService: IThemeService,
@IClipboardService clipboardService: IClipboardService,
@IPartService partService: IPartService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@ITelemetryService telemetryService: ITelemetryService,
@IContextKeyService contextKeyService: IContextKeyService,
@IContextViewService private contextViewService: IContextViewService
) {
super('', TelemetryKeys.ProfilerFilter, partService, telemetryService, clipboardService, themeService, contextKeyService, { isFlyout: false, hasTitleIcon: true });
super('', TelemetryKeys.ProfilerFilter, telemetryService, layoutService, clipboardService, themeService, contextKeyService, { isFlyout: false, hasTitleIcon: true });
}
public open(input: ProfilerInput) {
@@ -326,4 +326,4 @@ interface ClauseRowUI {
field: SelectBox;
operator: SelectBox;
value: InputBox;
}
}

View File

@@ -35,7 +35,6 @@ import { CommonFindController, FindStartFocusAction } from 'vs/editor/contrib/fi
import * as types from 'vs/base/common/types';
import { attachSelectBoxStyler } from 'vs/platform/theme/common/styler';
import { DARK, HIGH_CONTRAST } from 'vs/platform/theme/common/themeService';
import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService';
import { CancellationToken } from 'vs/base/common/cancellation';
import { IStorageService } from 'vs/platform/storage/common/storage';
import { IView, SplitView, Sizing } from 'vs/base/browser/ui/splitview/splitview';

View File

@@ -17,12 +17,12 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
import { IStorageService } from 'vs/platform/storage/common/storage';
import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration';
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService';
import { EditorOptions } from 'vs/workbench/common/editor';
import { StandaloneCodeEditor } from 'vs/editor/standalone/browser/standaloneCodeEditor';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { CancellationToken } from 'vs/base/common/cancellation';
import { IWindowService } from 'vs/platform/windows/common/windows';
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
class ProfilerResourceCodeEditor extends StandaloneCodeEditor {

View File

@@ -9,7 +9,6 @@ import { IDisposable, combinedDisposable } from 'vs/base/common/lifecycle';
import { IStatusbarItem } from 'vs/workbench/browser/parts/statusbar/statusbar';
import { IEditorCloseEvent } from 'vs/workbench/common/editor';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { Action } from 'vs/base/common/actions';
import errors = require('vs/base/common/errors');
@@ -69,7 +68,6 @@ export class SqlFlavorStatusbarItem implements IStatusbarItem {
constructor(
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService,
@IEditorService private _editorService: EditorServiceImpl,
@IEditorGroupsService private _editorGroupService: IEditorGroupsService,
@IQuickInputService private _quickInputService: IQuickInputService,
@IInstantiationService private _instantiationService: IInstantiationService,
) {

View File

@@ -14,7 +14,7 @@ import { resolveCurrentDirectory, getRootPath } from 'sql/platform/node/pathUtil
import { localize } from 'vs/nls';
import { Action } from 'vs/base/common/actions';
import { join, normalize } from 'vs/base/common/paths';
import { join, normalize } from 'vs/base/common/path';
import { writeFile } from 'vs/base/node/pfs';
import { IWindowsService, IWindowService } from 'vs/platform/windows/common/windows';
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
@@ -193,7 +193,7 @@ export class SaveImageAction extends Action {
filepathPlaceHolder = join(filepathPlaceHolder, 'chart.png');
return this.windowService.showSaveDialog({
title: localize('chartViewer.saveAsFileTitle', 'Choose Results File'),
defaultPath: normalize(filepathPlaceHolder, true)
defaultPath: normalize(filepathPlaceHolder)
});
}

View File

@@ -67,6 +67,6 @@ export class ImageInsight implements IInsight {
hexVal = hexVal.slice(2);
}
// should be able to be replaced with new Buffer(hexVal, 'hex').toString('base64')
return btoa(String.fromCharCode.apply(null, hexVal.replace(/\r|\n/g, '').replace(/([\da-fA-F]{2}) ?/g, '0x$1 ').replace(/ +$/, '').split(' ')));
return btoa(String.fromCharCode.apply(null, hexVal.replace(/\r|\n/g, '').replace(/([\da-fA-F]{2}) ?/g, '0x$1 ').replace(/ +$/, '').split(' ').map(v => Number(v))));
}
}

View File

@@ -27,7 +27,6 @@ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView
import { IActionItem } from 'vs/base/browser/ui/actionbar/actionbar';
import { Action } from 'vs/base/common/actions';
import { ISelectionData } from 'azdata';
import { IEditorGroup } from 'vs/workbench/services/group/common/editorGroupsService';
import { IDisposable } from 'vs/base/common/lifecycle';
import { IRange } from 'vs/editor/common/core/range';
@@ -48,6 +47,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
import { CancellationToken } from 'vs/base/common/cancellation';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { IStorageService } from 'vs/platform/storage/common/storage';
import { IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService';
/**
* Editor that hosts 2 sub-editors: A TextResourceEditor for SQL file editing, and a QueryResultsEditor

View File

@@ -7,7 +7,6 @@ import nls = require('vs/nls');
import { Action } from 'vs/base/common/actions';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration';
import * as azdata from 'azdata';
@@ -20,6 +19,7 @@ import * as Constants from 'sql/parts/query/common/constants';
import * as ConnectionConstants from 'sql/platform/connection/common/constants';
import { EditDataEditor } from 'sql/parts/editData/editor/editDataEditor';
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
const singleQuote = '\'';
@@ -247,7 +247,7 @@ export class RunQueryShortcutAction extends Action {
@IQueryModelService protected _queryModelService: IQueryModelService,
@IQueryManagementService private _queryManagementService: IQueryManagementService,
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService,
@IWorkspaceConfigurationService private _workspaceConfigurationService: IWorkspaceConfigurationService
@IConfigurationService private _workspaceConfigurationService: IConfigurationService
) {
super(RunQueryShortcutAction.ID);
}
@@ -454,4 +454,4 @@ export class ParseSyntaxAction extends Action {
}
return this._connectionManagementService.isConnected(editor.currentQueryInput.uri);
}
}
}

View File

@@ -8,7 +8,6 @@ import { IDisposable, combinedDisposable } from 'vs/base/common/lifecycle';
import { IStatusbarItem } from 'vs/workbench/browser/parts/statusbar/statusbar';
import { IEditorCloseEvent } from 'vs/workbench/common/editor';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService';
import { IQueryModelService } from 'sql/platform/query/common/queryModel';
import LocalizedConstants = require('sql/parts/query/common/localizedConstants');
import * as WorkbenchUtils from 'sql/workbench/common/sqlWorkbenchUtils';
@@ -30,8 +29,7 @@ export class QueryStatusbarItem implements IStatusbarItem {
constructor(
@IQueryModelService private _queryModelService: IQueryModelService,
@IEditorService private _editorService: EditorServiceImpl,
@IEditorGroupsService private _editorGroupService: IEditorGroupsService,
@IEditorService private _editorService: EditorServiceImpl
) {
this._queryStatusEditors = {};
}

View File

@@ -21,9 +21,8 @@ import ext = require('vs/workbench/common/contributions');
import { ITaskService } from 'sql/platform/taskHistory/common/taskService';
import { IActivityService, NumberBadge } from 'vs/workbench/services/activity/common/activity';
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService';
import { ToggleViewletAction } from 'vs/workbench/browser/parts/activitybar/activitybarActions';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
export class StatusUpdater implements ext.IWorkbenchContribution {
static ID = 'data.taskhistory.statusUpdater';
@@ -83,9 +82,9 @@ export class TaskHistoryViewletAction extends ToggleViewletAction {
id: string,
label: string,
@IViewletService viewletService: IViewletService,
@IPartService partService: IPartService
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService
) {
super(viewletDescriptor, partService, viewletService);
super(viewletDescriptor, layoutService, viewletService);
}
}
@@ -134,4 +133,4 @@ MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
title: localize({ key: 'miViewTasks', comment: ['&& denotes a mnemonic'] }, "&&Tasks")
},
order: 2
});
});

View File

@@ -17,10 +17,10 @@ import Severity from 'vs/base/common/severity';
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
import { TaskHistoryView } from 'sql/parts/taskHistory/viewlet/taskHistoryView';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IStorageService } from 'vs/platform/storage/common/storage';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
export const VIEWLET_ID = 'workbench.view.taskHistory';
@@ -35,11 +35,11 @@ export class TaskHistoryViewlet extends Viewlet {
@IThemeService themeService: IThemeService,
@IInstantiationService private _instantiationService: IInstantiationService,
@INotificationService private _notificationService: INotificationService,
@IPartService partService: IPartService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@IConfigurationService configurationService: IConfigurationService,
@IStorageService storageService: IStorageService
) {
super(VIEWLET_ID, configurationService, partService, telemetryService, themeService, storageService);
super(VIEWLET_ID, configurationService, layoutService, telemetryService, themeService, storageService);
}
private onError(err: any): void {

View File

@@ -10,7 +10,7 @@ import * as Constants from 'sql/common/constants';
import { ConnectionProviderProperties, IConnectionProviderRegistry, Extensions as ConnectionExtensions } from 'sql/workbench/parts/connection/common/connectionProviderExtension';
import { toObject } from 'sql/base/common/map';
import * as azdata from 'azdata';
import * as azdata from 'sqlops';
import { Event, Emitter } from 'vs/base/common/event';
import { IAction } from 'vs/base/common/actions';
@@ -21,6 +21,7 @@ import { IStorageService, StorageScope } from 'vs/platform/storage/common/storag
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';
import { entries } from 'sql/base/common/objects';
export const SERVICE_ID = 'capabilitiesService';
export const HOST_NAME = 'azdata';
@@ -115,14 +116,14 @@ export class CapabilitiesService extends Disposable implements ICapabilitiesServ
}
// handle in case some extensions have already registered (unlikley)
Object.entries(connectionRegistry.providers).map(v => {
entries(connectionRegistry.providers).map(v => {
this.handleConnectionProvider({ id: v[0], properties: v[1] });
});
// register for when new extensions are added
this._register(connectionRegistry.onNewProvider(this.handleConnectionProvider, this));
// handle adding already known capabilities (could have caching problems)
Object.entries(this.capabilities.connectionProviderCache).map(v => {
entries(this.capabilities.connectionProviderCache).map(v => {
this.handleConnectionProvider({ id: v[0], properties: v[1] }, false);
});

View File

@@ -9,15 +9,14 @@ import * as Utils from './utils';
import { IConnectionProfile, IConnectionProfileStore } from './interfaces';
import { IConnectionConfig } from './iconnectionConfig';
import { ConnectionProfileGroup, IConnectionProfileGroup } from './connectionProfileGroup';
import { ConfigurationEditingService, IConfigurationValue } from 'vs/workbench/services/configuration/node/configurationEditingService';
import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration';
import { ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { ConnectionProfile } from './connectionProfile';
import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService';
import * as azdata from 'azdata';
import * as nls from 'vs/nls';
import { generateUuid } from 'vs/base/common/uuid';
import { ConfigurationEditingService, IConfigurationValue } from 'vs/workbench/services/configuration/common/configurationEditingService';
export interface ISaveGroupResult {
groups: IConnectionProfileGroup[];
@@ -34,7 +33,7 @@ export class ConnectionConfig implements IConnectionConfig {
*/
public constructor(
private _configurationEditService: ConfigurationEditingService,
private _workspaceConfigurationService: IWorkspaceConfigurationService,
private _workspaceConfigurationService: IConfigurationService,
private _capabilitiesService: ICapabilitiesService
) { }

View File

@@ -31,7 +31,7 @@ import { IAngularEventingService, AngularEventType } from 'sql/platform/angularE
import * as QueryConstants from 'sql/parts/query/common/constants';
import { Deferred } from 'sql/base/common/promise';
import { ConnectionOptionSpecialType } from 'sql/workbench/api/common/sqlExtHostTypes';
import { values } from 'sql/base/common/objects';
import { values, entries } from 'sql/base/common/objects';
import { ConnectionProviderProperties, IConnectionProviderRegistry, Extensions as ConnectionProviderExtensions } from 'sql/workbench/parts/connection/common/connectionProviderExtension';
import { IAccountManagementService, AzureResource } from 'sql/platform/accountManagement/common/interfaces';
import { IServerGroupController, IServerGroupDialogCallbacks } from 'sql/platform/serverGroup/common/serverGroupController';
@@ -48,15 +48,15 @@ import { Memento } from 'vs/workbench/common/memento';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
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 { 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, StatusbarAlignment } from 'vs/platform/statusbar/common/statusbar';
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
import { IConnectionDialogService } from 'sql/workbench/services/connection/common/connectionDialogService';
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { ConfigurationEditingService } from 'vs/workbench/services/configuration/common/configurationEditingService';
export class ConnectionManagementService extends Disposable implements IConnectionManagementService {
@@ -88,7 +88,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
@IInstantiationService private _instantiationService: IInstantiationService,
@IEditorService private _editorService: IEditorService,
@ITelemetryService private _telemetryService: ITelemetryService,
@IWorkspaceConfigurationService private _workspaceConfigurationService: IWorkspaceConfigurationService,
@IConfigurationService private _configurationService: IConfigurationService,
@ICredentialsService private _credentialsService: ICredentialsService,
@ICapabilitiesService private _capabilitiesService: ICapabilitiesService,
@IQuickInputService private _quickInputService: IQuickInputService,
@@ -109,7 +109,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
}
if (!this._connectionStore) {
this._connectionStore = new ConnectionStore(_storageService, this._connectionMemento,
this._configurationEditService, this._workspaceConfigurationService, this._credentialsService, this._capabilitiesService);
this._configurationEditService, this._configurationService, this._credentialsService, this._capabilitiesService);
}
// Register Statusbar item
@@ -130,7 +130,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
};
registry.onNewProvider(providerRegistration, this);
Object.entries(registry.providers).map(v => {
entries(registry.providers).map(v => {
providerRegistration({ id: v[0], properties: v[1] });
});
@@ -750,7 +750,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
public ensureDefaultLanguageFlavor(uri: string): void {
if (!this.getProviderIdFromUri(uri)) {
// Lookup the default settings and use this
let defaultProvider = WorkbenchUtils.getSqlConfigValue<string>(this._workspaceConfigurationService, Constants.defaultEngine);
let defaultProvider = WorkbenchUtils.getSqlConfigValue<string>(this._configurationService, Constants.defaultEngine);
if (defaultProvider && this._providers.has(defaultProvider)) {
// Only set a default if it's in the list of registered providers
this.doChangeLanguageFlavor(uri, 'sql', defaultProvider);
@@ -1324,7 +1324,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
}
public getTabColorForUri(uri: string): string {
if (WorkbenchUtils.getSqlConfigValue<string>(this._workspaceConfigurationService, 'tabColorMode') === QueryConstants.tabColorModeOff) {
if (WorkbenchUtils.getSqlConfigValue<string>(this._configurationService, 'tabColorMode') === QueryConstants.tabColorModeOff) {
return undefined;
}
let connectionProfile = this.getConnectionProfile(uri);

View File

@@ -15,9 +15,9 @@ import { ConnectionConfig } from './connectionConfig';
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 { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { ConfigurationEditingService } from 'vs/workbench/services/configuration/common/configurationEditingService';
const MAX_CONNECTIONS_DEFAULT = 25;
@@ -36,7 +36,7 @@ export class ConnectionStore {
private _storageService: IStorageService,
private _context: Memento,
private _configurationEditService: ConfigurationEditingService,
private _workspaceConfigurationService: IWorkspaceConfigurationService,
private _configurationService: IConfigurationService,
private _credentialService: ICredentialsService,
private _capabilitiesService: ICapabilitiesService,
private _connectionConfig?: IConnectionConfig
@@ -48,7 +48,7 @@ export class ConnectionStore {
this._groupFullNameToIdMap = {};
if (!this._connectionConfig) {
this._connectionConfig = new ConnectionConfig(this._configurationEditService,
this._workspaceConfigurationService, this._capabilitiesService);
this._configurationService, this._capabilitiesService);
}
}
@@ -488,7 +488,7 @@ export class ConnectionStore {
}
private getMaxRecentConnectionsCount(): number {
let config = this._workspaceConfigurationService.getValue(Constants.sqlConfigSectionName);
let config = this._configurationService.getValue(Constants.sqlConfigSectionName);
let maxConnections: number = config[Constants.configMaxRecentConnections];
if (typeof (maxConnections) !== 'number' || maxConnections <= 0) {
@@ -568,4 +568,4 @@ export class ConnectionStore {
}
return result;
}
}
}

View File

@@ -12,7 +12,6 @@ import { Dialog, DialogButton } from 'sql/platform/dialog/dialogTypes';
import { DialogPane } from 'sql/platform/dialog/dialogPane';
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';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
@@ -26,6 +25,7 @@ import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { DialogMessage, MessageLevel } from '../../workbench/api/common/sqlExtHostTypes';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
export class DialogModal extends Modal {
private _dialogPane: DialogPane;
@@ -40,14 +40,14 @@ export class DialogModal extends Modal {
private _dialog: Dialog,
name: string,
options: IModalOptions,
@IPartService partService: IPartService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@IWorkbenchThemeService themeService: IWorkbenchThemeService,
@ITelemetryService telemetryService: ITelemetryService,
@IContextKeyService contextKeyService: IContextKeyService,
@IClipboardService clipboardService: IClipboardService,
@IInstantiationService private _instantiationService: IInstantiationService
) {
super(_dialog.title, name, partService, telemetryService, clipboardService, themeService, contextKeyService, options);
super(_dialog.title, name, telemetryService, layoutService, clipboardService, themeService, contextKeyService, options);
}
public layout(): void {

View File

@@ -16,7 +16,6 @@ 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 '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';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
@@ -25,6 +24,7 @@ import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { Emitter } from 'vs/base/common/event';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
export class WizardModal extends Modal {
private _dialogPanes = new Map<WizardPage, DialogPane>();
@@ -48,14 +48,14 @@ export class WizardModal extends Modal {
private _wizard: Wizard,
name: string,
options: IModalOptions,
@IPartService partService: IPartService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@IWorkbenchThemeService themeService: IWorkbenchThemeService,
@ITelemetryService telemetryService: ITelemetryService,
@IContextKeyService contextKeyService: IContextKeyService,
@IInstantiationService private _instantiationService: IInstantiationService,
@IClipboardService clipboardService: IClipboardService
) {
super(_wizard.title, name, partService, telemetryService, clipboardService, themeService, contextKeyService, options);
super(_wizard.title, name, telemetryService, layoutService, clipboardService, themeService, contextKeyService, options);
this._useDefaultMessageBoxLocation = false;
}
@@ -305,4 +305,4 @@ export class WizardModal extends Modal {
super.dispose();
this._dialogPanes.forEach(dialogPane => dialogPane.dispose());
}
}
}

View File

@@ -3,7 +3,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as path from 'vs/base/common/paths';
import { normalize, join, dirname } from 'vs/base/common/path';
import * as os from 'os';
import { URI } from 'vs/base/common/uri';
@@ -18,7 +18,7 @@ export function resolveCurrentDirectory(uri: string, rootPath: string): string {
// use current directory of the sql file if sql file is saved
if (sqlUri.scheme === FILE_SCHEMA) {
currentDirectory = path.dirname(sqlUri.fsPath);
currentDirectory = dirname(sqlUri.fsPath);
} else if (sqlUri.scheme === Schemas.untitled) {
// if sql file is unsaved/untitled but a workspace is open use workspace root
let root = rootPath;
@@ -29,14 +29,14 @@ export function resolveCurrentDirectory(uri: string, rootPath: string): string {
currentDirectory = os.tmpdir();
}
} else {
currentDirectory = path.dirname(sqlUri.path);
currentDirectory = dirname(sqlUri.path);
}
return currentDirectory;
}
export function resolveFilePath(uri: string, filePath: string, rootPath: string): string {
let currentDirectory = resolveCurrentDirectory(uri, rootPath);
return path.normalize(path.join(currentDirectory, filePath));
return normalize(join(currentDirectory, filePath));
}
export function getRootPath(contextService: IWorkspaceContextService): string {

View File

@@ -12,15 +12,13 @@ import { IQueryManagementService } from 'sql/platform/query/common/queryManageme
import { ISaveRequest, SaveFormat } from 'sql/parts/grid/common/interfaces';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IOutputService, IOutputChannel, IOutputChannelRegistry, Extensions as OutputExtensions } from 'vs/workbench/parts/output/common/output';
import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration';
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 { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
import { Schemas } from 'vs/base/common/network';
import * as paths from 'vs/base/common/paths';
import * as path from 'vs/base/common/path';
import * as nls from 'vs/nls';
import * as pretty from 'pretty-data';
@@ -30,6 +28,8 @@ import { getBaseLabel } from 'vs/base/common/labels';
import { ShowFileInFolderAction, OpenFileInFolderAction } from 'sql/workbench/common/workspaceActions';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { getRootPath, resolveCurrentDirectory, resolveFilePath } from 'sql/platform/node/pathUtilities';
import { IOutputService, IOutputChannelRegistry, IOutputChannel, Extensions as OutputExtensions } from 'vs/workbench/contrib/output/common/output';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
let prevSavePath: string;
@@ -47,7 +47,7 @@ export class ResultSerializer {
@IInstantiationService private _instantiationService: IInstantiationService,
@IOutputService private _outputService: IOutputService,
@IQueryManagementService private _queryManagementService: IQueryManagementService,
@IWorkspaceConfigurationService private _workspaceConfigurationService: IWorkspaceConfigurationService,
@IConfigurationService private _workspaceConfigurationService: IConfigurationService,
@IEditorService private _editorService: IEditorService,
@IWorkspaceContextService private _contextService: IWorkspaceContextService,
@IWindowsService private _windowsService: IWindowsService,
@@ -148,11 +148,11 @@ export class ResultSerializer {
}
private promptForFilepath(saveRequest: ISaveRequest): Thenable<string> {
let filepathPlaceHolder = (prevSavePath) ? paths.dirname(prevSavePath) : resolveCurrentDirectory(this._uri, this.rootPath);
filepathPlaceHolder = paths.join(filepathPlaceHolder, this.getResultsDefaultFilename(saveRequest));
let filepathPlaceHolder = (prevSavePath) ? path.dirname(prevSavePath) : resolveCurrentDirectory(this._uri, this.rootPath);
filepathPlaceHolder = path.join(filepathPlaceHolder, this.getResultsDefaultFilename(saveRequest));
return this._windowService.showSaveDialog({
title: nls.localize('resultsSerializer.saveAsFileTitle', 'Choose Results File'),
defaultPath: paths.normalize(filepathPlaceHolder, true),
defaultPath: path.normalize(filepathPlaceHolder),
filters: this.getResultsFileExtension(saveRequest)
}).then(filePath => {
prevSavePath = filePath;
@@ -277,7 +277,7 @@ export class ResultSerializer {
private getParameters(filePath: string, batchIndex: number, resultSetNo: number, format: string, selection: Slick.Range): SaveResultsRequestParams {
let saveResultsParams: SaveResultsRequestParams;
if (!paths.isAbsolute(filePath)) {
if (!path.isAbsolute(filePath)) {
this._filePath = resolveFilePath(this._uri, filePath, this.rootPath);
} else {
this._filePath = filePath;
@@ -315,7 +315,7 @@ export class ResultSerializer {
private promptFileSavedNotification(savedFilePath: string) {
let label = getBaseLabel(paths.dirname(savedFilePath));
let label = getBaseLabel(path.dirname(savedFilePath));
this._notificationService.prompt(
Severity.Info,
@@ -323,14 +323,14 @@ export class ResultSerializer {
[{
label: nls.localize('openLocation', "Open file location"),
run: () => {
let action = new ShowFileInFolderAction(savedFilePath, label || paths.sep, this._windowsService);
let action = new ShowFileInFolderAction(savedFilePath, label || path.sep, this._windowsService);
action.run();
action.dispose();
}
}, {
label: nls.localize('openFile', "Open file"),
run: () => {
let action = new OpenFileInFolderAction(savedFilePath, label || paths.sep, this._windowsService);
let action = new OpenFileInFolderAction(savedFilePath, label || path.sep, this._windowsService);
action.run();
action.dispose();
}

View File

@@ -12,6 +12,7 @@ import * as TelemetryKeys from 'sql/common/telemetryKeys';
import * as TelemetryUtils from 'sql/common/telemetryUtilities';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { Event, Emitter } from 'vs/base/common/event';
import { keys } from 'vs/base/common/map';
export const SERVICE_ID = 'queryManagementService';
@@ -157,7 +158,7 @@ export class QueryManagementService implements IQueryManagementService {
}
public getRegisteredProviders(): string[] {
return Array.from(this._requestHandlers.keys());
return Array.from(keys(this._requestHandlers));
}
private addTelemetry(eventName: string, ownerUri: string, runOptions?: azdata.ExecutionPlanOptions): void {

View File

@@ -8,15 +8,18 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { IInstantiationService, _util } from 'vs/platform/instantiation/common/instantiation';
import { IEditorInput } from 'vs/workbench/common/editor';
import { Trace } from 'vs/platform/instantiation/common/instantiationService';
import { values } from 'vs/base/common/map';
const selectorCounter = new Map<string, number>();
export function providerIterator(service: IInstantiationService): Provider[] {
return Array.from(_util.serviceIds.values()).map(v => {
return Array.from(values(_util.serviceIds)).map(v => {
let factory = () => {
return (<any>service)._getOrCreateServiceInstance(v, Trace.traceCreation(v));
};
factory.prototype = factory;
return {
provide: v, useFactory: () => {
return (<any>service)._getOrCreateServiceInstance(v, Trace.traceCreation(v));
}
provide: v, useFactory: factory
};
});
}

View File

@@ -15,7 +15,7 @@ import * as azdata from 'azdata';
import { SqlMainContext, ExtHostModelViewShape, MainThreadModelViewShape, ExtHostModelViewTreeViewsShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
import { IItemConfig, ModelComponentTypes, IComponentShape, IComponentEventArgs, ComponentEventType } from 'sql/workbench/api/common/sqlExtHostTypes';
import { IExtensionDescription } from 'vs/workbench/services/extensions/common/extensions';
import { IExtensionDescription } from 'vs/platform/extensions/common/extensions';
class ModelBuilderImpl implements azdata.ModelBuilder {
private nextComponentId: number;

View File

@@ -18,7 +18,7 @@ import { SqlMainContext, ExtHostModelViewDialogShape, MainThreadModelViewDialogS
import { IItemConfig, ModelComponentTypes, IComponentShape } from 'sql/workbench/api/common/sqlExtHostTypes';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { Inject } from '@angular/core';
import { IExtensionDescription } from 'vs/workbench/services/extensions/common/extensions';
import { IExtensionDescription } from 'vs/platform/extensions/common/extensions';
const DONE_LABEL = nls.localize('dialogDoneLabel', 'Done');
const CANCEL_LABEL = nls.localize('dialogCancelLabel', 'Cancel');
@@ -687,4 +687,4 @@ export class ExtHostModelViewDialog implements ExtHostModelViewDialogShape {
let handle = this.getHandle(wizard);
return this._proxy.$closeWizard(handle);
}
}
}

View File

@@ -13,7 +13,7 @@ import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import * as azdata from 'azdata';
import * as vsTreeExt from 'vs/workbench/api/node/extHostTreeViews';
import { Emitter } from 'vs/base/common/event';
import { IExtensionDescription } from 'vs/workbench/services/extensions/common/extensions';
import { IExtensionDescription } from 'vs/platform/extensions/common/extensions';
export class ExtHostModelViewTreeViews implements ExtHostModelViewTreeViewsShape {
private _proxy: MainThreadModelViewShape;
@@ -166,4 +166,4 @@ export class ExtHostTreeView<T> extends vsTreeExt.ExtHostTreeView<T> {
item = Object.assign({}, item, { checked: extensionTreeItem.checked, enabled: extensionTreeItem.enabled });
return item;
}
}
}

View File

@@ -8,6 +8,7 @@ import { IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import { ExtHostObjectExplorerShape, SqlMainContext, MainThreadObjectExplorerShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import { entries } from 'sql/base/common/objects';
export class ExtHostObjectExplorer implements ExtHostObjectExplorerShape {
@@ -85,6 +86,13 @@ class ExtHostObjectExplorerNode implements azdata.objectexplorer.ObjectExplorerN
}
private getDetailsFromInfo(nodeInfo: azdata.NodeInfo): void {
Object.entries(nodeInfo).forEach(([key, value]) => this[key] = value);
this.nodePath = nodeInfo.nodePath;
this.nodeType = nodeInfo.nodeType;
this.nodeSubType = nodeInfo.nodeSubType;
this.nodeStatus = nodeInfo.nodeStatus;
this.label = nodeInfo.label;
this.isLeaf = nodeInfo.isLeaf;
this.metadata = nodeInfo.metadata;
this.errorMessage = nodeInfo.errorMessage;
}
}

View File

@@ -12,7 +12,6 @@ import { URI, UriComponents } from 'vs/base/common/uri';
import { Event, Emitter } from 'vs/base/common/event';
import { IExtHostContext, IUndoStopOptions } from 'vs/workbench/api/node/extHost.protocol';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ITextEditorOptions } from 'vs/platform/editor/common/editor';
import { viewColumnToEditorGroup } from 'vs/workbench/api/shared/editor';
@@ -32,6 +31,7 @@ import { NotebookChangeType, CellTypes } from 'sql/parts/notebook/models/contrac
import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService';
import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
import { notebookModeId } from 'sql/common/constants';
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
class MainThreadNotebookEditor extends Disposable {
private _contentChangedEmitter = new Emitter<NotebookContentChange>();

View File

@@ -7,7 +7,6 @@
import * as extHostApi from 'vs/workbench/api/node/extHost.api.impl';
import { IInitData, IMainContext } from 'vs/workbench/api/node/extHost.protocol';
import { ExtHostExtensionService } from 'vs/workbench/api/node/extHostExtensionService';
import { IExtensionDescription } from 'vs/workbench/services/extensions/common/extensions';
import * as extHostTypes from 'vs/workbench/api/node/extHostTypes';
import { URI } from 'vs/base/common/uri';
@@ -40,7 +39,7 @@ import { ExtHostNotebookDocumentsAndEditors } from 'sql/workbench/api/node/extHo
import { ExtHostStorage } from 'vs/workbench/api/node/extHostStorage';
import { ExtensionDescriptionRegistry } from 'vs/workbench/services/extensions/node/extensionDescriptionRegistry';
import { ExtHostExtensionManagement } from 'sql/workbench/api/node/extHostExtensionManagement';
import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions';
import { TernarySearchTree } from 'vs/base/common/map';
export interface ISqlExtensionApiFactory {

View File

@@ -24,7 +24,7 @@ import {
} from 'sql/workbench/api/common/sqlExtHostTypes';
import { EditorViewColumn } from 'vs/workbench/api/shared/editor';
import { IUndoStopOptions } from 'vs/workbench/api/node/extHost.protocol';
import { IExtensionDescription } from 'vs/workbench/services/extensions/common/extensions';
import { IExtensionDescription } from 'vs/platform/extensions/common/extensions';
export abstract class ExtHostAccountManagementShape {
$autoOAuthCancelled(handle: number): Thenable<void> { throw ni(); }
@@ -871,4 +871,4 @@ export interface ExtHostExtensionManagementShape {
export interface MainThreadExtensionManagementShape extends IDisposable {
$install(vsixPath: string): Thenable<string>;
}
}

View File

@@ -5,7 +5,6 @@
import 'vs/css!./media/modal';
import { IThemable, attachButtonStyler } from 'vs/platform/theme/common/styler';
import { Color } from 'vs/base/common/color';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { mixin } from 'vs/base/common/objects';
import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
@@ -24,6 +23,7 @@ import { localize } from 'vs/nls';
import { MessageLevel } from 'sql/workbench/api/common/sqlExtHostTypes';
import * as os from 'os';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
export const MODAL_SHOWING_KEY = 'modalShowing';
export const MODAL_SHOWING_CONTEXT = new RawContextKey<Array<string>>(MODAL_SHOWING_KEY, []);
@@ -151,8 +151,8 @@ export abstract class Modal extends Disposable implements IThemable {
constructor(
private _title: string,
private _name: string,
private _partService: IPartService,
private _telemetryService: ITelemetryService,
protected layoutService: IWorkbenchLayoutService,
protected _clipboardService: IClipboardService,
protected _themeService: IThemeService,
_contextKeyService: IContextKeyService,
@@ -394,7 +394,7 @@ export abstract class Modal extends Disposable implements IThemable {
*/
protected show() {
this._modalShowingContext.get().push(this._staticKey);
this._builder.appendTo(this._partService.getWorkbenchElement());
this._builder.appendTo(this.layoutService.getWorkbenchElement());
this.setFocusableElements();

View File

@@ -16,7 +16,6 @@ import { ScrollableSplitView } from 'sql/base/browser/ui/scrollableSplitview/scr
import * as azdata from 'azdata';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { Event, Emitter } from 'vs/base/common/event';
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
import { IContextViewService, IContextMenuService } from 'vs/platform/contextview/browser/contextView';
@@ -34,6 +33,7 @@ import { IViewletPanelOptions, ViewletPanel } from 'vs/workbench/browser/parts/v
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
export class CategoryView extends ViewletPanel {
@@ -88,7 +88,7 @@ export class OptionsDialog extends Modal {
title: string,
name: string,
options: IOptionsDialogOptions,
@IPartService partService: IPartService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@IWorkbenchThemeService private _workbenchThemeService: IWorkbenchThemeService,
@IContextViewService private _contextViewService: IContextViewService,
@IInstantiationService private _instantiationService: IInstantiationService,
@@ -96,7 +96,7 @@ export class OptionsDialog extends Modal {
@IContextKeyService contextKeyService: IContextKeyService,
@IClipboardService clipboardService: IClipboardService
) {
super(title, name, partService, telemetryService, clipboardService, _workbenchThemeService, contextKeyService, options);
super(title, name, telemetryService, layoutService, clipboardService, _workbenchThemeService, contextKeyService, options);
}
public render() {
@@ -274,4 +274,4 @@ export class OptionsDialog extends Modal {
delete this._optionElements[optionName];
}
}
}
}

View File

@@ -24,7 +24,7 @@ import { IDataSource, ITree, IRenderer, ContextMenuEvent } from 'vs/base/parts/t
import { ResourceLabel } from 'vs/workbench/browser/labels';
import { ActionBar, IActionItemProvider, ActionItem } from 'vs/base/browser/ui/actionbar/actionbar';
import { URI } from 'vs/base/common/uri';
import { basename } from 'vs/base/common/paths';
import { basename } from 'vs/base/common/path';
import { LIGHT, FileThemeIcon, FolderThemeIcon, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
import { FileKind } from 'vs/platform/files/common/files';
import { WorkbenchTreeController } from 'vs/platform/list/browser/listService';
@@ -393,7 +393,7 @@ export class CustomTreeView extends Disposable implements ITreeView {
getOptimalWidth(): number {
if (this.tree) {
const parentNode = this.tree.getHTMLElement();
const childNodes = ([] as Element[]).slice.call(parentNode.querySelectorAll('.outline-item-label > a'));
const childNodes = ([] as HTMLElement[]).slice.call(parentNode.querySelectorAll('.outline-item-label > a'));
return DOM.getLargestChildWidth(parentNode, childNodes);
}
return 0;

View File

@@ -26,8 +26,8 @@ import { IWindowsService } from 'vs/platform/windows/common/windows';
import * as nls from 'vs/nls';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
export interface BaseActionContext {
object?: ObjectMetadata;
@@ -307,7 +307,7 @@ export class BackupAction extends Task {
let workbenchEditorService = accessor.get<IEditorService>(IEditorService);
profile = TaskUtilities.getCurrentGlobalConnection(objectExplorerService, connectionManagementService, workbenchEditorService);
}
let configurationService = accessor.get<IWorkspaceConfigurationService>(IWorkspaceConfigurationService);
let configurationService = accessor.get<IConfigurationService>(IConfigurationService);
let previewFeaturesEnabled: boolean = configurationService.getValue('workbench')['enablePreviewFeatures'];
if (!previewFeaturesEnabled) {
return new Promise<void>((resolve, reject) => {
@@ -346,7 +346,7 @@ export class RestoreAction extends Task {
}
runTask(accessor: ServicesAccessor, profile: IConnectionProfile): Promise<void> {
let configurationService = accessor.get<IWorkspaceConfigurationService>(IWorkspaceConfigurationService);
let configurationService = accessor.get<IConfigurationService>(IConfigurationService);
let previewFeaturesEnabled: boolean = configurationService.getValue('workbench')['enablePreviewFeatures'];
if (!previewFeaturesEnabled) {
return new Promise<void>((resolve, reject) => {

View File

@@ -31,7 +31,7 @@ import * as azdata from 'azdata';
import Severity from 'vs/base/common/severity';
import * as nls from 'vs/nls';
import * as path from 'vs/base/common/paths';
import * as path from 'vs/base/common/path';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
// map for the version of SQL Server (default is 140)
@@ -463,4 +463,4 @@ function getFilePath(metadata: azdata.ObjectMetadata): string {
function getServerInfo(connectionService: IConnectionManagementService, ownerUri: string): azdata.ServerInfo {
let connection: ConnectionManagementInfo = connectionService.getConnectionInfo(ownerUri);
return connection.serverInfo;
}
}

View File

@@ -1,5 +1,6 @@
import { Action } from 'vs/base/common/actions';
import { IWindowsService } from 'vs/platform/windows/common/windows';
import { URI } from 'vs/base/common/uri';
export class ShowFileInFolderAction extends Action {
@@ -8,7 +9,7 @@ export class ShowFileInFolderAction extends Action {
}
run(): Promise<void> {
return this.windowsService.showItemInFolder(this.path);
return this.windowsService.showItemInFolder(URI.parse(this.path));
}
}
@@ -21,4 +22,4 @@ export class OpenFileInFolderAction extends Action {
run() {
return this.windowsService.openExternal(this.path);
}
}
}

View File

@@ -23,12 +23,12 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { ClearSearchAction, AddServerAction, AddServerGroupAction, ActiveConnectionsFilterAction } from 'sql/parts/objectExplorer/viewlet/connectionTreeAction';
import { warn } from 'sql/base/common/log';
import { IObjectExplorerService } from 'sql/workbench/services/objectExplorer/common/objectExplorerService';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { localize } from 'vs/nls';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IStorageService } from 'vs/platform/storage/common/storage';
import { IConnectionsViewlet } from 'sql/workbench/parts/connection/common/connectionViewlet';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
export class ConnectionViewlet extends Viewlet implements IConnectionsViewlet {
@@ -47,12 +47,12 @@ export class ConnectionViewlet extends Viewlet implements IConnectionsViewlet {
@IInstantiationService private _instantiationService: IInstantiationService,
@INotificationService private _notificationService: INotificationService,
@IObjectExplorerService private objectExplorerService: IObjectExplorerService,
@IPartService partService: IPartService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@IConfigurationService configurationService: IConfigurationService,
@IStorageService storageService: IStorageService
) {
super(VIEWLET_ID, configurationService, partService, telemetryService, _themeService, storageService);
super(VIEWLET_ID, configurationService, layoutService, telemetryService, _themeService, storageService);
this._clearSearchAction = this._instantiationService.createInstance(ClearSearchAction, ClearSearchAction.ID, ClearSearchAction.LABEL, this);
this._addServerAction = this._instantiationService.createInstance(AddServerAction,

View File

@@ -11,8 +11,9 @@ import { generateUri } from 'sql/platform/connection/common/utils';
import { ICustomViewDescriptor, TreeViewItemHandleArg } from 'sql/workbench/common/views';
import { IQueryEditorService } from 'sql/workbench/services/queryEditor/common/queryEditorService';
import { CommandsRegistry } from 'vs/platform/commands/common/commands';
import { ViewsRegistry } from 'vs/workbench/common/views';
import { IViewsRegistry, Extensions } from 'vs/workbench/common/views';
import { IProgressService2 } from 'vs/platform/progress/common/progress';
import { Registry } from 'vs/platform/registry/common/platform';
export const DISCONNECT_COMMAND_ID = 'dataExplorer.disconnect';
export const MANAGE_COMMAND_ID = 'dataExplorer.manage';
@@ -25,7 +26,7 @@ CommandsRegistry.registerCommand({
if (args.$treeItem) {
const oeService = accessor.get(IOEShimService);
return oeService.disconnectNode(args.$treeViewId, args.$treeItem).then(() => {
const { treeView } = (<ICustomViewDescriptor>ViewsRegistry.getView(args.$treeViewId));
const { treeView } = (<ICustomViewDescriptor>Registry.as<IViewsRegistry>(Extensions.ViewsRegistry).getView(args.$treeViewId));
// we need to collapse it then refresh it so that the tree doesn't try and use it's cache next time the user expands the node
return treeView.collapse(args.$treeItem).then(() => treeView.refresh([args.$treeItem]).then(() => true));
});
@@ -83,7 +84,7 @@ CommandsRegistry.registerCommand({
handler: (accessor, args: TreeViewItemHandleArg) => {
const progressSerivce = accessor.get(IProgressService2);
if (args.$treeItem) {
const { treeView } = (<ICustomViewDescriptor>ViewsRegistry.getView(args.$treeViewId));
const { treeView } = (<ICustomViewDescriptor>Registry.as<IViewsRegistry>(Extensions.ViewsRegistry).getView(args.$treeViewId));
if (args.$treeContainerId) {
return progressSerivce.withProgress({ location: args.$treeContainerId }, () => treeView.refresh([args.$treeItem]).then(() => true));
} else {

View File

@@ -12,15 +12,15 @@ import * as TelemetryKeys from 'sql/common/telemetryKeys';
import { attachButtonStyler, attachModalDialogStyler } from 'sql/platform/theme/common/styler';
import { Builder } from 'sql/base/browser/builder';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { IPartService, Parts } from 'vs/workbench/services/part/common/partService';
import { Event, Emitter } from 'vs/base/common/event';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
import { localize } from 'vs/nls';
import { IDisposable, toDisposable } from 'vs/base/common/lifecycle';
import { WebviewElement } from 'vs/workbench/parts/webview/electron-browser/webviewElement';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { WebviewElement } from 'vs/workbench/contrib/webview/electron-browser/webviewElement';
import { IWorkbenchLayoutService, Parts } from 'vs/workbench/services/layout/browser/layoutService';
export class WebViewDialog extends Modal {
@@ -42,12 +42,12 @@ export class WebViewDialog extends Modal {
constructor(
@IThemeService themeService: IThemeService,
@IClipboardService clipboardService: IClipboardService,
@IPartService private _webViewPartService: IPartService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@ITelemetryService telemetryService: ITelemetryService,
@IContextKeyService contextKeyService: IContextKeyService,
@IInstantiationService private _instantiationService: IInstantiationService
) {
super('', TelemetryKeys.WebView, _webViewPartService, telemetryService, clipboardService, themeService, contextKeyService, { isFlyout: false, hasTitleIcon: true });
super('', TelemetryKeys.WebView, telemetryService, layoutService, clipboardService, themeService, contextKeyService, { isFlyout: false, hasTitleIcon: true });
this._okLabel = localize('webViewDialog.ok', 'OK');
this._closeLabel = localize('webViewDialog.close', 'Close');
}
@@ -89,9 +89,9 @@ export class WebViewDialog extends Modal {
this._body = bodyBuilder.getHTMLElement();
this._webview = this._instantiationService.createInstance(WebviewElement,
this._webViewPartService.getContainer(Parts.EDITOR_PART),
this.layoutService.getContainer(Parts.EDITOR_PART),
{},
{
enableWrappedPostMessage: true,
allowScripts: true
});
@@ -166,4 +166,4 @@ export class WebViewDialog extends Modal {
element.dispose();
});
}
}
}

View File

@@ -16,11 +16,11 @@ import { IConnectionProviderRegistry, Extensions as ConnectionProviderExtensions
import * as TaskUtilities from 'sql/workbench/common/taskUtilities';
import { IObjectExplorerService } from 'sql/workbench/services/objectExplorer/common/objectExplorerService';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { warn } from 'sql/base/common/log';
import { ipcRenderer as ipc} from 'electron';
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
export class CommandLineService implements ICommandLineProcessing {
public _serviceBrand: any;
@@ -33,7 +33,7 @@ export class CommandLineService implements ICommandLineProcessing {
@IObjectExplorerService private _objectExplorerService: IObjectExplorerService,
@IEditorService private _editorService: IEditorService,
@ICommandService private _commandService: ICommandService,
@IWorkspaceConfigurationService private _configurationService: IWorkspaceConfigurationService
@IConfigurationService private _configurationService: IConfigurationService
) {
if (ipc) {
ipc.on('ads:processCommandLine', (event: any, args: ParsedArgs) => this.onLaunched(args));
@@ -128,4 +128,4 @@ export class CommandLineService implements ICommandLineProcessing {
profile.setOptionValue('groupId', profile.groupId);
return profile;
}
}
}

View File

@@ -21,17 +21,17 @@ import { Deferred } from 'sql/base/common/promise';
import { IErrorMessageService } from 'sql/platform/errorMessage/common/errorMessageService';
import { IConnectionDialogService } from 'sql/workbench/services/connection/common/connectionDialogService';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import * as platform from 'vs/base/common/platform';
import Severity from 'vs/base/common/severity';
import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration';
import { Action, IAction } from 'vs/base/common/actions';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
import { ICommandService } from 'vs/platform/commands/common/commands';
import * as types from 'vs/base/common/types';
import { trim } from 'vs/base/common/strings';
import { localize } from 'vs/nls';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
export interface IConnectionValidateResult {
isValid: boolean;
@@ -82,11 +82,11 @@ export class ConnectionDialogService implements IConnectionDialogService {
private _connectionManagementService: IConnectionManagementService;
constructor(
@IPartService private _partService: IPartService,
@IWorkbenchLayoutService private layoutService: IWorkbenchLayoutService,
@IInstantiationService private _instantiationService: IInstantiationService,
@ICapabilitiesService private _capabilitiesService: ICapabilitiesService,
@IErrorMessageService private _errorMessageService: IErrorMessageService,
@IWorkspaceConfigurationService private _workspaceConfigurationService: IWorkspaceConfigurationService,
@IConfigurationService private _configurationService: IConfigurationService,
@IClipboardService private _clipboardService: IClipboardService,
@ICommandService private _commandService: ICommandService
) {
@@ -148,8 +148,8 @@ export class ConnectionDialogService implements IConnectionDialogService {
}
}
}
if (!defaultProvider && this._workspaceConfigurationService) {
defaultProvider = WorkbenchUtils.getSqlConfigValue<string>(this._workspaceConfigurationService, Constants.defaultEngine);
if (!defaultProvider && this._configurationService) {
defaultProvider = WorkbenchUtils.getSqlConfigValue<string>(this._configurationService, Constants.defaultEngine);
}
// as a fallback, default to MSSQL if the value from settings is not available
return defaultProvider || Constants.mssqlProviderName;
@@ -398,7 +398,7 @@ export class ConnectionDialogService implements IConnectionDialogService {
private doShowDialog(params: INewConnectionParams): Promise<void> {
if (!this._connectionDialog) {
let container = this._partService.getWorkbenchElement().parentElement;
let container = this.layoutService.getWorkbenchElement().parentElement;
this._container = container;
this._connectionDialog = this._instantiationService.createInstance(ConnectionDialogWidget, this._providerTypes, this._providerNameToDisplayNameMap[this._model.providerName], this._providerNameToDisplayNameMap);
this._connectionDialog.onCancel(() => {

View File

@@ -23,7 +23,6 @@ import { ClearRecentConnectionsAction } from 'sql/parts/connection/common/connec
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { IWorkbenchThemeService, IColorTheme } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { contrastBorder } from 'vs/platform/theme/common/colorRegistry';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { Event, Emitter } from 'vs/base/common/event';
import { Builder, $ } from 'sql/base/browser/builder';
import { ICancelableEvent } from 'vs/base/parts/tree/browser/treeDefaults';
@@ -38,6 +37,7 @@ import * as DOM from 'vs/base/browser/dom';
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
export interface OnShowUIResponse {
selectedProviderType: string;
@@ -92,14 +92,14 @@ export class ConnectionDialogWidget extends Modal {
@IInstantiationService private _instantiationService: IInstantiationService,
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService,
@IWorkbenchThemeService private _workbenchThemeService: IWorkbenchThemeService,
@IPartService _partService: IPartService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@ITelemetryService telemetryService: ITelemetryService,
@IContextKeyService contextKeyService: IContextKeyService,
@IContextMenuService private _contextMenuService: IContextMenuService,
@IContextViewService private _contextViewService: IContextViewService,
@IClipboardService clipboardService: IClipboardService
) {
super(localize('connection', 'Connection'), TelemetryKeys.Connection, _partService, telemetryService, clipboardService, _workbenchThemeService, contextKeyService, { hasSpinner: true, hasErrors: true });
super(localize('connection', 'Connection'), TelemetryKeys.Connection, telemetryService, layoutService, clipboardService, _workbenchThemeService, contextKeyService, { hasSpinner: true, hasErrors: true });
}
/**
@@ -467,4 +467,4 @@ export class ConnectionDialogWidget extends Modal {
public get databaseDropdownExpanded(): boolean {
return this._databaseDropdownExpanded;
}
}
}

View File

@@ -10,7 +10,6 @@ import 'vs/css!./media/newDashboardTabDialog';
import * as DOM from 'vs/base/browser/dom';
import { List } from 'vs/base/browser/ui/list/listWidget';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { Event, Emitter } from 'vs/base/common/event';
import { localize } from 'vs/nls';
import { IThemeService } from 'vs/platform/theme/common/themeService';
@@ -29,6 +28,7 @@ import { NewDashboardTabViewModel, IDashboardUITab } from 'sql/workbench/service
import { IDashboardTab } from 'sql/platform/dashboard/common/dashboardRegistry';
import { IClipboardService } from 'sql/platform/clipboard/common/clipboardService';
import { Orientation } from 'vs/base/browser/ui/sash/sash';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
class ExtensionListDelegate implements IListVirtualDelegate<IDashboardUITab> {
@@ -113,7 +113,7 @@ export class NewDashboardTabDialog extends Modal {
public get onCancel(): Event<void> { return this._onCancel.event; }
constructor(
@IPartService partService: IPartService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@IThemeService themeService: IThemeService,
@ITelemetryService telemetryService: ITelemetryService,
@IContextKeyService contextKeyService: IContextKeyService,
@@ -122,8 +122,8 @@ export class NewDashboardTabDialog extends Modal {
super(
localize('newDashboardTab.openDashboardExtensions', 'Open dashboard extensions'),
TelemetryKeys.AddNewDashboardTab,
partService,
telemetryService,
layoutService,
clipboardService,
themeService,
contextKeyService,

View File

@@ -15,13 +15,13 @@ import { Builder } from 'sql/base/browser/builder';
import Severity from 'vs/base/common/severity';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { SIDE_BAR_BACKGROUND, SIDE_BAR_FOREGROUND } from 'vs/workbench/common/theme';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { Event, Emitter } from 'vs/base/common/event';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
import { localize } from 'vs/nls';
import { IAction } from 'vs/base/common/actions';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
const maxActions = 1;
@@ -44,11 +44,11 @@ export class ErrorMessageDialog extends Modal {
constructor(
@IThemeService themeService: IThemeService,
@IClipboardService clipboardService: IClipboardService,
@IPartService partService: IPartService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@ITelemetryService telemetryService: ITelemetryService,
@IContextKeyService contextKeyService: IContextKeyService
) {
super('', TelemetryKeys.ErrorMessage, partService, telemetryService, clipboardService, themeService, contextKeyService, { isFlyout: false, hasTitleIcon: true });
super('', TelemetryKeys.ErrorMessage, telemetryService, layoutService, clipboardService, themeService, contextKeyService, { isFlyout: false, hasTitleIcon: true });
this._okLabel = localize('errorMessageDialog.ok', 'OK');
this._closeLabel = localize('errorMessageDialog.close', 'Close');
}
@@ -175,4 +175,4 @@ export class ErrorMessageDialog extends Modal {
public dispose(): void {
}
}
}

View File

@@ -29,10 +29,10 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { attachInputBoxStyler, attachSelectBoxStyler } from 'vs/platform/theme/common/styler';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import * as DOM from 'vs/base/browser/dom';
import * as strings from 'vs/base/common/strings';
import { IClipboardService } from 'sql/platform/clipboard/common/clipboardService';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
export class FileBrowserDialog extends Modal {
private _viewModel: FileBrowserViewModel;
@@ -50,7 +50,7 @@ export class FileBrowserDialog extends Modal {
private _isFolderSelected: boolean;
constructor(title: string,
@IPartService partService: IPartService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@IWorkbenchThemeService private _workbenchthemeService: IWorkbenchThemeService,
@IInstantiationService private _instantiationService: IInstantiationService,
@IContextViewService private _contextViewService: IContextViewService,
@@ -58,7 +58,7 @@ export class FileBrowserDialog extends Modal {
@IContextKeyService contextKeyService: IContextKeyService,
@IClipboardService clipboardService: IClipboardService
) {
super(title, TelemetryKeys.Backup, partService, telemetryService, clipboardService, _workbenchthemeService, contextKeyService, { isFlyout: true, hasTitleIcon: false, hasBackButton: true, hasSpinner: true });
super(title, TelemetryKeys.Backup, telemetryService, layoutService, clipboardService, _workbenchthemeService, contextKeyService, { isFlyout: true, hasTitleIcon: false, hasBackButton: true, hasSpinner: true });
this._viewModel = this._instantiationService.createInstance(FileBrowserViewModel);
this._viewModel.onAddFileTree(args => this.handleOnAddFileTree(args.rootNode, args.selectedNode, args.expandedNodes));
this._viewModel.onPathValidate(args => this.handleOnValidate(args.succeeded, args.message));
@@ -245,4 +245,4 @@ export class FileBrowserDialog extends Modal {
this._treeContainer.style('background-color', this.headerAndFooterBackground);
}
}
}
}

View File

@@ -9,9 +9,9 @@ import { ITree, IRenderer } from 'vs/base/parts/tree/browser/tree';
import { FileKind } from 'vs/platform/files/common/files';
import { URI } from 'vs/base/common/uri';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IFileTemplateData } from 'vs/workbench/parts/files/electron-browser/views/explorerViewer';
import { toDisposable } from 'vs/base/common/lifecycle';
import { ResourceLabels, DEFAULT_LABELS_CONTAINER } from 'vs/workbench/browser/labels';
import { IFileTemplateData } from 'vs/workbench/contrib/files/browser/views/explorerViewer';
const EmptyDisposable = toDisposable(() => null);
@@ -78,4 +78,4 @@ export class FileBrowserRenderer implements IRenderer {
public disposeTemplate(tree: ITree, templateId: string, templateData: IFileTemplateData): void {
templateData.label.dispose();
}
}
}

View File

@@ -23,7 +23,6 @@ import { IClipboardService } from 'sql/platform/clipboard/common/clipboardServic
import { IDisposableDataProvider } from 'sql/base/browser/ui/table/interfaces';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import * as DOM from 'vs/base/browser/dom';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { IThemeService } from 'vs/platform/theme/common/themeService';
@@ -41,6 +40,7 @@ import { SplitView, Orientation, Sizing } from 'vs/base/browser/ui/splitview/spl
import { ViewletPanel, IViewletPanelOptions } from 'vs/workbench/browser/parts/views/panelViewlet';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
const labelDisplay = nls.localize("insights.item", "Item");
const valueDisplay = nls.localize("insights.value", "Value");
@@ -158,7 +158,7 @@ export class InsightsDialogView extends Modal {
private _model: IInsightsDialogModel,
@IInstantiationService private _instantiationService: IInstantiationService,
@IThemeService themeService: IThemeService,
@IPartService partService: IPartService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@IContextMenuService private _contextMenuService: IContextMenuService,
@ITelemetryService telemetryService: ITelemetryService,
@IContextKeyService contextKeyService: IContextKeyService,
@@ -166,7 +166,7 @@ export class InsightsDialogView extends Modal {
@ICapabilitiesService private _capabilitiesService: ICapabilitiesService,
@IClipboardService clipboardService: IClipboardService
) {
super(nls.localize("InsightsDialogTitle", "Insights"), TelemetryKeys.Insights, partService, telemetryService, clipboardService, themeService, contextKeyService);
super(nls.localize("InsightsDialogTitle", "Insights"), TelemetryKeys.Insights, telemetryService, layoutService, clipboardService, themeService, contextKeyService);
this._model.onDataChange(e => this.build());
}

View File

@@ -29,13 +29,14 @@ import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/c
import { NotebookEditorVisibleContext } from 'sql/workbench/services/notebook/common/notebookContext';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { NotebookEditor } from 'sql/parts/notebook/notebookEditor';
import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { registerNotebookThemes } from 'sql/parts/notebook/notebookStyles';
import { IQueryManagementService } from 'sql/platform/query/common/queryManagement';
import { ILanguageMagic, notebookConstants } from 'sql/parts/notebook/models/modelInterfaces';
import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle';
import { SqlNotebookProvider } from 'sql/workbench/services/notebook/sql/sqlNotebookProvider';
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
import { keys } from 'vs/base/common/map';
export interface NotebookProviderProperties {
provider: string;
@@ -271,7 +272,7 @@ export class NotebookService extends Disposable implements INotebookService {
}
getSupportedFileExtensions(): string[] {
return Array.from(this._fileToProviders.keys());
return Array.from(keys(this._fileToProviders));
}
getProvidersForFileType(fileType: string): string[] {

View File

@@ -21,6 +21,7 @@ import { warn, error } from 'sql/base/common/log';
import { ServerTreeView } from 'sql/parts/objectExplorer/viewlet/serverTreeView';
import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService';
import * as Utils from 'sql/platform/connection/common/utils';
import { entries } from 'sql/base/common/objects';
export const SERVICE_ID = 'ObjectExplorerService';
@@ -490,7 +491,7 @@ export class ObjectExplorerService implements IObjectExplorerService {
// Complete any requests that are still open for the session
let sessionStatus = this._sessions[session.sessionId];
if (sessionStatus && sessionStatus.nodes) {
Object.entries(sessionStatus.nodes).forEach(([nodePath, nodeStatus]: [string, NodeStatus]) => {
entries(sessionStatus.nodes).forEach(([nodePath, nodeStatus]: [string, NodeStatus]) => {
if (nodeStatus.expandEmitter) {
nodeStatus.expandEmitter.fire({
sessionId: session.sessionId,
@@ -800,4 +801,4 @@ export class ObjectExplorerService implements IObjectExplorerService {
}
return currentNode;
}
}
}

View File

@@ -7,7 +7,6 @@ import { QueryResultsInput } from 'sql/parts/query/common/queryResultsInput';
import { QueryInput } from 'sql/parts/query/common/queryInput';
import { EditDataInput } from 'sql/parts/editData/common/editDataInput';
import { IConnectableInput, IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
import { IEditorGroupsService, IEditorGroup } from 'vs/workbench/services/group/common/editorGroupsService';
import { IQueryEditorService, IQueryEditorOptions } from 'sql/workbench/services/queryEditor/common/queryEditorService';
import { QueryPlanInput } from 'sql/parts/queryPlan/queryPlanInput';
import { sqlModeId, untitledFilePrefix, getSupportedInputResource } from 'sql/parts/common/customInputConverter';
@@ -18,11 +17,10 @@ import { ITextModel } from 'vs/editor/common/model';
import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
import { IEditorService, ACTIVE_GROUP } from 'vs/workbench/services/editor/common/editorService';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { FileEditorInput } from 'vs/workbench/parts/files/common/editors/fileEditorInput';
import Severity from 'vs/base/common/severity';
import nls = require('vs/nls');
import { URI } from 'vs/base/common/uri';
import paths = require('vs/base/common/paths');
import paths = require('vs/base/common/extpath');
import { isLinux } from 'vs/base/common/platform';
import { Schemas } from 'vs/base/common/network';
import { INotificationService } from 'vs/platform/notification/common/notification';
@@ -31,6 +29,8 @@ import { IEditorInput, IEditor } from 'vs/workbench/common/editor';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { ILanguageSelection } from 'vs/editor/common/services/modeService';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService';
import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput';
const fs = require('fs');

View File

@@ -7,13 +7,13 @@
import nls = require('vs/nls');
import { Action } from 'vs/base/common/actions';
import pkg from 'vs/platform/node/package';
import product from 'vs/platform/node/product';
import pkg from 'vs/platform/product/node/package';
import product from 'vs/platform/product/node/product';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { URI } from 'vs/base/common/uri';
import { IOpenerService } from 'vs/platform/opener/common/opener';
import { AbstractShowReleaseNotesAction } from 'vs/workbench/parts/update/electron-browser/update';
import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions';
import { AbstractShowReleaseNotesAction } from 'vs/workbench/contrib/update/electron-browser/update';
export class OpenGettingStartedInBrowserAction extends Action {