Skip to content

Commit d431ec5

Browse files
committed
1 parent 5dc11a2 commit d431ec5

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/vs/workbench/contrib/search/browser/searchActions.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { getSelectionKeyboardEvent, WorkbenchObjectTree } from 'vs/platform/list
1919
import { SearchView } from 'vs/workbench/contrib/search/browser/searchView';
2020
import * as Constants from 'vs/workbench/contrib/search/common/constants';
2121
import { IReplaceService } from 'vs/workbench/contrib/search/common/replace';
22-
import { FolderMatch, FileMatch, FileMatchOrMatch, FolderMatchWithResource, Match, RenderableMatch, searchMatchComparer, SearchResult } from 'vs/workbench/contrib/search/common/searchModel';
22+
import { FolderMatch, FileMatch, FolderMatchWithResource, Match, RenderableMatch, searchMatchComparer, SearchResult } from 'vs/workbench/contrib/search/common/searchModel';
2323
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
2424
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
2525
import { ISearchConfiguration, VIEW_ID } from 'vs/workbench/services/search/common/search';
@@ -711,16 +711,16 @@ export class ReplaceAction extends AbstractSearchAndReplaceAction {
711711
});
712712
}
713713

714-
private getElementToFocusAfterReplace(): Match {
715-
const navigator: ITreeNavigator<any> = this.viewer.navigate();
714+
private getElementToFocusAfterReplace(): RenderableMatch {
715+
const navigator: ITreeNavigator<RenderableMatch | null> = this.viewer.navigate();
716716
let fileMatched = false;
717-
let elementToFocus: any = null;
717+
let elementToFocus: RenderableMatch | null = null;
718718
do {
719719
elementToFocus = navigator.current();
720720
if (elementToFocus instanceof Match) {
721721
if (elementToFocus.parent().id() === this.element.parent().id()) {
722722
fileMatched = true;
723-
if (this.element.range().getStartPosition().isBeforeOrEqual((<Match>elementToFocus).range().getStartPosition())) {
723+
if (this.element.range().getStartPosition().isBeforeOrEqual(elementToFocus.range().getStartPosition())) {
724724
// Closest next match in the same file
725725
break;
726726
}
@@ -735,10 +735,10 @@ export class ReplaceAction extends AbstractSearchAndReplaceAction {
735735
}
736736
}
737737
} while (!!navigator.next());
738-
return elementToFocus;
738+
return elementToFocus!;
739739
}
740740

741-
private async getElementToShowReplacePreview(elementToFocus: FileMatchOrMatch): Promise<Match | null> {
741+
private async getElementToShowReplacePreview(elementToFocus: RenderableMatch): Promise<Match | null> {
742742
if (this.hasSameParent(elementToFocus)) {
743743
return <Match>elementToFocus;
744744
}

0 commit comments

Comments
 (0)