Skip to content

Commit 648e559

Browse files
committed
microsoft#99664 do not use deprecated values util
1 parent ef0366a commit 648e559

13 files changed

Lines changed: 29 additions & 39 deletions

File tree

src/vs/platform/configuration/common/configurationModels.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import * as json from 'vs/base/common/json';
7-
import { ResourceMap, values, getOrSet } from 'vs/base/common/map';
7+
import { ResourceMap, getOrSet } from 'vs/base/common/map';
88
import * as arrays from 'vs/base/common/arrays';
99
import * as types from 'vs/base/common/types';
1010
import * as objects from 'vs/base/common/objects';
@@ -692,7 +692,7 @@ export class Configuration {
692692
this.userConfiguration.freeze().keys.forEach(key => keys.add(key));
693693
this._workspaceConfiguration.freeze().keys.forEach(key => keys.add(key));
694694
this._folderConfigurations.forEach(folderConfiguraiton => folderConfiguraiton.freeze().keys.forEach(key => keys.add(key)));
695-
return values(keys);
695+
return [...keys.values()];
696696
}
697697

698698
protected getAllKeysForOverrideIdentifier(overrideIdentifier: string): string[] {
@@ -701,7 +701,7 @@ export class Configuration {
701701
this.userConfiguration.getKeysForOverrideIdentifier(overrideIdentifier).forEach(key => keys.add(key));
702702
this._workspaceConfiguration.getKeysForOverrideIdentifier(overrideIdentifier).forEach(key => keys.add(key));
703703
this._folderConfigurations.forEach(folderConfiguraiton => folderConfiguraiton.getKeysForOverrideIdentifier(overrideIdentifier).forEach(key => keys.add(key)));
704-
return values(keys);
704+
return [...keys.values()];
705705
}
706706

707707
static parse(data: IConfigurationData): Configuration {
@@ -738,8 +738,8 @@ export function mergeChanges(...changes: IConfigurationChange[]): IConfiguration
738738
});
739739
}
740740
const overrides: [string, string[]][] = [];
741-
overridesMap.forEach((keys, identifier) => overrides.push([identifier, values(keys)]));
742-
return { keys: values(keysSet), overrides };
741+
overridesMap.forEach((keys, identifier) => overrides.push([identifier, [...keys.values()]]));
742+
return { keys: [...keysSet.values()], overrides };
743743
}
744744

745745
export class ConfigurationChangeEvent implements IConfigurationChangeEvent {
@@ -753,7 +753,7 @@ export class ConfigurationChangeEvent implements IConfigurationChangeEvent {
753753
const keysSet = new Set<string>();
754754
change.keys.forEach(key => keysSet.add(key));
755755
change.overrides.forEach(([, keys]) => keys.forEach(key => keysSet.add(key)));
756-
this.affectedKeys = values(keysSet);
756+
this.affectedKeys = [...keysSet.values()];
757757

758758
const configurationModel = new ConfigurationModel();
759759
this.affectedKeys.forEach(key => configurationModel.setValue(key, {}));

src/vs/platform/extensionManagement/common/extensionGalleryService.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { IRequestService, asJson, asText } from 'vs/platform/request/common/requ
1313
import { IRequestOptions, IRequestContext, IHeaders } from 'vs/base/parts/request/common/request';
1414
import { isEngineValid } from 'vs/platform/extensions/common/extensionValidator';
1515
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
16-
import { values } from 'vs/base/common/map';
1716
import { CancellationToken } from 'vs/base/common/cancellation';
1817
import { ILogService } from 'vs/platform/log/common/log';
1918
import { IExtensionManifest } from 'vs/platform/extensions/common/extensions';
@@ -759,7 +758,7 @@ export class ExtensionGalleryService implements IExtensionGalleryService {
759758
}
760759
}
761760

762-
return Promise.resolve(values(map));
761+
return [...map.values()];
763762
});
764763
});
765764
}

src/vs/platform/files/common/keyValueFileSystemProvider.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
99
import { Event, Emitter } from 'vs/base/common/event';
1010
import { VSBuffer } from 'vs/base/common/buffer';
1111
import { joinPath, extUri, dirname } from 'vs/base/common/resources';
12-
import { values } from 'vs/base/common/map';
1312
import { localize } from 'vs/nls';
1413

1514
export abstract class KeyValueFileSystemProvider extends Disposable implements IFileSystemProviderWithFileReadWriteCapability {
@@ -97,7 +96,7 @@ export abstract class KeyValueFileSystemProvider extends Disposable implements I
9796
}
9897
}
9998
}
100-
return values(files);
99+
return [...files.values()];
101100
}
102101

