diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 718587cb00..cb019d8df7 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -45,7 +45,7 @@ { "type": "npm", "script": "strict-null-check-watch", - "label": "TS - Strict Null Cheks", + "label": "TS - Strict Null Checks", "isBackground": true, "presentation": { "reveal": "never" diff --git a/src/sql/azdata.proposed.d.ts b/src/sql/azdata.proposed.d.ts index 5c5de52279..abf76a6945 100644 --- a/src/sql/azdata.proposed.d.ts +++ b/src/sql/azdata.proposed.d.ts @@ -67,7 +67,7 @@ declare module 'azdata' { } export interface SerializeDataResult { - messages: string; + messages?: string; succeeded: boolean; } diff --git a/src/sql/platform/backup/common/backupService.ts b/src/sql/platform/backup/common/backupService.ts index accd08321e..06f4122157 100644 --- a/src/sql/platform/backup/common/backupService.ts +++ b/src/sql/platform/backup/common/backupService.ts @@ -19,7 +19,7 @@ export const IBackupService = createDecorator(SERVICE_ID); export interface IBackupService { _serviceBrand: undefined; - getBackupConfigInfo(connectionUri: string): Thenable; + getBackupConfigInfo(connectionUri: string): Promise; /** * Backup a data source using the provided connection diff --git a/src/sql/platform/backup/common/backupServiceImp.ts b/src/sql/platform/backup/common/backupServiceImp.ts index 950c1ece7d..21f2378070 100644 --- a/src/sql/platform/backup/common/backupServiceImp.ts +++ b/src/sql/platform/backup/common/backupServiceImp.ts @@ -27,12 +27,12 @@ export class BackupService implements IBackupService { /** * Get database metadata needed to populate backup UI */ - public getBackupConfigInfo(connectionUri: string): Thenable { + public getBackupConfigInfo(connectionUri: string): Promise { let providerId: string = this._connectionService.getProviderIdFromUri(connectionUri); if (providerId) { let provider = this._providers[providerId]; if (provider) { - return provider.getBackupConfigInfo(connectionUri); + return Promise.resolve(provider.getBackupConfigInfo(connectionUri)); } } return Promise.resolve(undefined); @@ -57,7 +57,7 @@ export class BackupService implements IBackupService { }); } - private getProvider(connectionUri: string): { provider: azdata.BackupProvider, providerName: string } { + private getProvider(connectionUri: string): { provider: azdata.BackupProvider, providerName: string } | undefined { let providerId: string = this._connectionService.getProviderIdFromUri(connectionUri); if (providerId) { return { provider: this._providers[providerId], providerName: providerId }; diff --git a/src/sql/platform/bootstrap/browser/commonServiceInterface.service.ts b/src/sql/platform/bootstrap/browser/commonServiceInterface.service.ts index ef497e2e82..9b54595fa3 100644 --- a/src/sql/platform/bootstrap/browser/commonServiceInterface.service.ts +++ b/src/sql/platform/bootstrap/browser/commonServiceInterface.service.ts @@ -31,7 +31,7 @@ export class SingleConnectionMetadataService { private _uri: string ) { } - get metadata(): Observable { + get metadata(): Observable { return Observable.fromPromise(this._metadataService.getMetadata(this._uri)); } diff --git a/src/sql/platform/capabilities/common/capabilitiesService.ts b/src/sql/platform/capabilities/common/capabilitiesService.ts index 8794d61a74..1f8a8f3844 100644 --- a/src/sql/platform/capabilities/common/capabilitiesService.ts +++ b/src/sql/platform/capabilities/common/capabilitiesService.ts @@ -5,7 +5,7 @@ import { ConnectionProviderProperties } from 'sql/workbench/parts/connection/common/connectionProviderExtension'; -import * as azdata from 'sqlops'; +import * as azdata from 'azdata'; import { Event } from 'vs/base/common/event'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; @@ -35,12 +35,12 @@ export interface ICapabilitiesService { /** * Retrieve a list of registered capabilities providers */ - getCapabilities(provider: string): ProviderFeatures; + getCapabilities(provider: string): ProviderFeatures | undefined; /** * get the old version of provider information */ - getLegacyCapabilities(provider: string): azdata.DataProtocolServerCapabilities; + getLegacyCapabilities(provider: string): azdata.DataProtocolServerCapabilities | undefined; /** * Register a capabilities provider diff --git a/src/sql/platform/capabilities/common/capabilitiesServiceImpl.ts b/src/sql/platform/capabilities/common/capabilitiesServiceImpl.ts index cc03e96297..98ab6a1ad1 100644 --- a/src/sql/platform/capabilities/common/capabilitiesServiceImpl.ts +++ b/src/sql/platform/capabilities/common/capabilitiesServiceImpl.ts @@ -122,11 +122,11 @@ export class CapabilitiesService extends Disposable implements ICapabilitiesServ /** * Retrieve a list of registered server capabilities */ - public getCapabilities(provider: string): ProviderFeatures { + public getCapabilities(provider: string): ProviderFeatures | undefined { return this._providers.get(provider); } - public getLegacyCapabilities(provider: string): azdata.DataProtocolServerCapabilities { + public getLegacyCapabilities(provider: string): azdata.DataProtocolServerCapabilities | undefined { return this._legacyProviders.get(provider); } diff --git a/src/sql/platform/capabilities/test/common/testCapabilitiesService.ts b/src/sql/platform/capabilities/test/common/testCapabilitiesService.ts index e28ced142e..f3dc734ad9 100644 --- a/src/sql/platform/capabilities/test/common/testCapabilitiesService.ts +++ b/src/sql/platform/capabilities/test/common/testCapabilitiesService.ts @@ -23,11 +23,11 @@ export class TestCapabilitiesService implements ICapabilitiesService { let connectionProvider: azdata.ConnectionOption[] = [ { name: 'connectionName', - displayName: undefined, - description: undefined, - groupName: undefined, - categoryValues: undefined, - defaultValue: undefined, + displayName: undefined!, + description: undefined!, + groupName: undefined!, + categoryValues: undefined!, + defaultValue: undefined!, isIdentity: true, isRequired: true, specialValueType: ConnectionOptionSpecialType.connectionName, @@ -35,11 +35,11 @@ export class TestCapabilitiesService implements ICapabilitiesService { }, { name: 'serverName', - displayName: undefined, - description: undefined, - groupName: undefined, - categoryValues: undefined, - defaultValue: undefined, + displayName: undefined!, + description: undefined!, + groupName: undefined!, + categoryValues: undefined!, + defaultValue: undefined!, isIdentity: true, isRequired: true, specialValueType: ConnectionOptionSpecialType.serverName, @@ -47,11 +47,11 @@ export class TestCapabilitiesService implements ICapabilitiesService { }, { name: 'databaseName', - displayName: undefined, - description: undefined, - groupName: undefined, - categoryValues: undefined, - defaultValue: undefined, + displayName: undefined!, + description: undefined!, + groupName: undefined!, + categoryValues: undefined!, + defaultValue: undefined!, isIdentity: true, isRequired: true, specialValueType: ConnectionOptionSpecialType.databaseName, @@ -59,11 +59,11 @@ export class TestCapabilitiesService implements ICapabilitiesService { }, { name: 'userName', - displayName: undefined, - description: undefined, - groupName: undefined, - categoryValues: undefined, - defaultValue: undefined, + displayName: undefined!, + description: undefined!, + groupName: undefined!, + categoryValues: undefined!, + defaultValue: undefined!, isIdentity: true, isRequired: true, specialValueType: ConnectionOptionSpecialType.userName, @@ -71,11 +71,11 @@ export class TestCapabilitiesService implements ICapabilitiesService { }, { name: 'authenticationType', - displayName: undefined, - description: undefined, - groupName: undefined, - categoryValues: undefined, - defaultValue: undefined, + displayName: undefined!, + description: undefined!, + groupName: undefined!, + categoryValues: undefined!, + defaultValue: undefined!, isIdentity: true, isRequired: true, specialValueType: ConnectionOptionSpecialType.authType, @@ -83,11 +83,11 @@ export class TestCapabilitiesService implements ICapabilitiesService { }, { name: 'password', - displayName: undefined, - description: undefined, - groupName: undefined, - categoryValues: undefined, - defaultValue: undefined, + displayName: undefined!, + description: undefined!, + groupName: undefined!, + categoryValues: undefined!, + defaultValue: undefined!, isIdentity: true, isRequired: true, specialValueType: ConnectionOptionSpecialType.password, @@ -125,7 +125,7 @@ export class TestCapabilitiesService implements ICapabilitiesService { // Event Emitters public get onProviderRegisteredEvent(): Event { - return undefined; + return Event.None; } public isFeatureAvailable(featureName: Action, connectionManagementInfo: ConnectionManagementInfo): boolean { @@ -133,7 +133,7 @@ export class TestCapabilitiesService implements ICapabilitiesService { } public onCapabilitiesReady(): Promise { - return Promise.resolve(null); + return Promise.resolve(); } public fireCapabilitiesRegistered(providerFeatures: ProviderFeatures): void { diff --git a/src/sql/platform/common/pathUtilities.ts b/src/sql/platform/common/pathUtilities.ts index 8ba433c4f7..88d42276ba 100644 --- a/src/sql/platform/common/pathUtilities.ts +++ b/src/sql/platform/common/pathUtilities.ts @@ -13,7 +13,7 @@ export const FILE_SCHEMA: string = 'file'; export function resolveCurrentDirectory(uri: string, rootPath: string): string | undefined { let sqlUri = URI.parse(uri); - let currentDirectory: string; + let currentDirectory: string | undefined; // use current directory of the sql file if sql file is saved if (sqlUri.scheme === FILE_SCHEMA) { @@ -30,12 +30,15 @@ export function resolveCurrentDirectory(uri: string, rootPath: string): string | return currentDirectory; } -export function resolveFilePath(uri: string, filePath: string, rootPath: string): string { +export function resolveFilePath(uri: string, filePath: string, rootPath: string): string | undefined { let currentDirectory = resolveCurrentDirectory(uri, rootPath); - return normalize(join(currentDirectory, filePath)); + if (currentDirectory) { + return normalize(join(currentDirectory, filePath)); + } + return undefined; } -export function getRootPath(contextService: IWorkspaceContextService): string { +export function getRootPath(contextService: IWorkspaceContextService): string | undefined { let isWorkspace = contextService.getWorkbenchState() === WorkbenchState.WORKSPACE; if (isWorkspace) { let folder = contextService.getWorkspace().folders[0]; diff --git a/src/sql/platform/connection/common/connectionManagement.ts b/src/sql/platform/connection/common/connectionManagement.ts index d6cdad47ac..0952bf0f33 100644 --- a/src/sql/platform/connection/common/connectionManagement.ts +++ b/src/sql/platform/connection/common/connectionManagement.ts @@ -110,7 +110,7 @@ export interface IConnectionManagementService { onIntelliSenseCacheComplete(handle: number, connectionUri: string): void; - onConnectionChangedNotification(handle: number, changedConnInfo: azdata.ChangedConnectionInfo); + onConnectionChangedNotification(handle: number, changedConnInfo: azdata.ChangedConnectionInfo): void; getConnectionGroups(providers?: string[]): ConnectionProfileGroup[]; diff --git a/src/sql/platform/connection/common/connectionProfile.ts b/src/sql/platform/connection/common/connectionProfile.ts index a526cf616a..85782ffc65 100644 --- a/src/sql/platform/connection/common/connectionProfile.ts +++ b/src/sql/platform/connection/common/connectionProfile.ts @@ -22,7 +22,7 @@ import * as Constants from 'sql/platform/connection/common/constants'; */ export class ConnectionProfile extends ProviderConnectionInfo implements interfaces.IConnectionProfile { - public parent: ConnectionProfileGroup = null; + public parent?: ConnectionProfileGroup; private _id: string; public savePassword: boolean; private _groupName: string; @@ -88,7 +88,7 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa this._id = generateUuid(); } - public getParent(): ConnectionProfileGroup { + public getParent(): ConnectionProfileGroup | undefined { return this.parent; } @@ -103,11 +103,11 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa this._id = value; } - public get azureTenantId(): string { + public get azureTenantId(): string | undefined { return this.options['azureTenantId']; } - public set azureTenantId(value: string) { + public set azureTenantId(value: string | undefined) { this.options['azureTenantId'] = value; } @@ -185,7 +185,7 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa databaseName: this.databaseName, authenticationType: this.authenticationType, getOptionsKey: this.getOptionsKey, - matches: undefined, + matches: this.matches, groupId: this.groupId, groupFullName: this.groupFullName, password: this.password, @@ -244,22 +244,24 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa public static convertToProfileStore( capabilitiesService: ICapabilitiesService, - connectionProfile: interfaces.IConnectionProfile): interfaces.IConnectionProfileStore { + connectionProfile: interfaces.IConnectionProfile): interfaces.IConnectionProfileStore | undefined { if (connectionProfile) { let connectionInfo = ConnectionProfile.fromIConnectionProfile(capabilitiesService, connectionProfile); - let profile: interfaces.IConnectionProfileStore = { - options: {}, - groupId: connectionProfile.groupId, - providerName: connectionInfo.providerName, - savePassword: connectionInfo.savePassword, - id: connectionInfo.id - }; + if (connectionInfo) { + let profile: interfaces.IConnectionProfileStore = { + options: {}, + groupId: connectionProfile.groupId, + providerName: connectionInfo.providerName, + savePassword: connectionInfo.savePassword, + id: connectionInfo.id + }; - profile.options = connectionInfo.options; + profile.options = connectionInfo.options; - return profile; - } else { - return undefined; + return profile; + } } + + return undefined; } } diff --git a/src/sql/platform/connection/common/connectionProfileGroup.ts b/src/sql/platform/connection/common/connectionProfileGroup.ts index 9af73a0e5b..3e8c815749 100644 --- a/src/sql/platform/connection/common/connectionProfileGroup.ts +++ b/src/sql/platform/connection/common/connectionProfileGroup.ts @@ -8,7 +8,7 @@ import { Disposable } from 'vs/base/common/lifecycle'; export interface IConnectionProfileGroup { id: string; - parentId: string; + parentId?: string; name: string; color: string; description: string; @@ -18,7 +18,7 @@ export class ConnectionProfileGroup extends Disposable implements IConnectionPro public children: ConnectionProfileGroup[]; public connections: ConnectionProfile[]; - public parentId: string; + public parentId?: string; private _isRenamed: boolean; public constructor( public name: string, @@ -53,8 +53,8 @@ export class ConnectionProfileGroup extends Disposable implements IConnectionPro return this.name; } - public get fullName(): string { - let fullName: string = (this.id === 'root') ? undefined : this.name; + public get fullName(): string | undefined { + let fullName: string | undefined = (this.id === 'root') ? undefined : this.name; if (this.parent) { let parentFullName = this.parent.fullName; if (parentFullName) { @@ -156,7 +156,7 @@ export class ConnectionProfileGroup extends Disposable implements IConnectionPro public isAncestorOf(node: ConnectionProfileGroup | ConnectionProfile): boolean { let isAncestor = false; - let currentNode = node; + let currentNode: ConnectionProfileGroup | ConnectionProfile | undefined = node; while (currentNode) { if (currentNode.parent && currentNode.parent.id === this.id) { isAncestor = true; @@ -195,7 +195,7 @@ export class ConnectionProfileGroup extends Disposable implements IConnectionPro } public static getConnectionsInGroup(group: ConnectionProfileGroup): ConnectionProfile[] { - let connections = []; + let connections: ConnectionProfile[] = []; if (group && group.connections) { group.connections.forEach((con) => connections.push(con)); } @@ -208,7 +208,7 @@ export class ConnectionProfileGroup extends Disposable implements IConnectionPro } public static getSubgroups(group: ConnectionProfileGroup): ConnectionProfileGroup[] { - let subgroups = []; + let subgroups: ConnectionProfileGroup[] = []; if (group && group.children) { group.children.forEach((grp) => subgroups.push(grp)); group.children.forEach((subgroup) => { diff --git a/src/sql/platform/connection/common/providerConnectionInfo.ts b/src/sql/platform/connection/common/providerConnectionInfo.ts index 1d183d288f..e8319a9b20 100644 --- a/src/sql/platform/connection/common/providerConnectionInfo.ts +++ b/src/sql/platform/connection/common/providerConnectionInfo.ts @@ -104,27 +104,27 @@ export class ProviderConnectionInfo extends Disposable implements azdata.Connect } public get connectionName(): string { - return this.getSpecialTypeOptionValue(ConnectionOptionSpecialType.connectionName); + return this.getSpecialTypeOptionValue(ConnectionOptionSpecialType.connectionName)!; } public get serverName(): string { - return this.getSpecialTypeOptionValue(ConnectionOptionSpecialType.serverName); + return this.getSpecialTypeOptionValue(ConnectionOptionSpecialType.serverName)!; } public get databaseName(): string { - return this.getSpecialTypeOptionValue(ConnectionOptionSpecialType.databaseName); + return this.getSpecialTypeOptionValue(ConnectionOptionSpecialType.databaseName)!; } public get userName(): string { - return this.getSpecialTypeOptionValue(ConnectionOptionSpecialType.userName); + return this.getSpecialTypeOptionValue(ConnectionOptionSpecialType.userName)!; } public get password(): string { - return this.getSpecialTypeOptionValue(ConnectionOptionSpecialType.password); + return this.getSpecialTypeOptionValue(ConnectionOptionSpecialType.password)!; } public get authenticationType(): string { - return this.getSpecialTypeOptionValue(ConnectionOptionSpecialType.authType); + return this.getSpecialTypeOptionValue(ConnectionOptionSpecialType.authType)!; } public set connectionName(value: string) { @@ -206,7 +206,7 @@ export class ProviderConnectionInfo extends Disposable implements azdata.Connect return isPasswordRequired; } - private getSpecialTypeOptionValue(type: string): string { + private getSpecialTypeOptionValue(type: string): string | undefined { let name = this.getSpecialTypeOptionName(type); if (name) { return this.options[name]; @@ -243,7 +243,7 @@ export class ProviderConnectionInfo extends Disposable implements azdata.Connect let idValues: string[] = []; for (let index = 0; index < idNames.length; index++) { - let value = this.options[idNames[index]]; + let value = this.options[idNames[index]!]; value = value ? value : ''; idValues.push(`${idNames[index]}${ProviderConnectionInfo.nameValueSeparator}${value}`); } @@ -266,7 +266,7 @@ export class ProviderConnectionInfo extends Disposable implements azdata.Connect return providerId; } - public getSpecialTypeOptionName(type: string): string { + public getSpecialTypeOptionName(type: string): string | undefined { if (this._serverCapabilities) { let optionMetadata = this._serverCapabilities.connectionOptions.find(o => o.specialValueType === type); return !!optionMetadata ? optionMetadata.name : undefined; diff --git a/src/sql/platform/connection/test/common/connectionStore.test.ts b/src/sql/platform/connection/test/common/connectionStore.test.ts index a7f4e0b55d..318ff1264a 100644 --- a/src/sql/platform/connection/test/common/connectionStore.test.ts +++ b/src/sql/platform/connection/test/common/connectionStore.test.ts @@ -31,7 +31,7 @@ suite('ConnectionStore', () => { groupId: '', groupFullName: '', getOptionsKey: undefined, - matches: undefined, + matches: () => false, providerName: mssqlProviderName, options: {}, saveProfile: true, diff --git a/src/sql/platform/fileBrowser/common/fileBrowserService.ts b/src/sql/platform/fileBrowser/common/fileBrowserService.ts index adba04339e..e201c69efa 100644 --- a/src/sql/platform/fileBrowser/common/fileBrowserService.ts +++ b/src/sql/platform/fileBrowser/common/fileBrowserService.ts @@ -46,7 +46,7 @@ export class FileBrowserService implements IFileBrowserService { return this._onPathValidate.event; } - public openFileBrowser(ownerUri: string, expandPath: string, fileFilters: string[], changeFilter: boolean): Thenable { + public openFileBrowser(ownerUri: string, expandPath: string, fileFilters: string[], changeFilter: boolean): Promise { return new Promise((resolve, reject) => { const provider = this.getProvider(ownerUri); if (provider) { @@ -67,7 +67,7 @@ export class FileBrowserService implements IFileBrowserService { && fileBrowserOpenedParams.fileTree.rootNode && fileBrowserOpenedParams.fileTree.selectedNode ) { - let fileTree = this.convertFileTree(null, fileBrowserOpenedParams.fileTree.rootNode, fileBrowserOpenedParams.fileTree.selectedNode.fullPath, fileBrowserOpenedParams.ownerUri); + let fileTree = this.convertFileTree(undefined, fileBrowserOpenedParams.fileTree.rootNode, fileBrowserOpenedParams.fileTree.selectedNode.fullPath, fileBrowserOpenedParams.ownerUri); this._onAddFileTree.fire({ rootNode: fileTree.rootNode, selectedNode: fileTree.selectedNode, expandedNodes: fileTree.expandedNodes }); } else { let genericErrorMessage = localize('fileBrowserErrorMessage', "An error occured while loading the file browser."); @@ -77,7 +77,7 @@ export class FileBrowserService implements IFileBrowserService { } } - public expandFolderNode(fileNode: FileNode): Thenable { + public expandFolderNode(fileNode: FileNode): Promise { this._pathToFileNodeMap[fileNode.fullPath] = fileNode; let self = this; return new Promise((resolve, reject) => { @@ -117,7 +117,7 @@ export class FileBrowserService implements IFileBrowserService { } } - public validateFilePaths(ownerUri: string, serviceType: string, selectedFiles: string[]): Thenable { + public validateFilePaths(ownerUri: string, serviceType: string, selectedFiles: string[]): Promise { return new Promise((resolve, reject) => { const provider = this.getProvider(ownerUri); if (provider) { @@ -136,10 +136,10 @@ export class FileBrowserService implements IFileBrowserService { this._onPathValidate.fire(fileBrowserValidatedParams); } - public closeFileBrowser(ownerUri: string): Thenable { + public closeFileBrowser(ownerUri: string): Promise { let provider = this.getProvider(ownerUri); if (provider) { - return provider.closeFileBrowser(ownerUri); + return Promise.resolve(provider.closeFileBrowser(ownerUri)); } return Promise.resolve(undefined); } @@ -147,7 +147,8 @@ export class FileBrowserService implements IFileBrowserService { private generateResolveMapKey(ownerUri: string, expandPath: string): string { return ownerUri + ':' + expandPath; } - private getProvider(connectionUri: string): azdata.FileBrowserProvider { + + private getProvider(connectionUri: string): azdata.FileBrowserProvider | undefined { let providerId: string = this._connectionService.getProviderIdFromUri(connectionUri); if (providerId) { return this._providers[providerId]; @@ -156,10 +157,10 @@ export class FileBrowserService implements IFileBrowserService { } } - private convertFileTree(parentNode: FileNode, fileTreeNode: azdata.FileTreeNode, expandPath: string, ownerUri: string): FileBrowserTree { + private convertFileTree(parentNode: FileNode | undefined, fileTreeNode: azdata.FileTreeNode, expandPath: string, ownerUri: string): FileBrowserTree { FileBrowserService.fileNodeId += 1; let expandedNodes: FileNode[] = []; - let selectedNode: FileNode; + let selectedNode: FileNode | undefined; let fileNode = new FileNode(FileBrowserService.fileNodeId.toString(), fileTreeNode.name, fileTreeNode.fullPath, diff --git a/src/sql/platform/fileBrowser/common/interfaces.ts b/src/sql/platform/fileBrowser/common/interfaces.ts index 874d558924..010599f582 100644 --- a/src/sql/platform/fileBrowser/common/interfaces.ts +++ b/src/sql/platform/fileBrowser/common/interfaces.ts @@ -24,35 +24,35 @@ export interface IFileBrowserService { /** * Open file browser */ - openFileBrowser(ownerUri: string, expandPath: string, fileFilters: string[], changeFilter: boolean): Thenable; + openFileBrowser(ownerUri: string, expandPath: string, fileFilters: string[], changeFilter: boolean): Promise; /** * Event called when file browser is opened */ - onFileBrowserOpened(handle: number, fileBrowserOpenedParams: azdata.FileBrowserOpenedParams); + onFileBrowserOpened(handle: number, fileBrowserOpenedParams: azdata.FileBrowserOpenedParams): void; /** * Expand folder node */ - expandFolderNode(fileNode: FileNode): Thenable; + expandFolderNode(fileNode: FileNode): Promise; /** * Event called when children nodes are retrieved */ - onFolderNodeExpanded(handle: number, fileBrowserExpandedParams: azdata.FileBrowserExpandedParams); + onFolderNodeExpanded(handle: number, fileBrowserExpandedParams: azdata.FileBrowserExpandedParams): void; /** * Validate selected file paths */ - validateFilePaths(ownerUri: string, serviceType: string, selectedFiles: string[]): Thenable; + validateFilePaths(ownerUri: string, serviceType: string, selectedFiles: string[]): Promise; /** * Event called when the validation is complete */ - onFilePathsValidated(handle: number, fileBrowserValidatedParams: azdata.FileBrowserValidatedParams); + onFilePathsValidated(handle: number, fileBrowserValidatedParams: azdata.FileBrowserValidatedParams): void; /** * Close file browser */ - closeFileBrowser(ownerUri: string): Thenable; + closeFileBrowser(ownerUri: string): Promise; } diff --git a/src/sql/platform/metadata/common/metadataService.ts b/src/sql/platform/metadata/common/metadataService.ts index 70f97f8fd6..c8610cc42e 100644 --- a/src/sql/platform/metadata/common/metadataService.ts +++ b/src/sql/platform/metadata/common/metadataService.ts @@ -14,13 +14,13 @@ export const IMetadataService = createDecorator(SERVICE_ID); export interface IMetadataService { _serviceBrand: undefined; - getMetadata(connectionUri: string): Thenable; + getMetadata(connectionUri: string): Thenable; getDatabaseNames(connectionUri: string): Thenable; - getTableInfo(connectionUri: string, metadata: azdata.ObjectMetadata): Thenable; + getTableInfo(connectionUri: string, metadata: azdata.ObjectMetadata): Thenable; - getViewInfo(connectionUri: string, metadata: azdata.ObjectMetadata): Thenable; + getViewInfo(connectionUri: string, metadata: azdata.ObjectMetadata): Thenable; /** * Register a metadata provider @@ -37,7 +37,7 @@ export class MetadataService implements IMetadataService { constructor(@IConnectionManagementService private _connectionService: IConnectionManagementService) { } - public getMetadata(connectionUri: string): Thenable { + public getMetadata(connectionUri: string): Thenable { let providerId: string = this._connectionService.getProviderIdFromUri(connectionUri); if (providerId) { let provider = this._providers[providerId]; @@ -61,7 +61,7 @@ export class MetadataService implements IMetadataService { return Promise.resolve([]); } - public getTableInfo(connectionUri: string, metadata: azdata.ObjectMetadata): Thenable { + public getTableInfo(connectionUri: string, metadata: azdata.ObjectMetadata): Thenable { let providerId: string = this._connectionService.getProviderIdFromUri(connectionUri); if (providerId) { let provider = this._providers[providerId]; @@ -73,7 +73,7 @@ export class MetadataService implements IMetadataService { return Promise.resolve(undefined); } - public getViewInfo(connectionUri: string, metadata: azdata.ObjectMetadata): Thenable { + public getViewInfo(connectionUri: string, metadata: azdata.ObjectMetadata): Thenable { let providerId: string = this._connectionService.getProviderIdFromUri(connectionUri); if (providerId) { let provider = this._providers[providerId]; diff --git a/src/sql/platform/model/browser/modelViewService.ts b/src/sql/platform/model/browser/modelViewService.ts index fb2a5909fa..4884ca2fc2 100644 --- a/src/sql/platform/model/browser/modelViewService.ts +++ b/src/sql/platform/model/browser/modelViewService.ts @@ -27,7 +27,7 @@ export interface IModelView extends IView { setProperties(componentId: string, properties: { [key: string]: any }): void; setDataProvider(handle: number, componentId: string, context: any): void; refreshDataProvider(componentId: string, item: any): void; - registerEvent(componentId: string); + registerEvent(componentId: string): void; onEvent: Event; validate(componentId: string): Thenable; readonly onDestroy: Event; diff --git a/src/sql/platform/modelComponents/browser/modelViewService.ts b/src/sql/platform/modelComponents/browser/modelViewService.ts index f682408a63..eb3e9ca4c7 100644 --- a/src/sql/platform/modelComponents/browser/modelViewService.ts +++ b/src/sql/platform/modelComponents/browser/modelViewService.ts @@ -13,7 +13,7 @@ export const SERVICE_ID = 'modelViewService'; export interface IModelViewService { _serviceBrand: undefined; onRegisteredModelView: Event; - registerModelView(widget: IModelView); + registerModelView(widget: IModelView): void; } export const IModelViewService = createDecorator(SERVICE_ID); diff --git a/src/sql/platform/oAuth/common/sqlOAuthService.ts b/src/sql/platform/oAuth/common/sqlOAuthService.ts index 466b3ae353..c2867d8d55 100644 --- a/src/sql/platform/oAuth/common/sqlOAuthService.ts +++ b/src/sql/platform/oAuth/common/sqlOAuthService.ts @@ -23,10 +23,4 @@ export interface ISqlOAuthService { * @return Promise to return an authorization code */ performOAuthAuthorization(eventId: string, url: string, silent: boolean): void; - - /** - * Registers a handler for the oauth-reply event on the IPC channel - * @param handler Handler to call when the event is triggered - */ - registerOAuthCallback(handler: (event, args) => void): void; } diff --git a/src/sql/platform/oAuth/electron-browser/sqlOAuthServiceImpl.ts b/src/sql/platform/oAuth/electron-browser/sqlOAuthServiceImpl.ts index 4045e57083..13412a5c9a 100644 --- a/src/sql/platform/oAuth/electron-browser/sqlOAuthServiceImpl.ts +++ b/src/sql/platform/oAuth/electron-browser/sqlOAuthServiceImpl.ts @@ -32,12 +32,4 @@ export class SqlOAuthService implements ISqlOAuthService { } ); } - - /** - * Registers a handler for the oauth-reply event on the IPC channel - * @param handler Handler to call when the event is triggered - */ - registerOAuthCallback(handler: (event, args) => void): void { - electron.ipcRenderer.on('oauth-reply', handler); - } } diff --git a/src/sql/platform/scripting/common/scriptingService.ts b/src/sql/platform/scripting/common/scriptingService.ts index f8e500e947..3374eae64d 100644 --- a/src/sql/platform/scripting/common/scriptingService.ts +++ b/src/sql/platform/scripting/common/scriptingService.ts @@ -25,7 +25,7 @@ export enum ScriptOperation { export interface IScriptingService { _serviceBrand: undefined; - script(connectionUri: string, metadata: azdata.ObjectMetadata, operation: ScriptOperation, paramDetails: azdata.ScriptingParamDetails): Thenable; + script(connectionUri: string, metadata: azdata.ObjectMetadata, operation: ScriptOperation, paramDetails: azdata.ScriptingParamDetails): Thenable; /** * Register a scripting provider @@ -45,7 +45,7 @@ export interface IScriptingService { /** * Returns the result for an operation if the operation failed */ - getOperationFailedResult(operationId: string): azdata.ScriptingCompleteResult; + getOperationFailedResult(operationId: string): azdata.ScriptingCompleteResult | undefined; } export class ScriptingService implements IScriptingService { @@ -63,7 +63,7 @@ export class ScriptingService implements IScriptingService { /** * Call the service for scripting based on provider and scripting operation */ - public script(connectionUri: string, metadata: azdata.ObjectMetadata, operation: ScriptOperation, paramDetails: azdata.ScriptingParamDetails): Thenable { + public script(connectionUri: string, metadata: azdata.ObjectMetadata, operation: ScriptOperation, paramDetails: azdata.ScriptingParamDetails): Thenable { let providerId: string = this._connectionService.getProviderIdFromUri(connectionUri); if (providerId) { @@ -91,7 +91,7 @@ export class ScriptingService implements IScriptingService { * Returns the result for an operation if the operation failed * @param operationId Operation Id */ - public getOperationFailedResult(operationId: string): azdata.ScriptingCompleteResult { + public getOperationFailedResult(operationId: string): azdata.ScriptingCompleteResult | undefined { if (operationId && operationId in this.failedScriptingOperations) { return this.failedScriptingOperations[operationId]; } else { diff --git a/src/sql/platform/serialization/common/serializationService.ts b/src/sql/platform/serialization/common/serializationService.ts index 8b2320868d..b686652f0c 100644 --- a/src/sql/platform/serialization/common/serializationService.ts +++ b/src/sql/platform/serialization/common/serializationService.ts @@ -51,7 +51,7 @@ export interface ISerializationService { serializeResults(request: SerializeDataParams): Promise; - getSaveResultsFeatureMetadataProvider(ownerUri: string): azdata.FeatureMetadataProvider; + getSaveResultsFeatureMetadataProvider(ownerUri: string): azdata.FeatureMetadataProvider | undefined; } function getBatchSize(totalRows: number, currentIndex: number): number { @@ -90,7 +90,7 @@ export class SerializationService implements ISerializationService { } - public getSaveResultsFeatureMetadataProvider(ownerUri: string): azdata.FeatureMetadataProvider { + public getSaveResultsFeatureMetadataProvider(ownerUri: string): azdata.FeatureMetadataProvider | undefined { let providerId: string = this._connectionService.getProviderIdFromUri(ownerUri); let providerCapabilities = this._capabilitiesService.getLegacyCapabilities(providerId); diff --git a/src/sql/platform/tasks/browser/tasksRegistry.ts b/src/sql/platform/tasks/browser/tasksRegistry.ts index 30849d2000..769659422e 100644 --- a/src/sql/platform/tasks/browser/tasksRegistry.ts +++ b/src/sql/platform/tasks/browser/tasksRegistry.ts @@ -28,7 +28,7 @@ export const TaskRegistry: ITaskRegistry = new class implements ITaskRegistry { let disposable: IDisposable; let id: string; if (types.isString(idOrTask)) { - disposable = CommandsRegistry.registerCommand(idOrTask, handler); + disposable = CommandsRegistry.registerCommand(idOrTask, handler!); id = idOrTask; } else { if (idOrTask.iconClass) { @@ -52,8 +52,8 @@ export const TaskRegistry: ITaskRegistry = new class implements ITaskRegistry { }; } - getOrCreateTaskIconClassName(item: ICommandAction): string { - let iconClass = null; + getOrCreateTaskIconClassName(item: ICommandAction): string | undefined { + let iconClass: string | undefined; if (this.taskIdToIconClassNameMap.has(item.id)) { iconClass = this.taskIdToIconClassNameMap.get(item.id); } else if (item.iconLocation) { @@ -74,17 +74,19 @@ export abstract class Task { public readonly id: string; public readonly title: string; public readonly iconPathDark: string; - public readonly iconPath: { dark: URI; light?: URI; }; - private readonly _iconClass: string; - private readonly _description: ITaskHandlerDescription; + public readonly iconPath?: { dark: URI; light?: URI; }; + private readonly _iconClass?: string; + private readonly _description?: ITaskHandlerDescription; constructor(private opts: ITaskOptions) { this.id = opts.id; this.title = opts.title; - this.iconPath = { - dark: opts.iconPath ? URI.parse(opts.iconPath.dark) : undefined, - light: opts.iconPath ? URI.parse(opts.iconPath.light) : undefined, - }; + if (opts.iconPath.dark) { + this.iconPath = { + dark: URI.parse(opts.iconPath.dark), + light: opts.iconPath.light ? URI.parse(opts.iconPath.light) : undefined, + }; + } this._iconClass = opts.iconClass; this._description = opts.description; } diff --git a/src/sql/platform/tasks/common/tasks.ts b/src/sql/platform/tasks/common/tasks.ts index 800ad8ee91..9795d733ca 100644 --- a/src/sql/platform/tasks/common/tasks.ts +++ b/src/sql/platform/tasks/common/tasks.ts @@ -16,7 +16,7 @@ import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation export interface ITaskOptions { id: string; title: string; - iconPath: { dark: string; light: string; }; + iconPath: { dark: string; light?: string; }; description?: ITaskHandlerDescription; iconClass?: string; } @@ -55,6 +55,6 @@ export interface ITaskRegistry { registerTask(id: string, command: ITaskHandler): IDisposable; registerTask(command: ITask): IDisposable; getTasks(): string[]; - getOrCreateTaskIconClassName(item: ICommandAction): string; + getOrCreateTaskIconClassName(item: ICommandAction): string | undefined; onTaskRegistered: Event; } diff --git a/src/sql/platform/tasks/common/tasksNode.ts b/src/sql/platform/tasks/common/tasksNode.ts index a7af0b5036..9dbe4a0514 100644 --- a/src/sql/platform/tasks/common/tasksNode.ts +++ b/src/sql/platform/tasks/common/tasksNode.ts @@ -36,12 +36,12 @@ export class TaskNode { /** * sever name */ - public serverName: string; + public serverName?: string; /** * Database Name */ - public databaseName: string; + public databaseName?: string; /** * Provider Name @@ -99,7 +99,7 @@ export class TaskNode { */ public script: string; - constructor(taskName: string, serverName: string, databaseName: string, taskId: string = undefined, taskExecutionMode: TaskExecutionMode = TaskExecutionMode.execute, isCancelable: boolean = true) { + constructor(taskName: string, serverName?: string, databaseName?: string, taskId: string | undefined = undefined, taskExecutionMode: TaskExecutionMode = TaskExecutionMode.execute, isCancelable: boolean = true) { this.id = taskId || generateUuid(); this.taskName = taskName; diff --git a/src/sql/platform/tasks/common/tasksService.ts b/src/sql/platform/tasks/common/tasksService.ts index 4c353883af..246be53101 100644 --- a/src/sql/platform/tasks/common/tasksService.ts +++ b/src/sql/platform/tasks/common/tasksService.ts @@ -25,11 +25,11 @@ export interface ITaskService { handleTaskComplete(eventArgs: TaskStatusChangeArgs): void; getAllTasks(): TaskNode; getNumberOfInProgressTasks(): number; - onNewTaskCreated(handle: number, taskInfo: azdata.TaskInfo); - createNewTask(taskInfo: azdata.TaskInfo); - updateTask(taskProgressInfo: azdata.TaskProgressInfo); - onTaskStatusChanged(handle: number, taskProgressInfo: azdata.TaskProgressInfo); - cancelTask(providerId: string, taskId: string): Thenable; + onNewTaskCreated(handle: number, taskInfo: azdata.TaskInfo): void; + createNewTask(taskInfo: azdata.TaskInfo): void; + updateTask(taskProgressInfo: azdata.TaskProgressInfo): void; + onTaskStatusChanged(handle: number, taskProgressInfo: azdata.TaskProgressInfo): void; + cancelTask(providerId: string, taskId: string): Promise; /** * Register a ObjectExplorer provider */ @@ -56,7 +56,7 @@ export class TaskService implements ITaskService { @IQueryEditorService private queryEditorService: IQueryEditorService, @IConnectionManagementService private connectionManagementService: IConnectionManagementService ) { - this._taskQueue = new TaskNode('Root', undefined, undefined); + this._taskQueue = new TaskNode('Root'); this._onTaskComplete = new Emitter(); this._onAddNewTask = new Emitter(); @@ -105,19 +105,21 @@ export class TaskService implements ITaskService { this.updateTask(taskProgressInfo); } - public cancelTask(providerId: string, taskId: string): Thenable { + public cancelTask(providerId: string, taskId: string): Promise { let task = this.getTaskInQueue(taskId); - task.status = TaskStatus.Canceling; - this._onTaskComplete.fire(task); - if (providerId) { - let provider = this._providers[providerId]; - if (provider && provider.cancelTask) { - return provider.cancelTask({ - taskId: taskId - }); + if (task) { + task.status = TaskStatus.Canceling; + this._onTaskComplete.fire(task); + if (providerId) { + let provider = this._providers[providerId]; + if (provider && provider.cancelTask) { + return Promise.resolve(provider.cancelTask({ + taskId: taskId + })); + } + } else { + return Promise.resolve(true); } - } else { - return Promise.resolve(true); } return Promise.resolve(undefined); } @@ -222,7 +224,7 @@ export class TaskService implements ITaskService { } - private getTaskInQueue(taskId: string): TaskNode { + private getTaskInQueue(taskId: string): TaskNode | undefined { if (this._taskQueue.hasChildren) { return this._taskQueue.children.find(x => x.id === taskId); } diff --git a/src/sql/workbench/browser/modelComponents/interfaces.ts b/src/sql/workbench/browser/modelComponents/interfaces.ts index bf246361b1..0c82ad4a26 100644 --- a/src/sql/workbench/browser/modelComponents/interfaces.ts +++ b/src/sql/workbench/browser/modelComponents/interfaces.ts @@ -14,7 +14,7 @@ import { IDisposable } from 'vs/base/common/lifecycle'; export interface IComponent extends IDisposable { descriptor: IComponentDescriptor; modelStore: IModelStore; - layout(); + layout(): void; registerEventHandler(handler: (event: IComponentEventArgs) => void): IDisposable; clearContainer?: () => void; addToContainer?: (componentDescriptor: IComponentDescriptor, config: any, index?: number) => void; @@ -76,7 +76,7 @@ export interface IModelStore { * Creates and saves the reference of a component descriptor. * This can be used during creation of a component later */ - createComponentDescriptor(type: string, createComponentDescriptor): IComponentDescriptor; + createComponentDescriptor(type: string, createComponentDescriptor: string): IComponentDescriptor; /** * gets the descriptor for a previously created component ID */ diff --git a/src/sql/workbench/electron-browser/scriptingUtils.ts b/src/sql/workbench/electron-browser/scriptingUtils.ts index eb5a38b355..fd90d0cc49 100644 --- a/src/sql/workbench/electron-browser/scriptingUtils.ts +++ b/src/sql/workbench/electron-browser/scriptingUtils.ts @@ -47,7 +47,7 @@ export function scriptSelect(connectionProfile: IConnectionProfile, metadata: az connectionService.connectIfNotConnected(connectionProfile).then(connectionResult => { let paramDetails: azdata.ScriptingParamDetails = getScriptingParamDetails(connectionService, connectionResult, metadata); scriptingService.script(connectionResult, metadata, ScriptOperation.Select, paramDetails).then(result => { - if (result.script) { + if (result && result.script) { queryEditorService.newSqlEditor(result.script).then((owner: IConnectableInput) => { // Connect our editor to the input connection let options: IConnectionCompletionOptions = { @@ -82,7 +82,7 @@ export function scriptEditSelect(connectionProfile: IConnectionProfile, metadata connectionService.connectIfNotConnected(connectionProfile).then(connectionResult => { let paramDetails: azdata.ScriptingParamDetails = getScriptingParamDetails(connectionService, connectionResult, metadata); scriptingService.script(connectionResult, metadata, ScriptOperation.Select, paramDetails).then(result => { - if (result.script) { + if (result && result.script) { queryEditorService.newEditDataEditor(metadata.schema, metadata.name, result.script).then((owner: EditDataInput) => { // Connect our editor let options: IConnectionCompletionOptions = { diff --git a/src/sql/workbench/parts/connection/common/connectionProviderExtension.ts b/src/sql/workbench/parts/connection/common/connectionProviderExtension.ts index 8f068036e9..531b73fed1 100644 --- a/src/sql/workbench/parts/connection/common/connectionProviderExtension.ts +++ b/src/sql/workbench/parts/connection/common/connectionProviderExtension.ts @@ -26,7 +26,7 @@ export const Extensions = { export interface IConnectionProviderRegistry { registerConnectionProvider(id: string, properties: ConnectionProviderProperties): void; - getProperties(id: string): ConnectionProviderProperties; + getProperties(id: string): ConnectionProviderProperties | undefined; readonly onNewProvider: Event<{ id: string, properties: ConnectionProviderProperties }>; readonly providers: { [id: string]: ConnectionProviderProperties }; } @@ -41,7 +41,7 @@ class ConnectionProviderRegistryImpl implements IConnectionProviderRegistry { this._onNewProvider.fire({ id, properties }); } - public getProperties(id: string): ConnectionProviderProperties { + public getProperties(id: string): ConnectionProviderProperties | undefined { return this._providers.get(id); } diff --git a/src/sql/workbench/parts/notebook/browser/outputs/gridOutput.component.ts b/src/sql/workbench/parts/notebook/browser/outputs/gridOutput.component.ts index e8618fddad..73b525dc74 100644 --- a/src/sql/workbench/parts/notebook/browser/outputs/gridOutput.component.ts +++ b/src/sql/workbench/parts/notebook/browser/outputs/gridOutput.component.ts @@ -257,7 +257,7 @@ class DataResourceDataProvider implements IGridDataProvider { return serializer.handleSerialization(this.documentUri, format, (filePath) => this.doSerialize(serializer, filePath, format, selection)); } - private async doSerialize(serializer: ResultSerializer, filePath: string, format: SaveFormat, selection: Slick.Range[]): Promise { + private doSerialize(serializer: ResultSerializer, filePath: string, format: SaveFormat, selection: Slick.Range[]): Promise { // TODO implement selection support let columns = this.resultSet.columnInfo; let rowLength = this.rows.length; @@ -296,8 +296,7 @@ class DataResourceDataProvider implements IGridDataProvider { getRowRange: (rowStart, numberOfRows) => getRows(rowStart, numberOfRows), rowCount: rowLength }); - let result = await this._serializationService.serializeResults(serializeRequestParams); - return result; + return this._serializationService.serializeResults(serializeRequestParams); } /** diff --git a/src/sql/workbench/parts/query/common/resultSerializer.ts b/src/sql/workbench/parts/query/common/resultSerializer.ts index 77ade3cf4a..cb2ae9db92 100644 --- a/src/sql/workbench/parts/query/common/resultSerializer.ts +++ b/src/sql/workbench/parts/query/common/resultSerializer.ts @@ -32,7 +32,7 @@ let prevSavePath: string; export interface SaveResultsResponse { succeeded: boolean; - messages: string; + messages?: string; } interface ICsvConfig { @@ -94,7 +94,7 @@ export class ResultSerializer { /** * Handle save request by getting filename from user and sending request to service */ - public handleSerialization(uri: string, format: SaveFormat, sendRequest: ((filePath: string) => Promise)): Thenable { + public handleSerialization(uri: string, format: SaveFormat, sendRequest: ((filePath: string) => Promise)): Thenable { const self = this; return this.promptForFilepath(format, uri).then(filePath => { if (filePath) { @@ -103,7 +103,7 @@ export class ResultSerializer { } return self.doSave(filePath, format, () => sendRequest(filePath)); } - return Promise.resolve(undefined); + return Promise.resolve(); }); } @@ -331,19 +331,19 @@ export class ResultSerializer { /** * Send request to sql tools service to save a result set */ - private async doSave(filePath: string, format: string, sendRequest: () => Promise): Promise { + private async doSave(filePath: string, format: string, sendRequest: () => Promise): Promise { this.logToOutputChannel(LocalizedConstants.msgSaveStarted + filePath); // send message to the sqlserverclient for converting results to the requested format and saving to filepath try { let result = await sendRequest(); - if (result.messages) { + if (!result || result.messages) { this._notificationService.notify({ severity: Severity.Error, - message: LocalizedConstants.msgSaveFailed + result.messages + message: LocalizedConstants.msgSaveFailed + (result ? result.messages : '') }); - this.logToOutputChannel(LocalizedConstants.msgSaveFailed + result.messages); + this.logToOutputChannel(LocalizedConstants.msgSaveFailed + (result ? result.messages : '')); } else { this.promptFileSavedNotification(filePath); this.logToOutputChannel(LocalizedConstants.msgSaveSucceeded + filePath); diff --git a/src/sql/workbench/services/fileBrowser/common/fileBrowserTree.ts b/src/sql/workbench/services/fileBrowser/common/fileBrowserTree.ts index 9235b2a64b..18348a31fd 100644 --- a/src/sql/workbench/services/fileBrowser/common/fileBrowserTree.ts +++ b/src/sql/workbench/services/fileBrowser/common/fileBrowserTree.ts @@ -10,6 +10,6 @@ import { FileNode } from 'sql/workbench/services/fileBrowser/common/fileNode'; */ export class FileBrowserTree { public rootNode: FileNode; - public selectedNode: FileNode; + public selectedNode?: FileNode; public expandedNodes: FileNode[]; } diff --git a/src/sql/workbench/services/fileBrowser/common/fileNode.ts b/src/sql/workbench/services/fileBrowser/common/fileNode.ts index 50cc4b1e81..5a96c74d36 100644 --- a/src/sql/workbench/services/fileBrowser/common/fileNode.ts +++ b/src/sql/workbench/services/fileBrowser/common/fileNode.ts @@ -33,7 +33,7 @@ export class FileNode { /** * Parent node */ - public parent: FileNode; + public parent?: FileNode; /** * Children nodes @@ -55,7 +55,7 @@ export class FileNode { */ public hasChildren: boolean; - constructor(id: string, name: string, fullPath: string, isFile: boolean, isExpanded: boolean, ownerUri: string, parent: FileNode) { + constructor(id: string, name: string, fullPath: string, isFile: boolean, isExpanded: boolean, ownerUri: string, parent?: FileNode) { if (id) { this.id = id; } else { @@ -69,4 +69,4 @@ export class FileNode { this.isExpanded = isExpanded; this.parent = parent; } -} \ No newline at end of file +} diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index 446fd3d0c2..0b8f9dba7b 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -5,7 +5,7 @@ "strictNullChecks": true, "noImplicitAny": true, "suppressImplicitAnyIndexErrors": true, - "skipLibCheck": true, + "skipLibCheck": true }, "include": [ "./typings", @@ -18,10 +18,24 @@ "./sql/base/**/*.ts", "./sql/editor/**/*.ts", "./sql/platform/angularEventing/**/*.ts", - // "./sql/platform/accounts/**/*.ts", + "./sql/platform/backup/**/*.ts", + "./sql/platform/browser/**/*.ts", + "./sql/platform/capabilities/**/*.ts", "./sql/platform/clipboard/**/*.ts", + "./sql/platform/common/**/*.ts", "./sql/platform/credentials/**/*.ts", - "./sql/platform/theme/**/*.ts", - "./sql/platform/telemetry/**/*.ts" + "./sql/platform/errorMessage/**/*.ts", + "./sql/platform/fileBrowser/**/*.ts", + "./sql/platform/metadata/**/*.ts", + "./sql/platform/model/**/*.ts", + "./sql/platform/modelComponents/**/*.ts", + "./sql/platform/notebooks/**/*.ts", + "./sql/platform/oAuth/**/*.ts", + "./sql/platform/scripting/**/*.ts", + "./sql/platform/serialization/**/*.ts", + "./sql/platform/serverGroup/**/*.ts", + "./sql/platform/tasks/**/*.ts", + "./sql/platform/telemetry/**/*.ts", + "./sql/platform/theme/**/*.ts" ] }