diff --git a/src/vs/base/browser/indexedDB.ts b/src/vs/base/browser/indexedDB.ts index 25651932124..a4319aaf5d4 100644 --- a/src/vs/base/browser/indexedDB.ts +++ b/src/vs/base/browser/indexedDB.ts @@ -6,7 +6,6 @@ import { toErrorMessage } from 'vs/base/common/errorMessage'; import { getErrorMessage } from 'vs/base/common/errors'; import { mark } from 'vs/base/common/performance'; -import { isArray } from 'vs/base/common/types'; class MissingStoresError extends Error { constructor(readonly db: IDBDatabase) { @@ -122,7 +121,7 @@ export class IndexedDB { this.pendingTransactions.push(transaction); return new Promise((c, e) => { transaction.oncomplete = () => { - if (isArray(request)) { + if (Array.isArray(request)) { c(request.map(r => r.result)); } else { c(request.result); diff --git a/src/vs/base/common/objects.ts b/src/vs/base/common/objects.ts index 7c7c4483bd9..52d27bc3080 100644 --- a/src/vs/base/common/objects.ts +++ b/src/vs/base/common/objects.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { isArray, isTypedArray, isObject, isUndefinedOrNull } from 'vs/base/common/types'; +import { isTypedArray, isObject, isUndefinedOrNull } from 'vs/base/common/types'; export function deepClone(obj: T): T { if (!obj || typeof obj !== 'object') { @@ -61,7 +61,7 @@ function _cloneAndChange(obj: any, changer: (orig: any) => any, seen: Set): return changed; } - if (isArray(obj)) { + if (Array.isArray(obj)) { const r1: any[] = []; for (const e of obj) { r1.push(_cloneAndChange(e, changer, seen)); diff --git a/src/vs/base/common/paging.ts b/src/vs/base/common/paging.ts index 60f72b407c3..1d9b7938169 100644 --- a/src/vs/base/common/paging.ts +++ b/src/vs/base/common/paging.ts @@ -6,7 +6,6 @@ import { range } from 'vs/base/common/arrays'; import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; import { canceled } from 'vs/base/common/errors'; -import { isArray } from 'vs/base/common/types'; /** * A Pager is a stateless abstraction over a paged collection. @@ -65,7 +64,7 @@ export class PagedModel implements IPagedModel { get length(): number { return this.pager.total; } constructor(arg: IPager | T[]) { - this.pager = isArray(arg) ? singlePagePager(arg) : arg; + this.pager = Array.isArray(arg) ? singlePagePager(arg) : arg; const totalPages = Math.ceil(this.pager.total / this.pager.pageSize); diff --git a/src/vs/base/common/types.ts b/src/vs/base/common/types.ts index e3844cd39e8..36e532e5695 100644 --- a/src/vs/base/common/types.ts +++ b/src/vs/base/common/types.ts @@ -5,13 +5,6 @@ import { URI, UriComponents } from 'vs/base/common/uri'; -/** - * @returns whether the provided parameter is a JavaScript Array or not. - */ -export function isArray(array: any): array is any[] { - return Array.isArray(array); -} - /** * @returns whether the provided parameter is a JavaScript String or not. */ diff --git a/src/vs/base/test/common/types.test.ts b/src/vs/base/test/common/types.test.ts index cb7dedbe272..1f5e7d0b812 100644 --- a/src/vs/base/test/common/types.test.ts +++ b/src/vs/base/test/common/types.test.ts @@ -82,24 +82,6 @@ suite('Types', () => { assert(types.isEmptyObject({})); }); - test('isArray', () => { - assert(!types.isArray(undefined)); - assert(!types.isArray(null)); - assert(!types.isArray('foo')); - assert(!types.isArray(5)); - assert(!types.isArray(true)); - assert(!types.isArray({})); - assert(!types.isArray(/test/)); - assert(!types.isArray(new RegExp(''))); - assert(!types.isArray(new Date())); - assert(!types.isArray(assert)); - assert(!types.isArray(function foo() { /**/ })); - assert(!types.isArray({ foo: 'bar' })); - - assert(types.isArray([])); - assert(types.isArray([1, 2, '3'])); - }); - test('isString', () => { assert(!types.isString(undefined)); assert(!types.isString(null)); diff --git a/src/vs/editor/contrib/folding/browser/folding.ts b/src/vs/editor/contrib/folding/browser/folding.ts index c35cdb69a65..2ec75651190 100644 --- a/src/vs/editor/contrib/folding/browser/folding.ts +++ b/src/vs/editor/contrib/folding/browser/folding.ts @@ -565,7 +565,7 @@ function foldingArgumentsConstraint(args: any) { if (!types.isUndefined(foldingArgs.direction) && !types.isString(foldingArgs.direction)) { return false; } - if (!types.isUndefined(foldingArgs.selectionLines) && (!types.isArray(foldingArgs.selectionLines) || !foldingArgs.selectionLines.every(types.isNumber))) { + if (!types.isUndefined(foldingArgs.selectionLines) && (!Array.isArray(foldingArgs.selectionLines) || !foldingArgs.selectionLines.every(types.isNumber))) { return false; } } diff --git a/src/vs/platform/configuration/common/configuration.ts b/src/vs/platform/configuration/common/configuration.ts index 4ea7a9bce8d..0afd5a8707c 100644 --- a/src/vs/platform/configuration/common/configuration.ts +++ b/src/vs/platform/configuration/common/configuration.ts @@ -26,7 +26,7 @@ export interface IConfigurationOverrides { export function isConfigurationUpdateOverrides(thing: any): thing is IConfigurationUpdateOverrides { return thing && typeof thing === 'object' - && (!thing.overrideIdentifiers || types.isArray(thing.overrideIdentifiers)) + && (!thing.overrideIdentifiers || Array.isArray(thing.overrideIdentifiers)) && !thing.overrideIdentifier && (!thing.resource || thing.resource instanceof URI); } diff --git a/src/vs/platform/extensionManagement/common/extensionStorage.ts b/src/vs/platform/extensionManagement/common/extensionStorage.ts index 52b35c6cb28..b7eb08a88b2 100644 --- a/src/vs/platform/extensionManagement/common/extensionStorage.ts +++ b/src/vs/platform/extensionManagement/common/extensionStorage.ts @@ -12,7 +12,7 @@ import { IProductService } from 'vs/platform/product/common/productService'; import { distinct } from 'vs/base/common/arrays'; import { ILogService } from 'vs/platform/log/common/log'; import { IExtension } from 'vs/platform/extensions/common/extensions'; -import { isArray, isString } from 'vs/base/common/types'; +import { isString } from 'vs/base/common/types'; import { IStringDictionary } from 'vs/base/common/collections'; import { IExtensionManagementService, IGalleryExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; @@ -197,7 +197,7 @@ export class ExtensionStorageService extends Disposable implements IExtensionSto const value = this.storageService.get('extensionStorage.migrationList', StorageScope.APPLICATION, '[]'); try { const migrationList = JSON.parse(value); - if (isArray(migrationList)) { + if (Array.isArray(migrationList)) { return migrationList; } } catch (error) { /* ignore */ } diff --git a/src/vs/platform/extensionManagement/common/extensionsScannerService.ts b/src/vs/platform/extensionManagement/common/extensionsScannerService.ts index b51075daec1..4de8730750a 100644 --- a/src/vs/platform/extensionManagement/common/extensionsScannerService.ts +++ b/src/vs/platform/extensionManagement/common/extensionsScannerService.ts @@ -18,7 +18,7 @@ import * as platform from 'vs/base/common/platform'; import { basename, isEqual, joinPath } from 'vs/base/common/resources'; import * as semver from 'vs/base/common/semver/semver'; import Severity from 'vs/base/common/severity'; -import { isArray, isEmptyObject, isObject, isString } from 'vs/base/common/types'; +import { isEmptyObject, isObject, isString } from 'vs/base/common/types'; import { URI } from 'vs/base/common/uri'; import { localize } from 'vs/nls'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; @@ -821,7 +821,7 @@ class ExtensionsScanner extends Disposable { k === 'commands' ? processEntry(value, k, true) : processEntry(value, k, command); } } - } else if (isArray(value)) { + } else if (Array.isArray(value)) { for (let i = 0; i < value.length; i++) { processEntry(value, i, command); } diff --git a/src/vs/platform/userDataSync/common/userDataSync.ts b/src/vs/platform/userDataSync/common/userDataSync.ts index 6973141914f..6f6bf364d98 100644 --- a/src/vs/platform/userDataSync/common/userDataSync.ts +++ b/src/vs/platform/userDataSync/common/userDataSync.ts @@ -10,7 +10,7 @@ import { FormattingOptions } from 'vs/base/common/jsonFormatter'; import { IJSONSchema } from 'vs/base/common/jsonSchema'; import { IDisposable } from 'vs/base/common/lifecycle'; import { IExtUri, isEqualOrParent, joinPath } from 'vs/base/common/resources'; -import { isArray, isObject, isString } from 'vs/base/common/types'; +import { isObject, isString } from 'vs/base/common/types'; import { URI } from 'vs/base/common/uri'; import { IHeaders } from 'vs/base/parts/request/common/request'; import { localize } from 'vs/nls'; @@ -128,7 +128,7 @@ export function isAuthenticationProvider(thing: any): thing is IAuthenticationPr return thing && isObject(thing) && isString(thing.id) - && isArray(thing.scopes); + && Array.isArray(thing.scopes); } export const enum SyncResource { diff --git a/src/vs/platform/userDataSync/common/userDataSyncServiceIpc.ts b/src/vs/platform/userDataSync/common/userDataSyncServiceIpc.ts index c945029e6a3..dea1952371d 100644 --- a/src/vs/platform/userDataSync/common/userDataSyncServiceIpc.ts +++ b/src/vs/platform/userDataSync/common/userDataSyncServiceIpc.ts @@ -6,7 +6,6 @@ import { CancellationToken } from 'vs/base/common/cancellation'; import { Emitter, Event } from 'vs/base/common/event'; import { Disposable, DisposableStore } from 'vs/base/common/lifecycle'; -import { isArray } from 'vs/base/common/types'; import { URI } from 'vs/base/common/uri'; import { IChannel, IServerChannel } from 'vs/base/parts/ipc/common/ipc'; import { ILogService } from 'vs/platform/log/common/log'; @@ -184,7 +183,7 @@ export class UserDataSyncChannelClient extends Disposable implements IUserDataSy const that = this; const manualSyncTaskChannelClient = new ManualSyncTaskChannelClient(id, manifest, status, { async call(command: string, arg?: any, cancellationToken?: CancellationToken): Promise { - return that.channel.call(`manualSync/${command}`, [id, ...(isArray(arg) ? arg : [arg])], cancellationToken); + return that.channel.call(`manualSync/${command}`, [id, ...(Array.isArray(arg) ? arg : [arg])], cancellationToken); }, listen(event: string, arg?: any): Event { return Event.map( diff --git a/src/vs/platform/userDataSync/common/userDataSyncStoreService.ts b/src/vs/platform/userDataSync/common/userDataSyncStoreService.ts index 2b7bd79e2b8..c3fe6a3db6c 100644 --- a/src/vs/platform/userDataSync/common/userDataSyncStoreService.ts +++ b/src/vs/platform/userDataSync/common/userDataSyncStoreService.ts @@ -12,7 +12,7 @@ import { Mimes } from 'vs/base/common/mime'; import { isWeb } from 'vs/base/common/platform'; import { ConfigurationSyncStore } from 'vs/base/common/product'; import { joinPath, relativePath } from 'vs/base/common/resources'; -import { isArray, isObject, isString } from 'vs/base/common/types'; +import { isObject, isString } from 'vs/base/common/types'; import { URI } from 'vs/base/common/uri'; import { generateUuid } from 'vs/base/common/uuid'; import { IHeaders, IRequestContext, IRequestOptions } from 'vs/base/parts/request/common/request'; @@ -72,7 +72,7 @@ export abstract class AbstractUserDataSyncStoreManagementService extends Disposa if (value && isString(value.url) && isObject(value.authenticationProviders) - && Object.keys(value.authenticationProviders).every(authenticationProviderId => isArray(value!.authenticationProviders![authenticationProviderId].scopes)) + && Object.keys(value.authenticationProviders).every(authenticationProviderId => Array.isArray(value!.authenticationProviders![authenticationProviderId].scopes)) ) { const syncStore = value as ConfigurationSyncStore; const canSwitch = !!syncStore.canSwitch && !configuredStore?.url; diff --git a/src/vs/workbench/api/common/extHostLanguageFeatures.ts b/src/vs/workbench/api/common/extHostLanguageFeatures.ts index d9244952ab0..17d1d86c2d7 100644 --- a/src/vs/workbench/api/common/extHostLanguageFeatures.ts +++ b/src/vs/workbench/api/common/extHostLanguageFeatures.ts @@ -18,7 +18,7 @@ import { regExpLeadsToEndlessLoop, regExpFlags } from 'vs/base/common/strings'; import { IPosition } from 'vs/editor/common/core/position'; import { IRange, Range as EditorRange } from 'vs/editor/common/core/range'; import { isFalsyOrEmpty, isNonEmptyArray, coalesce } from 'vs/base/common/arrays'; -import { isArray, isObject } from 'vs/base/common/types'; +import { isObject } from 'vs/base/common/types'; import { ISelection, Selection } from 'vs/editor/common/core/selection'; import { ILogService } from 'vs/platform/log/common/log'; import { CancellationToken } from 'vs/base/common/cancellation'; @@ -1124,8 +1124,8 @@ class InlineCompletionAdapter extends InlineCompletionAdapterBase { return undefined; } - const normalizedResult = isArray(result) ? result : result.items; - const commands = this._isAdditionsProposedApiEnabled ? isArray(result) ? [] : result.commands || [] : []; + const normalizedResult = Array.isArray(result) ? result : result.items; + const commands = this._isAdditionsProposedApiEnabled ? Array.isArray(result) ? [] : result.commands || [] : []; let disposableStore: DisposableStore | undefined = undefined; const pid = this._references.createReferenceId({ @@ -1230,8 +1230,8 @@ class InlineCompletionAdapterNew extends InlineCompletionAdapterBase { return undefined; } - const normalizedResult = isArray(result) ? result : result.items; - const commands = isArray(result) ? [] : result.commands || []; + const normalizedResult = Array.isArray(result) ? result : result.items; + const commands = Array.isArray(result) ? [] : result.commands || []; let disposableStore: DisposableStore | undefined = undefined; const pid = this._references.createReferenceId({ diff --git a/src/vs/workbench/api/common/extHostTypes.ts b/src/vs/workbench/api/common/extHostTypes.ts index 987ca4c4a30..d1dd009b1ba 100644 --- a/src/vs/workbench/api/common/extHostTypes.ts +++ b/src/vs/workbench/api/common/extHostTypes.ts @@ -10,7 +10,7 @@ import { MarkdownString as BaseMarkdownString } from 'vs/base/common/htmlContent import { ResourceMap } from 'vs/base/common/map'; import { Mimes, normalizeMimeType } from 'vs/base/common/mime'; import { nextCharLength } from 'vs/base/common/strings'; -import { isArray, isString, isStringArray } from 'vs/base/common/types'; +import { isString, isStringArray } from 'vs/base/common/types'; import { URI } from 'vs/base/common/uri'; import { generateUuid } from 'vs/base/common/uuid'; import { FileSystemProviderErrorCode, markAsFileSystemProviderError } from 'vs/platform/files/common/files'; @@ -3449,7 +3449,7 @@ export class NotebookCellOutput { if (!candidate || typeof candidate !== 'object') { return false; } - return typeof (candidate).id === 'string' && isArray((candidate).items); + return typeof (candidate).id === 'string' && Array.isArray((candidate).items); } static ensureUniqueMimeTypes(items: NotebookCellOutputItem[], warn: boolean = false): NotebookCellOutputItem[] { diff --git a/src/vs/workbench/browser/parts/editor/textDiffEditor.ts b/src/vs/workbench/browser/parts/editor/textDiffEditor.ts index a638504849a..f0a9e78c2c8 100644 --- a/src/vs/workbench/browser/parts/editor/textDiffEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textDiffEditor.ts @@ -5,7 +5,7 @@ import { localize } from 'vs/nls'; import { deepClone } from 'vs/base/common/objects'; -import { isObject, isArray, assertIsDefined, withUndefinedAsNull, withNullAsUndefined } from 'vs/base/common/types'; +import { isObject, assertIsDefined, withUndefinedAsNull, withNullAsUndefined } from 'vs/base/common/types'; import { ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser'; import { IDiffEditorOptions, IEditorOptions as ICodeEditorOptions } from 'vs/editor/common/config/editorOptions'; import { AbstractTextEditor, IEditorConfiguration } from 'vs/workbench/browser/parts/editor/textEditor'; @@ -259,7 +259,7 @@ export class TextDiffEditor extends AbstractTextEditor imp private isFileBinaryError(error: Error[]): boolean; private isFileBinaryError(error: Error): boolean; private isFileBinaryError(error: Error | Error[]): boolean { - if (isArray(error)) { + if (Array.isArray(error)) { const errors = error; return errors.some(error => this.isFileBinaryError(error)); diff --git a/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts b/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts index 13edddae38d..6c9c087bb9b 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts @@ -61,7 +61,6 @@ import { ExtensionEnablementWorkspaceTrustTransitionParticipant } from 'vs/workb import { clearSearchResultsIcon, configureRecommendedIcon, extensionsViewIcon, filterIcon, installWorkspaceRecommendedIcon, refreshIcon } from 'vs/workbench/contrib/extensions/browser/extensionsIcons'; import { EXTENSION_CATEGORIES } from 'vs/platform/extensions/common/extensions'; import { Disposable, DisposableStore, IDisposable } from 'vs/base/common/lifecycle'; -import { isArray } from 'vs/base/common/types'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IDialogService, IFileDialogService } from 'vs/platform/dialogs/common/dialogs'; import { mnemonicButtonLabel } from 'vs/base/common/labels'; @@ -1549,7 +1548,7 @@ class ExtensionsContributions extends Disposable implements IWorkbenchContributi } private registerExtensionAction(extensionActionOptions: IExtensionActionOptions): IDisposable { - const menus = extensionActionOptions.menu ? isArray(extensionActionOptions.menu) ? extensionActionOptions.menu : [extensionActionOptions.menu] : []; + const menus = extensionActionOptions.menu ? Array.isArray(extensionActionOptions.menu) ? extensionActionOptions.menu : [extensionActionOptions.menu] : []; let menusWithOutTitles: ({ id: MenuId } & Omit)[] = []; const menusWithTitles: { id: MenuId; item: IMenuItem }[] = []; if (extensionActionOptions.menuTitles) { diff --git a/src/vs/workbench/contrib/extensions/browser/webRecommendations.ts b/src/vs/workbench/contrib/extensions/browser/webRecommendations.ts index 12e005319e2..8688c14b824 100644 --- a/src/vs/workbench/contrib/extensions/browser/webRecommendations.ts +++ b/src/vs/workbench/contrib/extensions/browser/webRecommendations.ts @@ -6,7 +6,6 @@ import { ExtensionRecommendations, ExtensionRecommendation } from 'vs/workbench/contrib/extensions/browser/extensionRecommendations'; import { IProductService } from 'vs/platform/product/common/productService'; import { ExtensionRecommendationReason } from 'vs/workbench/services/extensionRecommendations/common/extensionRecommendations'; -import { isArray } from 'vs/base/common/types'; import { localize } from 'vs/nls'; import { IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; @@ -24,7 +23,7 @@ export class WebRecommendations extends ExtensionRecommendations { protected async doActivate(): Promise { const isOnlyWeb = this.extensionManagementServerService.webExtensionManagementServer && !this.extensionManagementServerService.localExtensionManagementServer && !this.extensionManagementServerService.remoteExtensionManagementServer; - if (isOnlyWeb && isArray(this.productService.webExtensionTips)) { + if (isOnlyWeb && Array.isArray(this.productService.webExtensionTips)) { this._recommendations = this.productService.webExtensionTips.map(extensionId => ({ extensionId: extensionId.toLowerCase(), reason: { diff --git a/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts b/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts index a506b12de3d..252f5e99204 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts @@ -20,7 +20,7 @@ import { Iterable } from 'vs/base/common/iterator'; import { KeyCode } from 'vs/base/common/keyCodes'; import { Disposable, DisposableStore, dispose } from 'vs/base/common/lifecycle'; import * as platform from 'vs/base/common/platform'; -import { isArray, withNullAsUndefined, withUndefinedAsNull } from 'vs/base/common/types'; +import { withNullAsUndefined, withUndefinedAsNull } from 'vs/base/common/types'; import { URI } from 'vs/base/common/uri'; import 'vs/css!./media/settingsEditor2'; import { localize } from 'vs/nls'; @@ -133,7 +133,7 @@ export class SettingsEditor2 extends EditorPane { ]; private static shouldSettingUpdateFast(type: SettingValueType | SettingValueType[]): boolean { - if (isArray(type)) { + if (Array.isArray(type)) { // nullable integer/number or complex return false; } diff --git a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts index 2ad3516e3e9..362212fc944 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts @@ -26,7 +26,7 @@ import { KeyCode } from 'vs/base/common/keyCodes'; import { Disposable, DisposableStore, dispose, toDisposable } from 'vs/base/common/lifecycle'; import { isIOS } from 'vs/base/common/platform'; import { escapeRegExpCharacters } from 'vs/base/common/strings'; -import { isArray, isDefined, isUndefinedOrNull } from 'vs/base/common/types'; +import { isDefined, isUndefinedOrNull } from 'vs/base/common/types'; import { localize } from 'vs/nls'; import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; import { ICommandService } from 'vs/platform/commands/common/commands'; @@ -348,7 +348,7 @@ function parseNumericObjectValues(dataElement: SettingsTreeSettingElement, v: Re } function getListDisplayValue(element: SettingsTreeSettingElement): IListDataItem[] { - if (!element.value || !isArray(element.value)) { + if (!element.value || !Array.isArray(element.value)) { return []; } @@ -1192,9 +1192,9 @@ export class SettingArrayRenderer extends AbstractSettingRenderer implements ITr private computeNewList(template: ISettingListItemTemplate, e: ISettingListChangeEvent): string[] | undefined { if (template.context) { let newValue: string[] = []; - if (isArray(template.context.scopeValue)) { + if (Array.isArray(template.context.scopeValue)) { newValue = [...template.context.scopeValue]; - } else if (isArray(template.context.value)) { + } else if (Array.isArray(template.context.value)) { newValue = [...template.context.value]; } @@ -1229,7 +1229,7 @@ export class SettingArrayRenderer extends AbstractSettingRenderer implements ITr if ( template.context.defaultValue && - isArray(template.context.defaultValue) && + Array.isArray(template.context.defaultValue) && template.context.defaultValue.length === newValue.length && template.context.defaultValue.join() === newValue.join() ) { diff --git a/src/vs/workbench/contrib/preferences/browser/settingsTreeModels.ts b/src/vs/workbench/contrib/preferences/browser/settingsTreeModels.ts index 8238b7b7ee2..23092ada5f9 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsTreeModels.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsTreeModels.ts @@ -5,7 +5,7 @@ import * as arrays from 'vs/base/common/arrays'; import { escapeRegExpCharacters, isFalsyOrWhitespace } from 'vs/base/common/strings'; -import { isArray, withUndefinedAsNull, isUndefinedOrNull } from 'vs/base/common/types'; +import { withUndefinedAsNull, isUndefinedOrNull } from 'vs/base/common/types'; import { URI } from 'vs/base/common/uri'; import { ConfigurationTarget, IConfigurationValue } from 'vs/platform/configuration/common/configuration'; import { SettingsTarget } from 'vs/workbench/contrib/preferences/browser/preferencesWidgets'; @@ -321,7 +321,7 @@ export class SettingsTreeSettingElement extends SettingsTreeElement { } else if (this.setting.type === 'array' && this.setting.arrayItemType && ['string', 'enum', 'number', 'integer'].includes(this.setting.arrayItemType)) { this.valueType = SettingValueType.Array; - } else if (isArray(this.setting.type) && this.setting.type.includes(SettingValueType.Null) && this.setting.type.length === 2) { + } else if (Array.isArray(this.setting.type) && this.setting.type.includes(SettingValueType.Null) && this.setting.type.length === 2) { if (this.setting.type.includes(SettingValueType.Integer)) { this.valueType = SettingValueType.NullableInteger; } else if (this.setting.type.includes(SettingValueType.Number)) { @@ -805,7 +805,7 @@ function isObjectSetting({ function settingTypeEnumRenderable(_type: string | string[]) { const enumRenderableSettingTypes = ['string', 'boolean', 'null', 'integer', 'number']; - const type = isArray(_type) ? _type : [_type]; + const type = Array.isArray(_type) ? _type : [_type]; return type.every(type => enumRenderableSettingTypes.includes(type)); } diff --git a/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts b/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts index 7f856c3e91a..cb53a27ac62 100644 --- a/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts +++ b/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts @@ -3625,7 +3625,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer } else if (suppressTaskName) { configElement.command = task._source.config.element.command; } - if (task.command.args && (!Types.isArray(task.command.args) || (task.command.args.length > 0))) { + if (task.command.args && (!Array.isArray(task.command.args) || (task.command.args.length > 0))) { if (!globalConfig.windows?.args && !globalConfig.osx?.args && !globalConfig.linux?.args) { configElement.args = task.command.args; } else { diff --git a/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts b/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts index 91e1316e1f6..eed6a1d6cf2 100644 --- a/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts +++ b/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.ts @@ -1565,7 +1565,7 @@ export class TerminalTaskSystem extends Disposable implements ITaskSystem { private _collectDefinitionVariables(variables: Set, definition: any): void { if (Types.isString(definition)) { this._collectVariables(variables, definition); - } else if (Types.isArray(definition)) { + } else if (Array.isArray(definition)) { definition.forEach((element: any) => this._collectDefinitionVariables(variables, element)); } else if (Types.isObject(definition)) { for (const key in definition) { diff --git a/src/vs/workbench/contrib/tasks/common/problemMatcher.ts b/src/vs/workbench/contrib/tasks/common/problemMatcher.ts index 7e2fb354129..de370e64892 100644 --- a/src/vs/workbench/contrib/tasks/common/problemMatcher.ts +++ b/src/vs/workbench/contrib/tasks/common/problemMatcher.ts @@ -236,7 +236,7 @@ export interface ILineMatcher { export function createLineMatcher(matcher: ProblemMatcher, fileService?: IFileService): ILineMatcher { const pattern = matcher.pattern; - if (Types.isArray(pattern)) { + if (Array.isArray(pattern)) { return new MultiLineMatcher(matcher, fileService); } else { return new SingleLineMatcher(matcher, fileService); @@ -644,7 +644,7 @@ export namespace Config { export namespace MultiLineProblemPattern { export function is(value: any): value is MultiLineProblemPattern { - return value && Types.isArray(value); + return value && Array.isArray(value); } } @@ -684,7 +684,7 @@ export namespace Config { export namespace NamedMultiLineCheckedProblemPattern { export function is(value: any): value is INamedMultiLineCheckedProblemPattern { const candidate = value as INamedMultiLineCheckedProblemPattern; - return candidate && Types.isString(candidate.name) && Types.isArray(candidate.patterns) && MultiLineCheckedProblemPattern.is(candidate.patterns); + return candidate && Types.isString(candidate.name) && Array.isArray(candidate.patterns) && MultiLineCheckedProblemPattern.is(candidate.patterns); } } diff --git a/src/vs/workbench/contrib/tasks/common/taskConfiguration.ts b/src/vs/workbench/contrib/tasks/common/taskConfiguration.ts index 0bb00f57620..8ea82730adf 100644 --- a/src/vs/workbench/contrib/tasks/common/taskConfiguration.ts +++ b/src/vs/workbench/contrib/tasks/common/taskConfiguration.ts @@ -1150,7 +1150,7 @@ export namespace ProblemMatcherConverter { export function namedFrom(this: void, declares: ProblemMatcherConfig.INamedProblemMatcher[] | undefined, context: IParseContext): IStringDictionary { const result: IStringDictionary = Object.create(null); - if (!Types.isArray(declares)) { + if (!Array.isArray(declares)) { return result; } (declares).forEach((value) => { @@ -1213,7 +1213,7 @@ export namespace ProblemMatcherConverter { function getProblemMatcherKind(this: void, value: ProblemMatcherConfig.ProblemMatcherType): ProblemMatcherKind { if (Types.isString(value)) { return ProblemMatcherKind.String; - } else if (Types.isArray(value)) { + } else if (Array.isArray(value)) { return ProblemMatcherKind.Array; } else if (!Types.isUndefined(value)) { return ProblemMatcherKind.ProblemMatcher; @@ -1365,7 +1365,7 @@ namespace ConfigurationProperties { } result.group = GroupKind.from(external.group); if (external.dependsOn !== undefined) { - if (Types.isArray(external.dependsOn)) { + if (Array.isArray(external.dependsOn)) { result.dependsOn = external.dependsOn.reduce((dependencies: Tasks.ITaskDependency[], item): Tasks.ITaskDependency[] => { const dependency = TaskDependency.from(item, context, source); if (dependency) { diff --git a/src/vs/workbench/electron-sandbox/window.ts b/src/vs/workbench/electron-sandbox/window.ts index b1987e81a3c..2978c4157db 100644 --- a/src/vs/workbench/electron-sandbox/window.ts +++ b/src/vs/workbench/electron-sandbox/window.ts @@ -40,7 +40,7 @@ import { WorkbenchState, IWorkspaceContextService } from 'vs/platform/workspace/ import { coalesce } from 'vs/base/common/arrays'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -import { assertIsDefined, isArray } from 'vs/base/common/types'; +import { assertIsDefined } from 'vs/base/common/types'; import { IOpenerService, OpenOptions } from 'vs/platform/opener/common/opener'; import { Schemas } from 'vs/base/common/network'; import { INativeHostService } from 'vs/platform/native/electron-sandbox/native'; @@ -753,7 +753,7 @@ export class NativeWindow extends Disposable { const disabled = this.configurationService.getValue('keyboard.touchbar.enabled') === false; const touchbarIgnored = this.configurationService.getValue('keyboard.touchbar.ignored'); - const ignoredItems = isArray(touchbarIgnored) ? touchbarIgnored : []; + const ignoredItems = Array.isArray(touchbarIgnored) ? touchbarIgnored : []; // Fill actions into groups respecting order this.touchBarDisposables.add(createAndFillInActionBarActions(this.touchBarMenu, undefined, actions)); diff --git a/src/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.ts b/src/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.ts index 07053d26b4d..4fe9ddc5505 100644 --- a/src/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.ts +++ b/src/vs/workbench/services/configurationResolver/browser/baseConfigurationResolverService.ts @@ -261,7 +261,7 @@ export abstract class BaseConfigurationResolverService extends AbstractVariableR variables.push(contributed); } } - } else if (Types.isArray(object)) { + } else if (Array.isArray(object)) { for (const value of object) { this.findVariables(value, variables); @@ -315,7 +315,7 @@ export abstract class BaseConfigurationResolverService extends AbstractVariableR if (!Types.isString(info.description)) { missingAttribute('description'); } - if (Types.isArray(info.options)) { + if (Array.isArray(info.options)) { for (const pickOption of info.options) { if (!Types.isString(pickOption) && !Types.isString(pickOption.value)) { missingAttribute('value'); diff --git a/src/vs/workbench/services/configurationResolver/common/variableResolver.ts b/src/vs/workbench/services/configurationResolver/common/variableResolver.ts index 8cbb4be2848..b3183db14bc 100644 --- a/src/vs/workbench/services/configurationResolver/common/variableResolver.ts +++ b/src/vs/workbench/services/configurationResolver/common/variableResolver.ts @@ -138,7 +138,7 @@ export class AbstractVariableResolverService implements IConfigurationResolverSe private async recursiveResolve(environment: Environment, folderUri: uri | undefined, value: any, commandValueMapping?: IStringDictionary, resolvedVariables?: Map): Promise { if (types.isString(value)) { return this.resolveString(environment, folderUri, value, commandValueMapping, resolvedVariables); - } else if (types.isArray(value)) { + } else if (Array.isArray(value)) { return Promise.all(value.map(s => this.recursiveResolve(environment, folderUri, s, commandValueMapping, resolvedVariables))); } else if (types.isObject(value)) { const result: IStringDictionary | string[]> = Object.create(null); diff --git a/src/vs/workbench/services/keybinding/browser/keybindingService.ts b/src/vs/workbench/services/keybinding/browser/keybindingService.ts index f75556ad8a3..a7c13b7c53e 100644 --- a/src/vs/workbench/services/keybinding/browser/keybindingService.ts +++ b/src/vs/workbench/services/keybinding/browser/keybindingService.ts @@ -41,7 +41,6 @@ import { parse } from 'vs/base/common/json'; import * as objects from 'vs/base/common/objects'; import { IKeyboardLayoutService } from 'vs/platform/keyboardLayout/common/keyboardLayout'; import { getDispatchConfig } from 'vs/platform/keyboardLayout/common/dispatchConfig'; -import { isArray } from 'vs/base/common/types'; import { INavigatorWithKeyboard, IKeyboard } from 'vs/workbench/services/keybinding/browser/navigatorKeyboard'; import { flatten } from 'vs/base/common/arrays'; import { BrowserFeatures, KeyboardSupport } from 'vs/base/browser/canIUse'; @@ -767,7 +766,7 @@ class UserKeybindings extends Disposable { try { const content = await this.fileService.readFile(this.userDataProfileService.currentProfile.keybindingsResource); const value = parse(content.value.toString()); - this._keybindings = isArray(value) ? value : []; + this._keybindings = Array.isArray(value) ? value : []; } catch (e) { this._keybindings = []; } diff --git a/src/vs/workbench/services/keybinding/common/keybindingEditing.ts b/src/vs/workbench/services/keybinding/common/keybindingEditing.ts index 9cecbd01bb3..a064d35bee6 100644 --- a/src/vs/workbench/services/keybinding/common/keybindingEditing.ts +++ b/src/vs/workbench/services/keybinding/common/keybindingEditing.ts @@ -10,7 +10,6 @@ import * as objects from 'vs/base/common/objects'; import { setProperty } from 'vs/base/common/jsonEdit'; import { Edit } from 'vs/base/common/jsonFormatter'; import { Disposable, IReference } from 'vs/base/common/lifecycle'; -import { isArray } from 'vs/base/common/types'; import { EditOperation } from 'vs/editor/common/core/editOperation'; import { Range } from 'vs/editor/common/core/range'; import { Selection } from 'vs/editor/common/core/selection'; @@ -267,7 +266,7 @@ export class KeybindingsEditingService extends Disposable implements IKeybinding return Promise.reject(new Error(localize('parseErrors', "Unable to write to the keybindings configuration file. Please open it to correct errors/warnings in the file and try again."))); } if (parsed.result) { - if (!isArray(parsed.result)) { + if (!Array.isArray(parsed.result)) { reference.dispose(); return Promise.reject(new Error(localize('errorInvalidConfiguration', "Unable to write to the keybindings configuration file. It has an object which is not of type Array. Please open the file to clean up and try again."))); } diff --git a/src/vs/workbench/services/preferences/browser/preferencesService.ts b/src/vs/workbench/services/preferences/browser/preferencesService.ts index fa24a64d7af..9e17f9dca37 100644 --- a/src/vs/workbench/services/preferences/browser/preferencesService.ts +++ b/src/vs/workbench/services/preferences/browser/preferencesService.ts @@ -42,7 +42,7 @@ import { defaultKeybindingsContents, DefaultKeybindingsEditorModel, DefaultRawSe import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; import { ITextEditorService } from 'vs/workbench/services/textfile/common/textEditorService'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; -import { isArray, isObject } from 'vs/base/common/types'; +import { isObject } from 'vs/base/common/types'; import { SuggestController } from 'vs/editor/contrib/suggest/browser/suggestController'; import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile'; @@ -577,7 +577,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic if (setting) { if (edit) { - if (isObject(setting.value) || isArray(setting.value)) { + if (isObject(setting.value) || Array.isArray(setting.value)) { position = { lineNumber: setting.valueRange.startLineNumber, column: setting.valueRange.startColumn + 1 }; codeEditor.setPosition(position); await CoreEditingCommands.LineBreakInsert.runEditorCommand(null, codeEditor, null); diff --git a/src/vs/workbench/services/preferences/common/preferencesModels.ts b/src/vs/workbench/services/preferences/common/preferencesModels.ts index 96d09e3a041..93ce790df86 100644 --- a/src/vs/workbench/services/preferences/common/preferencesModels.ts +++ b/src/vs/workbench/services/preferences/common/preferencesModels.ts @@ -21,7 +21,7 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { Registry } from 'vs/platform/registry/common/platform'; import { EditorModel } from 'vs/workbench/common/editor/editorModel'; import { IFilterMetadata, IFilterResult, IGroupFilter, IKeybindingsEditorModel, ISearchResultGroup, ISetting, ISettingMatch, ISettingMatcher, ISettingsEditorModel, ISettingsGroup, SettingMatchType } from 'vs/workbench/services/preferences/common/preferences'; -import { withNullAsUndefined, isArray } from 'vs/base/common/types'; +import { withNullAsUndefined } from 'vs/base/common/types'; import { FOLDER_SCOPES, WORKSPACE_SCOPES } from 'vs/workbench/services/configuration/common/configuration'; import { createValidator } from 'vs/workbench/services/preferences/common/preferencesValidation'; @@ -677,10 +677,10 @@ export class DefaultSettings extends Disposable { const descriptionLines = description.split('\n'); const overrides = OVERRIDE_PROPERTY_REGEX.test(key) ? this.parseOverrideSettings(prop.default) : []; let listItemType: string | undefined; - if (prop.type === 'array' && prop.items && !isArray(prop.items) && prop.items.type) { + if (prop.type === 'array' && prop.items && !Array.isArray(prop.items) && prop.items.type) { if (prop.items.enum) { listItemType = 'enum'; - } else if (!isArray(prop.items.type)) { + } else if (!Array.isArray(prop.items.type)) { listItemType = prop.items.type; } } @@ -692,7 +692,7 @@ export class DefaultSettings extends Disposable { let enumToUse = prop.enum; let enumDescriptions = prop.markdownEnumDescriptions ?? prop.enumDescriptions; let enumDescriptionsAreMarkdown = !!prop.markdownEnumDescriptions; - if (listItemType === 'enum' && !isArray(prop.items)) { + if (listItemType === 'enum' && !Array.isArray(prop.items)) { enumToUse = prop.items!.enum; enumDescriptions = prop.items!.markdownEnumDescriptions ?? prop.items!.enumDescriptions; enumDescriptionsAreMarkdown = !!prop.items!.markdownEnumDescriptions; diff --git a/src/vs/workbench/services/preferences/common/preferencesValidation.ts b/src/vs/workbench/services/preferences/common/preferencesValidation.ts index 14772a9ee3a..5dd0a2dfdda 100644 --- a/src/vs/workbench/services/preferences/common/preferencesValidation.ts +++ b/src/vs/workbench/services/preferences/common/preferencesValidation.ts @@ -6,7 +6,7 @@ import * as nls from 'vs/nls'; import { JSONSchemaType } from 'vs/base/common/jsonSchema'; import { Color } from 'vs/base/common/color'; -import { isArray, isObject, isUndefinedOrNull, isString, isStringArray } from 'vs/base/common/types'; +import { isObject, isUndefinedOrNull, isString, isStringArray } from 'vs/base/common/types'; import { IConfigurationPropertySchema } from 'vs/platform/configuration/common/configurationRegistry'; type Validator = { enabled: boolean; isValid: (value: T) => boolean; message: string }; @@ -20,7 +20,7 @@ function isNullOrEmpty(value: unknown): boolean { } export function createValidator(prop: IConfigurationPropertySchema): (value: any) => (string | null) { - const type: (string | undefined)[] = isArray(prop.type) ? prop.type : [prop.type]; + const type: (string | undefined)[] = Array.isArray(prop.type) ? prop.type : [prop.type]; const isNullable = canBeType(type, 'null'); const isNumeric = (canBeType(type, 'number') || canBeType(type, 'integer')) && (type.length === 1 || type.length === 2 && isNullable); @@ -85,7 +85,7 @@ export function getInvalidTypeError(value: any, type: undefined | string | strin return; } - const typeArr = isArray(type) ? type : [type]; + const typeArr = Array.isArray(type) ? type : [type]; if (!typeArr.some(_type => valueValidatesAsType(value, _type))) { return nls.localize('invalidTypeError', "Setting has an invalid type, expected {0}. Fix in JSON.", JSON.stringify(type)); } @@ -98,11 +98,11 @@ function valueValidatesAsType(value: any, type: string): boolean { if (type === 'boolean') { return valueType === 'boolean'; } else if (type === 'object') { - return value && !isArray(value) && valueType === 'object'; + return value && !Array.isArray(value) && valueType === 'object'; } else if (type === 'null') { return value === null; } else if (type === 'array') { - return isArray(value); + return Array.isArray(value); } else if (type === 'string') { return valueType === 'string'; } else if (type === 'number' || type === 'integer') { @@ -170,7 +170,7 @@ function getStringValidators(prop: IConfigurationPropertySchema) { } function getNumericValidators(prop: IConfigurationPropertySchema): Validator[] { - const type: (string | undefined)[] = isArray(prop.type) ? prop.type : [prop.type]; + const type: (string | undefined)[] = Array.isArray(prop.type) ? prop.type : [prop.type]; const isNullable = canBeType(type, 'null'); const isIntegral = (canBeType(type, 'integer')) && (type.length === 1 || type.length === 2 && isNullable); @@ -229,9 +229,9 @@ function getNumericValidators(prop: IConfigurationPropertySchema): Validator (string | null)) | null { - if (prop.type === 'array' && prop.items && !isArray(prop.items)) { + if (prop.type === 'array' && prop.items && !Array.isArray(prop.items)) { const propItems = prop.items; - if (propItems && !isArray(propItems.type)) { + if (propItems && !Array.isArray(propItems.type)) { const withQuotes = (s: string) => `'` + s + `'`; return value => { if (!value) { @@ -240,7 +240,7 @@ function getArrayValidator(prop: IConfigurationPropertySchema): ((value: any) => let message = ''; - if (!isArray(value)) { + if (!Array.isArray(value)) { message += nls.localize('validations.arrayIncorrectType', 'Incorrect type. Expected an array.'); message += '\n'; return message; diff --git a/src/vs/workbench/services/search/common/textSearchManager.ts b/src/vs/workbench/services/search/common/textSearchManager.ts index 2b6eb1befc7..68dcacea828 100644 --- a/src/vs/workbench/services/search/common/textSearchManager.ts +++ b/src/vs/workbench/services/search/common/textSearchManager.ts @@ -10,7 +10,6 @@ import { toErrorMessage } from 'vs/base/common/errorMessage'; import { Schemas } from 'vs/base/common/network'; import * as path from 'vs/base/common/path'; import * as resources from 'vs/base/common/resources'; -import { isArray } from 'vs/base/common/types'; import { URI } from 'vs/base/common/uri'; import { hasSiblingPromiseFn, IExtendedExtensionSearchOptions, IFileMatch, IFolderQuery, IPatternInfo, ISearchCompleteStats, ITextQuery, ITextSearchContext, ITextSearchMatch, ITextSearchResult, ITextSearchStats, QueryGlobTester, resolvePatternsForProvider } from 'vs/workbench/services/search/common/search'; import { Range, TextSearchComplete, TextSearchMatch, TextSearchOptions, TextSearchProvider, TextSearchQuery, TextSearchResult } from 'vs/workbench/services/search/common/searchExtTypes'; @@ -73,7 +72,7 @@ export class TextSearchManager { limitHit: this.isLimitHit || someFolderHitLImit, messages: flatten(results.map(result => { if (!result?.message) { return []; } - if (isArray(result.message)) { return result.message; } + if (Array.isArray(result.message)) { return result.message; } else { return [result.message]; } })), stats: { diff --git a/src/vs/workbench/services/themes/common/colorThemeData.ts b/src/vs/workbench/services/themes/common/colorThemeData.ts index 5013b0db476..5ccb9e5f93d 100644 --- a/src/vs/workbench/services/themes/common/colorThemeData.ts +++ b/src/vs/workbench/services/themes/common/colorThemeData.ts @@ -440,7 +440,7 @@ export class ColorThemeData implements IWorkbenchColorTheme { let themeSpecificColors; for (const key in colors) { const scopedColors = colors[key]; - if (this.isThemeScope(key) && scopedColors instanceof Object && !types.isArray(scopedColors)) { + if (this.isThemeScope(key) && scopedColors instanceof Object && !Array.isArray(scopedColors)) { const themeScopeList = key.match(themeScopeRegex) || []; for (const themeScope of themeScopeList) { const themeId = themeScope.substring(1, themeScope.length - 1); @@ -452,7 +452,7 @@ export class ColorThemeData implements IWorkbenchColorTheme { for (const subkey in scopedThemeSpecificColors) { const originalColors = themeSpecificColors[subkey]; const overrideColors = scopedThemeSpecificColors[subkey]; - if (types.isArray(originalColors) && types.isArray(overrideColors)) { + if (Array.isArray(originalColors) && Array.isArray(overrideColors)) { themeSpecificColors[subkey] = originalColors.concat(overrideColors); } else if (overrideColors) { themeSpecificColors[subkey] = overrideColors; diff --git a/src/vs/workbench/test/browser/workbenchTestServices.ts b/src/vs/workbench/test/browser/workbenchTestServices.ts index de310cbfb0d..34c472eca2b 100644 --- a/src/vs/workbench/test/browser/workbenchTestServices.ts +++ b/src/vs/workbench/test/browser/workbenchTestServices.ts @@ -124,7 +124,7 @@ import { IWorkspaceTrustManagementService, IWorkspaceTrustRequestService } from import { TestWorkspaceTrustManagementService, TestWorkspaceTrustRequestService } from 'vs/workbench/services/workspaces/test/common/testWorkspaceTrustService'; import { IExtensionTerminalProfile, IShellLaunchConfig, ITerminalProfile, TerminalIcon, TerminalLocation, TerminalShellType } from 'vs/platform/terminal/common/terminal'; import { ICreateTerminalOptions, IDeserializedTerminalEditorInput, ITerminalEditorService, ITerminalGroup, ITerminalGroupService, ITerminalInstance, ITerminalInstanceService, TerminalEditorLocation } from 'vs/workbench/contrib/terminal/browser/terminal'; -import { assertIsDefined, isArray } from 'vs/base/common/types'; +import { assertIsDefined } from 'vs/base/common/types'; import { IRegisterContributedProfileArgs, IShellLaunchConfigResolveOptions, ITerminalBackend, ITerminalProfileProvider, ITerminalProfileResolverService, ITerminalProfileService } from 'vs/workbench/contrib/terminal/common/terminal'; import { EditorResolverService } from 'vs/workbench/services/editor/browser/editorResolverService'; import { FILE_EDITOR_INPUT_ID } from 'vs/workbench/contrib/files/common/files'; @@ -1888,7 +1888,7 @@ export class TestQuickInputService implements IQuickInputService { pick(picks: Promise[]> | QuickPickInput[], options?: IPickOptions & { canPickMany: true }, token?: CancellationToken): Promise; pick(picks: Promise[]> | QuickPickInput[], options?: IPickOptions & { canPickMany: false }, token?: CancellationToken): Promise; async pick(picks: Promise[]> | QuickPickInput[], options?: Omit, 'canPickMany'>, token?: CancellationToken): Promise { - if (isArray(picks)) { + if (Array.isArray(picks)) { return { label: 'selectedPick', description: 'pick description', value: 'selectedPick' }; } else { return undefined;