Skip to content

Commit

Permalink
Removes usages of deprecated values helper
Browse files Browse the repository at this point in the history
  • Loading branch information
roblourens committed Jun 10, 2020
1 parent bcbe1ef commit 34573b3
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/vs/workbench/api/browser/mainThreadSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import { CancellationToken } from 'vs/base/common/cancellation';
import { dispose, IDisposable, DisposableStore } from 'vs/base/common/lifecycle';
import { values } from 'vs/base/common/map';
import { URI, UriComponents } from 'vs/base/common/uri';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
Expand Down Expand Up @@ -139,7 +138,7 @@ class RemoteSearchProvider implements ISearchResultProvider, IDisposable {

return Promise.resolve(searchP).then((result: ISearchCompleteStats) => {
this._searches.delete(search.id);
return { results: values(search.matches), stats: result.stats, limitHit: result.limitHit };
return { results: Array.from(search.matches.values()), stats: result.stats, limitHit: result.limitHit };
}, err => {
this._searches.delete(search.id);
return Promise.reject(err);
Expand Down
3 changes: 1 addition & 2 deletions src/vs/workbench/contrib/search/common/queryBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import * as arrays from 'vs/base/common/arrays';
import * as collections from 'vs/base/common/collections';
import * as glob from 'vs/base/common/glob';
import { untildify } from 'vs/base/common/labels';
import { values } from 'vs/base/common/map';
import { Schemas } from 'vs/base/common/network';
import * as path from 'vs/base/common/path';
import { isEqual } from 'vs/base/common/resources';
Expand Down Expand Up @@ -324,7 +323,7 @@ export class QueryBuilder {
}
});

return values(searchPathPatternMap);
return Array.from(searchPathPatternMap.values());
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/vs/workbench/contrib/search/common/searchModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import * as errors from 'vs/base/common/errors';
import { Emitter, Event } from 'vs/base/common/event';
import { getBaseLabel } from 'vs/base/common/labels';
import { Disposable, IDisposable, DisposableStore } from 'vs/base/common/lifecycle';
import { ResourceMap, TernarySearchTree, values } from 'vs/base/common/map';
import { ResourceMap, TernarySearchTree } from 'vs/base/common/map';
import * as objects from 'vs/base/common/objects';
import { lcut } from 'vs/base/common/strings';
import { URI } from 'vs/base/common/uri';
Expand Down Expand Up @@ -293,7 +293,7 @@ export class FileMatch extends Disposable implements IFileMatch {
endLineNumber: lineNumber,
endColumn: this._model.getLineMaxColumn(lineNumber)
};
const oldMatches = values(this._matches).filter(match => match.range().startLineNumber === lineNumber);
const oldMatches = Array.from(this._matches.values()).filter(match => match.range().startLineNumber === lineNumber);
oldMatches.forEach(match => this._matches.delete(match.id()));

const wordSeparators = this._query.isWordMatch && this._query.wordSeparators ? this._query.wordSeparators : null;
Expand Down Expand Up @@ -351,7 +351,7 @@ export class FileMatch extends Disposable implements IFileMatch {
}

matches(): Match[] {
return values(this._matches);
return Array.from(this._matches.values());
}

remove(match: Match): void {
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/services/search/common/searchService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as arrays from 'vs/base/common/arrays';
import { CancellationToken } from 'vs/base/common/cancellation';
import { canceled } from 'vs/base/common/errors';
import { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle';
import { keys, ResourceMap, values } from 'vs/base/common/map';
import { keys, ResourceMap } from 'vs/base/common/map';
import { Schemas } from 'vs/base/common/network';
import { StopWatch } from 'vs/base/common/stopwatch';
import { URI as uri } from 'vs/base/common/uri';
Expand Down Expand Up @@ -493,7 +493,7 @@ export class SearchService extends Disposable implements ISearchService {
clearCache(cacheKey: string): Promise<void> {
const clearPs = [
this.diskSearch,
...values(this.fileSearchProviders)
...Array.from(this.fileSearchProviders.values())
].map(provider => provider && provider.clearCache(cacheKey));

return Promise.all(clearPs)
Expand Down

0 comments on commit 34573b3

Please sign in to comment.