mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Fix a bunch of strict issues (#11857)
* fix a bunch of strict issues * fix tests * fix tests
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -25,7 +25,7 @@ export type TabType = 'tab' | 'group-header';
|
||||
export class TabComponent implements OnDestroy {
|
||||
private _child?: TabChild;
|
||||
@ContentChild(TemplateRef) templateRef!: TemplateRef<any>;
|
||||
@Input() public title!: string;
|
||||
@Input() public title?: string;
|
||||
@Input() public canClose!: boolean;
|
||||
@Input() public actions?: Array<Action>;
|
||||
@Input() public iconClass?: string;
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<string, number>();
|
||||
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<string, number>();
|
||||
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[] {
|
||||
|
||||
@@ -482,7 +482,7 @@ export class MouseController<T> implements IDisposable {
|
||||
if (document.activeElement !== e.browserEvent.target) {
|
||||
this.table.domFocus();
|
||||
}
|
||||
const merger = (lastEvent: ITableMouseEvent<T>, currentEvent: MouseEvent): ITableMouseEvent<T> => {
|
||||
const merger = (lastEvent: ITableMouseEvent<T> | null, currentEvent: MouseEvent): ITableMouseEvent<T> => {
|
||||
return this.view.toMouseEvent(currentEvent);
|
||||
};
|
||||
this._mouseMoveMonitor.startMonitoring(e.browserEvent.target as HTMLElement, e.buttons, merger, e => this.onMouseMove(e), () => this.onMouseStop());
|
||||
|
||||
@@ -27,7 +27,7 @@ export interface ButtonClickEventArgs<T extends Slick.SlickData> {
|
||||
export class ButtonColumn<T extends Slick.SlickData> implements Slick.Plugin<T> {
|
||||
private _handler = new Slick.EventHandler();
|
||||
private _definition: ButtonColumnDefinition<T>;
|
||||
private _grid: Slick.Grid<T>;
|
||||
private _grid!: Slick.Grid<T>;
|
||||
private _onClick = new Emitter<ButtonClickEventArgs<T>>();
|
||||
public onClick = this._onClick.event;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ export class TextWithIconColumn<T extends Slick.SlickData> {
|
||||
}
|
||||
private formatter(row: number, cell: number, value: any, columnDef: Slick.Column<T>, dataContext: T): string {
|
||||
const iconColumn = columnDef as TextWithIconColumnDefinition<T>;
|
||||
return `<div class="icon codicon slick-icon-cell-content ${dataContext[iconColumn.iconCssClassField]}">${value}</div>`;
|
||||
return `<div class="icon codicon slick-icon-cell-content ${iconColumn.iconCssClassField ? dataContext[iconColumn.iconCssClassField] : ''}">${value}</div>`;
|
||||
}
|
||||
|
||||
public get definition(): TextWithIconColumnDefinition<T> {
|
||||
|
||||
@@ -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 ((<HTMLElement>this._overflow.firstChild).className !== 'taskbarSeparator') {
|
||||
(<HTMLElement>this._overflow.firstChild.firstChild).setAttribute('role', 'menuItem');
|
||||
(<HTMLElement>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 ((<HTMLElement>item).className !== 'taskbarSeparator') {
|
||||
(<HTMLElement>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 ((<HTMLElement>item).className !== 'taskbarSeparator') {
|
||||
(<HTMLElement>item.firstChild).setAttribute('role', 'button');
|
||||
}
|
||||
this._actionsList.insertBefore(item, this._actionsList.lastChild);
|
||||
|
||||
// move placeholder in this._items if item isn't a separator
|
||||
if (!(<HTMLElement>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 (!(<HTMLElement>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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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;
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<boolean> {
|
||||
@@ -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<azdata.Account[]> {
|
||||
return Promise.resolve(storedAccounts);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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<IResolvedExternalUri> {
|
||||
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<boolean> { return Promise.resolve(true); }
|
||||
async resolveExternalUri(uri: any) { return undefined; }
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -263,4 +263,3 @@ suite('Assessment Actions', () => {
|
||||
notificationService.verify(s => s.prompt(TypeMoq.It.isAny(), TypeMoq.It.isAny(), TypeMoq.It.isAny()), TypeMoq.Times.once());
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user