提交 d431ec51 编写于 作者: S Sandeep Somavarapu

Fix #91962

上级 5dc11a21
......@@ -19,7 +19,7 @@ import { getSelectionKeyboardEvent, WorkbenchObjectTree } from 'vs/platform/list
import { SearchView } from 'vs/workbench/contrib/search/browser/searchView';
import * as Constants from 'vs/workbench/contrib/search/common/constants';
import { IReplaceService } from 'vs/workbench/contrib/search/common/replace';
import { FolderMatch, FileMatch, FileMatchOrMatch, FolderMatchWithResource, Match, RenderableMatch, searchMatchComparer, SearchResult } from 'vs/workbench/contrib/search/common/searchModel';
import { FolderMatch, FileMatch, FolderMatchWithResource, Match, RenderableMatch, searchMatchComparer, SearchResult } from 'vs/workbench/contrib/search/common/searchModel';
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { ISearchConfiguration, VIEW_ID } from 'vs/workbench/services/search/common/search';
......@@ -711,16 +711,16 @@ export class ReplaceAction extends AbstractSearchAndReplaceAction {
});
}
private getElementToFocusAfterReplace(): Match {
const navigator: ITreeNavigator<any> = this.viewer.navigate();
private getElementToFocusAfterReplace(): RenderableMatch {
const navigator: ITreeNavigator<RenderableMatch | null> = this.viewer.navigate();
let fileMatched = false;
let elementToFocus: any = null;
let elementToFocus: RenderableMatch | null = null;
do {
elementToFocus = navigator.current();
if (elementToFocus instanceof Match) {
if (elementToFocus.parent().id() === this.element.parent().id()) {
fileMatched = true;
if (this.element.range().getStartPosition().isBeforeOrEqual((<Match>elementToFocus).range().getStartPosition())) {
if (this.element.range().getStartPosition().isBeforeOrEqual(elementToFocus.range().getStartPosition())) {
// Closest next match in the same file
break;
}
......@@ -735,10 +735,10 @@ export class ReplaceAction extends AbstractSearchAndReplaceAction {
}
}
} while (!!navigator.next());
return elementToFocus;
return elementToFocus!;
}
private async getElementToShowReplacePreview(elementToFocus: FileMatchOrMatch): Promise<Match | null> {
private async getElementToShowReplacePreview(elementToFocus: RenderableMatch): Promise<Match | null> {
if (this.hasSameParent(elementToFocus)) {
return <Match>elementToFocus;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册