Global object linting (#6857)

* add more linting

* fix linting issues
This commit is contained in:
Anthony Dresser
2019-08-22 10:51:59 -07:00
committed by GitHub
parent 854508e940
commit 8e070454c3
54 changed files with 375 additions and 388 deletions

View File

@@ -135,9 +135,9 @@ const copyrightFilter = [
'!extensions/mssql/src/objectExplorerNodeProvider/webhdfs.ts',
'!src/sql/workbench/parts/notebook/browser/outputs/tableRenderers.ts',
'!src/sql/workbench/parts/notebook/common/models/url.ts',
'!src/sql/workbench/parts/notebook/common/models/renderMimeInterfaces.ts',
'!src/sql/workbench/parts/notebook/common/models/outputProcessor.ts',
'!src/sql/workbench/parts/notebook/common/models/mimemodel.ts',
'!src/sql/workbench/parts/notebook/browser/models/renderMimeInterfaces.ts',
'!src/sql/workbench/parts/notebook/browser/models/outputProcessor.ts',
'!src/sql/workbench/parts/notebook/browser/models/mimemodel.ts',
'!src/sql/workbench/parts/notebook/browser/cellViews/media/*.css',
'!src/sql/base/browser/ui/table/plugins/rowSelectionModel.plugin.ts',
'!src/sql/base/browser/ui/table/plugins/rowDetailView.ts',
@@ -252,7 +252,7 @@ gulp.task('tslint', () => {
.pipe(filter(tslintExtensionsFilter))
.pipe(gulptslint.default({ rulesDirectory: 'build/lib/tslint' }))
.pipe(gulptslint.default.report({ emitError: true }))
]);
]).pipe(es.through()); // {{SQL CARBON EDIT}} fix issue
});
function hygiene(some) {

View File

@@ -3,234 +3,18 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import 'vs/css!./media/accountPicker';
import * as DOM from 'vs/base/browser/dom';
import { Event, Emitter } from 'vs/base/common/event';
import { List } from 'vs/base/browser/ui/list/listWidget';
import { IDropdownOptions } from 'vs/base/browser/ui/dropdown/dropdown';
import { IListEvent } from 'vs/base/browser/ui/list/list';
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { buttonBackground } from 'vs/platform/theme/common/colorRegistry';
import { attachListStyler } from 'vs/platform/theme/common/styler';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { Event } from 'vs/base/common/event';
import * as azdata from 'azdata';
import { DropdownList } from 'sql/base/browser/ui/dropdownList/dropdownList';
import { attachDropdownStyler } from 'sql/platform/theme/common/styler';
import { AddAccountAction, RefreshAccountAction } from 'sql/platform/accounts/common/accountActions';
import { AccountPickerListRenderer, AccountListDelegate } from 'sql/platform/accounts/browser/accountListRenderer';
import { AccountPickerViewModel } from 'sql/platform/accounts/common/accountPickerViewModel';
export class AccountPicker extends Disposable {
public static ACCOUNTPICKERLIST_HEIGHT = 47;
public viewModel: AccountPickerViewModel;
private _accountList: List<azdata.Account>;
private _rootElement: HTMLElement;
private _refreshContainer: HTMLElement;
private _listContainer: HTMLElement;
private _dropdown: DropdownList;
private _refreshAccountAction: RefreshAccountAction;
// EVENTING ////////////////////////////////////////////////////////////
private _addAccountCompleteEmitter: Emitter<void>;
public get addAccountCompleteEvent(): Event<void> { return this._addAccountCompleteEmitter.event; }
private _addAccountErrorEmitter: Emitter<string>;
public get addAccountErrorEvent(): Event<string> { return this._addAccountErrorEmitter.event; }
private _addAccountStartEmitter: Emitter<void>;
public get addAccountStartEvent(): Event<void> { return this._addAccountStartEmitter.event; }
private _onAccountSelectionChangeEvent: Emitter<azdata.Account | undefined>;
public get onAccountSelectionChangeEvent(): Event<azdata.Account | undefined> { return this._onAccountSelectionChangeEvent.event; }
constructor(
private _providerId: string,
@IThemeService private _themeService: IThemeService,
@IInstantiationService private _instantiationService: IInstantiationService,
@IContextViewService private _contextViewService: IContextViewService
) {
super();
// Create event emitters
this._addAccountCompleteEmitter = new Emitter<void>();
this._addAccountErrorEmitter = new Emitter<string>();
this._addAccountStartEmitter = new Emitter<void>();
this._onAccountSelectionChangeEvent = new Emitter<azdata.Account>();
// Create the view model, wire up the events, and initialize with baseline data
this.viewModel = this._instantiationService.createInstance(AccountPickerViewModel, this._providerId);
this.viewModel.updateAccountListEvent(arg => {
if (arg.providerId === this._providerId) {
this.updateAccountList(arg.accountList);
}
});
}
// PUBLIC METHODS //////////////////////////////////////////////////////
/**
* Render account picker
*/
public render(container: HTMLElement): void {
DOM.append(container, this._rootElement);
}
// PUBLIC METHODS //////////////////////////////////////////////////////
/**
* Create account picker component
*/
public createAccountPickerComponent() {
// Create an account list
const delegate = new AccountListDelegate(AccountPicker.ACCOUNTPICKERLIST_HEIGHT);
const accountRenderer = new AccountPickerListRenderer();
this._listContainer = DOM.$('div.account-list-container');
this._accountList = new List<azdata.Account>(this._listContainer, delegate, [accountRenderer]);
this._register(attachListStyler(this._accountList, this._themeService));
this._rootElement = DOM.$('div.account-picker-container');
// Create a dropdown for account picker
const option: IDropdownOptions = {
contextViewProvider: this._contextViewService,
labelRenderer: (container) => this.renderLabel(container)
};
// Create the add account action
const addAccountAction = this._instantiationService.createInstance(AddAccountAction, this._providerId);
addAccountAction.addAccountCompleteEvent(() => this._addAccountCompleteEmitter.fire());
addAccountAction.addAccountErrorEvent((msg) => this._addAccountErrorEmitter.fire(msg));
addAccountAction.addAccountStartEvent(() => this._addAccountStartEmitter.fire());
this._dropdown = this._register(new DropdownList(this._rootElement, option, this._listContainer, this._accountList, addAccountAction));
this._register(attachDropdownStyler(this._dropdown, this._themeService));
this._register(this._accountList.onSelectionChange((e: IListEvent<azdata.Account>) => {
if (e.elements.length === 1) {
this._dropdown.renderLabel();
this.onAccountSelectionChange(e.elements[0]);
}
}));
// Create refresh account action
this._refreshContainer = DOM.append(this._rootElement, DOM.$('div.refresh-container'));
DOM.append(this._refreshContainer, DOM.$('div.sql icon warning'));
const actionBar = new ActionBar(this._refreshContainer, { animated: false });
this._refreshAccountAction = this._instantiationService.createInstance(RefreshAccountAction);
actionBar.push(this._refreshAccountAction, { icon: false, label: true });
if (this._accountList.length > 0) {
this._accountList.setSelection([0]);
this.onAccountSelectionChange(this._accountList.getSelectedElements()[0]);
} else {
DOM.hide(this._refreshContainer);
}
this._register(this._themeService.onThemeChange(e => this.updateTheme(e)));
this.updateTheme(this._themeService.getTheme());
// Load the initial contents of the view model
this.viewModel.initialize()
.then((accounts: azdata.Account[]) => {
this.updateAccountList(accounts);
});
}
public dispose() {
super.dispose();
if (this._accountList) {
this._accountList.dispose();
}
}
// PRIVATE HELPERS /////////////////////////////////////////////////////
private onAccountSelectionChange(account: azdata.Account | undefined) {
this.viewModel.selectedAccount = account;
if (account && account.isStale) {
this._refreshAccountAction.account = account;
DOM.show(this._refreshContainer);
} else {
DOM.hide(this._refreshContainer);
}
this._onAccountSelectionChangeEvent.fire(account);
}
private renderLabel(container: HTMLElement): IDisposable | null {
if (container.hasChildNodes()) {
for (let i = 0; i < container.childNodes.length; i++) {
container.removeChild(container.childNodes.item(i));
}
}
const selectedAccounts = this._accountList.getSelectedElements();
const account = selectedAccounts ? selectedAccounts[0] : undefined;
if (account) {
const badge = DOM.$('div.badge');
const row = DOM.append(container, DOM.$('div.selected-account-container'));
const icon = DOM.append(row, DOM.$('div.icon'));
DOM.append(icon, badge);
const badgeContent = DOM.append(badge, DOM.$('div.badge-content'));
const label = DOM.append(row, DOM.$('div.label'));
// Set the account icon
icon.classList.add('icon', account.displayInfo.accountType);
// TODO: Pick between the light and dark logo
label.innerText = account.displayInfo.displayName + ' (' + account.displayInfo.contextualDisplayName + ')';
if (account.isStale) {
badgeContent.className = 'badge-content icon warning-badge';
} else {
badgeContent.className = 'badge-content';
}
} else {
const row = DOM.append(container, DOM.$('div.no-account-container'));
row.innerText = AddAccountAction.LABEL + '...';
}
return null;
}
private updateAccountList(accounts: azdata.Account[]): void {
// keep the selection to the current one
const selectedElements = this._accountList.getSelectedElements();
// find selected index
let selectedIndex: number | undefined;
if (selectedElements.length > 0 && accounts.length > 0) {
selectedIndex = accounts.findIndex((account) => {
return (account.key.accountId === selectedElements[0].key.accountId);
});
}
// Replace the existing list with the new one
this._accountList.splice(0, this._accountList.length, accounts);
if (this._accountList.length > 0) {
if (selectedIndex && selectedIndex !== -1) {
this._accountList.setSelection([selectedIndex]);
} else {
this._accountList.setSelection([0]);
}
} else {
// if the account is empty, re-render dropdown label
this.onAccountSelectionChange(undefined);
this._dropdown.renderLabel();
}
this._accountList.layout(this._accountList.contentHeight);
}
/**
* Update theming that is specific to account picker
*/
private updateTheme(theme: ITheme): void {
const linkColor = theme.getColor(buttonBackground);
const link = linkColor ? linkColor.toString() : null;
this._refreshContainer.style.color = link;
if (this._refreshContainer) {
this._refreshContainer.style.color = link;
}
}
export const IAccountPickerService = createDecorator<IAccountPickerService>('AccountPickerService');
export interface IAccountPickerService {
_serviceBrand: any;
renderAccountPicker(container: HTMLElement): void;
addAccountCompleteEvent: Event<void>;
addAccountErrorEvent: Event<string>;
addAccountStartEvent: Event<void>;
onAccountSelectionChangeEvent: Event<azdata.Account | undefined>;
selectedAccount: azdata.Account | undefined;
}

View File

@@ -0,0 +1,236 @@
/*---------------------------------------------------------------------------------------------
* 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/accountPicker';
import * as DOM from 'vs/base/browser/dom';
import { Event, Emitter } from 'vs/base/common/event';
import { List } from 'vs/base/browser/ui/list/listWidget';
import { IDropdownOptions } from 'vs/base/browser/ui/dropdown/dropdown';
import { IListEvent } from 'vs/base/browser/ui/list/list';
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { buttonBackground } from 'vs/platform/theme/common/colorRegistry';
import { attachListStyler } from 'vs/platform/theme/common/styler';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
import * as azdata from 'azdata';
import { DropdownList } from 'sql/base/browser/ui/dropdownList/dropdownList';
import { attachDropdownStyler } from 'sql/platform/theme/common/styler';
import { AddAccountAction, RefreshAccountAction } from 'sql/platform/accounts/common/accountActions';
import { AccountPickerListRenderer, AccountListDelegate } from 'sql/platform/accounts/browser/accountListRenderer';
import { AccountPickerViewModel } from 'sql/platform/accounts/common/accountPickerViewModel';
export class AccountPicker extends Disposable {
public static ACCOUNTPICKERLIST_HEIGHT = 47;
public viewModel: AccountPickerViewModel;
private _accountList: List<azdata.Account>;
private _rootElement: HTMLElement;
private _refreshContainer: HTMLElement;
private _listContainer: HTMLElement;
private _dropdown: DropdownList;
private _refreshAccountAction: RefreshAccountAction;
// EVENTING ////////////////////////////////////////////////////////////
private _addAccountCompleteEmitter: Emitter<void>;
public get addAccountCompleteEvent(): Event<void> { return this._addAccountCompleteEmitter.event; }
private _addAccountErrorEmitter: Emitter<string>;
public get addAccountErrorEvent(): Event<string> { return this._addAccountErrorEmitter.event; }
private _addAccountStartEmitter: Emitter<void>;
public get addAccountStartEvent(): Event<void> { return this._addAccountStartEmitter.event; }
private _onAccountSelectionChangeEvent: Emitter<azdata.Account | undefined>;
public get onAccountSelectionChangeEvent(): Event<azdata.Account | undefined> { return this._onAccountSelectionChangeEvent.event; }
constructor(
private _providerId: string,
@IThemeService private _themeService: IThemeService,
@IInstantiationService private _instantiationService: IInstantiationService,
@IContextViewService private _contextViewService: IContextViewService
) {
super();
// Create event emitters
this._addAccountCompleteEmitter = new Emitter<void>();
this._addAccountErrorEmitter = new Emitter<string>();
this._addAccountStartEmitter = new Emitter<void>();
this._onAccountSelectionChangeEvent = new Emitter<azdata.Account>();
// Create the view model, wire up the events, and initialize with baseline data
this.viewModel = this._instantiationService.createInstance(AccountPickerViewModel, this._providerId);
this.viewModel.updateAccountListEvent(arg => {
if (arg.providerId === this._providerId) {
this.updateAccountList(arg.accountList);
}
});
}
// PUBLIC METHODS //////////////////////////////////////////////////////
/**
* Render account picker
*/
public render(container: HTMLElement): void {
DOM.append(container, this._rootElement);
}
// PUBLIC METHODS //////////////////////////////////////////////////////
/**
* Create account picker component
*/
public createAccountPickerComponent() {
// Create an account list
const delegate = new AccountListDelegate(AccountPicker.ACCOUNTPICKERLIST_HEIGHT);
const accountRenderer = new AccountPickerListRenderer();
this._listContainer = DOM.$('div.account-list-container');
this._accountList = new List<azdata.Account>(this._listContainer, delegate, [accountRenderer]);
this._register(attachListStyler(this._accountList, this._themeService));
this._rootElement = DOM.$('div.account-picker-container');
// Create a dropdown for account picker
const option: IDropdownOptions = {
contextViewProvider: this._contextViewService,
labelRenderer: (container) => this.renderLabel(container)
};
// Create the add account action
const addAccountAction = this._instantiationService.createInstance(AddAccountAction, this._providerId);
addAccountAction.addAccountCompleteEvent(() => this._addAccountCompleteEmitter.fire());
addAccountAction.addAccountErrorEvent((msg) => this._addAccountErrorEmitter.fire(msg));
addAccountAction.addAccountStartEvent(() => this._addAccountStartEmitter.fire());
this._dropdown = this._register(new DropdownList(this._rootElement, option, this._listContainer, this._accountList, addAccountAction));
this._register(attachDropdownStyler(this._dropdown, this._themeService));
this._register(this._accountList.onSelectionChange((e: IListEvent<azdata.Account>) => {
if (e.elements.length === 1) {
this._dropdown.renderLabel();
this.onAccountSelectionChange(e.elements[0]);
}
}));
// Create refresh account action
this._refreshContainer = DOM.append(this._rootElement, DOM.$('div.refresh-container'));
DOM.append(this._refreshContainer, DOM.$('div.sql icon warning'));
const actionBar = new ActionBar(this._refreshContainer, { animated: false });
this._refreshAccountAction = this._instantiationService.createInstance(RefreshAccountAction);
actionBar.push(this._refreshAccountAction, { icon: false, label: true });
if (this._accountList.length > 0) {
this._accountList.setSelection([0]);
this.onAccountSelectionChange(this._accountList.getSelectedElements()[0]);
} else {
DOM.hide(this._refreshContainer);
}
this._register(this._themeService.onThemeChange(e => this.updateTheme(e)));
this.updateTheme(this._themeService.getTheme());
// Load the initial contents of the view model
this.viewModel.initialize()
.then((accounts: azdata.Account[]) => {
this.updateAccountList(accounts);
});
}
public dispose() {
super.dispose();
if (this._accountList) {
this._accountList.dispose();
}
}
// PRIVATE HELPERS /////////////////////////////////////////////////////
private onAccountSelectionChange(account: azdata.Account | undefined) {
this.viewModel.selectedAccount = account;
if (account && account.isStale) {
this._refreshAccountAction.account = account;
DOM.show(this._refreshContainer);
} else {
DOM.hide(this._refreshContainer);
}
this._onAccountSelectionChangeEvent.fire(account);
}
private renderLabel(container: HTMLElement): IDisposable | null {
if (container.hasChildNodes()) {
for (let i = 0; i < container.childNodes.length; i++) {
container.removeChild(container.childNodes.item(i));
}
}
const selectedAccounts = this._accountList.getSelectedElements();
const account = selectedAccounts ? selectedAccounts[0] : undefined;
if (account) {
const badge = DOM.$('div.badge');
const row = DOM.append(container, DOM.$('div.selected-account-container'));
const icon = DOM.append(row, DOM.$('div.icon'));
DOM.append(icon, badge);
const badgeContent = DOM.append(badge, DOM.$('div.badge-content'));
const label = DOM.append(row, DOM.$('div.label'));
// Set the account icon
icon.classList.add('icon', account.displayInfo.accountType);
// TODO: Pick between the light and dark logo
label.innerText = account.displayInfo.displayName + ' (' + account.displayInfo.contextualDisplayName + ')';
if (account.isStale) {
badgeContent.className = 'badge-content icon warning-badge';
} else {
badgeContent.className = 'badge-content';
}
} else {
const row = DOM.append(container, DOM.$('div.no-account-container'));
row.innerText = AddAccountAction.LABEL + '...';
}
return null;
}
private updateAccountList(accounts: azdata.Account[]): void {
// keep the selection to the current one
const selectedElements = this._accountList.getSelectedElements();
// find selected index
let selectedIndex: number | undefined;
if (selectedElements.length > 0 && accounts.length > 0) {
selectedIndex = accounts.findIndex((account) => {
return (account.key.accountId === selectedElements[0].key.accountId);
});
}
// Replace the existing list with the new one
this._accountList.splice(0, this._accountList.length, accounts);
if (this._accountList.length > 0) {
if (selectedIndex && selectedIndex !== -1) {
this._accountList.setSelection([selectedIndex]);
} else {
this._accountList.setSelection([0]);
}
} else {
// if the account is empty, re-render dropdown label
this.onAccountSelectionChange(undefined);
this._dropdown.renderLabel();
}
this._accountList.layout(this._accountList.contentHeight);
}
/**
* Update theming that is specific to account picker
*/
private updateTheme(theme: ITheme): void {
const linkColor = theme.getColor(buttonBackground);
const link = linkColor ? linkColor.toString() : null;
this._refreshContainer.style.color = link;
if (this._refreshContainer) {
this._refreshContainer.style.color = link;
}
}
}

View File

@@ -7,8 +7,8 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
import { Event, Emitter } from 'vs/base/common/event';
import * as azdata from 'azdata';
import { IAccountPickerService } from 'sql/platform/accounts/common/accountPicker';
import { AccountPicker } from 'sql/platform/accounts/browser/accountPicker';
import { IAccountPickerService } from 'sql/platform/accounts/browser/accountPicker';
import { AccountPicker } from 'sql/platform/accounts/browser/accountPickerImpl';
export class AccountPickerService implements IAccountPickerService {
_serviceBrand: any;

View File

@@ -25,7 +25,7 @@ import { Modal } from 'sql/workbench/browser/modal/modal';
import { FirewallRuleViewModel } from 'sql/platform/accounts/common/firewallRuleViewModel';
import { attachModalDialogStyler, attachButtonStyler } from 'sql/platform/theme/common/styler';
import { InputBox } from 'sql/base/browser/ui/inputBox/inputBox';
import { IAccountPickerService } from 'sql/platform/accounts/common/accountPicker';
import { IAccountPickerService } from 'sql/platform/accounts/browser/accountPicker';
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
import { ILogService } from 'vs/platform/log/common/log';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';

View File

@@ -1,20 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { Event } from 'vs/base/common/event';
import * as azdata from 'azdata';
export const IAccountPickerService = createDecorator<IAccountPickerService>('AccountPickerService');
export interface IAccountPickerService {
_serviceBrand: any;
renderAccountPicker(container: HTMLElement): void;
addAccountCompleteEvent: Event<void>;
addAccountErrorEvent: Event<string>;
addAccountStartEvent: Event<void>;
onAccountSelectionChangeEvent: Event<azdata.Account | undefined>;
selectedAccount: azdata.Account | undefined;
}

View File

@@ -8,7 +8,7 @@ import * as assert from 'assert';
import * as TypeMoq from 'typemoq';
import { EventVerifierSingle } from 'sqltest/utils/eventVerifier';
import { Emitter } from 'vs/base/common/event';
import { AccountPicker } from 'sql/platform/accounts/browser/accountPicker';
import { AccountPicker } from 'sql/platform/accounts/browser/accountPickerImpl';
import { AccountPickerService } from 'sql/platform/accounts/browser/accountPickerService';
import { AccountPickerViewModel } from 'sql/platform/accounts/common/accountPickerViewModel';
import { TestAccountManagementService } from 'sql/platform/accounts/test/common/testAccountManagementService';

View File

@@ -3,7 +3,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { NgModuleRef, enableProdMode, PlatformRef, Provider } from '@angular/core';
import { NgModuleRef, PlatformRef, Provider } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { IInstantiationService, _util } from 'vs/platform/instantiation/common/instantiation';
import { IEditorInput } from 'vs/workbench/common/editor';
@@ -61,7 +61,3 @@ export function bootstrapAngular<T>(service: IInstantiationService, moduleType:
return uniqueSelectorString;
}
if (!process.env['VSCODE_DEV']) {
enableProdMode();
}

View File

@@ -18,7 +18,7 @@ import * as Constants from 'sql/platform/connection/common/constants';
import { ICapabilitiesService } from 'sql/platform/capabilities/common/capabilitiesService';
import * as ConnectionContracts from 'sql/workbench/parts/connection/common/connection';
import { ConnectionStatusManager } from 'sql/platform/connection/common/connectionStatusManager';
import { DashboardInput } from 'sql/workbench/parts/dashboard/common/dashboardInput';
import { DashboardInput } from 'sql/workbench/parts/dashboard/browser/dashboardInput';
import { ConnectionGlobalStatus } from 'sql/workbench/parts/connection/common/connectionGlobalStatus';
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
import * as TelemetryUtils from 'sql/platform/telemetry/common/telemetryUtilities';

View File

@@ -21,7 +21,7 @@ import {
SqlMainContext, MainThreadNotebookDocumentsAndEditorsShape, SqlExtHostContext, ExtHostNotebookDocumentsAndEditorsShape,
INotebookDocumentsAndEditorsDelta, INotebookEditorAddData, INotebookShowOptions, INotebookModelAddedData, INotebookModelChangedData
} from 'sql/workbench/api/common/sqlExtHost.protocol';
import { NotebookInput } from 'sql/workbench/parts/notebook/common/models/notebookInput';
import { NotebookInput } from 'sql/workbench/parts/notebook/browser/models/notebookInput';
import { INotebookService, INotebookEditor } from 'sql/workbench/services/notebook/common/notebookService';
import { ISingleNotebookEditOperation, NotebookChangeKind } from 'sql/workbench/api/common/sqlExtHostTypes';
import { disposed } from 'vs/base/common/errors';

View File

@@ -21,7 +21,7 @@ import { attachTableStyler } from 'sql/platform/theme/common/styler';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { getContentHeight, getContentWidth, Dimension } from 'vs/base/browser/dom';
import { RowSelectionModel } from 'sql/base/browser/ui/table/plugins/rowSelectionModel.plugin';
import { CheckboxSelectColumn, ICheckboxCellActionEventArgs, ActionOnCheck } from 'sql/base/browser/ui/table/plugins/checkboxSelectColumn.plugin';
import { CheckboxSelectColumn, ICheckboxCellActionEventArgs } from 'sql/base/browser/ui/table/plugins/checkboxSelectColumn.plugin';
import { Emitter, Event as vsEvent } from 'vs/base/common/event';
@Component({
@@ -213,8 +213,8 @@ export default class TableComponent extends ComponentBase implements IComponent,
this._table.setSelectedRows(this.selectedRows);
}
for (let col in this._checkboxColumns) {
this.registerCheckboxPlugin(this._checkboxColumns[col]);
for (const col of this._checkboxColumns) {
this.registerCheckboxPlugin(col);
}
if (this.ariaRowCount === -1) {

View File

@@ -9,12 +9,12 @@ import {
IConnectionCompletionOptions, ConnectionType,
RunQueryOnConnectionMode, IConnectionResult
} from 'sql/platform/connection/common/connectionManagement';
import { EditDataInput } from 'sql/workbench/parts/editData/common/editDataInput';
import { EditDataInput } from 'sql/workbench/parts/editData/browser/editDataInput';
import { IRestoreDialogController } from 'sql/platform/restore/common/restoreService';
import { IInsightsDialogService } from 'sql/workbench/services/insights/browser/insightsDialogService';
import { IObjectExplorerService } from 'sql/workbench/services/objectExplorer/common/objectExplorerService';
import { QueryInput } from 'sql/workbench/parts/query/common/queryInput';
import { DashboardInput } from 'sql/workbench/parts/dashboard/common/dashboardInput';
import { DashboardInput } from 'sql/workbench/parts/dashboard/browser/dashboardInput';
import { ProfilerInput } from 'sql/workbench/parts/profiler/browser/profilerInput';
import { IBackupUiService } from 'sql/workbench/services/backup/common/backupUiService';

View File

@@ -12,7 +12,7 @@ import { QueryResultsInput } from 'sql/workbench/parts/query/common/queryResults
import { QueryInput } from 'sql/workbench/parts/query/common/queryInput';
import { IQueryEditorOptions } from 'sql/workbench/services/queryEditor/common/queryEditorService';
import { QueryPlanInput } from 'sql/workbench/parts/queryPlan/common/queryPlanInput';
import { NotebookInput } from 'sql/workbench/parts/notebook/common/models/notebookInput';
import { NotebookInput } from 'sql/workbench/parts/notebook/browser/models/notebookInput';
import { INotebookService } from 'sql/workbench/services/notebook/common/notebookService';
import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput';
import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput';

View File

@@ -14,7 +14,7 @@ import { IErrorMessageService } from 'sql/platform/errorMessage/common/errorMess
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
import { IQueryEditorService } from 'sql/workbench/services/queryEditor/common/queryEditorService';
import { IScriptingService, ScriptOperation } from 'sql/platform/scripting/common/scriptingService';
import { EditDataInput } from 'sql/workbench/parts/editData/common/editDataInput';
import { EditDataInput } from 'sql/workbench/parts/editData/browser/editDataInput';
// map for the version of SQL Server (default is 140)
const scriptCompatibilityOptionMap = {
@@ -215,4 +215,4 @@ function getFilePath(metadata: azdata.ObjectMetadata): string {
} else {
return path.join(os.tmpdir(), `${objectName}_${timestamp}.txt`);
}
}
}

View File

@@ -84,7 +84,7 @@ export class RecentConnectionTreeController extends DefaultController {
protected onRightClick(tree: ITree, element: any, eventish: ICancelableEvent, origin: string = 'mouse'): boolean {
this.clickcb(element, eventish, origin);
this.showContextMenu(tree, element, event);
this.showContextMenu(tree, element, eventish);
return true;
}

View File

@@ -13,8 +13,8 @@ import Severity from 'vs/base/common/severity';
import { IDialogService, IConfirmation, IConfirmationResult } from 'vs/platform/dialogs/common/dialogs';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { QueryInput } from 'sql/workbench/parts/query/common/queryInput';
import { EditDataInput } from 'sql/workbench/parts/editData/common/editDataInput';
import { DashboardInput } from 'sql/workbench/parts/dashboard/common/dashboardInput';
import { EditDataInput } from 'sql/workbench/parts/editData/browser/editDataInput';
import { DashboardInput } from 'sql/workbench/parts/dashboard/browser/dashboardInput';
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
import { IObjectExplorerService } from 'sql/workbench/services/objectExplorer/common/objectExplorerService';

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { DashboardEditor } from 'sql/workbench/parts/dashboard/browser/dashboardEditor';
import { DashboardInput } from 'sql/workbench/parts/dashboard/common/dashboardInput';
import { DashboardInput } from 'sql/workbench/parts/dashboard/browser/dashboardInput';
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
import { EditorDescriptor, IEditorRegistry, Extensions as EditorExtensions } from 'vs/workbench/browser/editor';

View File

@@ -11,7 +11,7 @@ import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/work
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { DashboardInput } from '../common/dashboardInput';
import { DashboardInput } from './dashboardInput';
import { DashboardModule } from './dashboard.module';
import { bootstrapAngular } from 'sql/platform/bootstrap/browser/bootstrapService';
import { IDashboardComponentParams } from 'sql/platform/bootstrap/common/bootstrapParams';

View File

@@ -4,9 +4,9 @@
*--------------------------------------------------------------------------------------------*/
import { EditDataEditor } from 'sql/workbench/parts/editData/browser/editDataEditor';
import { EditDataInput } from 'sql/workbench/parts/editData/common/editDataInput';
import { EditDataInput } from 'sql/workbench/parts/editData/browser/editDataInput';
import { EditDataResultsEditor } from 'sql/workbench/parts/editData/browser/editDataResultsEditor';
import { EditDataResultsInput } from 'sql/workbench/parts/editData/common/editDataResultsInput';
import { EditDataResultsInput } from 'sql/workbench/parts/editData/browser/editDataResultsInput';
import { EditorDescriptor, IEditorRegistry, Extensions } from 'vs/workbench/browser/editor';
import { Registry } from 'vs/platform/registry/common/platform';
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';

View File

@@ -14,7 +14,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { EditDataInput } from 'sql/workbench/parts/editData/common/editDataInput';
import { EditDataInput } from 'sql/workbench/parts/editData/browser/editDataInput';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import * as queryContext from 'sql/workbench/parts/query/common/queryContext';
@@ -32,7 +32,7 @@ import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/c
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import { IFlexibleSash, HorizontalFlexibleSash } from 'sql/workbench/parts/query/browser/flexibleSash';
import { EditDataResultsEditor } from 'sql/workbench/parts/editData/browser/editDataResultsEditor';
import { EditDataResultsInput } from 'sql/workbench/parts/editData/common/editDataResultsInput';
import { EditDataResultsInput } from 'sql/workbench/parts/editData/browser/editDataResultsInput';
import { CancellationToken } from 'vs/base/common/cancellation';
import { IStorageService } from 'vs/platform/storage/common/storage';
import { IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService';

View File

@@ -6,7 +6,6 @@
import { EditorInput, EditorModel, ConfirmResult, EncodingMode } from 'vs/workbench/common/editor';
import { IConnectionManagementService, IConnectableInput, INewConnectionParams } from 'sql/platform/connection/common/connectionManagement';
import { IQueryModelService } from 'sql/platform/query/common/queryModel';
import { dispose } from 'vs/base/common/lifecycle';
import { Event, Emitter } from 'vs/base/common/event';
import { EditSessionReadyParams } from 'azdata';
import { URI } from 'vs/base/common/uri';
@@ -14,7 +13,7 @@ import * as nls from 'vs/nls';
import { INotificationService } from 'vs/platform/notification/common/notification';
import Severity from 'vs/base/common/severity';
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import { EditDataResultsInput } from 'sql/workbench/parts/editData/common/editDataResultsInput';
import { EditDataResultsInput } from 'sql/workbench/parts/editData/browser/editDataResultsInput';
import { IEditorViewState } from 'vs/editor/common/editorCommon';
/**

View File

@@ -20,7 +20,7 @@ import { BareResultsGridInfo } from 'sql/workbench/parts/query/browser/queryResu
import { IEditDataComponentParams } from 'sql/platform/bootstrap/common/bootstrapParams';
import { EditDataModule } from 'sql/workbench/parts/editData/browser/editData.module';
import { EDITDATA_SELECTOR } from 'sql/workbench/parts/editData/browser/editData.component';
import { EditDataResultsInput } from 'sql/workbench/parts/editData/common/editDataResultsInput';
import { EditDataResultsInput } from 'sql/workbench/parts/editData/browser/editDataResultsInput';
import { CancellationToken } from 'vs/base/common/cancellation';
import { IStorageService } from 'vs/platform/storage/common/storage';

View File

@@ -14,7 +14,7 @@ import { AgentViewComponent } from 'sql/workbench/parts/jobManagement/browser/ag
import { CommonServiceInterface } from 'sql/platform/bootstrap/browser/commonServiceInterface.service';
import { RunJobAction, StopJobAction, EditJobAction, JobsRefreshAction } from 'sql/platform/jobManagement/browser/jobActions';
import { JobCacheObject } from 'sql/platform/jobManagement/common/jobManagementService';
import { JobManagementUtilities } from 'sql/platform/jobManagement/common/jobManagementUtilities';
import { JobManagementUtilities } from 'sql/platform/jobManagement/browser/jobManagementUtilities';
import { IJobManagementService } from 'sql/platform/jobManagement/common/interfaces';
import {
JobHistoryController, JobHistoryDataSource,

View File

@@ -15,7 +15,7 @@ import { AgentViewComponent } from 'sql/workbench/parts/jobManagement/browser/ag
import { RowDetailView } from 'sql/base/browser/ui/table/plugins/rowDetailView';
import { JobCacheObject } from 'sql/platform/jobManagement/common/jobManagementService';
import { EditJobAction, DeleteJobAction, NewJobAction, RunJobAction } from 'sql/platform/jobManagement/browser/jobActions';
import { JobManagementUtilities } from 'sql/platform/jobManagement/common/jobManagementUtilities';
import { JobManagementUtilities } from 'sql/platform/jobManagement/browser/jobManagementUtilities';
import { HeaderFilter } from 'sql/base/browser/ui/table/plugins/headerFilter.plugin';
import { IJobManagementService } from 'sql/platform/jobManagement/common/interfaces';
import { JobManagementView, JobActionContext } from 'sql/workbench/parts/jobManagement/browser/jobManagementView';

View File

@@ -10,7 +10,7 @@ import { AngularDisposable } from 'sql/base/browser/lifecycle';
import { Event } from 'vs/base/common/event';
import { nb } from 'azdata';
import { ICellModel } from 'sql/workbench/parts/notebook/common/models/modelInterfaces';
import * as outputProcessor from 'sql/workbench/parts/notebook/common/models/outputProcessor';
import * as outputProcessor from 'sql/workbench/parts/notebook/browser/models/outputProcessor';
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
import * as DOM from 'vs/base/browser/dom';
import { ComponentHostDirective } from 'sql/workbench/parts/dashboard/browser/core/componentHost.directive';

View File

@@ -3,7 +3,7 @@
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
import { IRenderMime } from './renderMimeInterfaces';
import { ReadonlyJSONObject } from './jsonext';
import { ReadonlyJSONObject } from '../../common/models/jsonext';
import { IThemeService } from 'vs/platform/theme/common/themeService';
/**
@@ -96,4 +96,4 @@ export namespace MimeModel {
*/
themeService?: IThemeService;
}
}
}

View File

@@ -4,9 +4,9 @@
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
import { JSONObject, isPrimitive } from './jsonext';
import { JSONObject, isPrimitive } from '../../common/models/jsonext';
import { MimeModel } from './mimemodel';
import { nbformat } from './nbformat';
import { nbformat } from '../../common/models/nbformat';
import { nb } from 'azdata';
/**
@@ -108,4 +108,4 @@ export interface IOutputModelOptions {
* Whether the output is trusted. The default is false.
*/
trusted?: boolean;
}
}

View File

@@ -3,7 +3,7 @@
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
import { ReadonlyJSONObject } from './jsonext';
import { ReadonlyJSONObject } from '../../common/models/jsonext';
import { IThemeService } from 'vs/platform/theme/common/themeService';
/**

View File

@@ -8,7 +8,7 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actions';
import { SyncActionDescriptor, registerAction } from 'vs/platform/actions/common/actions';
import { NotebookInput } from 'sql/workbench/parts/notebook/common/models/notebookInput';
import { NotebookInput } from 'sql/workbench/parts/notebook/browser/models/notebookInput';
import { NotebookEditor } from 'sql/workbench/parts/notebook/browser/notebookEditor';
import { NewNotebookAction } from 'sql/workbench/parts/notebook/browser/notebookActions';
import { KeyMod } from 'vs/editor/common/standalone/standaloneBase';

View File

@@ -11,7 +11,7 @@ import { bootstrapAngular } from 'sql/platform/bootstrap/browser/bootstrapServic
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { CancellationToken } from 'vs/base/common/cancellation';
import { NotebookInput } from 'sql/workbench/parts/notebook/common/models/notebookInput';
import { NotebookInput } from 'sql/workbench/parts/notebook/browser/models/notebookInput';
import { NotebookModule } from 'sql/workbench/parts/notebook/browser/notebook.module';
import { NOTEBOOK_SELECTOR } from 'sql/workbench/parts/notebook/browser/notebook.component';
import { INotebookParams } from 'sql/workbench/services/notebook/common/notebookService';

View File

@@ -4,7 +4,7 @@
|----------------------------------------------------------------------------*/
import * as widgets from './widgets';
import { IRenderMime } from '../../common/models/renderMimeInterfaces';
import { IRenderMime } from '../models/renderMimeInterfaces';
/**
* A mime renderer factory for raw html.
@@ -92,4 +92,3 @@ export const standardRendererFactories: ReadonlyArray<IRenderMime.IRendererFacto
textRendererFactory,
dataResourceRendererFactory
];

View File

@@ -25,7 +25,7 @@ import { IAction } from 'vs/base/common/actions';
import { AngularDisposable } from 'sql/base/browser/lifecycle';
import { IMimeComponent } from 'sql/workbench/parts/notebook/browser/outputs/mimeRegistry';
import { ICellModel } from 'sql/workbench/parts/notebook/common/models/modelInterfaces';
import { MimeModel } from 'sql/workbench/parts/notebook/common/models/mimemodel';
import { MimeModel } from 'sql/workbench/parts/notebook/browser/models/mimemodel';
import { GridTableState } from 'sql/workbench/parts/query/common/gridPanelState';
import { GridTableBase } from 'sql/workbench/parts/query/browser/gridPanel';
import { getErrorMessage } from 'vs/base/common/errors';

View File

@@ -6,7 +6,7 @@ import { Type } from '@angular/core';
import * as platform from 'vs/platform/registry/common/platform';
import { ReadonlyJSONObject } from 'sql/workbench/parts/notebook/common/models/jsonext';
import { MimeModel } from 'sql/workbench/parts/notebook/common/models/mimemodel';
import { MimeModel } from 'sql/workbench/parts/notebook/browser/models/mimemodel';
import * as types from 'vs/base/common/types';
import { ICellModel } from 'sql/workbench/parts/notebook/common/models/modelInterfaces';
@@ -191,4 +191,4 @@ function sortedTypes(map: RankMap): string[] {
}
return p1.id - p2.id;
});
}
}

View File

@@ -6,7 +6,7 @@
import { IMimeComponent } from 'sql/workbench/parts/notebook/browser/outputs/mimeRegistry';
import { AngularDisposable } from 'sql/base/browser/lifecycle';
import { ElementRef, forwardRef, Inject, Component, OnInit, Input } from '@angular/core';
import { MimeModel } from 'sql/workbench/parts/notebook/common/models/mimemodel';
import { MimeModel } from 'sql/workbench/parts/notebook/browser/models/mimemodel';
import { INotebookService } from 'sql/workbench/services/notebook/common/notebookService';
import { RenderMimeRegistry } from 'sql/workbench/parts/notebook/browser/outputs/registry';
import { localize } from 'vs/nls';

View File

@@ -11,7 +11,7 @@ import * as types from 'vs/base/common/types';
import { AngularDisposable } from 'sql/base/browser/lifecycle';
import { IMimeComponent } from 'sql/workbench/parts/notebook/browser/outputs/mimeRegistry';
import { ICellModel } from 'sql/workbench/parts/notebook/common/models/modelInterfaces';
import { MimeModel } from 'sql/workbench/parts/notebook/common/models/mimemodel';
import { MimeModel } from 'sql/workbench/parts/notebook/browser/models/mimemodel';
import { getErrorMessage } from 'vs/base/common/errors';
type ObjectType = object;

View File

@@ -3,8 +3,8 @@
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
import { IRenderMime } from '../../common/models/renderMimeInterfaces';
import { MimeModel } from '../../common/models/mimemodel';
import { IRenderMime } from '../models/renderMimeInterfaces';
import { MimeModel } from '../models/mimemodel';
import { ReadonlyJSONObject } from '../../common/models/jsonext';
import { defaultSanitizer } from './sanitizer';

View File

@@ -4,7 +4,7 @@
|----------------------------------------------------------------------------*/
import { default as AnsiUp } from 'ansi_up';
import { IRenderMime } from '../../common/models/renderMimeInterfaces';
import { IRenderMime } from '../models/renderMimeInterfaces';
import { URLExt } from '../../common/models/url';
import { URI } from 'vs/base/common/uri';

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import * as renderers from './renderers';
import { IRenderMime } from '../../common/models/renderMimeInterfaces';
import { IRenderMime } from '../models/renderMimeInterfaces';
import { ReadonlyJSONObject } from '../../common/models/jsonext';
import * as tableRenderers from 'sql/workbench/parts/notebook/browser/outputs/tableRenderers';

View File

@@ -18,11 +18,6 @@ export function isStream(output: nb.ICellOutput): output is nb.IStreamResult {
return output.output_type === 'stream';
}
export function getUserHome(): string {
return process.env.HOME || process.env.USERPROFILE;
}
export function getProvidersForFileName(fileName: string, notebookService: INotebookService): string[] {
let fileExt = path.extname(fileName);
let providers: string[];

View File

@@ -16,7 +16,7 @@ import { INotebookService } from 'sql/workbench/services/notebook/common/noteboo
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { NotebookMarkdownRenderer } from 'sql/workbench/parts/notebook/electron-browser/outputs/notebookMarkdown';
import { MimeModel } from 'sql/workbench/parts/notebook/common/models/mimemodel';
import { MimeModel } from 'sql/workbench/parts/notebook/browser/models/mimemodel';
import { ICellModel } from 'sql/workbench/parts/notebook/common/models/modelInterfaces';
import { useInProcMarkdown, convertVscodeResourceToFileInSubDirectories } from 'sql/workbench/parts/notebook/common/models/notebookUtils';
import { URI } from 'vs/base/common/uri';

View File

@@ -230,7 +230,7 @@ export class QueryResultsView extends Disposable {
this.hideChart();
this.hidePlan();
this.hideDynamicViewModelTabs();
this.input.state.visibleTabs = new Set();
this.input.state.visibleTabs.clear();
this.input.state.activeTab = this.resultsTab.identifier;
}));
this.runnerDisposables.add(runner.onQueryEnd(() => {

View File

@@ -5,7 +5,6 @@
import { localize } from 'vs/nls';
import { EditorInput } from 'vs/workbench/common/editor';
import { Emitter } from 'vs/base/common/event';
import { TopOperationsState } from 'sql/workbench/parts/queryPlan/common/topOperationsState';
import { ChartState } from 'sql/workbench/parts/charts/common/interfaces';
@@ -15,15 +14,15 @@ import { GridPanelState } from 'sql/workbench/parts/query/common/gridPanelState'
import { QueryModelViewState } from 'sql/workbench/parts/query/common/modelViewTab/modelViewState';
export class ResultsViewState {
public gridPanelState: GridPanelState = new GridPanelState();
public messagePanelState: MessagePanelState = new MessagePanelState();
public chartState: ChartState = new ChartState();
public queryPlanState: QueryPlanState = new QueryPlanState();
public topOperationsState = new TopOperationsState();
public dynamicModelViewTabsState: Map<string, QueryModelViewState> = new Map<string, QueryModelViewState>();
public readonly gridPanelState: GridPanelState = new GridPanelState();
public readonly messagePanelState: MessagePanelState = new MessagePanelState();
public readonly chartState: ChartState = new ChartState();
public readonly queryPlanState: QueryPlanState = new QueryPlanState();
public readonly topOperationsState = new TopOperationsState();
public readonly dynamicModelViewTabsState: Map<string, QueryModelViewState> = new Map<string, QueryModelViewState>();
public activeTab: string;
public visibleTabs: Set<string> = new Set<string>();
public readonly visibleTabs: Set<string> = new Set<string>();
dispose() {
this.gridPanelState.dispose();
@@ -43,19 +42,6 @@ export class ResultsViewState {
*/
export class QueryResultsInput extends EditorInput {
// Tracks if the editor that holds this input should be visible (i.e. true if a query has been run)
private _visible: boolean;
// Tracks if the editor has holds this input has has bootstrapped angular yet
private _hasBootstrapped: boolean;
// Holds the HTML content for the editor when the editor discards this input and loads another
private _editorContainer: HTMLElement;
public css: HTMLStyleElement;
public readonly onRestoreViewStateEmitter = new Emitter<void>();
public readonly onSaveViewStateEmitter = new Emitter<void>();
private _state = new ResultsViewState();
public get state(): ResultsViewState {
@@ -64,8 +50,6 @@ export class QueryResultsInput extends EditorInput {
constructor(private _uri: string) {
super();
this._visible = false;
this._hasBootstrapped = false;
}
close() {
@@ -98,56 +82,17 @@ export class QueryResultsInput extends EditorInput {
return false;
}
public setBootstrappedTrue(): void {
this._hasBootstrapped = true;
}
public dispose(): void {
this._disposeContainer();
super.dispose();
}
private _disposeContainer() {
if (!this._editorContainer) {
return;
}
let parentContainer = this._editorContainer.parentNode;
if (parentContainer) {
parentContainer.removeChild(this._editorContainer);
this._editorContainer = null;
}
}
//// Properties
static get ID() {
return 'workbench.query.queryResultsInput';
}
set container(container: HTMLElement) {
this._disposeContainer();
this._editorContainer = container;
}
get container(): HTMLElement {
return this._editorContainer;
}
get hasBootstrapped(): boolean {
return this._hasBootstrapped;
}
get visible(): boolean {
return this._visible;
}
set visible(visible: boolean) {
this._visible = visible;
}
get uri(): string {
return this._uri;
}
}

View File

@@ -11,7 +11,7 @@ import { URI } from 'vs/base/common/uri';
import { RenderMimeRegistry } from 'sql/workbench/parts/notebook/browser/outputs/registry';
import { ModelFactory } from 'sql/workbench/parts/notebook/common/models/modelFactory';
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
import { NotebookInput } from 'sql/workbench/parts/notebook/common/models/notebookInput';
import { NotebookInput } from 'sql/workbench/parts/notebook/browser/models/notebookInput';
import { ISingleNotebookEditOperation } from 'sql/workbench/api/common/sqlExtHostTypes';
import { ICellModel, INotebookModel } from 'sql/workbench/parts/notebook/common/models/modelInterfaces';
import { NotebookChangeType } from 'sql/workbench/parts/notebook/common/models/contracts';

View File

@@ -556,10 +556,10 @@ export class SQLFuture extends Disposable implements FutureInternal {
}
htmlString += '</tr>';
}
for (let row in d.resultSubset.rows) {
for (const row of d.resultSubset.rows) {
htmlString += '<tr>';
for (let column in columns) {
htmlString += '<td>' + escape(d.resultSubset.rows[row][column].displayValue) + '</td>';
for (let i = 0; i <= columns.length; i++) {
htmlString += '<td>' + escape(row[i].displayValue) + '</td>';
}
htmlString += '</tr>';
}

View File

@@ -5,7 +5,7 @@
import { QueryResultsInput } from 'sql/workbench/parts/query/common/queryResultsInput';
import { QueryInput } from 'sql/workbench/parts/query/common/queryInput';
import { EditDataInput } from 'sql/workbench/parts/editData/common/editDataInput';
import { EditDataInput } from 'sql/workbench/parts/editData/browser/editDataInput';
import { IConnectableInput, IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
import { IQueryEditorService, IQueryEditorOptions } from 'sql/workbench/services/queryEditor/common/queryEditorService';
import { QueryPlanInput } from 'sql/workbench/parts/queryPlan/common/queryPlanInput';
@@ -23,7 +23,7 @@ import paths = require('vs/base/common/extpath');
import { isLinux } from 'vs/base/common/platform';
import { Schemas } from 'vs/base/common/network';
import { INotificationService } from 'vs/platform/notification/common/notification';
import { EditDataResultsInput } from 'sql/workbench/parts/editData/common/editDataResultsInput';
import { EditDataResultsInput } from 'sql/workbench/parts/editData/browser/editDataResultsInput';
import { IEditorInput, IEditor } from 'vs/workbench/common/editor';
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { ILanguageSelection } from 'vs/editor/common/services/modeService';

View File

@@ -17,7 +17,7 @@ import { coalesce } from 'vs/base/common/arrays';
import { QueryInput } from 'sql/workbench/parts/query/common/queryInput';
import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput';
import * as CustomInputConverter from 'sql/workbench/common/customInputConverter';
import { NotebookInput } from 'sql/workbench/parts/notebook/common/models/notebookInput';
import { NotebookInput } from 'sql/workbench/parts/notebook/browser/models/notebookInput';
import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput';
const EditorOpenPositioning = {

View File

@@ -339,8 +339,7 @@ export class TerminalTaskSystem implements ITaskSystem {
private async executeTask(task: Task, resolver: ITaskResolver, trigger: string): Promise<ITaskSummary> {
let promises: Promise<ITaskSummary>[] = [];
if (task.configurationProperties.dependsOn) {
for (let index in task.configurationProperties.dependsOn) {
const dependency = task.configurationProperties.dependsOn[index];
for (const dependency of task.configurationProperties.dependsOn) { //{{SQL CARBON EDIT}} change to for of for linting
let dependencyTask = resolver.resolve(dependency.workspaceFolder, dependency.task!);
if (dependencyTask) {
let key = dependencyTask.getMapKey();

View File

@@ -985,14 +985,14 @@ export namespace KeyedTaskIdentifier {
function sortedStringify(literal: any): string {
const keys = Object.keys(literal).sort();
let result: string = '';
for (let position in keys) {
let stringified = literal[keys[position]];
for (const position of keys) { // {{SQL CARBON EDIT}} change to of for linting
let stringified = literal[position];
if (stringified instanceof Object) {
stringified = sortedStringify(stringified);
} else if (typeof stringified === 'string') {
stringified = stringified.replace(/,/g, ',,');
}
result += keys[position] + ',' + stringified + ',';
result += position + ',' + stringified + ',';
}
return result;
}

View File

@@ -141,7 +141,7 @@ import { SqlOAuthService } from 'sql/platform/oAuth/electron-browser/sqlOAuthSer
import { IClipboardService as sqlIClipboardService } from 'sql/platform/clipboard/common/clipboardService';
import { ClipboardService as sqlClipboardService } from 'sql/platform/clipboard/electron-browser/clipboardService';
import { AccountPickerService } from 'sql/platform/accounts/browser/accountPickerService';
import { IAccountPickerService } from 'sql/platform/accounts/common/accountPicker';
import { IAccountPickerService } from 'sql/platform/accounts/browser/accountPicker';
import { IResourceProviderService } from 'sql/workbench/services/resourceProvider/common/resourceProviderService';
import { ResourceProviderService } from 'sql/workbench/services/resourceProvider/browser/resourceProviderService';
import { IDashboardViewService } from 'sql/platform/dashboard/common/dashboardViewService';

View File

@@ -9,10 +9,10 @@
"no-duplicate-super": true,
"no-duplicate-switch-case": true,
"no-duplicate-variable": true,
// "no-for-in-array": true, // {{SQL CARBON EDIT}} @anthonydresser disable till we fix
"no-for-in-array": true,
"no-eval": true,
"no-redundant-jsdoc": true,
// "no-restricted-globals": true, // {{SQL CARBON EDIT}} @anthonydresser disable till we fix
"no-restricted-globals": true,
"no-sparse-arrays": true,
"no-string-throw": true,
"no-unsafe-finally": true,
@@ -170,6 +170,60 @@
],
// {{SQL CARBON EDIT}}
// remove import patterns and layering
"no-nodejs-globals": [
true,
{
"target": "**/{vs,sql}/base/common/{path,process,platform}.ts",
"allowed": [
"process" // -> defines safe access to process
]
},
{
"target": "**/{vs,sql}/**/test/{common,browser}/**",
"allowed": [
"process",
"Buffer",
"__filename",
"__dirname"
]
},
{
"target": "**/{vs,sql}/workbench/api/common/extHostExtensionService.ts",
"allowed": [
"global" // -> safe access to 'global'
]
},
{
"target": "**/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts",
"allowed": [
"process"
]
},
{
"target": "**/{vs,sql}/**/{common,browser}/**",
"allowed": [ /* none */]
}
],
"no-dom-globals": [
true,
{
"target": "**/{vs,sql}/**/test/{common,node,electron-main}/**",
"allowed": [
"document",
"HTMLElement"
]
},
{
"target": "**/vs/workbench/contrib/terminal/common/{terminal.ts,terminalService.ts}",
"allowed": [
"HTMLElement"
]
},
{
"target": "**/{vs,sql}/**/{common,node,electron-main}/**",
"allowed": [ /* none */]
}
],
"duplicate-imports": true,
"no-new-buffer": true,
"translation-remind": true,