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

@@ -13,6 +13,8 @@ import {
import { AzureResource } from 'sql/workbench/api/common/sqlExtHostTypes';
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
import { Event, Emitter } from 'vs/base/common/event';
import { firstIndex } from 'vs/base/common/arrays';
import { values } from 'vs/base/common/collections';
export class ExtHostAccountManagement extends ExtHostAccountManagementShape {
private _handlePool: number = 0;
@@ -94,7 +96,7 @@ export class ExtHostAccountManagement extends ExtHostAccountManagementShape {
return this.$getAllAccounts().then(() => {
for (const handle in this._accounts) {
const providerHandle = parseInt(handle);
if (this._accounts[handle].findIndex((acct) => acct.key.accountId === account.key.accountId) !== -1) {
if (firstIndex(this._accounts[handle], (acct) => acct.key.accountId === account.key.accountId) !== -1) {
return this._withProvider(providerHandle, (provider: azdata.AccountProvider) => provider.getSecurityToken(account, resource));
}
}
@@ -115,7 +117,7 @@ export class ExtHostAccountManagement extends ExtHostAccountManagementShape {
let self = this;
// Look for any account providers that have the same provider ID
let matchingProviderIndex = Object.values(this._providers).findIndex((provider: AccountProviderWithMetadata) => {
let matchingProviderIndex = firstIndex(values(this._providers), (provider: AccountProviderWithMetadata) => {
return provider.metadata.id === providerMetadata.id;
});
if (matchingProviderIndex >= 0) {