Merge pull request #229570 from microsoft/andreamah/issue229466

Can NOT open Replace Preview
This commit is contained in:
Andrea Mah 2024-09-24 09:11:33 -07:00 committed by GitHub
commit c45f9a3e8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -72,7 +72,7 @@ class ReplacePreviewModel extends Disposable {
async resolve(replacePreviewUri: URI): Promise<ITextModel> {
const fileResource = toFileResource(replacePreviewUri);
const fileMatch = <FileMatch>this.searchWorkbenchService.searchModel.searchResult.matches(true).filter(match => match.resource.toString() === fileResource.toString())[0];
const fileMatch = <FileMatch>this.searchWorkbenchService.searchModel.searchResult.matches(false).filter(match => match.resource.toString() === fileResource.toString())[0];
const ref = this._register(await this.textModelResolverService.createModelReference(fileResource));
const sourceModel = ref.object.textEditorModel;
const sourceModelLanguageId = sourceModel.getLanguageId();