Remove typings and replace missing methods with vscodes (#8217)

* remove typings and replace missing methods with vscodes

* fix strict-null-checks

* fix tests
This commit is contained in:
Anthony Dresser
2019-11-05 13:03:20 -08:00
committed by GitHub
parent 4645a8ba6b
commit 22a427f934
184 changed files with 634 additions and 43388 deletions

View File

@@ -20,6 +20,8 @@ import { Deferred } from 'sql/base/common/promise';
import { localize } from 'vs/nls';
import { IOpenerService } from 'vs/platform/opener/common/opener';
import { URI } from 'vs/base/common/uri';
import { firstIndex } from 'vs/base/common/arrays';
import { values } from 'vs/base/common/collections';
export class AccountManagementService implements IAccountManagementService {
// CONSTANTS ///////////////////////////////////////////////////////////
@@ -166,7 +168,7 @@ export class AccountManagementService implements IAccountManagementService {
}
if (result.accountModified) {
// Find the updated account and splice the updated on in
let indexToRemove: number = provider.accounts.findIndex(account => {
let indexToRemove: number = firstIndex(provider.accounts, account => {
return account.key.accountId === result.changedAccount.key.accountId;
});
if (indexToRemove >= 0) {
@@ -184,7 +186,7 @@ export class AccountManagementService implements IAccountManagementService {
* @returns Registered account providers
*/
public getAccountProviderMetadata(): Thenable<azdata.AccountProviderMetadata[]> {
return Promise.resolve(Object.values(this._providers).map(provider => provider.metadata));
return Promise.resolve(values(this._providers).map(provider => provider.metadata));
}
/**
@@ -241,7 +243,7 @@ export class AccountManagementService implements IAccountManagementService {
return result;
}
let indexToRemove: number = provider.accounts.findIndex(account => {
let indexToRemove: number = firstIndex(provider.accounts, account => {
return account.key.accountId === accountKey.accountId;
});
@@ -423,7 +425,7 @@ export class AccountManagementService implements IAccountManagementService {
private spliceModifiedAccount(provider: AccountProviderWithMetadata, modifiedAccount: azdata.Account) {
// Find the updated account and splice the updated one in
let indexToRemove: number = provider.accounts.findIndex(account => {
let indexToRemove: number = firstIndex(provider.accounts, account => {
return account.key.accountId === modifiedAccount.key.accountId;
});
if (indexToRemove >= 0) {