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

* Revert "Revert "Remove typings and replace missing methods with vscodes (#8217)" (#8240)"

This reverts commit e801a04bcf.

* fix runtime error

* add tests for chartview
This commit is contained in:
Anthony Dresser
2019-11-06 15:00:34 -08:00
committed by GitHub
parent df6b6ded33
commit 564f78b6f6
185 changed files with 670 additions and 43395 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) {