mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-05 04:45:23 +01:00
Quick search: Not possible to search for space in front (#201015)
Fixes #192765
This commit is contained in:
@@ -70,6 +70,9 @@ export interface IPickerQuickAccessProviderOptions<T extends IPickerQuickAccessI
|
||||
* Enables to show a pick entry when no results are returned from a search.
|
||||
*/
|
||||
readonly noResultsPick?: T | ((filter: string) => T);
|
||||
|
||||
/** Whether to skip trimming the pick filter string */
|
||||
readonly shouldSkipTrimPickFilter?: boolean;
|
||||
}
|
||||
|
||||
export type Pick<T> = T | IQuickPickSeparator;
|
||||
@@ -138,7 +141,12 @@ export abstract class PickerQuickAccessProvider<T extends IPickerQuickAccessItem
|
||||
|
||||
// Collect picks and support both long running and short or combined
|
||||
const picksToken = picksCts.token;
|
||||
const picksFilter = picker.value.substr(this.prefix.length).trim();
|
||||
let picksFilter = picker.value.substring(this.prefix.length);
|
||||
|
||||
if (!this.options?.shouldSkipTrimPickFilter) {
|
||||
picksFilter = picksFilter.trim();
|
||||
}
|
||||
|
||||
const providedPicks = this._getPicks(picksFilter, picksDisposables, picksToken, runOptions);
|
||||
|
||||
const applyPicks = (picks: Picks<T>, skipEmpty?: boolean): boolean => {
|
||||
|
||||
@@ -70,7 +70,7 @@ export class TextSearchQuickAccess extends PickerQuickAccessProvider<IPickerQuic
|
||||
@IViewsService private readonly _viewsService: IViewsService,
|
||||
@IConfigurationService private readonly _configurationService: IConfigurationService,
|
||||
) {
|
||||
super(TEXT_SEARCH_QUICK_ACCESS_PREFIX, { canAcceptInBackground: true });
|
||||
super(TEXT_SEARCH_QUICK_ACCESS_PREFIX, { canAcceptInBackground: true, shouldSkipTrimPickFilter: true });
|
||||
|
||||
this.queryBuilder = this._instantiationService.createInstance(QueryBuilder);
|
||||
this.searchModel = this._instantiationService.createInstance(SearchModel);
|
||||
|
||||
Reference in New Issue
Block a user