103102
async readFile(resource: URI): Promise<Uint8Array> {

src/vs/platform/userDataSync/common/settingsMerge.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import * as objects from 'vs/base/common/objects';
77
import { parse, JSONVisitor, visit } from 'vs/base/common/json';
88
import { setProperty, withFormatting, applyEdits } from 'vs/base/common/jsonEdit';
9-
import { values } from 'vs/base/common/map';
109
import { IStringDictionary } from 'vs/base/common/collections';
1110
import { FormattingOptions, Edit, getEOL } from 'vs/base/common/jsonFormatter';
1211
import * as contentUtil from 'vs/platform/userDataSync/common/content';
@@ -223,7 +222,7 @@ export function merge(originalLocalContent: string, originalRemoteContent: strin
223222
const hasConflicts = conflicts.size > 0 || !areSame(localContent, remoteContent, ignoredSettings);
224223
const hasLocalChanged = hasConflicts || !areSame(localContent, originalLocalContent, []);
225224
const hasRemoteChanged = hasConflicts || !areSame(remoteContent, originalRemoteContent, []);
226-
return { localContent: hasLocalChanged ? localContent : null, remoteContent: hasRemoteChanged ? remoteContent : null, conflictsSettings: values(conflicts), hasConflicts };
225+
return { localContent: hasLocalChanged ? localContent : null, remoteContent: hasRemoteChanged ? remoteContent : null, conflictsSettings: [...conflicts.values()], hasConflicts };
227226
}
228227

229228
export function areSame(localContent: string, remoteContent: string, ignoredSettings: string[]): boolean {

src/vs/platform/userDataSync/common/snippetsMerge.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { values } from 'vs/base/common/map';
76
import { IStringDictionary } from 'vs/base/common/collections';
87

98
export interface IMergeResult {
@@ -27,7 +26,7 @@ export function merge(local: IStringDictionary<string>, remote: IStringDictionar
2726

2827
if (!remote) {
2928
return {
30-
local: { added: localAdded, updated: localUpdated, removed: values(localRemoved) },
29+
local: { added: localAdded, updated: localUpdated, removed: [...localRemoved.values()] },
3130
remote: { added: local, updated: {}, removed: [] },
3231
conflicts: []
3332
};
@@ -37,7 +36,7 @@ export function merge(local: IStringDictionary<string>, remote: IStringDictionar
3736
if (localToRemote.added.size === 0 && localToRemote.removed.size === 0 && localToRemote.updated.size === 0) {
3837
// No changes found between local and remote.
3938
return {
40-
local: { added: localAdded, updated: localUpdated, removed: values(localRemoved) },
39+
local: { added: localAdded, updated: localUpdated, removed: [...localRemoved.values()] },
4140
remote: { added: {}, updated: {}, removed: [] },
4241
conflicts: []
4342
};
@@ -145,9 +144,9 @@ export function merge(local: IStringDictionary<string>, remote: IStringDictionar
145144
}
146145

147146
return {
148-
local: { added: localAdded, removed: values(localRemoved), updated: localUpdated },
149-
remote: { added: remoteAdded, removed: values(remoteRemoved), updated: remoteUpdated },
150-
conflicts: values(conflicts),
147+
local: { added: localAdded, removed: [...localRemoved.values()], updated: localUpdated },
148+
remote: { added: remoteAdded, removed: [...remoteRemoved.values()], updated: remoteUpdated },
149+
conflicts: [...conflicts.values()],
151150
};
152151
}
153152

src/vs/platform/userDataSync/common/snippetsSync.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import { CancellationToken } from 'vs/base/common/cancellation';
2121
import { IStorageService } from 'vs/platform/storage/common/storage';
2222
import { deepClone } from 'vs/base/common/objects';
2323
import { localize } from 'vs/nls';
24-
import { values } from 'vs/base/common/map';
2524

2625
export class SnippetsSynchroniser extends AbstractSynchroniser implements IUserDataSynchroniser {
2726

@@ -286,7 +285,7 @@ export class SnippetsSynchroniser extends AbstractSynchroniser implements IUserD
286285
}
287286
}
288287

289-
return values(resourcePreviews);
288+
return [...resourcePreviews.values()];
290289
}
291290

292291
async getAssociatedResources({ uri }: ISyncResourceHandle): Promise<{ resource: URI, comparableResource?: URI }[]> {

src/vs/platform/userDataSync/common/storageKeys.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import { Event, Emitter } from 'vs/base/common/event';
7-
import { values } from 'vs/base/common/map';
87
import { Disposable, toDisposable } from 'vs/base/common/lifecycle';
98
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
109

@@ -43,7 +42,7 @@ export class StorageKeysSyncRegistryService extends Disposable implements IStora
4342
_serviceBrand: any;
4443

4544
private readonly _storageKeys = new Map<string, IStorageKey>();
46-
get storageKeys(): ReadonlyArray<IStorageKey> { return values(this._storageKeys); }
45+
get storageKeys(): ReadonlyArray<IStorageKey> { return [...this._storageKeys.values()]; }
4746

4847
private readonly _onDidChangeStorageKeys: Emitter<ReadonlyArray<IStorageKey>> = this._register(new Emitter<ReadonlyArray<IStorageKey>>());
4948
readonly onDidChangeStorageKeys = this._onDidChangeStorageKeys.event;

src/vs/workbench/common/views.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { localize } from 'vs/nls';
1111
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
1212
import { IDisposable, Disposable, toDisposable } from 'vs/base/common/lifecycle';
1313
import { ThemeIcon } from 'vs/platform/theme/common/themeService';
14-
import { values, keys, getOrSet } from 'vs/base/common/map';
14+
import { getOrSet } from 'vs/base/common/map';
1515
import { Registry } from 'vs/platform/registry/common/platform';
1616
import { IKeybindings } from 'vs/platform/keybinding/common/keybindingsRegistry';
1717
import { IAction, IActionViewItem } from 'vs/base/common/actions';
@@ -140,7 +140,7 @@ class ViewContainersRegistryImpl extends Disposable implements IViewContainersRe
140140
private readonly defaultViewContainers: ViewContainer[] = [];
141141

142142
get all(): ViewContainer[] {
143-
return flatten(values(this.viewContainers));
143+
return flatten([...this.viewContainers.values()]);
144144
}
145145

146146
registerViewContainer(viewContainerDescriptor: IViewContainerDescriptor, viewContainerLocation: ViewContainerLocation, isDefault?: boolean): ViewContainer {
@@ -160,7 +160,7 @@ class ViewContainersRegistryImpl extends Disposable implements IViewContainersRe
160160
}
161161

162162
deregisterViewContainer(viewContainer: ViewContainer): void {
163-
for (const viewContainerLocation of keys(this.viewContainers)) {
163+
for (const viewContainerLocation of this.viewContainers.keys()) {
164164
const viewContainers = this.viewContainers.get(viewContainerLocation)!;
165165
const index = viewContainers?.indexOf(viewContainer);
166166
if (index !== -1) {
@@ -183,7 +183,7 @@ class ViewContainersRegistryImpl extends Disposable implements IViewContainersRe
183183
}
184184

185185
getViewContainerLocation(container: ViewContainer): ViewContainerLocation {
186-
return keys(this.viewContainers).filter(location => this.getViewContainers(location).filter(viewContainer => viewContainer.id === container.id).length > 0)[0];
186+
return [...this.viewContainers.keys()].filter(location => this.getViewContainers(location).filter(viewContainer => viewContainer.id === container.id).length > 0)[0];
187187
}
188188

189189
getDefaultViewContainer(location: ViewContainerLocation): ViewContainer | undefined {
@@ -365,15 +365,15 @@ class ViewsRegistry extends Disposable implements IViewsRegistry {
365365
}
366366

367367
moveViews(viewsToMove: IViewDescriptor[], viewContainer: ViewContainer): void {
368-
keys(this._views).forEach(container => {
368+
for (const container of this._views.keys()) {
369369
if (container !== viewContainer) {
370370
const views = this.removeViews(viewsToMove, container);
371371
if (views.length) {
372372
this.addViews(views, viewContainer);
373373
this._onDidChangeContainer.fire({ views, from: container, to: viewContainer });
374374
}
375375
}
376-
});
376+
}
377377
}
378378

379379
getViews(loc: ViewContainer): IViewDescriptor[] {

src/vs/workbench/contrib/extensions/browser/configBasedRecommendations.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { IStorageService } from 'vs/platform/storage/common/storage';
1515
import { IStorageKeysSyncRegistryService } from 'vs/platform/userDataSync/common/storageKeys';
1616
import { IWorkspaceContextService, IWorkspaceFoldersChangeEvent } from 'vs/platform/workspace/common/workspace';
1717
import { distinct } from 'vs/base/common/arrays';
18-
import { values } from 'vs/base/common/map';
1918

2019
export class ConfigBasedRecommendations extends ExtensionRecommendations {
2120

@@ -60,8 +59,8 @@ export class ConfigBasedRecommendations extends ExtensionRecommendations {
6059
}
6160
}
6261
}
63-
this.importantTips = values(importantTips);
64-
this.otherTips = values(otherTips).filter(tip => !importantTips.has(tip.extensionId));
62+
this.importantTips = [...importantTips.values()];
63+
this.otherTips = [...otherTips.values()].filter(tip => !importantTips.has(tip.extensionId));
6564
this._recommendations = [...this.importantTips, ...this.otherTips].map(tip => this.toExtensionRecommendation(tip));
6665
}
6766

src/vs/workbench/contrib/extensions/browser/extensionsDependencyChecker.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { IExtensionService } from 'vs/workbench/services/extensions/common/exten
99
import { CommandsRegistry } from 'vs/platform/commands/common/commands';
1010
import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions';
1111
import { localize } from 'vs/nls';
12-
import { values } from 'vs/base/common/map';
1312
import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
1413
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
1514
import { Action } from 'vs/base/common/actions';
@@ -55,7 +54,7 @@ export class ExtensionDependencyChecker extends Disposable implements IWorkbench
5554
});
5655
}
5756
}
58-
return values(missingDependencies);
57+
return [...missingDependencies.values()];
5958
}
6059

6160
private async installMissingDependencies(): Promise<void> {

0 commit comments

Comments
 (0)