Change:
Issue Type: <bBug</bSee below screenshot, it is not sorted by install count: ! VS Code version: Code 1.28.0 (, 2018-10-05T14:58:53.203Z) OS version: Windows_NT x64 10.0.
(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like: <!-- score: 0.5 --- <!-- score: 0.458 --- <!-- score: 0.446 --<!-- potentialduplicatescomment --

Discussion:
case 'rating': options = assign(options, { sortBy: SortBy.WeightedRating }); break; case 'name': options = assign(options, { sortBy: SortBy.Title }); break; } <del> if (!query || !query.trim()) { options.sortBy = SortBy.InstallCount; } </del> const successCallback = model => { this.setModel(model);

} private async queryGallery(query: Query, options: IQueryOptions): Promise<IPagedModel<IExtension>> { <ins> const hasUserDefinedSortOrder = options.sortBy !== undefined; if (!hasUserDefinedSortOrder) { options.sortBy = SortBy.InstallCount; } </ins> let value = query.value; const idRegex = /@id:(([a-z0-9A-Z][a-z0-9-A-Z]*).([a-z0-9A-Z][a-z0-9-A-Z]*))/g;

let preferredResults: string[] = []; if (text) { options = assign(options, { text: text.substr(0, 350), source: 'searchText' }); <del> for (let i = 0; i < this.searchExperiments.length; i++) { if (text.toLowerCase() === this.searchExperiments[i].action.properties['searchText'] && Array.isArray(this.searchExperiments[i].action.properties['preferredResults'])) { preferredResults = this.searchExperiments[i].action.properties['preferredResults']; options.source += `-experiment-${this.searchExperiments[i].id}`; break; </del> <ins> if (!hasUserDefinedSortOrder) { for (let i = 0; i < this.searchExperiments.length; i++) { if (text.toLowerCase() === this.searchExperiments[i].action.properties['searchText'] && Array.isArray(this.searchExperiments[i].action.properties['preferredResults'])) { preferredResults = this.searchExperiments[i].action.properties['preferredResults']; options.source += `-experiment-${this.searchExperiments[i].id}`; break; } </ins> } } } else {

}); }); <ins> test('Skip preferred search experiment when user defines sort order', () => { const searchText = 'search-me'; const realResults = [ fileBasedRecommendationA, workspaceRecommendationA, otherRecommendationA, workspaceRecommendationB ]; const queryTarget = <SinonStub>instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(...realResults)); const experimentTarget = <SinonStub>instantiationService.stubPromise(IExperimentService, 'getExperimentsByType', [{ id: 'someId', enabled: true, state: ExperimentState.Run, action: { type: ExperimentActionType.ExtensionSearchResults, properties: { searchText: 'search-me', preferredResults: [ workspaceRecommendationA.identifier.id, 'something-that-wasnt-in-first-page', workspaceRecommendationB.identifier.id ] } } }]); testableView.dispose(); testableView = instantiationService.createInstance(ExtensionsListView, {}); return testableView.show('search-me @sort:installs').then(result => { const options: IQueryOptions = queryTarget.args[0][0]; assert.ok(experimentTarget.calledOnce); assert.ok(queryTarget.calledOnce); assert.equal(options.text, searchText); assert.equal(result.length, realResults.length); for (let i = 0; i < realResults.length; i++) { assert.equal(result.get(i).id, realResults[i].identifier.id); } }); }); </ins> function aLocalExtension(name: string = 'someext', manifest: any = {}, properties: any = {}, type: LocalExtensionType = LocalExtensionType.User): ILocalExtension { const localExtension = <ILocalExtension>Object.create({ manifest: {} }); assign(localExtension, { type, manifest: {}, location: URI.file(`pub.${name}`) }, properties);