提交 d9e833bc 编写于 作者: R Rob Lourens

SearchResult#remove must still handle FolderMatch

Fix #78509
上级 fe3669fe
......@@ -721,11 +721,19 @@ export class SearchResult extends Disposable {
this.disposeMatches();
}
remove(matches: FileMatch | FileMatch[]): void {
remove(matches: FileMatch | FolderMatch | (FileMatch | FolderMatch)[]): void {
if (!Array.isArray(matches)) {
matches = [matches];
}
matches.forEach(m => {
if (m instanceof FolderMatch) {
m.clear();
}
});
matches = matches.filter(m => m instanceof FileMatch);
const { byFolder, other } = this.groupFilesByFolder(matches);
byFolder.forEach(matches => {
if (!matches.length) {
......@@ -740,10 +748,6 @@ export class SearchResult extends Disposable {
}
}
removeFolder(match: FolderMatch): void {
match.clear();
}
replace(match: FileMatch): Promise<any> {
return this.getFolderMatch(match.resource).replace(match);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册