Add more areas to strict null (#7243)

* add more areas to strict null

* fix compile errors

* fix tests

* fix checks

* address PR comments
This commit is contained in:
Anthony Dresser
2019-09-18 12:27:19 -07:00
committed by GitHub
parent 373828d76f
commit aad9c0f965
35 changed files with 193 additions and 184 deletions

View File

@@ -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

View File

@@ -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);
}

View File

@@ -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<azdata.DataProtocolServerCapabilities> {
return undefined;
return Event.None;
}
public isFeatureAvailable(featureName: Action, connectionManagementInfo: ConnectionManagementInfo): boolean {
@@ -133,7 +133,7 @@ export class TestCapabilitiesService implements ICapabilitiesService {
}
public onCapabilitiesReady(): Promise<void> {
return Promise.resolve(null);
return Promise.resolve();
}
public fireCapabilitiesRegistered(providerFeatures: ProviderFeatures): void {