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

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