提交 599ae179 编写于 作者: R Rob Lourens

Fix NPE from #46353

上级 96ddd4f2
...@@ -563,6 +563,7 @@ export class SearchResult extends Disposable { ...@@ -563,6 +563,7 @@ export class SearchResult extends Disposable {
private _otherFilesMatch: FolderMatch; private _otherFilesMatch: FolderMatch;
private _folderMatchesMap: TernarySearchTree<FolderMatch> = TernarySearchTree.forPaths<FolderMatch>(); private _folderMatchesMap: TernarySearchTree<FolderMatch> = TernarySearchTree.forPaths<FolderMatch>();
private _showHighlights: boolean; private _showHighlights: boolean;
private _query: ITextQuery;
private _rangeHighlightDecorations: RangeHighlightDecorations; private _rangeHighlightDecorations: RangeHighlightDecorations;
...@@ -572,6 +573,10 @@ export class SearchResult extends Disposable { ...@@ -572,6 +573,10 @@ export class SearchResult extends Disposable {
this._rangeHighlightDecorations = this.instantiationService.createInstance(RangeHighlightDecorations); this._rangeHighlightDecorations = this.instantiationService.createInstance(RangeHighlightDecorations);
} }
public get query(): ITextQuery {
return this._query;
}
public set query(query: ITextQuery) { public set query(query: ITextQuery) {
// When updating the query we could change the roots, so ensure we clean up the old roots first. // When updating the query we could change the roots, so ensure we clean up the old roots first.
this.clear(); this.clear();
...@@ -581,6 +586,7 @@ export class SearchResult extends Disposable { ...@@ -581,6 +586,7 @@ export class SearchResult extends Disposable {
this._folderMatches.forEach(fm => this._folderMatchesMap.set(fm.resource().toString(), fm)); this._folderMatches.forEach(fm => this._folderMatchesMap.set(fm.resource().toString(), fm));
this._otherFilesMatch = this.createFolderMatch(null, 'otherFiles', this._folderMatches.length + 1, query); this._otherFilesMatch = this.createFolderMatch(null, 'otherFiles', this._folderMatches.length + 1, query);
this._query = query;
} }
private createFolderMatch(resource: URI | null, id: string, index: number, query: ITextQuery): FolderMatch { private createFolderMatch(resource: URI | null, id: string, index: number, query: ITextQuery): FolderMatch {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册