Renable Strict TSLint (#5018)

* removes more builder references

* remove builder from profiler

* formatting

* fix profiler dailog

* remove builder from oatuhdialog

* remove the rest of builder references

* formatting

* add more strict null checks to base

* enable strict tslint rules

* fix formatting

* fix compile error

* fix the rest of the hygeny issues and add pipeline step

* fix pipeline files
This commit is contained in:
Anthony Dresser
2019-04-18 00:34:53 -07:00
committed by GitHub
parent b852f032d3
commit ddd89fc52a
431 changed files with 3147 additions and 3789 deletions

View File

@@ -2,7 +2,6 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { nb, IConnectionProfile } from 'azdata';
import * as vsExtTypes from 'vs/workbench/api/common/extHostTypes';
@@ -555,12 +554,12 @@ export enum SchemaUpdateAction {
Add = 2
}
export enum SchemaDifferenceType {
export enum SchemaDifferenceType {
Object = 0,
Property = 1
}
export enum SchemaCompareEndpointType {
export enum SchemaCompareEndpointType {
database = 0,
dacpac = 1
}

View File

@@ -1,9 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { SqlMainContext, MainThreadDashboardShape, ExtHostDashboardShape, SqlExtHostContext } from 'sql/workbench/api/node/sqlExtHost.protocol';
import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
@@ -15,14 +14,14 @@ export class MainThreadDashboard implements MainThreadDashboardShape {
constructor(
context: IExtHostContext,
@IDashboardService private _dashboardService: IDashboardService
@IDashboardService dashboardService: IDashboardService
) {
this._proxy = context.getProxy(SqlExtHostContext.ExtHostDashboard);
_dashboardService.onDidChangeToDashboard(e => {
dashboardService.onDidChangeToDashboard(e => {
this._proxy.$onDidChangeToDashboard(e);
});
_dashboardService.onDidOpenDashboard(e => {
dashboardService.onDidOpenDashboard(e => {
this._proxy.$onDidOpenDashboard(e);
});
}

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import { Disposable } from 'vs/workbench/api/common/extHostTypes';
import {
@@ -143,7 +141,7 @@ export class ExtHostAccountManagement extends ExtHostAccountManagementShape {
/**
* This method is for testing only, it is not exposed via the shape.
* @return {number} Number of providers that are currently registered
* @return Number of providers that are currently registered
*/
public getProviderCount(): number {
return Object.keys(this._providers).length;

View File

@@ -2,7 +2,6 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import { SqlMainContext, MainThreadCredentialManagementShape, ExtHostCredentialManagementShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
@@ -93,7 +92,7 @@ export class ExtHostCredentialManagement extends ExtHostCredentialManagementShap
/**
* Helper method for tests. Not exposed via shape.
* @return {number} Number of providers registered
* @return Number of providers registered
*/
public getProviderCount(): number {
return Object.keys(this._adapter).length;

View File

@@ -358,11 +358,11 @@ export class ExtHostDataProtocol extends ExtHostDataProtocolShape {
}
public $expandObjectExplorerNode(handle: number, nodeInfo: azdata.ExpandNodeInfo): Thenable<boolean> {
return this._resolveProvider<azdata.ObjectExplorerProviderBase> (handle).expandNode(nodeInfo);
return this._resolveProvider<azdata.ObjectExplorerProviderBase>(handle).expandNode(nodeInfo);
}
public $refreshObjectExplorerNode(handle: number, nodeInfo: azdata.ExpandNodeInfo): Thenable<boolean> {
return this._resolveProvider<azdata.ObjectExplorerProviderBase> (handle).refreshNode(nodeInfo);
return this._resolveProvider<azdata.ObjectExplorerProviderBase>(handle).refreshNode(nodeInfo);
}
public $closeObjectExplorerSession(handle: number, closeSessionInfo: azdata.ObjectExplorerCloseSessionInfo): Thenable<azdata.ObjectExplorerCloseSessionResponse> {

View File

@@ -99,15 +99,15 @@ export class ExtHostTreeView<T> extends vsTreeExt.ExtHostTreeView<T> {
console.error(`No tree item with id \'${parentHandle}\' found.`);
}
this._onNodeCheckedChanged.fire({element: parentElement, checked: checked});
this._onNodeCheckedChanged.fire({ element: parentElement, checked: checked });
}
onNodeSelectedChanged(parentHandles?: vsTreeExt.TreeItemHandle[]): void {
if (parentHandles) {
let nodes = parentHandles.map(parentHandle => {
return parentHandle ? this.getExtensionElement(parentHandle) : void 0;
return parentHandle ? this.getExtensionElement(parentHandle) : void 0;
});
this._onChangeSelection.fire({ selection: nodes});
this._onChangeSelection.fire({ selection: nodes });
}
}

View File

@@ -2,7 +2,6 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
@@ -99,7 +98,7 @@ export class ExtHostNotebook implements ExtHostNotebookShape {
};
return details;
} catch (error) {
throw typeof(error) === 'string' ? new Error(error) : error;
throw typeof (error) === 'string' ? new Error(error) : error;
}
});
}
@@ -231,7 +230,7 @@ export class ExtHostNotebook implements ExtHostNotebookShape {
}
private findManagerForUri(uriString: string): NotebookManagerAdapter {
for(let manager of this.getAdapters(NotebookManagerAdapter)) {
for (let manager of this.getAdapters(NotebookManagerAdapter)) {
if (manager.uriString === uriString) {
return manager;
}
@@ -279,7 +278,7 @@ export class ExtHostNotebook implements ExtHostNotebookShape {
let value = await callback(manager);
return value;
} catch (error) {
throw typeof(error) === 'string' ? new Error(error) : error;
throw typeof (error) === 'string' ? new Error(error) : error;
}
}

View File

@@ -2,7 +2,6 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
@@ -91,7 +90,7 @@ export class ExtHostNotebookDocumentData implements IDisposable {
}
private _validateIndex(index: number): number {
if (typeof(index) !== 'number') {
if (typeof (index) !== 'number') {
throw new Error('Invalid argument');
}

View File

@@ -2,7 +2,6 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
@@ -70,7 +69,7 @@ export class NotebookEditorEdit {
private getAsRange(location: number | CellRange): CellRange {
let range: CellRange = null;
if (typeof (location) === 'number') {
range = new CellRange(location, location+1);
range = new CellRange(location, location + 1);
}
else if (location instanceof CellRange) {
range = location;
@@ -81,7 +80,7 @@ export class NotebookEditorEdit {
return range;
}
insertCell(value: Partial<azdata.nb.ICellContents>, location?: number): void {
insertCell(value: Partial<azdata.nb.ICellContents>, location?: number): void {
if (location === null || location === undefined) {
// If not specified, assume adding to end of list
location = this._document.cells.length;
@@ -92,11 +91,11 @@ export class NotebookEditorEdit {
deleteCell(index: number): void {
let range: CellRange = null;
if (typeof(index) === 'number') {
if (typeof (index) === 'number') {
// Currently only allowing single-cell deletion.
// Do this by saying the range extends over 1 cell so on the main thread
// we can delete that cell, then handle insertions
range = new CellRange(index, index+1);
range = new CellRange(index, index + 1);
} else {
throw new Error('Unrecognized index');
}
@@ -104,7 +103,7 @@ export class NotebookEditorEdit {
this._pushEdit(range, null, true);
}
private _pushEdit(range: azdata.nb.CellRange, cell: Partial<azdata.nb.ICellContents>, forceMoveMarkers: boolean): void {
private _pushEdit(range: azdata.nb.CellRange, cell: Partial<azdata.nb.ICellContents>, forceMoveMarkers: boolean): void {
let validRange = this._document.validateCellRange(range);
this._collectedEdits.push({
range: validRange,

View File

@@ -2,7 +2,6 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import { ExtHostQueryEditorShape, SqlMainContext, MainThreadQueryEditorShape } from 'sql/workbench/api/node/sqlExtHost.protocol';
@@ -31,7 +30,7 @@ class ExtHostQueryDocument implements azdata.queryeditor.QueryDocument {
}
}
export class ExtHostQueryEditor implements ExtHostQueryEditorShape {
export class ExtHostQueryEditor implements ExtHostQueryEditorShape {
private _proxy: MainThreadQueryEditorShape;
private _nextListenerHandle: number = 0;
@@ -57,7 +56,7 @@ export class ExtHostQueryEditor implements ExtHostQueryEditorShape {
this._nextListenerHandle++;
}
public $onQueryEvent(handle: number, fileUri:string, event: IQueryEvent): void {
public $onQueryEvent(handle: number, fileUri: string, event: IQueryEvent): void {
let listener: azdata.queryeditor.QueryEventListener = this._queryListeners[handle];
if (listener) {
let planXml = event.params ? event.params.planXml : undefined;

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import { Disposable } from 'vs/workbench/api/common/extHostTypes';
@@ -64,7 +62,7 @@ export class ExtHostResourceProvider extends ExtHostResourceProviderShape {
/**
* This method is for testing only, it is not exposed via the shape.
* @return {number} Number of providers that are currently registered
* @return Number of providers that are currently registered
*/
public getProviderCount(): number {
return Object.keys(this._providers).length;

View File

@@ -2,7 +2,6 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import {
@@ -255,7 +254,7 @@ export class MainThreadDataProtocol implements MainThreadDataProtocolShape {
public $registerObjectExplorerNodeProvider(providerId: string, supportedProviderId: string, group: string, handle: number): Promise<any> {
const self = this;
this._objectExplorerService.registerNodeProvider(<azdata.ObjectExplorerNodeProvider> {
this._objectExplorerService.registerNodeProvider(<azdata.ObjectExplorerNodeProvider>{
supportedProviderId: supportedProviderId,
providerId: providerId,
group: group,

View File

@@ -2,7 +2,6 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import {
createMainContextProxyIdentifier as createMainId,
@@ -18,7 +17,7 @@ import * as vscode from 'vscode';
import { ITreeComponentItem } from 'sql/workbench/common/views';
import { ITaskHandlerDescription } from 'sql/platform/tasks/common/tasks';
import {
IItemConfig, ModelComponentTypes, IComponentShape, IModelViewDialogDetails, IModelViewTabDetails, IModelViewButtonDetails,
IItemConfig, IComponentShape, IModelViewDialogDetails, IModelViewTabDetails, IModelViewButtonDetails,
IModelViewWizardDetails, IModelViewWizardPageDetails, INotebookManagerDetails, INotebookSessionDetails, INotebookKernelDetails, INotebookFutureDetails, FutureMessageType, INotebookFutureDone, ISingleNotebookEditOperation
} from 'sql/workbench/api/common/sqlExtHostTypes';
import { EditorViewColumn } from 'vs/workbench/api/common/shared/editor';
@@ -460,7 +459,7 @@ export abstract class ExtHostDataProtocolShape {
*/
$schemaCompare(handle: number, sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, targetEndpointInfo: azdata.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.SchemaCompareResult> { throw ni(); }
/**
/**
* Schema compare generate script
*/
$schemaCompareGenerateScript(handle: number, operationId: string, targetDatabaseName: string, scriptFilePath: string, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.ResultStatus> { throw ni(); }
@@ -768,7 +767,7 @@ export interface MainThreadModelViewDialogShape extends IDisposable {
$setDirty(handle: number, isDirty: boolean): void;
}
export interface ExtHostQueryEditorShape {
$onQueryEvent(handle: number, fileUri:string, event: IQueryEvent): void;
$onQueryEvent(handle: number, fileUri: string, event: IQueryEvent): void;
}
export interface MainThreadQueryEditorShape extends IDisposable {
@@ -782,9 +781,7 @@ export interface ExtHostNotebookShape {
/**
* Looks up a notebook manager for a given notebook URI
* @param {number} providerHandle
* @param {vscode.Uri} notebookUri
* @returns {Thenable<string>} handle of the manager to be used when sending
* @returns handle of the manager to be used when sending
*/
$getNotebookManager(providerHandle: number, notebookUri: UriComponents): Thenable<INotebookManagerDetails>;
$handleNotebookClosed(notebookUri: UriComponents): void;
@@ -887,4 +884,4 @@ export interface ExtHostExtensionManagementShape {
export interface MainThreadExtensionManagementShape extends IDisposable {
$install(vsixPath: string): Thenable<string>;
}
}

View File

@@ -3,7 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { SelectBox } from 'sql/base/browser/ui/selectBox/selectBox';
import { Button } from 'sql/base/browser/ui/button/button';
import { append, $, addClass, addClasses } from 'vs/base/browser/dom';
@@ -51,7 +50,7 @@ export function getBooleanValueFromStringOrBoolean(value: any): boolean {
}
export function getCategoryDisplayName(categories: azdata.CategoryValue[], categoryName: string) {
var displayName: string;
let displayName: string;
categories.forEach(c => {
if (c.name === categoryName) {
displayName = c.displayName;
@@ -61,7 +60,7 @@ export function getCategoryDisplayName(categories: azdata.CategoryValue[], categ
}
export function getCategoryName(categories: azdata.CategoryValue[], categoryDisplayName: string) {
var categoryName: string;
let categoryName: string;
categories.forEach(c => {
if (c.displayName === categoryDisplayName) {
categoryName = c.name;

View File

@@ -136,7 +136,6 @@ export abstract class Modal extends Disposable implements IThemable {
* Constructor for modal
* @param _title Title of the modal, if undefined, the title section is not rendered
* @param _name Name of the modal, used for telemetry
* @param _partService
* @param options Modal options
*/
constructor(
@@ -474,7 +473,6 @@ export abstract class Modal extends Disposable implements IThemable {
/**
* Set the title of the modal
* @param title
*/
protected set title(title: string) {
if (this._title !== undefined) {
@@ -488,7 +486,6 @@ export abstract class Modal extends Disposable implements IThemable {
/**
* Set the icon title class name
* @param iconClassName
*/
protected set titleIconClassName(iconClassName: string) {
if (this._modalTitleIcon) {

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as DialogHelper from './dialogHelper';
import { SelectBox } from 'sql/base/browser/ui/selectBox/selectBox';
import { MessageType } from 'vs/base/browser/ui/inputbox/inputBox';
@@ -69,7 +67,7 @@ export function createOptionElement(option: azdata.ServiceOption, rowContainer:
}
export function getOptionValueAndCategoryValues(option: azdata.ServiceOption, options: { [optionName: string]: any }, possibleInputs: string[]): any {
var optionValue = option.defaultValue;
let optionValue = option.defaultValue;
if (options[option.name]) {
// if the value type is boolean, the option value can be either boolean or string
if (option.valueType === ServiceOptionType.boolean) {
@@ -106,10 +104,10 @@ export function getOptionValueAndCategoryValues(option: azdata.ServiceOption, op
export function validateInputs(optionsMap: { [optionName: string]: IOptionElement }): boolean {
let isValid = true;
let isFocused = false;
for (var optionName in optionsMap) {
var optionElement: IOptionElement = optionsMap[optionName];
var widget = optionElement.optionWidget;
var isInputBox = (optionElement.option.valueType === ServiceOptionType.string ||
for (let optionName in optionsMap) {
let optionElement: IOptionElement = optionsMap[optionName];
let widget = optionElement.optionWidget;
let isInputBox = (optionElement.option.valueType === ServiceOptionType.string ||
optionElement.option.valueType === ServiceOptionType.password ||
optionElement.option.valueType === ServiceOptionType.number);
@@ -127,8 +125,8 @@ export function validateInputs(optionsMap: { [optionName: string]: IOptionElemen
}
export function updateOptions(options: { [optionName: string]: any }, optionsMap: { [optionName: string]: IOptionElement }): void {
for (var optionName in optionsMap) {
var optionElement: IOptionElement = optionsMap[optionName];
for (let optionName in optionsMap) {
let optionElement: IOptionElement = optionsMap[optionName];
if (optionElement.optionWidget.value !== options[optionName]) {
if (!optionElement.optionWidget.value && options[optionName]) {
delete options[optionName];
@@ -149,9 +147,9 @@ export let trueInputValue: string = 'True';
export let falseInputValue: string = 'False';
export function findElement(container: HTMLElement, className: string): HTMLElement {
var elementBuilder = container;
let elementBuilder = container;
while (elementBuilder) {
var htmlElement = elementBuilder;
let htmlElement = elementBuilder;
if (htmlElement.className.startsWith(className)) {
break;
}
@@ -161,9 +159,9 @@ export function findElement(container: HTMLElement, className: string): HTMLElem
}
export function groupOptionsByCategory(options: azdata.ServiceOption[]): { [category: string]: azdata.ServiceOption[] } {
var connectionOptionsMap: { [category: string]: azdata.ServiceOption[] } = {};
let connectionOptionsMap: { [category: string]: azdata.ServiceOption[] } = {};
options.forEach(option => {
var groupName = option.groupName;
let groupName = option.groupName;
if (groupName === null || groupName === undefined) {
groupName = 'General';
}

View File

@@ -13,11 +13,6 @@ import { IEditorInput } from 'vs/workbench/common/editor';
/**
* Gets the 'sql' configuration section for use in looking up settings. Note that configs under
* 'mssql' or other sections are not available from this.
*
* @export
* @param {IWorkspaceConfigurationService} workspaceConfigService
* @param {string} sectionName
* @returns {*}
*/
export function getSqlConfigSection(workspaceConfigService: IConfigurationService, sectionName: string): any {
let config = workspaceConfigService.getValue(ConnectionConstants.sqlConfigSectionName);

View File

@@ -309,9 +309,6 @@ export function openInsight(query: IInsightsConfig, profile: IConnectionProfile,
* is focused or there is no such editor, in which case it comes from the OE selection. Returns
* undefined when there is no such connection.
*
* @param objectExplorerService
* @param connectionManagementService
* @param workbenchEditorService
* @param topLevelOnly If true, only return top-level (i.e. connected) Object Explorer connections instead of database connections when appropriate
*/
export function getCurrentGlobalConnection(objectExplorerService: IObjectExplorerService, connectionManagementService: IConnectionManagementService, workbenchEditorService: IEditorService, topLevelOnly: boolean = false): IConnectionProfile {

View File

@@ -25,7 +25,7 @@ export class AdvancedPropertiesController {
public showDialog(providerOptions: azdata.ConnectionOption[], container: HTMLElement, options: { [name: string]: any }): void {
this._options = options;
var serviceOptions = providerOptions.map(option => AdvancedPropertiesController.connectionOptionToServiceOption(option));
let serviceOptions = providerOptions.map(option => AdvancedPropertiesController.connectionOptionToServiceOption(option));
this.advancedDialog.open(serviceOptions, this._options);
}

View File

@@ -109,7 +109,7 @@ export class RecentConnectionTreeController extends DefaultController {
}
public showContextMenu(tree: ITree, element: any, event: any): boolean {
var actionContext: any;
let actionContext: any;
if (element instanceof ConnectionProfile) {
actionContext = new RecentConnectionsActionsContext();

View File

@@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Directive, ViewContainerRef, Inject, forwardRef } from '@angular/core';
@@ -9,5 +9,5 @@ import { Directive, ViewContainerRef, Inject, forwardRef } from '@angular/core';
selector: '[component-host]',
})
export class ComponentHostDirective {
constructor( @Inject(forwardRef(() => ViewContainerRef)) public viewContainerRef: ViewContainerRef) { }
constructor(@Inject(forwardRef(() => ViewContainerRef)) public viewContainerRef: ViewContainerRef) { }
}

View File

@@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'vs/css!./dashboardControlHostContainer';

View File

@@ -3,7 +3,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
dashboard-controlhost-container {
dashboard-controlhost-container {
height: 100%;
width : 100%;
display: block;

View File

@@ -3,7 +3,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
dashboard-home-tab {
dashboard-home-tab {
height: 100%;
width: 100%;
display: block;

View File

@@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'vs/css!./dashboardWebviewContainer';

View File

@@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'vs/css!./dashboardWebviewContainer';

View File

@@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'vs/css!./controlHostContent';

View File

@@ -3,7 +3,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
controlhost-content {
controlhost-content {
height: 100%;
width : 100%;
display: block;

View File

@@ -197,11 +197,6 @@ export class DashboardWidgetWrapper extends AngularDisposable implements OnInit
/**
* Attempts to get the selector for a given key, and if none is defined tries
* to load it from the widget registry and configure as needed
*
* @private
* @param {string} key
* @returns {Type<IDashboardWidget>}
* @memberof DashboardWidgetWrapper
*/
private getOrCreateSelector(key: string): Type<IDashboardWidget> {
let selector = componentMap[key];

View File

@@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'vs/css!./webviewContent';

View File

@@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'vs/css!./dashboard';

View File

@@ -293,7 +293,7 @@ function isValidData(data: IInsightData): boolean {
Chart.pluginService.register({
beforeDraw: function (chart) {
if (chart.config.options.viewArea && chart.config.options.viewArea.backgroundColor) {
var ctx = chart.chart.ctx;
let ctx = chart.chart.ctx;
ctx.fillStyle = chart.config.options.viewArea.backgroundColor;
ctx.fillRect(0, 0, chart.chart.width, chart.chart.height);
}

View File

@@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { ProviderProperties } from './propertiesWidget.component';
import * as nls from 'vs/nls';

View File

@@ -1,4 +1,3 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.

View File

@@ -1,71 +1,76 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.fullsize {
height: 100%;
width: 100%;
height: 100%;
width: 100%;
}
/* vertical box styles */
.vertBox {
display: flex;
flex-flow: column;
display: flex;
flex-flow: column;
}
.vertBox .boxRow.header {
flex: 0 0 auto;
flex: 0 0 auto;
}
.vertBox .boxRow.content {
flex: 1 1 0;
flex: 1 1 0;
}
.edgesPadding {
padding-left: 10px;
padding-right: 10px;
padding-top: 10px;
padding-left: 10px;
padding-right: 10px;
padding-top: 10px;
}
.messagesTopSpacing {
height: 5px;
height: 5px;
}
.results {
flex: 100 1 0;
flex: 100 1 0;
}
.scrollable {
overflow: auto;
overflow: auto;
}
.maxHeight {
max-height: fit-content;
max-height: fit-content;
}
.minHeight {
min-height: fit-content;
min-height: fit-content;
}
/* horizontal box style */
.horzBox {
display: flex;
flex-flow: row;
display: flex;
flex-flow: row;
}
.horzBox .boxCol.content {
flex: 1 1 1%;
overflow: auto;
max-width: fit-content;
flex: 1 1 1%;
overflow: auto;
max-width: fit-content;
}
.hidden {
display: none !important;
display: none !important;
}
/* testing
.vertBox {
border: 1px solid green;
border: 1px solid green;
}
.horzBox {
border: 1px solid red;
border: 1px solid red;
}
*/

View File

@@ -7,7 +7,7 @@
<div class="fullsize vertBox editdata-component">
<div id="results" *ngIf="renderedDataSets.length > 0" class="results vertBox scrollable"
(onScroll)="onScroll($event)" [class.hidden]="!resultActive">
(onScroll)="onScroll($event)" [class.hidden]="!resultActive">
<div class="boxRow content horzBox slickgrid editable" *ngFor="let dataSet of renderedDataSets; let i = index"
[style.max-height]="dataSet.maxHeight" [style.min-height]="dataSet.minHeight">
<slick-grid #slickgrid id="slickgrid_{{i}}" [columnDefinitions]="dataSet.columnDefinitions"

View File

@@ -370,7 +370,7 @@ export abstract class GridParentComponent {
}
protected _keybindingFor(action: IAction): ResolvedKeybinding {
var [kb] = this.keybindingService.lookupKeybindings(action.id);
let [kb] = this.keybindingService.lookupKeybindings(action.id);
return kb;
}
@@ -407,8 +407,6 @@ export abstract class GridParentComponent {
/**
* Returns a function that selects all elements of a grid. This needs to
* return a function in order to capture the scope for this component
* @private
* @returns {(gridIndex: number) => void}
*
* @memberOf QueryComponent
*/
@@ -559,11 +557,6 @@ export abstract class GridParentComponent {
* Called by keyEvent method to give child classes a chance to
* handle key events.
*
* @protected
* @abstract
* @param {StandardKeyboardEvent} e
* @returns {boolean}
*
* @memberOf GridParentComponent
*/
protected abstract tryHandleKeyEvent(e: StandardKeyboardEvent): boolean;

View File

@@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { ElementRef } from '@angular/core';
@@ -19,7 +19,7 @@ import { ToggleMoreWidgetAction } from 'sql/workbench/parts/dashboard/common/act
import { CellTypes, CellType } from 'sql/workbench/parts/notebook/models/contracts';
import { CellModel } from 'sql/workbench/parts/notebook/models/cell';
export const HIDDEN_CLASS ='actionhidden';
export const HIDDEN_CLASS = 'actionhidden';
export class CellToggleMoreActions {
private _actions: CellActionBase[] = [];
@@ -29,7 +29,7 @@ export class CellToggleMoreActions {
@IInstantiationService private instantiationService: IInstantiationService) {
this._actions.push(
instantiationService.createInstance(DeleteCellAction, 'delete', localize('delete', 'Delete')),
instantiationService.createInstance(AddCellFromContextAction,'codeBefore', localize('codeBefore', 'Insert Code before'), CellTypes.Code, false),
instantiationService.createInstance(AddCellFromContextAction, 'codeBefore', localize('codeBefore', 'Insert Code before'), CellTypes.Code, false),
instantiationService.createInstance(AddCellFromContextAction, 'codeAfter', localize('codeAfter', 'Insert Code after'), CellTypes.Code, true),
instantiationService.createInstance(AddCellFromContextAction, 'markdownBefore', localize('markdownBefore', 'Insert Text before'), CellTypes.Markdown, false),
instantiationService.createInstance(AddCellFromContextAction, 'markdownAfter', localize('markdownAfter', 'Insert Text after'), CellTypes.Markdown, true),
@@ -38,7 +38,7 @@ export class CellToggleMoreActions {
}
public onInit(elementRef: ElementRef, model: NotebookModel, cellModel: ICellModel) {
let context = new CellContext(model,cellModel);
let context = new CellContext(model, cellModel);
this._moreActionsElement = <HTMLElement>elementRef.nativeElement;
if (this._moreActionsElement.childNodes.length > 0) {
this._moreActionsElement.removeChild(this._moreActionsElement.childNodes[0]);

View File

@@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'vs/css!./code';
import { OnInit, Component, Input, Inject, ElementRef, ViewChild, Output, EventEmitter, OnChanges, SimpleChange, forwardRef, ChangeDetectorRef } from '@angular/core';
@@ -160,7 +160,7 @@ export class CodeComponent extends AngularDisposable implements OnInit, OnChange
&& this.cellModel.cellUri;
}
private get destroyed(): boolean{
private get destroyed(): boolean {
return !!(this._changeRef['destroyed']);
}

View File

@@ -1,9 +1,7 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { nb } from 'azdata';
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Action } from 'vs/base/common/actions';
import { localize } from 'vs/nls';
@@ -15,12 +13,12 @@ import { NotebookModel } from 'sql/workbench/parts/notebook/models/notebookModel
import { getErrorMessage } from 'sql/workbench/parts/notebook/notebookUtils';
import { ICellModel, CellExecutionState } from 'sql/workbench/parts/notebook/models/modelInterfaces';
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
import { MultiStateAction, IMultiStateData, IActionStateData } from 'sql/workbench/parts/notebook/notebookActions';
import { MultiStateAction, IMultiStateData } from 'sql/workbench/parts/notebook/notebookActions';
let notebookMoreActionMsg = localize('notebook.failed', "Please select active cell and try again");
const emptyExecutionCountLabel = '[ ]';
function hasModelAndCell(context: CellContext, notificationService: INotificationService): boolean {
function hasModelAndCell(context: CellContext, notificationService: INotificationService): boolean {
if (!context || !context.model) {
return false;
}
@@ -71,11 +69,11 @@ export class RunCellAction extends MultiStateAction<CellExecutionState> {
constructor(context: CellContext, @INotificationService private notificationService: INotificationService,
@IConnectionManagementService private connectionManagementService: IConnectionManagementService) {
super(RunCellAction.ID, new IMultiStateData<CellExecutionState>([
{ key: CellExecutionState.Hidden, value: { label: emptyExecutionCountLabel, className: '', tooltip: '', hideIcon: true }},
{ key: CellExecutionState.Stopped, value: { label: '', className: 'toolbarIconRun', tooltip: localize('runCell', 'Run cell') }},
{ key: CellExecutionState.Running, value: { label: '', className: 'toolbarIconStop', tooltip: localize('stopCell', 'Cancel execution') }},
{ key: CellExecutionState.Error, value: { label: '', className: 'toolbarIconRunError', tooltip: localize('errorRunCell', 'Error on last run. Click to run again') }},
], CellExecutionState.Hidden ));
{ key: CellExecutionState.Hidden, value: { label: emptyExecutionCountLabel, className: '', tooltip: '', hideIcon: true } },
{ key: CellExecutionState.Stopped, value: { label: '', className: 'toolbarIconRun', tooltip: localize('runCell', 'Run cell') } },
{ key: CellExecutionState.Running, value: { label: '', className: 'toolbarIconStop', tooltip: localize('stopCell', 'Cancel execution') } },
{ key: CellExecutionState.Error, value: { label: '', className: 'toolbarIconRunError', tooltip: localize('errorRunCell', 'Error on last run. Click to run again') } },
], CellExecutionState.Hidden));
this.ensureContextIsUpdated(context);
}

View File

@@ -1,9 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { OnInit, Component, Input, Inject, forwardRef, ElementRef, ChangeDetectorRef, OnDestroy, ViewChild, SimpleChange, OnChanges, AfterViewInit } from '@angular/core';
import { OnInit, Component, Input, Inject, forwardRef, ChangeDetectorRef, SimpleChange, OnChanges } from '@angular/core';
import { CellView } from 'sql/workbench/parts/notebook/cellViews/interfaces';
import { ICellModel } from 'sql/workbench/parts/notebook/models/modelInterfaces';
import { NotebookModel } from 'sql/workbench/parts/notebook/models/notebookModel';

View File

@@ -8,126 +8,126 @@
|----------------------------------------------------------------------------*/
output-component .jp-RenderedText {
text-align: left;
padding-left: var(--jp-code-padding);
font-size: var(--jp-code-font-size);
line-height: var(--jp-code-line-height);
font-family: var(--jp-code-font-family);
text-align: left;
padding-left: var(--jp-code-padding);
font-size: var(--jp-code-font-size);
line-height: var(--jp-code-line-height);
font-family: var(--jp-code-font-family);
}
output-component .jp-RenderedText pre,
.jp-RenderedJavaScript pre,
output-component .jp-RenderedHTMLCommon pre {
color: var(--jp-content-font-color1);
border: none;
margin: 0px;
padding: 0px;
color: var(--jp-content-font-color1);
border: none;
margin: 0px;
padding: 0px;
}
/* ansi_up creates classed spans for console foregrounds and backgrounds. */
output-component .jp-RenderedText pre .ansi-black-fg {
color: #3e424d;
color: #3e424d;
}
output-component .jp-RenderedText pre .ansi-red-fg {
color: #e75c58;
color: #e75c58;
}
output-component .jp-RenderedText pre .ansi-green-fg {
color: #00a250;
color: #00a250;
}
output-component .jp-RenderedText pre .ansi-yellow-fg {
color: #ddb62b;
color: #ddb62b;
}
output-component .jp-RenderedText pre .ansi-blue-fg {
color: #208ffb;
color: #208ffb;
}
output-component .jp-RenderedText pre .ansi-magenta-fg {
color: #d160c4;
color: #d160c4;
}
output-component .jp-RenderedText pre .ansi-cyan-fg {
color: #60c6c8;
color: #60c6c8;
}
output-component .jp-RenderedText pre .ansi-white-fg {
color: #c5c1b4;
color: #c5c1b4;
}
output-component .jp-RenderedText pre .ansi-black-bg {
background-color: #3e424d;
background-color: #3e424d;
}
output-component .jp-RenderedText pre .ansi-red-bg {
background-color: #e75c58;
background-color: #e75c58;
}
output-component .jp-RenderedText pre .ansi-green-bg {
background-color: #00a250;
background-color: #00a250;
}
output-component .jp-RenderedText pre .ansi-yellow-bg {
background-color: #ddb62b;
background-color: #ddb62b;
}
output-component .jp-RenderedText pre .ansi-blue-bg {
background-color: #208ffb;
background-color: #208ffb;
}
output-component .jp-RenderedText pre .ansi-magenta-bg {
background-color: #d160c4;
background-color: #d160c4;
}
output-component .jp-RenderedText pre .ansi-cyan-bg {
background-color: #60c6c8;
background-color: #60c6c8;
}
output-component .jp-RenderedText pre .ansi-white-bg {
background-color: #c5c1b4;
background-color: #c5c1b4;
}
output-component .jp-RenderedText pre .ansi-bright-black-fg {
color: #282c36;
color: #282c36;
}
output-component .jp-RenderedText pre .ansi-bright-red-fg {
color: #b22b31;
color: #b22b31;
}
output-component .jp-RenderedText pre .ansi-bright-green-fg {
color: #007427;
color: #007427;
}
output-component .jp-RenderedText pre .ansi-bright-yellow-fg {
color: #b27d12;
color: #b27d12;
}
output-component .jp-RenderedText pre .ansi-bright-blue-fg {
color: #0065ca;
color: #0065ca;
}
output-component .jp-RenderedText pre .ansi-bright-magenta-fg {
color: #a03196;
color: #a03196;
}
output-component .jp-RenderedText pre .ansi-bright-cyan-fg {
color: #258f8f;
color: #258f8f;
}
output-component .jp-RenderedText pre .ansi-bright-white-fg {
color: #a1a6b2;
color: #a1a6b2;
}
output-component .jp-RenderedText pre .ansi-bright-black-bg {
background-color: #282c36;
background-color: #282c36;
}
output-component .jp-RenderedText pre .ansi-bright-red-bg {
background-color: #b22b31;
background-color: #b22b31;
}
output-component .jp-RenderedText pre .ansi-bright-green-bg {
background-color: #007427;
background-color: #007427;
}
output-component .jp-RenderedText pre .ansi-bright-yellow-bg {
background-color: #b27d12;
background-color: #b27d12;
}
output-component .jp-RenderedText pre .ansi-bright-blue-bg {
background-color: #0065ca;
background-color: #0065ca;
}
output-component .jp-RenderedText pre .ansi-bright-magenta-bg {
background-color: #a03196;
background-color: #a03196;
}
output-component .jp-RenderedText pre .ansi-bright-cyan-bg {
background-color: #258f8f;
background-color: #258f8f;
}
output-component .jp-RenderedText pre .ansi-bright-white-bg {
background-color: #a1a6b2;
background-color: #a1a6b2;
}
output-component .jp-RenderedText[data-mime-type='application/vnd.jupyter.stderr'] {
background: var(--jp-rendermime-error-background);
padding-top: var(--jp-code-padding);
background: var(--jp-rendermime-error-background);
padding-top: var(--jp-code-padding);
}
/*-----------------------------------------------------------------------------
@@ -135,14 +135,14 @@ output-component .jp-RenderedText[data-mime-type='application/vnd.jupyter.stderr
|----------------------------------------------------------------------------*/
.jp-RenderedLatex {
color: var(--jp-content-font-color1);
font-size: var(--jp-content-font-size1);
line-height: var(--jp-content-line-height);
color: var(--jp-content-font-color1);
font-size: var(--jp-content-font-size1);
line-height: var(--jp-content-line-height);
}
/* Left-justify outputs.*/
.jp-OutputArea-output.jp-RenderedLatex {
text-align: left;
text-align: left;
}
/*-----------------------------------------------------------------------------
@@ -150,36 +150,36 @@ output-component .jp-RenderedText[data-mime-type='application/vnd.jupyter.stderr
|----------------------------------------------------------------------------*/
output-component .jp-RenderedHTMLCommon {
color: var(--jp-content-font-color1);
font-family: var(--jp-content-font-family);
font-size: var(--jp-content-font-size1);
line-height: var(--jp-content-line-height);
/* Give a bit more R padding on Markdown text to keep line lengths reasonable */
padding-right: 20px;
color: var(--jp-content-font-color1);
font-family: var(--jp-content-font-family);
font-size: var(--jp-content-font-size1);
line-height: var(--jp-content-line-height);
/* Give a bit more R padding on Markdown text to keep line lengths reasonable */
padding-right: 20px;
}
output-component .jp-RenderedHTMLCommon em {
font-style: italic;
font-style: italic;
}
output-component .jp-RenderedHTMLCommon strong {
font-weight: bold;
font-weight: bold;
}
output-component .jp-RenderedHTMLCommon u {
text-decoration: underline;
text-decoration: underline;
}
output-component .jp-RenderedHTMLCommon a:link {
text-decoration: none;
text-decoration: none;
}
output-component .jp-RenderedHTMLCommon a:hover {
text-decoration: underline;
text-decoration: underline;
}
output-component .jp-RenderedHTMLCommon a:visited {
text-decoration: none;
text-decoration: none;
}
/* Headings */
@@ -190,11 +190,11 @@ output-component .jp-RenderedHTMLCommon h3,
output-component .jp-RenderedHTMLCommon h4,
output-component .jp-RenderedHTMLCommon h5,
output-component .jp-RenderedHTMLCommon h6 {
line-height: var(--jp-content-heading-line-height);
font-weight: var(--jp-content-heading-font-weight);
font-style: normal;
margin: var(--jp-content-heading-margin-top) 0
var(--jp-content-heading-margin-bottom) 0;
line-height: var(--jp-content-heading-line-height);
font-weight: var(--jp-content-heading-font-weight);
font-style: normal;
margin: var(--jp-content-heading-margin-top) 0
var(--jp-content-heading-margin-bottom) 0;
}
output-component .jp-RenderedHTMLCommon h1:first-child,
@@ -203,7 +203,7 @@ output-component .jp-RenderedHTMLCommon h3:first-child,
output-component .jp-RenderedHTMLCommon h4:first-child,
output-component .jp-RenderedHTMLCommon h5:first-child,
output-component .jp-RenderedHTMLCommon h6:first-child {
margin-top: calc(0.5 * var(--jp-content-heading-margin-top));
margin-top: calc(0.5 * var(--jp-content-heading-margin-top));
}
output-component .jp-RenderedHTMLCommon h1:last-child,
@@ -212,194 +212,194 @@ output-component .jp-RenderedHTMLCommon h3:last-child,
output-component .jp-RenderedHTMLCommon h4:last-child,
output-component .jp-RenderedHTMLCommon h5:last-child,
output-component .jp-RenderedHTMLCommon h6:last-child {
margin-bottom: calc(0.5 * var(--jp-content-heading-margin-bottom));
margin-bottom: calc(0.5 * var(--jp-content-heading-margin-bottom));
}
output-component .jp-RenderedHTMLCommon h1 {
font-size: var(--jp-content-font-size5);
font-size: var(--jp-content-font-size5);
}
output-component .jp-RenderedHTMLCommon h2 {
font-size: var(--jp-content-font-size4);
font-size: var(--jp-content-font-size4);
}
output-component .jp-RenderedHTMLCommon h3 {
font-size: var(--jp-content-font-size3);
font-size: var(--jp-content-font-size3);
}
output-component .jp-RenderedHTMLCommon h4 {
font-size: var(--jp-content-font-size2);
font-size: var(--jp-content-font-size2);
}
output-component .jp-RenderedHTMLCommon h5 {
font-size: var(--jp-content-font-size1);
font-size: var(--jp-content-font-size1);
}
output-component .jp-RenderedHTMLCommon h6 {
font-size: var(--jp-content-font-size0);
font-size: var(--jp-content-font-size0);
}
/* Lists */
output-component .jp-RenderedHTMLCommon ul:not(.list-inline),
output-component .jp-RenderedHTMLCommon ol:not(.list-inline) {
padding-left: 2em;
padding-left: 2em;
}
output-component .jp-RenderedHTMLCommon ul {
list-style: disc;
list-style: disc;
}
output-component .jp-RenderedHTMLCommon ul ul {
list-style: square;
list-style: square;
}
output-component .jp-RenderedHTMLCommon ul ul ul {
list-style: circle;
list-style: circle;
}
output-component .jp-RenderedHTMLCommon ol {
list-style: decimal;
list-style: decimal;
}
output-component .jp-RenderedHTMLCommon ol ol {
list-style: upper-alpha;
list-style: upper-alpha;
}
output-component .jp-RenderedHTMLCommon ol ol ol {
list-style: lower-alpha;
list-style: lower-alpha;
}
output-component .jp-RenderedHTMLCommon ol ol ol ol {
list-style: lower-roman;
list-style: lower-roman;
}
output-component .jp-RenderedHTMLCommon ol ol ol ol ol {
list-style: decimal;
list-style: decimal;
}
output-component .jp-RenderedHTMLCommon ol,
output-component .jp-RenderedHTMLCommon ul {
margin-bottom: 1em;
margin-bottom: 1em;
}
output-component .jp-RenderedHTMLCommon ul ul,
output-component .jp-RenderedHTMLCommon ul ol,
output-component .jp-RenderedHTMLCommon ol ul,
output-component .jp-RenderedHTMLCommon ol ol {
margin-bottom: 0em;
margin-bottom: 0em;
}
output-component .jp-RenderedHTMLCommon hr {
color: var(--jp-border-color2);
background-color: var(--jp-border-color1);
margin-top: 1em;
margin-bottom: 1em;
color: var(--jp-border-color2);
background-color: var(--jp-border-color1);
margin-top: 1em;
margin-bottom: 1em;
}
output-component .jp-RenderedHTMLCommon > pre {
margin: 1.5em 2em;
margin: 1.5em 2em;
}
output-component .jp-RenderedHTMLCommon pre,
output-component .jp-RenderedHTMLCommon code {
border: 0;
background-color: var(--jp-layout-color0);
color: var(--jp-content-font-color1);
font-family: var(--jp-code-font-family);
font-size: inherit;
line-height: var(--jp-code-line-height);
padding: 0;
border: 0;
background-color: var(--jp-layout-color0);
color: var(--jp-content-font-color1);
font-family: var(--jp-code-font-family);
font-size: inherit;
line-height: var(--jp-code-line-height);
padding: 0;
}
output-component .jp-RenderedHTMLCommon p > code {
background-color: var(--jp-layout-color2);
padding: 1px 5px;
background-color: var(--jp-layout-color2);
padding: 1px 5px;
}
/* Tables */
output-component .jp-RenderedHTMLCommon table {
border-collapse: collapse;
border-spacing: 0;
border: none;
color: var(--jp-ui-font-color1);
font-size: 12px;
table-layout: auto;
margin-left: auto;
margin-right: auto;
border-collapse: collapse;
border-spacing: 0;
border: none;
color: var(--jp-ui-font-color1);
font-size: 12px;
table-layout: auto;
margin-left: auto;
margin-right: auto;
}
output-component .jp-RenderedHTMLCommon thead {
border-bottom: var(--jp-border-width) solid var(--jp-border-color1);
vertical-align: bottom;
border-bottom: var(--jp-border-width) solid var(--jp-border-color1);
vertical-align: bottom;
}
output-component .jp-RenderedHTMLCommon td,
output-component .jp-RenderedHTMLCommon th,
output-component .jp-RenderedHTMLCommon tr {
text-align: left;
vertical-align: middle;
padding: 0.5em 0.5em;
line-height: normal;
white-space: normal;
max-width: none;
border: none;
text-align: left;
vertical-align: middle;
padding: 0.5em 0.5em;
line-height: normal;
white-space: normal;
max-width: none;
border: none;
}
.jp-RenderedMarkdown.jp-RenderedHTMLCommon td,
.jp-RenderedMarkdown.jp-RenderedHTMLCommon th {
max-width: none;
max-width: none;
}
output-component th {
font-weight: bold;
font-weight: bold;
}
output-component .jp-RenderedHTMLCommon tbody tr:nth-child(odd) {
background: var(--jp-layout-color0);
background: var(--jp-layout-color0);
}
output-component .jp-RenderedHTMLCommon tbody tr:nth-child(even) {
background: var(--jp-rendermime-table-row-background);
background: var(--jp-rendermime-table-row-background);
}
output-component .jp-RenderedHTMLCommon tbody tr:hover {
background: var(--jp-rendermime-table-row-hover-background);
background: var(--jp-rendermime-table-row-hover-background);
}
output-component .jp-RenderedHTMLCommon table {
margin-bottom: 1em;
display: table-row;
margin-bottom: 1em;
display: table-row;
}
output-component .jp-RenderedHTMLCommon p {
text-align: left;
margin: 0px;
text-align: left;
margin: 0px;
}
output-component .jp-RenderedHTMLCommon p {
margin-bottom: 1em;
margin-bottom: 1em;
}
output-component .jp-RenderedHTMLCommon img {
-moz-force-broken-image-icon: 1;
-moz-force-broken-image-icon: 1;
}
/* Restrict to direct children as other images could be nested in other content. */
output-component .jp-RenderedHTMLCommon > img {
display: block;
margin-left: auto;
margin-right: auto;
margin-bottom: 1em;
display: block;
margin-left: auto;
margin-right: auto;
margin-bottom: 1em;
}
/* Change color behind transparent images if they need it... */
[data-theme-light='false'] .jp-RenderedImage img.jp-needs-light-background {
background-color: var(--jp-inverse-layout-color1);
background-color: var(--jp-inverse-layout-color1);
}
[data-theme-light='true'] .jp-RenderedImage img.jp-needs-dark-background {
background-color: var(--jp-inverse-layout-color1);
background-color: var(--jp-inverse-layout-color1);
}
/* ...or leave it untouched if they don't */
[data-theme-light='false'] .jp-RenderedImage img.jp-needs-dark-background {
@@ -411,31 +411,31 @@ output-component .jp-RenderedHTMLCommon img,
.jp-RenderedImage img,
output-component .jp-RenderedHTMLCommon svg,
.jp-RenderedSVG svg {
max-width: 100%;
height: auto;
max-width: 100%;
height: auto;
}
output-component .jp-RenderedHTMLCommon img.jp-mod-unconfined,
.jp-RenderedImage img.jp-mod-unconfined,
output-component .jp-RenderedHTMLCommon svg.jp-mod-unconfined,
.jp-RenderedSVG svg.jp-mod-unconfined {
max-width: none;
max-width: none;
}
output-component .jp-RenderedHTMLCommon .alert {
margin-bottom: 1em;
margin-bottom: 1em;
}
output-component .jp-RenderedHTMLCommon blockquote {
margin: 1em 2em;
padding: 0 1em;
border-left: 5px solid var(--jp-border-color2);
margin: 1em 2em;
padding: 0 1em;
border-left: 5px solid var(--jp-border-color2);
}
a.jp-InternalAnchorLink {
visibility: hidden;
margin-left: 8px;
color: var(--md-blue-800);
visibility: hidden;
margin-left: 8px;
color: var(--md-blue-800);
}
h1:hover .jp-InternalAnchorLink,
@@ -444,7 +444,7 @@ h3:hover .jp-InternalAnchorLink,
h4:hover .jp-InternalAnchorLink,
h5:hover .jp-InternalAnchorLink,
h6:hover .jp-InternalAnchorLink {
visibility: visible;
visibility: visible;
}
/* Most direct children of .jp-RenderedHTMLCommon have a margin-bottom of 1.0.
@@ -453,7 +453,7 @@ h6:hover .jp-InternalAnchorLink {
* code cells.
*/
output-component .jp-RenderedHTMLCommon > *:last-child {
margin-bottom: 0.5em;
margin-bottom: 0.5em;
}
/*-----------------------------------------------------------------------------
@@ -461,5 +461,5 @@ output-component .jp-RenderedHTMLCommon > *:last-child {
|----------------------------------------------------------------------------*/
.jp-RenderedPDF {
font-size: var(--jp-ui-font-size1);
font-size: var(--jp-ui-font-size1);
}

View File

@@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'vs/css!./code';
import 'vs/css!./media/output';
@@ -17,7 +17,7 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
import * as DOM from 'vs/base/browser/dom';
export const OUTPUT_SELECTOR: string = 'output-component';
const USER_SELECT_CLASS ='actionselect';
const USER_SELECT_CLASS = 'actionselect';
@Component({
selector: OUTPUT_SELECTOR,

View File

@@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'vs/css!./code';
import 'vs/css!./outputArea';
import { OnInit, Component, Input, Inject, ElementRef, ViewChild, forwardRef, ChangeDetectorRef } from '@angular/core';

View File

@@ -18,5 +18,5 @@ output-area-component .notebook-output {
.output-userselect pre{
white-space: pre-wrap;
word-wrap: break-word;
}
word-wrap: break-word;
}

View File

@@ -3,7 +3,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
placeholder-cell-component {
placeholder-cell-component {
height: 50px;
width: 100%;
display: block;
@@ -12,7 +12,7 @@
placeholder-cell-component .text {
display: flex;
align-items: center;
align-items: center;
justify-content: center;
height: 50px;
-webkit-margin-before: 0em;

View File

@@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'vs/css!./placeholder';
import { OnInit, Component, Input, Inject, forwardRef, ElementRef, ChangeDetectorRef, OnDestroy, ViewChild, SimpleChange, OnChanges } from '@angular/core';
@@ -49,7 +49,7 @@ export class PlaceholderCellComponent extends CellView implements OnInit, OnChan
}
get clickOn(): string {
return localize('clickOn','Click on');
return localize('clickOn', 'Click on');
}
get plusCode(): string {

View File

@@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'vs/css!./textCell';
import { OnInit, Component, Input, Inject, forwardRef, ElementRef, ChangeDetectorRef, OnDestroy, ViewChild, OnChanges, SimpleChange } from '@angular/core';
@@ -25,7 +25,7 @@ import { NotebookModel } from 'sql/workbench/parts/notebook/models/notebookModel
import { CellToggleMoreActions } from 'sql/workbench/parts/notebook/cellToggleMoreActions';
export const TEXT_SELECTOR: string = 'text-cell-component';
const USER_SELECT_CLASS ='actionselect';
const USER_SELECT_CLASS = 'actionselect';
@Component({
selector: TEXT_SELECTOR,
@@ -165,7 +165,7 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges {
// If the asset is in the same folder or a subfolder, replace 'vscode-resource:' with 'file:', so the image is visible
if (!path.relative(path.dirname(this.cellModel.notebookModel.notebookUri.fsPath), filePath).includes('..')) {
// ok to change from vscode-resource: to file:
htmlContent = htmlContent.replace('vscode-resource:'+ filePath, 'file:' + filePath);
htmlContent = htmlContent.replace('vscode-resource:' + filePath, 'file:' + filePath);
}
htmlContentCopy = htmlContentCopy.slice(pathEndIndex);
}
@@ -190,7 +190,7 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges {
}
public toggleEditMode(editMode?: boolean): void {
this.isEditMode = editMode !== undefined? editMode : !this.isEditMode;
this.isEditMode = editMode !== undefined ? editMode : !this.isEditMode;
this.updateMoreActions();
this.updatePreview();
this._changeRef.detectChanges();

View File

@@ -1,11 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { nb, ServerInfo } from 'azdata';
import { Event, Emitter } from 'vs/base/common/event';

View File

@@ -1,16 +1,13 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { ICellMagicMapper, ILanguageMagic } from 'sql/workbench/parts/notebook/models/modelInterfaces';
const defaultKernel = '*';
export class CellMagicMapper implements ICellMagicMapper {
private kernelToMagicMap = new Map<string,ILanguageMagic[]>();
private kernelToMagicMap = new Map<string, ILanguageMagic[]>();
constructor(languageMagics: ILanguageMagic[]) {
if (languageMagics) {

View File

@@ -1,13 +1,10 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// This code is based on @jupyterlab/packages/apputils/src/clientsession.tsx
'use strict';
import { nb } from 'azdata';
import { URI } from 'vs/base/common/uri';
import { Event, Emitter } from 'vs/base/common/event';
@@ -274,7 +271,6 @@ export class ClientSession implements IClientSession {
/**
* Helper method to either call ChangeKernel on current session, or start a new session
* @param options
*/
private async doChangeKernel(options: nb.IKernelSpec): Promise<nb.IKernel> {
let kernel: nb.IKernel;

View File

@@ -1,10 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
export type CellType = 'code' | 'markdown' | 'raw';

View File

@@ -1,13 +1,10 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// This code is based on @jupyterlab/packages/apputils/src/clientsession.tsx
'use strict';
import { nb } from 'azdata';
import { Event } from 'vs/base/common/event';
import { IDisposable } from 'vs/base/common/lifecycle';
@@ -417,9 +414,6 @@ export interface NotebookContentChange {
cellIndex?: number;
/**
* Optional value indicating if the notebook is in a dirty or clean state after this change
*
* @type {boolean}
* @memberof NotebookContentChange
*/
isDirty?: boolean;
}

View File

@@ -1,11 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { localize } from 'vs/nls';
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
@@ -22,7 +19,6 @@ export namespace constants {
* Long term this should be refactored to an extension contribution
*
* @export
* @class NotebookConnection
*/
export class NotebookConnection {
private _host: string;

View File

@@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { OnInit, Component, Inject, forwardRef, ElementRef, ChangeDetectorRef, ViewChild, OnDestroy } from '@angular/core';
@@ -185,7 +185,9 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
cell.trustedMode = isTrusted;
});
//Updates dirty state
this._notebookParams.input && this._notebookParams.input.updateModel();
if (this._notebookParams.input) {
this._notebookParams.input.updateModel();
}
this.detectChanges();
}

View File

@@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';

View File

@@ -1,11 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
export namespace nbversion {
/**
* The major version of the notebook format.

View File

@@ -252,11 +252,11 @@ export class NotebookInput extends EditorInput {
return this.resource;
}
public get untitledEditorModel() : UntitledEditorModel {
public get untitledEditorModel(): UntitledEditorModel {
return this._untitledEditorModel;
}
public set untitledEditorModel(value : UntitledEditorModel) {
public set untitledEditorModel(value: UntitledEditorModel) {
this._untitledEditorModel = value;
}

View File

@@ -41,7 +41,7 @@ export class MimeModel implements IRenderMime.IMimeModel {
}
get themeService(): IThemeService {
return this._themeService;
return this._themeService;
}
/**

View File

@@ -90,11 +90,11 @@ export namespace URLExt {
return (
'?' +
keys
.map(key => {
const content = encodeURIComponent(String(value[key]));
return key + (content ? '=' + content : '');
})
.join('&')
.map(key => {
const content = encodeURIComponent(String(value[key]));
return key + (content ? '=' + content : '');
})
.join('&')
);
}

View File

@@ -13,7 +13,7 @@ export const htmlRendererFactory: IRenderMime.IRendererFactory = {
safe: true,
mimeTypes: ['text/html'],
defaultRank: 50,
createRenderer: options => new widgets.RenderedHTML(options)
createRenderer: options => new widgets.RenderedHTML(options)
};
/**

View File

@@ -1,4 +1,3 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

View File

@@ -41,7 +41,7 @@ export class RefreshAction extends Action {
this._tree = tree;
}
public run(): Promise<boolean> {
var treeNode: TreeNode;
let treeNode: TreeNode;
if (this.element instanceof ConnectionProfile) {
let connection: ConnectionProfile = this.element;
if (this._connectionManagementService.isConnected(undefined, connection)) {

View File

@@ -183,10 +183,10 @@ export class OEScriptSelectAction extends ScriptSelectAction {
this._objectExplorerTreeNode = await getTreeNode(actionContext, this._objectExplorerService);
}
this._treeSelectionHandler.onTreeActionStateChange(true);
var connectionProfile = TreeUpdateUtils.getConnectionProfile(this._objectExplorerTreeNode);
var ownerUri = this._connectionManagementService.getConnectionUri(connectionProfile);
let connectionProfile = TreeUpdateUtils.getConnectionProfile(this._objectExplorerTreeNode);
let ownerUri = this._connectionManagementService.getConnectionUri(connectionProfile);
ownerUri = this._connectionManagementService.getFormattedUri(ownerUri, connectionProfile);
var metadata = this._objectExplorerTreeNode.metadata;
let metadata = this._objectExplorerTreeNode.metadata;
return super.run({ profile: connectionProfile, object: metadata }).then((result) => {
this._treeSelectionHandler.onTreeActionStateChange(false);
@@ -218,8 +218,8 @@ export class OEEditDataAction extends EditDataAction {
this._objectExplorerTreeNode = await getTreeNode(actionContext, this._objectExplorerService);
}
this._treeSelectionHandler.onTreeActionStateChange(true);
var connectionProfile = TreeUpdateUtils.getConnectionProfile(<TreeNode>this._objectExplorerTreeNode);
var metadata = (<TreeNode>this._objectExplorerTreeNode).metadata;
let connectionProfile = TreeUpdateUtils.getConnectionProfile(<TreeNode>this._objectExplorerTreeNode);
let metadata = (<TreeNode>this._objectExplorerTreeNode).metadata;
return super.run({ profile: connectionProfile, object: metadata }).then((result) => {
this._treeSelectionHandler.onTreeActionStateChange(false);
@@ -252,9 +252,9 @@ export class OEScriptCreateAction extends ScriptCreateAction {
this._objectExplorerTreeNode = await getTreeNode(actionContext, this._objectExplorerService);
}
this._treeSelectionHandler.onTreeActionStateChange(true);
var connectionProfile = TreeUpdateUtils.getConnectionProfile(<TreeNode>this._objectExplorerTreeNode);
var metadata = (<TreeNode>this._objectExplorerTreeNode).metadata;
var ownerUri = this._connectionManagementService.getConnectionUri(connectionProfile);
let connectionProfile = TreeUpdateUtils.getConnectionProfile(<TreeNode>this._objectExplorerTreeNode);
let metadata = (<TreeNode>this._objectExplorerTreeNode).metadata;
let ownerUri = this._connectionManagementService.getConnectionUri(connectionProfile);
ownerUri = this._connectionManagementService.getFormattedUri(ownerUri, connectionProfile);
return super.run({ profile: connectionProfile, object: metadata }).then((result) => {
@@ -288,9 +288,9 @@ export class OEScriptExecuteAction extends ScriptExecuteAction {
this._objectExplorerTreeNode = await getTreeNode(actionContext, this._objectExplorerService);
}
this._treeSelectionHandler.onTreeActionStateChange(true);
var connectionProfile = TreeUpdateUtils.getConnectionProfile(<TreeNode>this._objectExplorerTreeNode);
var metadata = (<TreeNode>this._objectExplorerTreeNode).metadata;
var ownerUri = this._connectionManagementService.getConnectionUri(connectionProfile);
let connectionProfile = TreeUpdateUtils.getConnectionProfile(<TreeNode>this._objectExplorerTreeNode);
let metadata = (<TreeNode>this._objectExplorerTreeNode).metadata;
let ownerUri = this._connectionManagementService.getConnectionUri(connectionProfile);
ownerUri = this._connectionManagementService.getFormattedUri(ownerUri, connectionProfile);
return super.run({ profile: connectionProfile, object: metadata }).then((result) => {
@@ -324,9 +324,9 @@ export class OEScriptAlterAction extends ScriptAlterAction {
this._objectExplorerTreeNode = await getTreeNode(actionContext, this._objectExplorerService);
}
this._treeSelectionHandler.onTreeActionStateChange(true);
var connectionProfile = TreeUpdateUtils.getConnectionProfile(<TreeNode>this._objectExplorerTreeNode);
var metadata = (<TreeNode>this._objectExplorerTreeNode).metadata;
var ownerUri = this._connectionManagementService.getConnectionUri(connectionProfile);
let connectionProfile = TreeUpdateUtils.getConnectionProfile(<TreeNode>this._objectExplorerTreeNode);
let metadata = (<TreeNode>this._objectExplorerTreeNode).metadata;
let ownerUri = this._connectionManagementService.getConnectionUri(connectionProfile);
ownerUri = this._connectionManagementService.getFormattedUri(ownerUri, connectionProfile);
return super.run({ profile: connectionProfile, object: metadata }).then((result) => {
@@ -360,9 +360,9 @@ export class OEScriptDeleteAction extends ScriptDeleteAction {
this._objectExplorerTreeNode = await getTreeNode(actionContext, this._objectExplorerService);
}
this._treeSelectionHandler.onTreeActionStateChange(true);
var connectionProfile = TreeUpdateUtils.getConnectionProfile(<TreeNode>this._objectExplorerTreeNode);
var metadata = (<TreeNode>this._objectExplorerTreeNode).metadata;
var ownerUri = this._connectionManagementService.getConnectionUri(connectionProfile);
let connectionProfile = TreeUpdateUtils.getConnectionProfile(<TreeNode>this._objectExplorerTreeNode);
let metadata = (<TreeNode>this._objectExplorerTreeNode).metadata;
let ownerUri = this._connectionManagementService.getConnectionUri(connectionProfile);
ownerUri = this._connectionManagementService.getFormattedUri(ownerUri, connectionProfile);
return super.run({ profile: connectionProfile, object: metadata }).then((result) => {
@@ -410,4 +410,3 @@ export class ObjectExplorerActionUtilities {
return scriptMap;
}
}

View File

@@ -68,7 +68,7 @@ export class ServerTreeController extends treedefaults.DefaultController {
tree.setFocus(element);
var actionContext: any;
let actionContext: any;
if (element instanceof TreeNode) {
let context = new ObjectExplorerActionsContext();
context.nodeInfo = element.toNodeInfo();
@@ -103,4 +103,4 @@ export class ServerTreeController extends treedefaults.DefaultController {
return true;
}
}
}

View File

@@ -67,7 +67,7 @@ export class ServerTreeDataSource implements IDataSource {
} else if (element instanceof ConnectionProfileGroup) {
resolve((<ConnectionProfileGroup>element).getChildren());
} else if (element instanceof TreeNode) {
var node = element;
let node = element;
if (node.children) {
resolve(node.children);
} else {

View File

@@ -69,12 +69,6 @@ export class TreeSelectionHandler {
/**
*
* @param connectionManagementService
* @param objectExplorerService
* @param isDoubleClick
* @param isKeyboard
* @param selection
* @param tree
* @param connectionCompleteCallback A function that gets called after a connection is established due to the selection, if needed
*/
private handleTreeItemSelected(connectionManagementService: IConnectionManagementService, objectExplorerService: IObjectExplorerService, isDoubleClick: boolean, isKeyboard: boolean, selection: any[], tree: ITree, connectionCompleteCallback: () => void): void {
@@ -117,4 +111,4 @@ export class TreeSelectionHandler {
tree.toggleExpansion(selection[0]);
}
}
}
}

View File

@@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
import { NodeType, SqlThemeIcon } from 'sql/workbench/parts/objectExplorer/common/nodeType';
@@ -107,7 +107,7 @@ export class TreeNode {
this.nodeStatus = nodeStatus;
}
public getConnectionProfile(): ConnectionProfile {
var currentNode: TreeNode = this;
let currentNode: TreeNode = this;
while (!currentNode.connection && currentNode.parent) {
currentNode = currentNode.parent;
}
@@ -118,7 +118,7 @@ export class TreeNode {
if (this.connection) {
return undefined;
}
var currentNode: TreeNode = this;
let currentNode: TreeNode = this;
while (currentNode.nodeTypeId !== NodeType.Database && currentNode.nodeTypeId !== NodeType.Server && currentNode.parent) {
currentNode = currentNode.parent;
}
@@ -130,7 +130,7 @@ export class TreeNode {
}
public getSession(): azdata.ObjectExplorerSession {
var currentNode: TreeNode = this;
let currentNode: TreeNode = this;
while (!currentNode.session && currentNode.parent) {
currentNode = currentNode.parent;
}
@@ -172,4 +172,4 @@ export class TreeNode {
public setSelected(selected: boolean, clearOtherSelections?: boolean): Thenable<void> {
return this._objectExplorerCallbacks.setNodeSelected(this, selected, clearOtherSelections);
}
}
}

View File

@@ -1,79 +1,85 @@
div.qp-node {
margin: 2px;
padding: 2px;
border: 1px solid;
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
div.qp-node {
margin: 2px;
padding: 2px;
border: 1px solid;
}
div.qp-statement-header {
margin: 2px;
padding: 2px;
font-size: 12px;
line-height: normal;
}
margin: 2px;
padding: 2px;
font-size: 12px;
line-height: normal;
}
div.qp-node,
div.qp-tt {
font-size: 11px;
line-height: normal;
font-size: 11px;
line-height: normal;
}
.qp-node>div {
font-family: Monospace;
text-align: center;
font-family: Monospace;
text-align: center;
}
div[class|='qp-icon'] {
height: 32px;
width: 32px;
margin-left: auto;
margin-right: auto;
background-repeat: no-repeat;
height: 32px;
width: 32px;
margin-left: auto;
margin-right: auto;
background-repeat: no-repeat;
}
.qp-tt {
top: 4em;
left: 2em;
border: 1px solid;
padding: 2px;
width: 30em;
top: 4em;
left: 2em;
border: 1px solid;
padding: 2px;
width: 30em;
}
.qp-tt div,
.qp-tt table {
font-family: Sans-Serif;
text-align: left;
font-family: Sans-Serif;
text-align: left;
}
.qp-tt table {
border-width: 0px;
border-spacing: 0px;
margin-top: 10px;
margin-bottom: 10px;
width: 100%;
border-width: 0px;
border-spacing: 0px;
margin-top: 10px;
margin-bottom: 10px;
width: 100%;
}
.qp-tt td,
.qp-tt th {
font-size: 11px;
border-bottom: solid 1px;
padding: 1px;
font-size: 11px;
border-bottom: solid 1px;
padding: 1px;
}
.qp-tt td {
text-align: right;
padding-left: 10px;
text-align: right;
padding-left: 10px;
}
.qp-tt th {
text-align: left;
text-align: left;
}
.qp-bold,
.qp-tt-header {
font-weight: bold;
font-weight: bold;
}
.qp-tt-header {
text-align: center;
text-align: center;
}
/* Icons */
@@ -165,54 +171,54 @@ div[class|='qp-icon'] {
/* Layout - can't touch this */
.qp-tt {
position: absolute;
z-index: 1;
white-space: normal;
-webkit-transition-delay: 0.5s;
transition-delay: 0.5s;
position: absolute;
z-index: 1;
white-space: normal;
-webkit-transition-delay: 0.5s;
transition-delay: 0.5s;
}
div.qp-node .qp-tt,
.qp-noCssTooltip div.qp-node:hover .qp-tt {
visibility: hidden;
position: absolute;
overflow: hidden;
visibility: hidden;
position: absolute;
overflow: hidden;
}
div.qp-node:hover .qp-tt {
visibility: visible;
visibility: visible;
}
.qp-tt table {
white-space: nowrap;
white-space: nowrap;
}
.qp-node {
position: relative;
white-space: nowrap;
position: relative;
white-space: nowrap;
}
.qp-tr {
display: table;
display: table;
}
.qp-tr>div {
display: table-cell;
padding-left: 15px;
display: table-cell;
padding-left: 15px;
}
.qp-root {
display: table;
position: relative;
position: relative;
}
.qp-root svg {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 0;
background: transparent;
pointer-events: none;
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 0;
background: transparent;
pointer-events: none;
}

View File

@@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'vs/css!./media/qp';

View File

@@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { NgModule, Inject, forwardRef, ApplicationRef, ComponentFactoryResolver, Type } from '@angular/core';
import { APP_BASE_HREF, CommonModule } from '@angular/common';

View File

@@ -43,7 +43,7 @@ export class TaskHistoryActionProvider extends ContributableActionProvider {
* Return actions for history task
*/
public getTaskHistoryActions(tree: ITree, element: TaskNode): IAction[] {
var actions = [];
let actions = [];
// get actions for tasks in progress
if (element.status === TaskStatus.InProgress && element.isCancelable) {

View File

@@ -55,7 +55,7 @@ export class TaskHistoryRenderer implements IRenderer {
const taskTemplate: ITaskHistoryTemplateData = Object.create(null);
taskTemplate.root = dom.append(container, $('.task-group'));
taskTemplate.icon = dom.append(taskTemplate.root, $('img.task-icon'));
var titleContainer = dom.append(taskTemplate.root, $('div.task-details'));
let titleContainer = dom.append(taskTemplate.root, $('div.task-details'));
taskTemplate.title = dom.append(titleContainer, $('div.title'));
taskTemplate.description = dom.append(titleContainer, $('div.description'));
taskTemplate.time = dom.append(titleContainer, $('div.time'));
@@ -147,7 +147,5 @@ export class TaskHistoryRenderer implements IRenderer {
public disposeTemplate(tree: ITree, templateId: string, templateData: any): void {
// no op
// InputBox disposed in wrapUp
}
}

View File

@@ -142,7 +142,7 @@ export class TaskHistoryView {
let isDoubleClick = isMouseOrigin && event.payload.originalEvent && event.payload.originalEvent.detail === 2;
if (isDoubleClick) {
if (task.status === TaskStatus.Failed) {
var err = task.taskName + ': ' + task.message;
let err = task.taskName + ': ' + task.message;
this._errorMessageService.showDialog(Severity.Error, localize('taskError', 'Task error'), err);
}
}

View File

@@ -1,7 +1,7 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { StopWatch } from 'vs/base/common/stopwatch';
import { generateUuid } from 'vs/base/common/uuid';

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import * as platform from 'vs/platform/registry/common/platform';
import * as statusbar from 'vs/workbench/browser/parts/statusbar/statusbar';
@@ -88,7 +86,7 @@ export class AccountManagementService implements IAccountManagementService {
/**
* Called from an account provider (via extension host -> main thread interop) when an
* account's properties have been updated (usually when the account goes stale).
* @param {Account} updatedAccount Account with the updated properties
* @param updatedAccount Account with the updated properties
*/
public accountUpdated(updatedAccount: azdata.Account): Thenable<void> {
let self = this;
@@ -123,8 +121,8 @@ export class AccountManagementService implements IAccountManagementService {
/**
* Asks the requested provider to prompt for an account
* @param {string} providerId ID of the provider to ask to prompt for an account
* @return {Thenable<Account>} Promise to return an account
* @param providerId ID of the provider to ask to prompt for an account
* @return Promise to return an account
*/
public addAccount(providerId: string): Thenable<void> {
let self = this;
@@ -155,8 +153,8 @@ export class AccountManagementService implements IAccountManagementService {
/**
* Asks the requested provider to refresh an account
* @param {Account} account account to refresh
* @return {Thenable<Account>} Promise to return an account
* @param account account to refresh
* @return Promise to return an account
*/
public refreshAccount(account: azdata.Account): Thenable<azdata.Account> {
let self = this;
@@ -187,7 +185,7 @@ export class AccountManagementService implements IAccountManagementService {
/**
* Retrieves metadata of all providers that have been registered
* @returns {Thenable<AccountProviderMetadata[]>} Registered account providers
* @returns Registered account providers
*/
public getAccountProviderMetadata(): Thenable<azdata.AccountProviderMetadata[]> {
return Promise.resolve(Object.values(this._providers).map(provider => provider.metadata));
@@ -195,8 +193,8 @@ export class AccountManagementService implements IAccountManagementService {
/**
* Retrieves the accounts that belong to a specific provider
* @param {string} providerId ID of the provider the returned accounts belong to
* @returns {Thenable<Account[]>} Promise to return a list of accounts
* @param providerId ID of the provider the returned accounts belong to
* @returns Promise to return a list of accounts
*/
public getAccountsForProvider(providerId: string): Thenable<azdata.Account[]> {
let self = this;
@@ -214,9 +212,9 @@ export class AccountManagementService implements IAccountManagementService {
/**
* Generates a security token by asking the account's provider
* @param {Account} account Account to generate security token for
* @param {azdata.AzureResource} resource The resource to get the security token for
* @return {Thenable<{}>} Promise to return the security token
* @param account Account to generate security token for
* @param resource The resource to get the security token for
* @return Promise to return the security token
*/
public getSecurityToken(account: azdata.Account, resource: azdata.AzureResource): Thenable<{}> {
return this.doWithProvider(account.key.providerId, provider => {
@@ -226,8 +224,8 @@ export class AccountManagementService implements IAccountManagementService {
/**
* Removes an account from the account store and clears sensitive data in the provider
* @param {AccountKey} accountKey Key for the account to remove
* @returns {Thenable<void>} Promise with result of account removal, true if account was
* @param accountKey Key for the account to remove
* @returns Promise with result of account removal, true if account was
* removed, false otherwise.
*/
public removeAccount(accountKey: azdata.AccountKey): Thenable<boolean> {
@@ -263,7 +261,7 @@ export class AccountManagementService implements IAccountManagementService {
// UI METHODS //////////////////////////////////////////////////////////
/**
* Opens the account list dialog
* @return {TPromise<any>} Promise that finishes when the account list dialog opens
* @return Promise that finishes when the account list dialog opens
*/
public openAccountListDialog(): Thenable<void> {
let self = this;
@@ -285,7 +283,7 @@ export class AccountManagementService implements IAccountManagementService {
/**
* Begin auto OAuth device code open add account dialog
* @return {TPromise<any>} Promise that finishes when the account list dialog opens
* @return Promise that finishes when the account list dialog opens
*/
public beginAutoOAuthDeviceCode(providerId: string, title: string, message: string, userCode: string, uri: string): Thenable<void> {
let self = this;
@@ -325,8 +323,8 @@ export class AccountManagementService implements IAccountManagementService {
// SERVICE MANAGEMENT METHODS //////////////////////////////////////////
/**
* Called by main thread to register an account provider from extension
* @param {azdata.AccountProviderMetadata} providerMetadata Metadata of the provider that is being registered
* @param {azdata.AccountProvider} provider References to the methods of the provider
* @param providerMetadata Metadata of the provider that is being registered
* @param provider References to the methods of the provider
*/
public registerProvider(providerMetadata: azdata.AccountProviderMetadata, provider: azdata.AccountProvider): Thenable<void> {
let self = this;

View File

@@ -2,10 +2,10 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as azdata from 'azdata';
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
import {ConnectionProfileGroup} from 'sql/platform/connection/common/connectionProfileGroup';
import { ConnectionProfileGroup } from 'sql/platform/connection/common/connectionProfileGroup';
import { equalsIgnoreCase } from 'vs/base/common/strings';
import { ICommandLineProcessing } from 'sql/workbench/services/commandLine/common/commandLine';
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
@@ -20,10 +20,10 @@ import { IObjectExplorerService } from 'sql/workbench/services/objectExplorer/co
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { warn } from 'sql/base/common/log';
import { ipcRenderer as ipc} from 'electron';
import { ipcRenderer as ipc } from 'electron';
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IStatusbarService, StatusbarAlignment } from 'vs/platform/statusbar/common/statusbar';
import { IStatusbarService } from 'vs/platform/statusbar/common/statusbar';
import { localize } from 'vs/nls';
export class CommandLineService implements ICommandLineProcessing {
@@ -32,7 +32,7 @@ export class CommandLineService implements ICommandLineProcessing {
constructor(
@ICapabilitiesService private _capabilitiesService: ICapabilitiesService,
@IConnectionManagementService private _connectionManagementService: IConnectionManagementService,
@IEnvironmentService private _environmentService: IEnvironmentService,
@IEnvironmentService environmentService: IEnvironmentService,
@IQueryEditorService private _queryEditorService: IQueryEditorService,
@IObjectExplorerService private _objectExplorerService: IObjectExplorerService,
@IEditorService private _editorService: IEditorService,
@@ -41,16 +41,15 @@ export class CommandLineService implements ICommandLineProcessing {
@IStatusbarService private _statusBarService: IStatusbarService
) {
if (ipc) {
ipc.on('ads:processCommandLine', (event: any, args: ParsedArgs) => this.onLaunched(args));
ipc.on('ads:processCommandLine', (event: any, args: ParsedArgs) => this.onLaunched(args));
}
// we only get the ipc from main during window reuse
if (_environmentService) {
this.onLaunched(_environmentService.args);
if (environmentService) {
this.onLaunched(environmentService.args);
}
}
private onLaunched(args: ParsedArgs)
{
private onLaunched(args: ParsedArgs) {
const registry = platform.Registry.as<IConnectionProviderRegistry>(ConnectionProviderExtensions.ConnectionProviderContributions);
let sqlProvider = registry.getProperties(Constants.mssqlProviderName);
// We can't connect to object explorer until the MSSQL connection provider is registered
@@ -81,7 +80,7 @@ export class CommandLineService implements ICommandLineProcessing {
if (args.server) {
profile = this.readProfileFromArgs(args);
}
}
}
let showConnectDialogOnStartup: boolean = this._configurationService.getValue('workbench.showConnectDialogOnStartup');
if (showConnectDialogOnStartup && !commandName && !profile && !this._connectionManagementService.hasRegisteredServers()) {
// prompt the user for a new connection on startup if no profiles are registered
@@ -90,9 +89,8 @@ export class CommandLineService implements ICommandLineProcessing {
}
let connectedContext: azdata.ConnectedContext = undefined;
if (profile) {
if (this._statusBarService)
{
this._statusBarService.setStatusMessage(localize('connectingLabel','Connecting:') + profile.serverName, 2500);
if (this._statusBarService) {
this._statusBarService.setStatusMessage(localize('connectingLabel', 'Connecting:') + profile.serverName, 2500);
}
try {
await this._connectionManagementService.connectIfNotConnected(profile, 'connection', true);
@@ -105,15 +103,13 @@ export class CommandLineService implements ICommandLineProcessing {
}
}
if (commandName) {
if (this._statusBarService)
{
this._statusBarService.setStatusMessage(localize('runningCommandLabel','Running command:') + commandName, 2500);
if (this._statusBarService) {
this._statusBarService.setStatusMessage(localize('runningCommandLabel', 'Running command:') + commandName, 2500);
}
await this._commandService.executeCommand(commandName, connectedContext);
} else if (profile) {
if (this._statusBarService)
{
this._statusBarService.setStatusMessage(localize('openingNewQueryLabel','Opening new query:') + profile.serverName, 2500);
if (this._statusBarService) {
this._statusBarService.setStatusMessage(localize('openingNewQueryLabel', 'Opening new query:') + profile.serverName, 2500);
}
// Default to showing new query
try {
@@ -146,29 +142,26 @@ export class CommandLineService implements ICommandLineProcessing {
return this._connectionManagementService ? this.tryMatchSavedProfile(profile) : profile;
}
private tryMatchSavedProfile(profile: ConnectionProfile)
{
private tryMatchSavedProfile(profile: ConnectionProfile) {
let match: ConnectionProfile = undefined;
// If we can find a saved mssql provider connection that matches the args, use it
let groups = this._connectionManagementService.getConnectionGroups([Constants.mssqlProviderName]);
if (groups && groups.length > 0)
{
if (groups && groups.length > 0) {
let rootGroup = groups[0];
let connections = ConnectionProfileGroup.getConnectionsInGroup(rootGroup);
match = connections.find((c) => this.matchProfile(profile, c)) ;
match = connections.find((c) => this.matchProfile(profile, c));
}
return match ? match : profile;
}
// determines if the 2 profiles are a functional match
// profile1 is the profile generated from command line parameters
private matchProfile(profile1: ConnectionProfile, profile2: ConnectionProfile): boolean
{
return equalsIgnoreCase(profile1.serverName,profile2.serverName)
&& equalsIgnoreCase(profile1.providerName, profile2.providerName)
// case sensitive servers can have 2 databases whose name differs only in case
&& profile1.databaseName === profile2.databaseName
&& equalsIgnoreCase(profile1.userName, profile2.userName)
&& profile1.authenticationType === profile2.authenticationType;
private matchProfile(profile1: ConnectionProfile, profile2: ConnectionProfile): boolean {
return equalsIgnoreCase(profile1.serverName, profile2.serverName)
&& equalsIgnoreCase(profile1.providerName, profile2.providerName)
// case sensitive servers can have 2 databases whose name differs only in case
&& profile1.databaseName === profile2.databaseName
&& equalsIgnoreCase(profile1.userName, profile2.userName)
&& profile1.authenticationType === profile2.authenticationType;
}
}

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
import { IConnectionComponentCallbacks, IConnectionComponentController, IConnectionValidateResult } from 'sql/workbench/services/connection/browser/connectionDialogService';
import { AdvancedPropertiesController } from 'sql/workbench/parts/connection/browser/advancedPropertiesController';
@@ -40,7 +38,7 @@ export class ConnectionController implements IConnectionComponentController {
this._connectionManagementService = connectionManagementService;
this._callback = callback;
this._providerOptions = connectionProperties.connectionOptions;
var specialOptions = this._providerOptions.filter(
let specialOptions = this._providerOptions.filter(
(property) => (property.specialValueType !== null && property.specialValueType !== undefined));
this._connectionWidget = this._instantiationService.createInstance(ConnectionWidget, specialOptions, {
onSetConnectButton: (enable: boolean) => this._callback.onSetConnectButton(enable),
@@ -100,8 +98,8 @@ export class ConnectionController implements IConnectionComponentController {
}
private handleonSetAzureTimeOut(): void {
var timeoutPropertyName = 'connectTimeout';
var timeoutOption = this._model.options[timeoutPropertyName];
let timeoutPropertyName = 'connectTimeout';
let timeoutOption = this._model.options[timeoutPropertyName];
if (timeoutOption === undefined || timeoutOption === null) {
this._model.options[timeoutPropertyName] = 30;
}
@@ -111,7 +109,7 @@ export class ConnectionController implements IConnectionComponentController {
if (!this._advancedController) {
this._advancedController = this._instantiationService.createInstance(AdvancedPropertiesController, () => this._connectionWidget.focusOnAdvancedButton());
}
var advancedOption = this._providerOptions.filter(
let advancedOption = this._providerOptions.filter(
(property) => (property.specialValueType === undefined || property.specialValueType === null));
this._advancedController.showDialog(advancedOption, this._container, this._model.options);
}
@@ -133,8 +131,8 @@ export class ConnectionController implements IConnectionComponentController {
}
private getAllServerGroups(providers?: string[]): IConnectionProfileGroup[] {
var connectionGroupRoot = this._connectionManagementService.getConnectionGroups(providers);
var connectionGroupNames: IConnectionProfileGroup[] = [];
let connectionGroupRoot = this._connectionManagementService.getConnectionGroups(providers);
let connectionGroupNames: IConnectionProfileGroup[] = [];
if (connectionGroupRoot && connectionGroupRoot.length > 0) {
this.getServerGroupHelper(connectionGroupRoot[0], connectionGroupNames);
}

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import {
IConnectionManagementService,
ConnectionType, INewConnectionParams, IConnectionCompletionOptions, IConnectionResult
@@ -302,7 +300,7 @@ export class ConnectionDialogService implements IConnectionDialogService {
private handleFillInConnectionInputs(connectionInfo: IConnectionProfile): void {
this._connectionManagementService.addSavedPassword(connectionInfo).then(connectionWithPassword => {
var model = this.createModel(connectionWithPassword);
let model = this.createModel(connectionWithPassword);
this._model = model;
this.uiController.fillInConnectionInputs(model);
});

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import 'vs/css!./media/sqlConnection';
import { Button } from 'sql/base/browser/ui/button/button';
@@ -110,12 +108,12 @@ export class ConnectionWidget {
this._callbacks = callbacks;
this._toDispose = [];
this._optionsMaps = {};
for (var i = 0; i < options.length; i++) {
var option = options[i];
for (let i = 0; i < options.length; i++) {
let option = options[i];
this._optionsMaps[option.specialValueType] = option;
}
var authTypeOption = this._optionsMaps[ConnectionOptionSpecialType.authType];
let authTypeOption = this._optionsMaps[ConnectionOptionSpecialType.authType];
if (authTypeOption) {
if (OS === OperatingSystem.Windows) {
authTypeOption.defaultValue = this.getAuthTypeDisplayName(AuthenticationType.Integrated);
@@ -571,7 +569,7 @@ export class ConnectionWidget {
}
if (connectionInfo.authenticationType !== null && connectionInfo.authenticationType !== undefined) {
var authTypeDisplayName = this.getAuthTypeDisplayName(connectionInfo.authenticationType);
let authTypeDisplayName = this.getAuthTypeDisplayName(connectionInfo.authenticationType);
this._authTypeSelectBox.selectWithOptionName(authTypeDisplayName);
}
@@ -607,8 +605,8 @@ export class ConnectionWidget {
}
private getAuthTypeDisplayName(authTypeName: string) {
var displayName: string;
var authTypeOption = this._optionsMaps[ConnectionOptionSpecialType.authType];
let displayName: string;
let authTypeOption = this._optionsMaps[ConnectionOptionSpecialType.authType];
if (authTypeOption) {
authTypeOption.categoryValues.forEach(c => {
@@ -621,8 +619,8 @@ export class ConnectionWidget {
}
private getAuthTypeName(authTypeDisplayName: string) {
var authTypeName: string;
var authTypeOption = this._optionsMaps[ConnectionOptionSpecialType.authType];
let authTypeName: string;
let authTypeOption = this._optionsMaps[ConnectionOptionSpecialType.authType];
authTypeOption.categoryValues.forEach(c => {
if (c.displayName === authTypeDisplayName) {
authTypeName = c.name;

View File

@@ -2,7 +2,6 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { INewConnectionParams, IConnectionResult, IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
@@ -13,21 +12,12 @@ export interface IConnectionDialogService {
_serviceBrand: any;
/**
* Opens the connection dialog and returns the promise for successfully opening the dialog
* @param connectionManagementService
* @param params
* @param model
* @param connectionResult
*/
showDialog(connectionManagementService: IConnectionManagementService, params: INewConnectionParams, model: IConnectionProfile, connectionResult?: IConnectionResult): Thenable<void>;
/**
* Opens the connection dialog and returns the promise when connection is made
* or dialog is closed
* @param connectionManagementService
* @param params
* @param model
* @param connectionResult
*/
openDialogAndWait(connectionManagementService: IConnectionManagementService, params?: INewConnectionParams, model?: IConnectionProfile, connectionResult?: IConnectionResult, doConnect?: boolean): Thenable<IConnectionProfile>;
}

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import 'vs/css!sql/media/icons/common-icons';
import 'vs/css!./media/newDashboardTabDialog';
@@ -27,7 +25,6 @@ import * as TelemetryKeys from 'sql/platform/telemetry/telemetryKeys';
import { NewDashboardTabViewModel, IDashboardUITab } from 'sql/workbench/services/dashboard/common/newDashboardTabViewModel';
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> {
@@ -67,7 +64,7 @@ class ExtensionListRenderer implements IListRenderer<IDashboardUITab, ExtensionL
const tableTemplate: ExtensionListTemplate = Object.create(null);
tableTemplate.root = DOM.append(container, DOM.$('div.list-row.extensionTab-list'));
tableTemplate.icon = DOM.append(tableTemplate.root, DOM.$('div.icon'));
var titleContainer = DOM.append(tableTemplate.root, DOM.$('div.extension-details'));
let titleContainer = DOM.append(tableTemplate.root, DOM.$('div.extension-details'));
tableTemplate.title = DOM.append(titleContainer, DOM.$('div.title'));
tableTemplate.description = DOM.append(titleContainer, DOM.$('div.description'));
tableTemplate.publisher = DOM.append(titleContainer, DOM.$('div.publisher'));
@@ -96,7 +93,7 @@ class ExtensionListRenderer implements IListRenderer<IDashboardUITab, ExtensionL
export class NewDashboardTabDialog extends Modal {
public static EXTENSIONLIST_HEIGHT = 101;
// MEMBER VARIABLES ////////////////////////////////////////////////////
// MEMBER letIABLES ////////////////////////////////////////////////////
private _addNewTabButton: Button;
private _cancelButton: Button;
private _extensionList: List<IDashboardUITab>;

View File

@@ -2,7 +2,8 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.error-dialog {
.error-dialog {
padding: 15px;
overflow: auto;
height: 200px;

View File

@@ -3,7 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { ITree } from 'vs/base/parts/tree/browser/tree';
import treedefaults = require('vs/base/parts/tree/browser/treeDefaults');
import { IMouseEvent } from 'vs/base/browser/mouseEvent';
@@ -21,12 +20,12 @@ export class FileBrowserController extends treedefaults.DefaultController {
protected onLeftClick(tree: ITree, element: any, event: IMouseEvent, origin: string = 'mouse'): boolean {
// In file browser, double clicking an element calls tree.dispose(). There should not be any tree events after selection.
if (event.detail === 2) {
var payload = { origin: origin, originalEvent: event };
let payload = { origin: origin, originalEvent: event };
if (tree.getInput() === element) {
tree.clearFocus(payload);
tree.clearSelection(payload);
} else {
var isMouseDown = event && event.browserEvent && event.browserEvent.type === 'mousedown';
let isMouseDown = event && event.browserEvent && event.browserEvent.type === 'mousedown';
if (!isMouseDown) {
event.preventDefault(); // we cannot preventDefault onMouseDown because this would break DND otherwise
}
@@ -41,16 +40,16 @@ export class FileBrowserController extends treedefaults.DefaultController {
}
protected onEnter(tree: ITree, event: IKeyboardEvent): boolean {
var payload = { origin: 'keyboard', originalEvent: event };
let payload = { origin: 'keyboard', originalEvent: event };
if (tree.getHighlight()) {
return false;
}
var focus = tree.getFocus();
let focus = tree.getFocus();
if (focus) {
// In file browser, pressing enter key on an element will close dialog and call tree.dispose(). There should not be any tree events after selection.
tree.setSelection([focus], payload);
}
return true;
}
}
}

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { IFileBrowserService } from 'sql/platform/fileBrowser/common/interfaces';
import { FileNode } from 'sql/workbench/services/fileBrowser/common/fileNode';
import { ITree, IDataSource } from 'vs/base/parts/tree/browser/tree';
@@ -47,7 +45,7 @@ export class FileBrowserDataSource implements IDataSource {
public getChildren(tree: ITree, element: any): Promise<any> {
return new Promise<any>((resolve) => {
if (element instanceof FileNode) {
var node = <FileNode>element;
let node = <FileNode>element;
if (node.children) {
resolve(node.children);
} else {
@@ -69,4 +67,4 @@ export class FileBrowserDataSource implements IDataSource {
public getParent(tree: ITree, element: any): Promise<any> {
return Promise.resolve(null);
}
}
}

View File

@@ -3,7 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { FileNode } from 'sql/workbench/services/fileBrowser/common/fileNode';
import { ITree, IRenderer } from 'vs/base/parts/tree/browser/tree';
import { FileKind } from 'vs/platform/files/common/files';
@@ -61,8 +60,8 @@ export class FileBrowserRenderer implements IRenderer {
templateData.label.element.style.display = 'flex';
const extraClasses = ['explorer-item'];
var fileuri = URI.file(element.fullPath);
var filekind;
let fileuri = URI.file(element.fullPath);
let filekind;
if (element.parent === null) {
filekind = FileKind.ROOT_FOLDER;
} else if (element.isFile === false) {

View File

@@ -3,8 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { IFileBrowserService } from 'sql/platform/fileBrowser/common/interfaces';
import { localize } from 'vs/nls';
@@ -18,7 +16,7 @@ export class FileBrowserViewModel {
private _fileValidationServiceType: string;
public formattedFileFilters: string[];
constructor( @IFileBrowserService private _fileBrowserService: IFileBrowserService) {
constructor(@IFileBrowserService private _fileBrowserService: IFileBrowserService) {
}
public onAddFileTree(onAddFileTreeCallback) {
@@ -44,8 +42,8 @@ export class FileBrowserViewModel {
this._fileFilters = fileFilters;
}
this.formattedFileFilters = [];
for (var i = 0; i < this._fileFilters.length; i++) {
var filterStr = this._fileFilters[i].label + '(' + this._fileFilters[i].filters.join(';') + ')';
for (let i = 0; i < this._fileFilters.length; i++) {
let filterStr = this._fileFilters[i].label + '(' + this._fileFilters[i].filters.join(';') + ')';
this.formattedFileFilters.push(filterStr);
}
}
@@ -63,4 +61,4 @@ export class FileBrowserViewModel {
public closeFileBrowser() {
this._fileBrowserService.closeFileBrowser(this._ownerUri);
}
}
}

View File

@@ -1,8 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { generateUuid } from 'vs/base/common/uuid';
/**

View File

@@ -17,7 +17,7 @@ export class InsightsDialogService implements IInsightsDialogService {
private _insightsDialogView: InsightsDialogView;
private _insightsDialogModel: IInsightsDialogModel;
constructor( @IInstantiationService private _instantiationService: IInstantiationService) { }
constructor(@IInstantiationService private _instantiationService: IInstantiationService) { }
// query string
public show(input: IInsightsConfig, connectionProfile: IConnectionProfile): void {

View File

@@ -403,7 +403,6 @@ export class InsightsDialogView extends Modal {
/**
* Creates the context that should be passed to the action passed on the selected element for the top table
* @param element
*/
private topInsightContext(element: ListResource): IConnectionProfile {
let database = this._insight.actions.database || this._connectionProfile.databaseName;
@@ -451,7 +450,6 @@ export class InsightsDialogView extends Modal {
/**
* Creates the context that should be passed to the action passed on the selected element for the bottom table
* @param element
*/
private bottomInsightContext(element: ListResource, cell: Slick.Cell): IInsightDialogActionContext {

View File

@@ -116,7 +116,7 @@ export class NotebookService extends Disposable implements INotebookService {
notebookRegistry.providers.forEach(p => {
// Don't need to re-register SQL_NOTEBOOK_PROVIDER
if (p.provider !== SQL_NOTEBOOK_PROVIDER) {
this.updateRegisteredProviders({id: p.provider, registration: p});
this.updateRegisteredProviders({ id: p.provider, registration: p });
}
});
}

View File

@@ -5,8 +5,6 @@
// Note: the code in the v3 and v4 namespaces has been adapted (with significant changes) from https://github.com/nteract/nteract/tree/master/packages/commutable
'use strict';
import { nb } from 'azdata';
import * as json from 'vs/base/common/json';
@@ -347,7 +345,7 @@ namespace v3 {
pdf: 'application/pdf'
};
type MimeTypeKey = keyof typeof VALID_MIMETYPES;
type MimePayload = {[P in MimeTypeKey]?: nb.MultilineString };
type MimePayload = { [P in MimeTypeKey]?: nb.MultilineString };
interface MimeOutput<T extends string = string> extends MimePayload {
output_type: T;

View File

@@ -2,7 +2,6 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as os from 'os';
import { nb, QueryExecuteSubsetResult, IDbColumn, BatchSummary, IResultMessage, ResultSetSummary } from 'azdata';
@@ -432,7 +431,7 @@ export class SQLFuture extends Disposable implements FutureInternal {
if (rowCount > 0) {
subsetResult = await this._queryRunner.getQueryRows(0, rowCount, resultSet.batchId, resultSet.id);
} else {
subsetResult = { message: '', resultSubset: { rowCount: 0, rows: [] }};
subsetResult = { message: '', resultSubset: { rowCount: 0, rows: [] } };
}
let msg: nb.IIOPubMessage = {
channel: 'iopub',

View File

@@ -2,7 +2,6 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { NodeType } from 'sql/workbench/parts/objectExplorer/common/nodeType';
import { TreeNode, TreeItemCollapsibleState } from 'sql/workbench/parts/objectExplorer/common/treeNode';
@@ -190,8 +189,8 @@ export class ObjectExplorerService implements IObjectExplorerService {
public deleteObjectExplorerNode(connection: IConnectionProfile): Thenable<void> {
let self = this;
var connectionUri = connection.id;
var nodeTree = this._activeObjectExplorerNodes[connectionUri];
let connectionUri = connection.id;
let nodeTree = this._activeObjectExplorerNodes[connectionUri];
if (nodeTree) {
return self.closeSession(connection.providerName, nodeTree.getSession()).then(() => {
delete self._activeObjectExplorerNodes[connectionUri];

View File

@@ -23,7 +23,7 @@ export interface IQueryEditorService {
_serviceBrand: any;
// Creates new untitled document for SQL queries and opens it in a new editor tab
newSqlEditor(sqlContent?: string, connectionProviderName?: string, isDirty?: boolean, objectName?:string ): Promise<IConnectableInput>;
newSqlEditor(sqlContent?: string, connectionProviderName?: string, isDirty?: boolean, objectName?: string): Promise<IConnectableInput>;
// Creates a new query plan document
newQueryPlanEditor(xmlShowPlan: string): Promise<any>;
@@ -34,9 +34,8 @@ export interface IQueryEditorService {
/**
* Handles updating of SQL files on a save as event. These need special consideration
* due to query results and other information being tied to the URI of the file
* @param {URI} oldResource URI of the file before the save as was completed
* @param {URI} newResource URI of the file after the save as operation was completed
* @memberof IQueryEditorService
* @param oldResource URI of the file before the save as was completed
* @param newResource URI of the file after the save as operation was completed
*/
onSaveAsCompleted(oldResource: URI, newResource: URI): void;
}
}