Quick open: cannot search for tilde anymore (fix #99031)

This commit is contained in:
Benjamin Pasero 2020-06-02 11:28:29 +02:00
parent cb23f87929
commit ff4c7956ac

View file

@ -491,22 +491,34 @@ export class AnythingQuickAccessProvider extends PickerQuickAccessProvider<IAnyt
// Use absolute path result as only results if present
let fileMatches: Array<URI>;
if (absolutePathResult) {
fileMatches = [absolutePathResult];
if (excludes.has(absolutePathResult)) {
return []; // excluded
}
// Create a single result pick and make sure to apply full
// highlights to ensure the pick is displayed. Since a
// ~ might have been used for searching, our fuzzy scorer
// may otherwise not properly respect the pick as a result
const absolutePathPick = this.createAnythingPick(absolutePathResult, this.configuration);
absolutePathPick.highlights = {
label: [{ start: 0, end: absolutePathPick.label.length }],
description: absolutePathPick.description ? [{ start: 0, end: absolutePathPick.description.length }] : undefined
};
return [absolutePathPick];
}
// Otherwise run the file search (with a delayer if cache is not ready yet)
else {
if (this.pickState.fileQueryCache?.isLoaded) {
fileMatches = await this.doFileSearch(query, token);
} else {
fileMatches = await this.fileQueryDelayer.trigger(async () => {
if (token.isCancellationRequested) {
return [];
}
if (this.pickState.fileQueryCache?.isLoaded) {
fileMatches = await this.doFileSearch(query, token);
} else {
fileMatches = await this.fileQueryDelayer.trigger(async () => {
if (token.isCancellationRequested) {
return [];
}
return this.doFileSearch(query, token);
});
}
return this.doFileSearch(query, token);
});
}
if (token.isCancellationRequested) {