mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 17:19:48 +01:00
Quick Text Search: Duplicate results when file is open (#192797)
* Quick Text Search: Duplicate results when file is open Fixes #191746 * use ResourceSet
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { IMatch } from 'vs/base/common/filters';
|
||||
import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { ResourceSet } from 'vs/base/common/map';
|
||||
import { basenameOrAuthority, dirname } from 'vs/base/common/resources';
|
||||
import { ThemeIcon } from 'vs/base/common/themables';
|
||||
import { IRange, Range } from 'vs/editor/common/core/range';
|
||||
@@ -128,7 +129,8 @@ export class TextSearchQuickAccess extends PickerQuickAccessProvider<IPickerQuic
|
||||
|
||||
const getAsyncResults = async () => {
|
||||
await result.asyncResults;
|
||||
return this.searchModel.searchResult.matches().filter(e => result.syncResults.indexOf(e) === -1);
|
||||
const syncResultURIs = new ResourceSet(result.syncResults.map(e => e.resource));
|
||||
return this.searchModel.searchResult.matches().filter(e => !syncResultURIs.has(e.resource));
|
||||
};
|
||||
return {
|
||||
syncResults: this.searchModel.searchResult.matches(),
|
||||
|
||||
Reference in New Issue
Block a user