Skip to content

Commit 46b04fe

Browse files
authored
Remove experimental flag and move up quick search on quick access list (microsoft#209993)
* Add setting migration for `search.experimental.quickAccess.preserveInput` and promote quick search on quick access * remove more mentions to experimental and relocate setting
1 parent ddf7225 commit 46b04fe

File tree

5 files changed

+41
-29
lines changed

5 files changed

+41
-29
lines changed

src/vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export class TextSearchQuickAccess extends PickerQuickAccessProvider<ITextSearch
157157

158158
return {
159159
openEditorPinned: !editorConfig?.enablePreviewFromQuickOpen || !editorConfig?.enablePreview,
160-
preserveInput: searchConfig.experimental.quickAccess.preserveInput,
160+
preserveInput: searchConfig.quickAccess.preserveInput,
161161
maxResults: searchConfig.maxResults,
162162
smartCase: searchConfig.smartCase,
163163
};

src/vs/workbench/contrib/search/browser/search.contribution.ts

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import 'vs/workbench/contrib/search/browser/searchActionsSymbol';
4040
import 'vs/workbench/contrib/search/browser/searchActionsTopBar';
4141
import 'vs/workbench/contrib/search/browser/searchActionsTextQuickAccess';
4242
import { TEXT_SEARCH_QUICK_ACCESS_PREFIX, TextSearchQuickAccess } from 'vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess';
43+
import { Extensions, IConfigurationMigrationRegistry } from 'vs/workbench/common/configuration';
4344

4445
registerSingleton(ISearchViewModelWorkbenchService, SearchViewModelWorkbenchService, InstantiationType.Delayed);
4546
registerSingleton(ISearchHistoryService, SearchHistoryService, InstantiationType.Delayed);
@@ -108,12 +109,12 @@ quickAccessRegistry.registerQuickAccessProvider({
108109
ctor: TextSearchQuickAccess,
109110
prefix: TEXT_SEARCH_QUICK_ACCESS_PREFIX,
110111
contextKey: 'inTextSearchPicker',
111-
placeholder: nls.localize('textSearchPickerPlaceholder', "Search for text in your workspace files (experimental)."),
112+
placeholder: nls.localize('textSearchPickerPlaceholder', "Search for text in your workspace files."),
112113
helpEntries: [
113114
{
114-
description: nls.localize('textSearchPickerHelp', "Search for Text (Experimental)"),
115+
description: nls.localize('textSearchPickerHelp', "Search for Text"),
115116
commandId: Constants.SearchCommandIds.QuickTextSearchActionId,
116-
commandCenterOrder: 65,
117+
commandCenterOrder: 25,
117118
}
118119
]
119120
});
@@ -203,14 +204,14 @@ configurationRegistry.registerConfiguration({
203204
default: true
204205
},
205206
'search.quickOpen.history.filterSortOrder': {
206-
'type': 'string',
207-
'enum': ['default', 'recency'],
208-
'default': 'default',
209-
'enumDescriptions': [
207+
type: 'string',
208+
enum: ['default', 'recency'],
209+
default: 'default',
210+
enumDescriptions: [
210211
nls.localize('filterSortOrder.default', 'History entries are sorted by relevance based on the filter value used. More relevant entries appear first.'),
211212
nls.localize('filterSortOrder.recency', 'History entries are sorted by recency. More recently opened entries appear first.')
212213
],
213-
'description': nls.localize('filterSortOrder', "Controls sorting order of editor history in quick open when filtering.")
214+
description: nls.localize('filterSortOrder', "Controls sorting order of editor history in quick open when filtering.")
214215
},
215216
'search.followSymlinks': {
216217
type: 'boolean',
@@ -329,18 +330,18 @@ configurationRegistry.registerConfiguration({
329330
markdownDescription: nls.localize('search.searchEditor.defaultNumberOfContextLines', "The default number of surrounding context lines to use when creating new Search Editors. If using `#search.searchEditor.reusePriorSearchConfiguration#`, this can be set to `null` (empty) to use the prior Search Editor's configuration.")
330331
},
331332
'search.sortOrder': {
332-
'type': 'string',
333-
'enum': [SearchSortOrder.Default, SearchSortOrder.FileNames, SearchSortOrder.Type, SearchSortOrder.Modified, SearchSortOrder.CountDescending, SearchSortOrder.CountAscending],
334-
'default': SearchSortOrder.Default,
335-
'enumDescriptions': [
333+
type: 'string',
334+
enum: [SearchSortOrder.Default, SearchSortOrder.FileNames, SearchSortOrder.Type, SearchSortOrder.Modified, SearchSortOrder.CountDescending, SearchSortOrder.CountAscending],
335+
default: SearchSortOrder.Default,
336+
enumDescriptions: [
336337
nls.localize('searchSortOrder.default', "Results are sorted by folder and file names, in alphabetical order."),
337338
nls.localize('searchSortOrder.filesOnly', "Results are sorted by file names ignoring folder order, in alphabetical order."),
338339
nls.localize('searchSortOrder.type', "Results are sorted by file extensions, in alphabetical order."),
339340
nls.localize('searchSortOrder.modified', "Results are sorted by file last modified date, in descending order."),
340341
nls.localize('searchSortOrder.countDescending', "Results are sorted by count per file, in descending order."),
341342
nls.localize('searchSortOrder.countAscending', "Results are sorted by count per file, in ascending order.")
342343
],
343-
'description': nls.localize('search.sortOrder', "Controls sorting order of search results.")
344+
description: nls.localize('search.sortOrder', "Controls sorting order of search results.")
344345
},
345346
'search.decorations.colors': {
346347
type: 'boolean',
@@ -353,25 +354,26 @@ configurationRegistry.registerConfiguration({
353354
default: true
354355
},
355356
'search.defaultViewMode': {
356-
'type': 'string',
357-
'enum': [ViewMode.Tree, ViewMode.List],
358-
'default': ViewMode.List,
359-
'enumDescriptions': [
357+
type: 'string',
358+
enum: [ViewMode.Tree, ViewMode.List],
359+
default: ViewMode.List,
360+
enumDescriptions: [
360361
nls.localize('scm.defaultViewMode.tree', "Shows search results as a tree."),
361362
nls.localize('scm.defaultViewMode.list', "Shows search results as a list.")
362363
],
363-
'description': nls.localize('search.defaultViewMode', "Controls the default search result view mode.")
364+
description: nls.localize('search.defaultViewMode', "Controls the default search result view mode.")
365+
},
366+
'search.quickAccess.preserveInput': {
367+
type: 'boolean',
368+
description: nls.localize('search.quickAccess.preserveInput', "Controls whether the last typed input to Quick Search should be restored when opening it the next time."),
369+
default: false
364370
},
365371
'search.experimental.closedNotebookRichContentResults': {
366372
type: 'boolean',
367373
description: nls.localize('search.experimental.closedNotebookResults', "Show notebook editor rich content results for closed notebooks. Please refresh your search results after changing this setting."),
368374
default: false
369375
},
370-
'search.experimental.quickAccess.preserveInput': {
371-
'type': 'boolean',
372-
'description': nls.localize('search.experimental.quickAccess.preserveInput', "Controls whether the last typed input to Quick Search should be restored when opening it the next time."),
373-
'default': false
374-
},
376+
375377
}
376378
});
377379

@@ -381,3 +383,13 @@ CommandsRegistry.registerCommand('_executeWorkspaceSymbolProvider', async functi
381383
const result = await getWorkspaceSymbols(query);
382384
return result.map(item => item.symbol);
383385
});
386+
387+
// todo: @andreamah get rid of this after a few iterations
388+
Registry.as<IConfigurationMigrationRegistry>(Extensions.ConfigurationMigration)
389+
.registerConfigurationMigrations([{
390+
key: 'search.experimental.quickAccess.preserveInput',
391+
migrateFn: (value, _accessor) => ([
392+
['search.quickAccess.preserveInput', { value }],
393+
['search.experimental.quickAccess.preserveInput', { value: undefined }]
394+
])
395+
}]);

src/vs/workbench/contrib/search/browser/searchActionsTextQuickAccess.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ registerAction2(class TextSearchQuickAccessAction extends Action2 {
2121
) {
2222
super({
2323
id: Constants.SearchCommandIds.QuickTextSearchActionId,
24-
title: nls.localize2('quickTextSearch', "Quick Search (Experimental)"),
24+
title: nls.localize2('quickTextSearch', "Quick Search"),
2525
category,
2626
f1: true
2727
});

src/vs/workbench/contrib/search/common/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const enum SearchCommandIds {
3030
RevealInSideBarForSearchResults = 'search.action.revealInSideBar',
3131
ReplaceInFilesActionId = 'workbench.action.replaceInFiles',
3232
ShowAllSymbolsActionId = 'workbench.action.showAllSymbols',
33-
QuickTextSearchActionId = 'workbench.action.experimental.quickTextSearch',
33+
QuickTextSearchActionId = 'workbench.action.quickTextSearch',
3434
CancelSearchActionId = 'search.action.cancel',
3535
RefreshSearchResultsActionId = 'search.action.refreshSearchResults',
3636
FocusNextSearchResultActionId = 'search.action.focusNextSearchResult',

src/vs/workbench/services/search/common/search.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,12 +436,12 @@ export interface ISearchConfigurationProperties {
436436
colors: boolean;
437437
badges: boolean;
438438
};
439+
quickAccess: {
440+
preserveInput: boolean;
441+
};
439442
defaultViewMode: ViewMode;
440443
experimental: {
441444
closedNotebookRichContentResults: boolean;
442-
quickAccess: {
443-
preserveInput: boolean;
444-
};
445445
};
446446
}
447447

0 commit comments

Comments
 (0)