diff --git a/src/sql/base/browser/ui/loadingSpinner/loadingSpinner.component.ts b/src/sql/base/browser/ui/loadingSpinner/loadingSpinner.component.ts index ded55f5405..2a1fb3722e 100644 --- a/src/sql/base/browser/ui/loadingSpinner/loadingSpinner.component.ts +++ b/src/sql/base/browser/ui/loadingSpinner/loadingSpinner.component.ts @@ -37,11 +37,11 @@ export default class LoadingSpinner implements OnChanges { } @Input() - loading: boolean; + loading?: boolean; @Input() - loadingMessage: string; + loadingMessage?: string; @Input() - loadingCompletedMessage: string; + loadingCompletedMessage?: string; } diff --git a/src/sql/base/browser/ui/panel/panel.component.ts b/src/sql/base/browser/ui/panel/panel.component.ts index 6c679c7279..add79079da 100644 --- a/src/sql/base/browser/ui/panel/panel.component.ts +++ b/src/sql/base/browser/ui/panel/panel.component.ts @@ -107,7 +107,7 @@ export class PanelComponent extends Disposable implements IThemable { private _actionbar?: ActionBar; private _mru: TabComponent[] = []; private _tabExpanded: boolean = true; - private _styleElement: HTMLStyleElement; + private _styleElement!: HTMLStyleElement; protected AutoScrollbarVisibility = ScrollbarVisibility.Auto; // used by angular template protected HiddenScrollbarVisibility = ScrollbarVisibility.Hidden; // used by angular template @@ -266,7 +266,7 @@ export class PanelComponent extends Disposable implements IThemable { public updateTab(tabId: string, config: { title?: string, iconClass?: string }): void { // First find the tab and update it with the new values. Then manually refresh the // tab header since it won't detect changes made to the corresponding tab by itself. - let tabHeader: TabHeaderComponent; + let tabHeader: TabHeaderComponent | undefined; const tabHeaders = this._tabHeaders.toArray(); const tab = this._tabs.find((item, i) => { if (item.identifier === tabId) { diff --git a/src/sql/base/browser/ui/panel/tab.component.ts b/src/sql/base/browser/ui/panel/tab.component.ts index 0cca4bc2c0..3761f2d765 100644 --- a/src/sql/base/browser/ui/panel/tab.component.ts +++ b/src/sql/base/browser/ui/panel/tab.component.ts @@ -25,7 +25,7 @@ export type TabType = 'tab' | 'group-header'; export class TabComponent implements OnDestroy { private _child?: TabChild; @ContentChild(TemplateRef) templateRef!: TemplateRef; - @Input() public title!: string; + @Input() public title?: string; @Input() public canClose!: boolean; @Input() public actions?: Array; @Input() public iconClass?: string; diff --git a/src/sql/base/browser/ui/scrollableView/scrollableView.ts b/src/sql/base/browser/ui/scrollableView/scrollableView.ts index f5c3eb7800..d77b89eecf 100644 --- a/src/sql/base/browser/ui/scrollableView/scrollableView.ts +++ b/src/sql/base/browser/ui/scrollableView/scrollableView.ts @@ -102,7 +102,7 @@ export class ScrollableView extends Disposable { height: typeof height === 'number' ? height : DOM.getContentHeight(this.domNode) }; - this.renderHeight = scrollDimensions.height; + this.renderHeight = scrollDimensions.height!; this.width = width ?? DOM.getContentWidth(this.domNode); @@ -110,7 +110,7 @@ export class ScrollableView extends Disposable { if (this.scrollableElementUpdateDisposable) { this.scrollableElementUpdateDisposable.dispose(); - this.scrollableElementUpdateDisposable = null; + this.scrollableElementUpdateDisposable = undefined; scrollDimensions.scrollHeight = this.scrollHeight; } @@ -120,7 +120,7 @@ export class ScrollableView extends Disposable { setScrollTop(scrollTop: number): void { if (this.scrollableElementUpdateDisposable) { this.scrollableElementUpdateDisposable.dispose(); - this.scrollableElementUpdateDisposable = null; + this.scrollableElementUpdateDisposable = undefined; this.scrollableElement.setScrollDimensions({ scrollHeight: this.scrollHeight }); } @@ -136,7 +136,7 @@ export class ScrollableView extends Disposable { public addViews(views: IView[]): void { // @todo anthonydresser add ability to splice into the middle of the list and remove a particular index const lastRenderRange = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight); - const items = views.map(view => ({ size: view.minimumSize, view, disposables: [], index: 0 })); + const items: IItem[] = views.map(view => ({ size: view.minimumSize, view, disposables: [], index: 0 })); items.map(i => i.disposables.push(i.view.onDidChange(() => this.rerender(this.getRenderRange(this.lastRenderTop, this.lastRenderHeight))))); @@ -256,7 +256,7 @@ export class ScrollableView extends Disposable { // DOM operations - private insertItemInDOM(index: number, beforeElement: HTMLElement | null): void { + private insertItemInDOM(index: number, beforeElement: HTMLElement | undefined): void { const item = this.items[index]; if (!item.domNode) { @@ -298,29 +298,29 @@ export class ScrollableView extends Disposable { private removeItemFromDOM(index: number): void { const item = this.items[index]; - if (item) { + if (item && item.domNode) { item.domNode.remove(); item.onDidInsertDisposable?.dispose(); if (item.view.onDidRemove) { item.onDidRemoveDisposable = DOM.scheduleAtNextAnimationFrame(() => { // we don't trust the items to be performant so don't interrupt our operations - item.view.onDidRemove(); + item.view.onDidRemove!(); }); } } } - private getNextToLastElement(ranges: IRange[]): HTMLElement | null { + private getNextToLastElement(ranges: IRange[]): HTMLElement | undefined { const lastRange = ranges[ranges.length - 1]; if (!lastRange) { - return null; + return undefined; } const nextToLastItem = this.items[lastRange.end]; if (!nextToLastItem) { - return null; + return undefined; } return nextToLastItem.domNode; @@ -333,7 +333,7 @@ export class ScrollableView extends Disposable { if (!this.scrollableElementUpdateDisposable) { this.scrollableElementUpdateDisposable = DOM.scheduleAtNextAnimationFrame(() => { this.scrollableElement.setScrollDimensions({ scrollHeight: this.scrollHeight }); - this.scrollableElementUpdateDisposable = null; + this.scrollableElementUpdateDisposable = undefined; }); } } diff --git a/src/sql/base/browser/ui/selectBox/selectBox.ts b/src/sql/base/browser/ui/selectBox/selectBox.ts index 6230588a59..71dc09558c 100644 --- a/src/sql/base/browser/ui/selectBox/selectBox.ts +++ b/src/sql/base/browser/ui/selectBox/selectBox.ts @@ -68,7 +68,9 @@ export class SelectBox extends vsSelectBox { let optionItems: SelectOptionItemSQL[] = SelectBox.createOptions(options); super(optionItems, 0, contextViewProvider, undefined, selectBoxOptions); + this._optionsDictionary = new Map(); this.populateOptionsDictionary(optionItems); + this._dialogOptions = optionItems; const option = this._optionsDictionary.get(selectedOption); if (option) { super.select(option); @@ -144,7 +146,7 @@ export class SelectBox extends vsSelectBox { } public populateOptionsDictionary(options: SelectOptionItemSQL[]) { - this._optionsDictionary = new Map(); + this._optionsDictionary.clear(); for (let i = 0; i < options.length; i++) { this._optionsDictionary.set(options[i].value, i); } @@ -198,7 +200,7 @@ export class SelectBox extends vsSelectBox { } public get label(): string | undefined { - return this._dialogOptions.find(s => s.value === this._selectedOption).text; + return this._dialogOptions?.find(s => s.value === this._selectedOption)?.text; } public get values(): string[] { diff --git a/src/sql/base/browser/ui/table/highPerf/tableWidget.ts b/src/sql/base/browser/ui/table/highPerf/tableWidget.ts index 670921962d..8d6c8ecfce 100644 --- a/src/sql/base/browser/ui/table/highPerf/tableWidget.ts +++ b/src/sql/base/browser/ui/table/highPerf/tableWidget.ts @@ -482,7 +482,7 @@ export class MouseController implements IDisposable { if (document.activeElement !== e.browserEvent.target) { this.table.domFocus(); } - const merger = (lastEvent: ITableMouseEvent, currentEvent: MouseEvent): ITableMouseEvent => { + const merger = (lastEvent: ITableMouseEvent | null, currentEvent: MouseEvent): ITableMouseEvent => { return this.view.toMouseEvent(currentEvent); }; this._mouseMoveMonitor.startMonitoring(e.browserEvent.target as HTMLElement, e.buttons, merger, e => this.onMouseMove(e), () => this.onMouseStop()); diff --git a/src/sql/base/browser/ui/table/plugins/buttonColumn.plugin.ts b/src/sql/base/browser/ui/table/plugins/buttonColumn.plugin.ts index 99cbb8a0ed..20b0849ed9 100644 --- a/src/sql/base/browser/ui/table/plugins/buttonColumn.plugin.ts +++ b/src/sql/base/browser/ui/table/plugins/buttonColumn.plugin.ts @@ -27,7 +27,7 @@ export interface ButtonClickEventArgs { export class ButtonColumn implements Slick.Plugin { private _handler = new Slick.EventHandler(); private _definition: ButtonColumnDefinition; - private _grid: Slick.Grid; + private _grid!: Slick.Grid; private _onClick = new Emitter>(); public onClick = this._onClick.event; diff --git a/src/sql/base/browser/ui/table/plugins/textWithIconColumn.ts b/src/sql/base/browser/ui/table/plugins/textWithIconColumn.ts index 023c0670cf..f4cd02dbb6 100644 --- a/src/sql/base/browser/ui/table/plugins/textWithIconColumn.ts +++ b/src/sql/base/browser/ui/table/plugins/textWithIconColumn.ts @@ -37,7 +37,7 @@ export class TextWithIconColumn { } private formatter(row: number, cell: number, value: any, columnDef: Slick.Column, dataContext: T): string { const iconColumn = columnDef as TextWithIconColumnDefinition; - return `
${value}
`; + return `
${value}
`; } public get definition(): TextWithIconColumnDefinition { diff --git a/src/sql/base/browser/ui/taskbar/overflowActionbar.ts b/src/sql/base/browser/ui/taskbar/overflowActionbar.ts index 0b7267a86e..35951b0f8f 100644 --- a/src/sql/base/browser/ui/taskbar/overflowActionbar.ts +++ b/src/sql/base/browser/ui/taskbar/overflowActionbar.ts @@ -26,9 +26,9 @@ const defaultOptions: IActionBarOptions = { export class OverflowActionBar extends ActionBar { // Elements private _overflow: HTMLElement; - private _moreItemElement: HTMLElement; - private _moreActionsElement: HTMLElement; - private _previousWidth: number; + private _moreItemElement?: HTMLElement; + private _moreActionsElement?: HTMLElement; + private _previousWidth: number = 0; constructor(container: HTMLElement, options: IActionBarOptions = defaultOptions) { super(container, options); @@ -74,7 +74,7 @@ export class OverflowActionBar extends ActionBar { this.createMoreItemElement(); } - this._moreItemElement.style.display = 'block'; + this._moreItemElement!.style.display = 'block'; while (width < fullWidth) { let index = this._actionsList.childNodes.length - 2; // remove the last toolbar action before the more actions '...' if (index > -1) { @@ -94,7 +94,7 @@ export class OverflowActionBar extends ActionBar { this.collapseItem(); break; } else if (!this._overflow.hasChildNodes()) { - this._moreItemElement.style.display = 'none'; + this._moreItemElement!.style.display = 'none'; } } } @@ -117,23 +117,26 @@ export class OverflowActionBar extends ActionBar { // change role to menuItem when it's in the overflow if ((this._overflow.firstChild).className !== 'taskbarSeparator') { - (this._overflow.firstChild.firstChild).setAttribute('role', 'menuItem'); + (this._overflow.firstChild!.firstChild).setAttribute('role', 'menuItem'); } } public restoreItem(): void { - let item = this._overflow.removeChild(this._overflow.firstChild); - // change role back to button when it's in the toolbar - if ((item).className !== 'taskbarSeparator') { - (item.firstChild).setAttribute('role', 'button'); - } - this._actionsList.insertBefore(item, this._actionsList.lastChild); + let firstChild = this._overflow.firstChild; + if (firstChild) { + let item = this._overflow.removeChild(firstChild); + // change role back to button when it's in the toolbar + if ((item).className !== 'taskbarSeparator') { + (item.firstChild).setAttribute('role', 'button'); + } + this._actionsList.insertBefore(item, this._actionsList.lastChild); - // move placeholder in this._items if item isn't a separator - if (!(item).classList.contains('taskbarSeparator')) { - let placeHolderIndex = this._items.findIndex(i => i === undefined); - let placeHolderItem = this._items.splice(placeHolderIndex, 1); - this._items.splice(placeHolderIndex + 1, 0, placeHolderItem[0]); + // move placeholder in this._items if item isn't a separator + if (!(item).classList.contains('taskbarSeparator')) { + let placeHolderIndex = this._items.findIndex(i => i === undefined); + let placeHolderItem = this._items.splice(placeHolderIndex, 1); + this._items.splice(placeHolderIndex + 1, 0, placeHolderItem[0]); + } } } @@ -163,7 +166,7 @@ export class OverflowActionBar extends ActionBar { // Close overflow if Escape is pressed if (event.equals(KeyCode.Escape)) { this.hideOverflowDisplay(); - this._moreActionsElement.focus(); + this._moreActionsElement!.focus(); } else if (event.equals(KeyCode.UpArrow)) { // up arrow on first element in overflow should move focus to the bottom of the overflow if (this._focusedItem === this._actionsList.childElementCount) { @@ -192,7 +195,7 @@ export class OverflowActionBar extends ActionBar { this._moreItemElement.appendChild(this._moreActionsElement); this._actionsList.appendChild(this._moreItemElement); - this._items.push(undefined); // add place holder for more item element + this._items.push(undefined!); // add place holder for more item element @anthonydresser, im not sure how this is working, vscode indexes into this value all the time... } public moreElementOnClick(event: MouseEvent | StandardKeyboardEvent): void { @@ -324,7 +327,7 @@ export class OverflowActionBar extends ActionBar { if (i === this._focusedItem) { // placeholder for location of moreActionsElement if (!actionItem) { - this._moreActionsElement.focus(); + this._moreActionsElement!.focus(); } else if (types.isFunction(actionItem.focus)) { actionItem.focus(); @@ -362,7 +365,7 @@ export class OverflowActionBar extends ActionBar { return this._overflow; } - public get focusedItem(): number { + public get focusedItem(): number | undefined { return this._focusedItem; } } diff --git a/src/sql/base/test/browser/ui/scrollableView/scrollableView.test.ts b/src/sql/base/test/browser/ui/scrollableView/scrollableView.test.ts index e30080ef28..ea9e6e2c54 100644 --- a/src/sql/base/test/browser/ui/scrollableView/scrollableView.test.ts +++ b/src/sql/base/test/browser/ui/scrollableView/scrollableView.test.ts @@ -20,7 +20,7 @@ class TestView extends Disposable implements IView { this._onDidLayout.fire({ height, width }); } - private _size: number; + private _size: number = 0; public get size(): number { return this._size; } @@ -135,7 +135,7 @@ suite('ScrollableView', () => { assert.equal(view1.size, 100, 'view1 is minimum size'); assert.equal(view2.size, 100, 'view2 is minimum size'); - assert.equal(view3.size, undefined, 'view3 should not have been layout yet'); + assert.equal(view3.size, 0, 'view3 should not have been layout yet'); }); test('reacts to changes in views', async () => { @@ -157,7 +157,7 @@ suite('ScrollableView', () => { assert.equal(view1.size, 130, 'view1 should be 130'); assert.equal(view2.size, 100, 'view2 should still be minimum size'); - assert.equal(view3.size, undefined, 'view3 should not have been layout yet'); + assert.equal(view3.size, 0, 'view3 should not have been layout yet'); }); test('programmatically scrolls', async () => { @@ -174,7 +174,7 @@ suite('ScrollableView', () => { assert.equal(view1.size, 100, 'view1 is minimum size'); assert.equal(view2.size, 100, 'view2 is minimum size'); - assert.equal(view3.size, undefined, 'view3 should not have been layout yet'); + assert.equal(view3.size, 0, 'view3 should not have been layout yet'); assert.equal(getViewChildren(container).length, 2, 'only 2 views are rendered'); scrollableView.setScrollTop(100); diff --git a/src/sql/base/test/browser/ui/selectBox/selectBox.test.ts b/src/sql/base/test/browser/ui/selectBox/selectBox.test.ts index 6ebfaa4d33..468b28d961 100644 --- a/src/sql/base/test/browser/ui/selectBox/selectBox.test.ts +++ b/src/sql/base/test/browser/ui/selectBox/selectBox.test.ts @@ -16,13 +16,13 @@ const options: SelectOptionItemSQL[] = [ suite('Select Box tests', () => { test('default value', () => { - const sb = new SelectBox(options, options[1].value, undefined, undefined, undefined); + const sb = new SelectBox(options, options[1].value, undefined!, undefined!, undefined!); assert(sb.value === options[1].value); }); test('values change', () => { - const sb = new SelectBox(options, options[1].value, undefined, undefined, undefined); + const sb = new SelectBox(options, options[1].value, undefined!, undefined!, undefined!); const newOptions = deepClone(options); { const moreOptions: SelectOptionItemSQL[] = [ @@ -38,7 +38,7 @@ suite('Select Box tests', () => { }); test('the selected option changes', () => { - const sb = new SelectBox(options, options[1].value, undefined, undefined, undefined); + const sb = new SelectBox(options, options[1].value, undefined!, undefined!, undefined!); sb.onSelect({ index: 0, @@ -50,16 +50,16 @@ suite('Select Box tests', () => { }); test('values get auto populated', () => { - const newOptions = deepClone(options).map(s => { return { text: s.text, value: undefined }; }); - const sb = new SelectBox(newOptions, undefined, undefined, undefined, undefined); + const newOptions = deepClone(options).map(s => { return { text: s.text, value: s.text }; }); + const sb = new SelectBox(newOptions, undefined!, undefined!, undefined!, undefined!); assert(equals(sb.values, newOptions.map(s => s.text))); }); test('value did not contain label', () => { - const newOptions = deepClone(options).map(s => { return { text: s.text, value: undefined }; }); + const newOptions = deepClone(options).map(s => { return { text: s.text, value: s.text }; }); delete newOptions[0].text; - const sb = new SelectBox(newOptions, undefined, undefined, undefined, undefined); + const sb = new SelectBox(newOptions, undefined!, undefined!, undefined!, undefined!); sb.onSelect({ diff --git a/src/sql/platform/accounts/common/accountActions.ts b/src/sql/platform/accounts/common/accountActions.ts index 24087653da..c0b7888f45 100644 --- a/src/sql/platform/accounts/common/accountActions.ts +++ b/src/sql/platform/accounts/common/accountActions.ts @@ -58,6 +58,7 @@ export class AddAccountAction extends Action { this.logService.error(`Error while adding account: ${err}`); this._addAccountErrorEmitter.fire(err); this._addAccountCompleteEmitter.fire(); + return false; })); } } diff --git a/src/sql/platform/accounts/test/common/testAccountManagementService.ts b/src/sql/platform/accounts/test/common/testAccountManagementService.ts index 2800464214..fa12fcc7ef 100644 --- a/src/sql/platform/accounts/test/common/testAccountManagementService.ts +++ b/src/sql/platform/accounts/test/common/testAccountManagementService.ts @@ -56,7 +56,7 @@ export class TestAccountManagementService implements IAccountManagementService { } getAccountSecurityToken(account: azdata.Account, tenant: string, resource: azdata.AzureResource): Thenable<{ token: string }> { - return Promise.resolve(undefined); + return Promise.resolve(undefined!); } removeAccount(accountKey: azdata.AccountKey): Thenable { @@ -105,7 +105,7 @@ export class AccountProviderStub implements azdata.AccountProvider { } getAccountSecurityToken(account: azdata.Account, tenant: string, resource: azdata.AzureResource): Thenable<{ token: string }> { - return Promise.resolve(undefined); + return Promise.resolve(undefined!); } initialize(storedAccounts: azdata.Account[]): Thenable { return Promise.resolve(storedAccounts); diff --git a/src/sql/platform/connection/test/common/connectionProfile.test.ts b/src/sql/platform/connection/test/common/connectionProfile.test.ts index 712f37eadc..6f2b621e7e 100644 --- a/src/sql/platform/connection/test/common/connectionProfile.test.ts +++ b/src/sql/platform/connection/test/common/connectionProfile.test.ts @@ -187,7 +187,7 @@ suite('SQL ConnectionProfileInfo tests', () => { }); test('createFromStoredProfile should set the id to new guid if not set in stored profile', () => { - let savedProfile = assign({}, storedProfile, { id: undefined }); + let savedProfile: IConnectionProfileStore = assign({}, storedProfile, { id: undefined }); let connectionProfile = ConnectionProfile.createFromStoredProfile(savedProfile, capabilitiesService); assert.equal(savedProfile.groupId, connectionProfile.groupId); assert.deepEqual(savedProfile.providerName, connectionProfile.providerName); diff --git a/src/sql/platform/connection/test/common/testConfigurationService.ts b/src/sql/platform/connection/test/common/testConfigurationService.ts index f473adbf4a..0b7b5529a1 100644 --- a/src/sql/platform/connection/test/common/testConfigurationService.ts +++ b/src/sql/platform/connection/test/common/testConfigurationService.ts @@ -33,14 +33,16 @@ export class TestConfigurationService implements IConfigurationService { let _target: 'user' | 'workspace' = (target as ConfigurationTarget) === ConfigurationTarget.USER ? 'user' : 'workspace'; let keyArray = key.split('.'); let targetObject = this.configuration[_target]; - for (let i = 0; i < keyArray.length; i++) { - if (i === keyArray.length - 1) { - targetObject[keyArray[i]] = value; - } else { - if (!targetObject[keyArray[i]]) { - targetObject[keyArray[i]] = {}; + if (targetObject) { + for (let i = 0; i < keyArray.length; i++) { + if (i === keyArray.length - 1) { + targetObject![keyArray[i]] = value; + } else { + if (!targetObject![keyArray[i]]) { + targetObject![keyArray[i]] = {}; + } + targetObject = targetObject![keyArray[i]]; } - targetObject = targetObject[keyArray[i]]; } } return Promise.resolve(void 0); diff --git a/src/sql/platform/connection/test/common/testConnectionManagementService.ts b/src/sql/platform/connection/test/common/testConnectionManagementService.ts index 52edf4001b..19630a7980 100644 --- a/src/sql/platform/connection/test/common/testConnectionManagementService.ts +++ b/src/sql/platform/connection/test/common/testConnectionManagementService.ts @@ -260,7 +260,7 @@ export class TestConnectionManagementService implements IConnectionManagementSer } getConnectionCredentials(profileId: string): Promise<{ [name: string]: string }> { - return Promise.resolve(undefined); + return Promise.resolve(undefined!); } getServerInfo(profileId: string): azdata.ServerInfo { diff --git a/src/sql/platform/opener/common/openerServiceStub.ts b/src/sql/platform/opener/common/openerServiceStub.ts index eb93513f80..2c0dda3bdb 100644 --- a/src/sql/platform/opener/common/openerServiceStub.ts +++ b/src/sql/platform/opener/common/openerServiceStub.ts @@ -3,15 +3,26 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { URI } from 'vs/base/common/uri'; -import { IOpenerService } from 'vs/platform/opener/common/opener'; +import { IOpenerService, IOpener, IValidator, IExternalUriResolver, IExternalOpener, ResolveExternalUriOptions, IResolvedExternalUri } from 'vs/platform/opener/common/opener'; +import { IDisposable } from 'vs/base/common/lifecycle'; export class OpenerServiceStub implements IOpenerService { + registerOpener(opener: IOpener): IDisposable { + throw new Error('Method not implemented.'); + } + registerValidator(validator: IValidator): IDisposable { + throw new Error('Method not implemented.'); + } + registerExternalUriResolver(resolver: IExternalUriResolver): IDisposable { + throw new Error('Method not implemented.'); + } + setExternalOpener(opener: IExternalOpener): void { + throw new Error('Method not implemented.'); + } + resolveExternalUri(resource: URI, options?: ResolveExternalUriOptions): Promise { + throw new Error('Method not implemented.'); + } _serviceBrand: undefined; - registerOpener() { return undefined; } - registerValidator() { return undefined; } - registerExternalUriResolver() { return undefined; } - setExternalOpener() { return undefined; } async open(resource: URI | string, options?: any): Promise { return Promise.resolve(true); } - async resolveExternalUri(uri: any) { return undefined; } } diff --git a/src/sql/platform/serialization/common/serializationService.ts b/src/sql/platform/serialization/common/serializationService.ts index e26e3b4741..b7ecdbebee 100644 --- a/src/sql/platform/serialization/common/serializationService.ts +++ b/src/sql/platform/serialization/common/serializationService.ts @@ -157,7 +157,7 @@ export class SerializationService implements ISerializationService { private createStartRequest(serializationRequest: SerializeDataParams, index: number): azdata.SerializeDataStartRequestParams { let batchSize = getBatchSize(serializationRequest.rowCount, index); - let rows = serializationRequest.getRowRange(index, serializationRequest.includeHeaders, batchSize); + let rows = serializationRequest.getRowRange(index, serializationRequest.includeHeaders ?? false, batchSize); let columns: azdata.SimpleColumnInfo[] = serializationRequest.columns.map(c => { // For now treat all as strings. In the future, would like to use the // type info for correct data type mapping @@ -186,7 +186,7 @@ export class SerializationService implements ISerializationService { private createContinueRequest(serializationRequest: SerializeDataParams, index: number): azdata.SerializeDataContinueRequestParams { let numberOfRows = getBatchSize(serializationRequest.rowCount, index); - let rows = serializationRequest.getRowRange(index, serializationRequest.includeHeaders, numberOfRows); + let rows = serializationRequest.getRowRange(index, serializationRequest.includeHeaders ?? false, numberOfRows); let isLastBatch = index + rows.length >= serializationRequest.rowCount; let continueSerializeRequest: azdata.SerializeDataContinueRequestParams = { filePath: serializationRequest.filePath, diff --git a/src/sql/workbench/contrib/assessment/test/browser/asmtActions.test.ts b/src/sql/workbench/contrib/assessment/test/browser/asmtActions.test.ts index cef25c43f5..395ccec0c9 100644 --- a/src/sql/workbench/contrib/assessment/test/browser/asmtActions.test.ts +++ b/src/sql/workbench/contrib/assessment/test/browser/asmtActions.test.ts @@ -263,4 +263,3 @@ suite('Assessment Actions', () => { notificationService.verify(s => s.prompt(TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny()), TypeMoq.Times.once()); }); }); - diff --git a/src/tsconfig.vscode.json b/src/tsconfig.vscode.json index c6ca3cdb7b..6819cd7f55 100644 --- a/src/tsconfig.vscode.json +++ b/src/tsconfig.vscode.json @@ -7,7 +7,10 @@ "noUnusedLocals": true, "strict": true, "forceConsistentCasingInFileNames": true, - "skipLibCheck": true + "strictNullChecks": true, + "strictPropertyInitialization": true, + "skipLibCheck": true, + "noImplicitAny": true }, "include": [ "./typings", @@ -20,12 +23,12 @@ // "./vs/code/**/*.ts", "./vs/editor/**/*.ts", "./vs/platform/**/*.ts", - "./vs/workbench/contrib/debug/common/debugProtocol.d.ts", - "./vs/workbench/services/**/*.ts", - "./sql/workbench/services/**/*.ts", + // "./vs/workbench/contrib/debug/common/debugProtocol.d.ts", + // "./vs/workbench/services/**/*.ts", "./sql/base/**/*.ts", "./sql/editor/**/*.ts", - "./sql/platform/**/*.ts" + "./sql/platform/**/*.ts", + // "./sql/workbench/services/**/*.ts" ], "exclude": [ "./vs/platform/workspaces/test/electron-main/workspacesMainService.test.ts",